Skip to content

Commit

Permalink
feat(api): api update (#2128)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Nov 14, 2024
1 parent e6a2cde commit 5542325
Show file tree
Hide file tree
Showing 7 changed files with 81 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 1417
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-1c64fbec9a1e17ca560abf251c26a4adb4d60123dbe3f7dcc10819494cd97a6f.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-2959676ecfc112a904ecea7f0874900dd48e4e15ea12ab641b3428db5dade9aa.yml
30 changes: 26 additions & 4 deletions src/resources/zero-trust/access/applications/applications.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ export class Applications extends APIResource {
if (isRequestOptions(params)) {
return this.list({}, params);
}
const { account_id, zone_id } = params;
const { account_id, zone_id, ...query } = params;
if (!account_id && !zone_id) {
throw new CloudflareError('You must provide either account_id or zone_id.');
}
Expand All @@ -155,7 +155,7 @@ export class Applications extends APIResource {
return this._client.getAPIList(
`/${accountOrZone}/${accountOrZoneId}/access/apps`,
ApplicationListResponsesSinglePage,
options,
{ query, ...options },
);
}

Expand Down Expand Up @@ -12156,14 +12156,36 @@ export namespace ApplicationUpdateParams {

export interface ApplicationListParams {
/**
* The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
* Path param: The Account ID to use for this endpoint. Mutually exclusive with the
* Zone ID.
*/
account_id?: string;

/**
* The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
* Path param: The Zone ID to use for this endpoint. Mutually exclusive with the
* Account ID.
*/
zone_id?: string;

/**
* Query param: The aud of the app.
*/
aud?: string;

/**
* Query param: The domain of the app.
*/
domain?: string;

/**
* Query param: The name of the app.
*/
name?: string;

/**
* Query param: Search for apps by other listed query parameters.
*/
search?: string;
}

export interface ApplicationDeleteParams {
Expand Down
20 changes: 16 additions & 4 deletions src/resources/zero-trust/access/groups.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export class Groups extends APIResource {
if (isRequestOptions(params)) {
return this.list({}, params);
}
const { account_id, zone_id } = params;
const { account_id, zone_id, ...query } = params;
if (!account_id && !zone_id) {
throw new CloudflareError('You must provide either account_id or zone_id.');
}
Expand All @@ -105,7 +105,7 @@ export class Groups extends APIResource {
return this._client.getAPIList(
`/${accountOrZone}/${accountOrZoneId}/access/groups`,
ZeroTrustGroupsSinglePage,
options,
{ query, ...options },
);
}

Expand Down Expand Up @@ -329,14 +329,26 @@ export interface GroupUpdateParams {

export interface GroupListParams {
/**
* The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
* Path param: The Account ID to use for this endpoint. Mutually exclusive with the
* Zone ID.
*/
account_id?: string;

/**
* The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
* Path param: The Zone ID to use for this endpoint. Mutually exclusive with the
* Account ID.
*/
zone_id?: string;

/**
* Query param: The name of the group.
*/
name?: string;

/**
* Query param: Search for groups by other listed query parameters.
*/
search?: string;
}

export interface GroupDeleteParams {
Expand Down
24 changes: 21 additions & 3 deletions src/resources/zero-trust/access/users/users.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,11 @@ export class Users extends APIResource {
params: UserListParams,
options?: Core.RequestOptions,
): Core.PagePromise<AccessUsersSinglePage, AccessUser> {
const { account_id } = params;
return this._client.getAPIList(`/accounts/${account_id}/access/users`, AccessUsersSinglePage, options);
const { account_id, ...query } = params;
return this._client.getAPIList(`/accounts/${account_id}/access/users`, AccessUsersSinglePage, {
query,
...options,
});
}
}

Expand Down Expand Up @@ -96,9 +99,24 @@ export interface AccessUser {

export interface UserListParams {
/**
* Identifier
* Path param: Identifier
*/
account_id: string;

/**
* Query param: The email of the user.
*/
email?: string;

/**
* Query param: The name of the user.
*/
name?: string;

/**
* Query param: Search for users by other listed query parameters.
*/
search?: string;
}

Users.AccessUsersSinglePage = AccessUsersSinglePage;
Expand Down
20 changes: 12 additions & 8 deletions src/resources/zero-trust/identity-providers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1091,11 +1091,13 @@ export interface IdentityProviderSCIMConfig {
enabled?: boolean;

/**
* A flag to revoke a user's session in Access and force a reauthentication on the
* user's Gateway session when they have been added or removed from a group in the
* Identity Provider.
* Indicates how a SCIM event updates an Access identity. Use "automatic" to
* automatically update a user's Access identity and augment it with fields from
* the SCIM user resource. Use "reauth" to force re-authentication on group
* membership updates. With "reauth" Access identities will not contain fields from
* the SCIM user resource.
*/
group_member_deprovision?: boolean;
identity_update_behavior?: 'automatic' | 'reauth';

/**
* A flag to remove a user's seat in Zero Trust when they have been deprovisioned
Expand Down Expand Up @@ -1129,11 +1131,13 @@ export interface IdentityProviderSCIMConfigParam {
enabled?: boolean;

/**
* A flag to revoke a user's session in Access and force a reauthentication on the
* user's Gateway session when they have been added or removed from a group in the
* Identity Provider.
* Indicates how a SCIM event updates an Access identity. Use "automatic" to
* automatically update a user's Access identity and augment it with fields from
* the SCIM user resource. Use "reauth" to force re-authentication on group
* membership updates. With "reauth" Access identities will not contain fields from
* the SCIM user resource.
*/
group_member_deprovision?: boolean;
identity_update_behavior?: 'automatic' | 'reauth';

/**
* A flag to remove a user's seat in Zero Trust when they have been deprovisioned
Expand Down
3 changes: 3 additions & 0 deletions tests/api-resources/zero-trust/access/users/users.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ describe('resource users', () => {
test('list: required and optional params', async () => {
const response = await client.zeroTrust.access.users.list({
account_id: '023e105f4ecef8ad9ca31a8372d0c353',
email: 'email',
name: 'name',
search: 'search',
});
});
});
4 changes: 2 additions & 2 deletions tests/api-resources/zero-trust/identity-providers.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ describe('resource identityProviders', () => {
account_id: 'account_id',
scim_config: {
enabled: true,
group_member_deprovision: true,
identity_update_behavior: 'automatic',
seat_deprovision: true,
user_deprovision: true,
},
Expand Down Expand Up @@ -85,7 +85,7 @@ describe('resource identityProviders', () => {
account_id: 'account_id',
scim_config: {
enabled: true,
group_member_deprovision: true,
identity_update_behavior: 'automatic',
seat_deprovision: true,
user_deprovision: true,
},
Expand Down

0 comments on commit 5542325

Please sign in to comment.