Skip to content

Commit

Permalink
feat(api): OpenAPI spec update via Stainless API (#819)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Jun 6, 2024
1 parent f15d3ae commit 2d33492
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 8 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: 1336
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6a077023d5a748c646073f33bc20264fc7235f7fe9ce157d1f50f9914a3927e1.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-bc197b361ec3d5030fd853cb37172adbed55aa014ca7a5ac89fb498a88a8e5cb.yml
2 changes: 1 addition & 1 deletion api.md
Original file line number Diff line number Diff line change
Expand Up @@ -4800,7 +4800,7 @@ Types:

Methods:

- <code title="get /accounts/{account_id}/access/logs/access_requests">client.zeroTrust.access.logs.accessRequests.<a href="./src/resources/zero-trust/access/logs/access-requests.ts">list</a>({ ...params }) -> AccessRequestListResponse | null</code>
- <code title="get /accounts/{account_id}/access/logs/access_requests">client.zeroTrust.access.logs.accessRequests.<a href="./src/resources/zero-trust/access/logs/access-requests.ts">list</a>({ ...params }) -> AccessRequestListResponse</code>

### Users

Expand Down
33 changes: 27 additions & 6 deletions src/resources/zero-trust/access/logs/access-requests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@ export class AccessRequests extends APIResource {
list(
params: AccessRequestListParams,
options?: Core.RequestOptions,
): Core.APIPromise<AccessRequestListResponse | null> {
const { account_id } = params;
): Core.APIPromise<AccessRequestListResponse> {
const { account_id, ...query } = params;
return (
this._client.get(`/accounts/${account_id}/access/logs/access_requests`, options) as Core.APIPromise<{
result: AccessRequestListResponse | null;
}>
this._client.get(`/accounts/${account_id}/access/logs/access_requests`, {
query,
...options,
}) as Core.APIPromise<{ result: AccessRequestListResponse }>
)._thenUnwrap((obj) => obj.result);
}
}
Expand Down Expand Up @@ -69,9 +70,29 @@ export type AccessRequestListResponse = Array<AccessRequests>;

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

/**
* Query param: The chronological sorting order for the logs.
*/
direction?: 'desc' | 'asc';

/**
* Query param: The maximum number of log entries to retrieve.
*/
limit?: number;

/**
* Query param: The earliest event timestamp to query.
*/
since?: string;

/**
* Query param: The latest event timestamp to query.
*/
until?: string;
}

export namespace AccessRequests {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ describe('resource accessRequests', () => {
test('list: required and optional params', async () => {
const response = await cloudflare.zeroTrust.access.logs.accessRequests.list({
account_id: '023e105f4ecef8ad9ca31a8372d0c353',
direction: 'desc',
limit: 0,
since: '2020-07-01T05:20:00Z',
until: '2020-10-01T05:20:00Z',
});
});
});

0 comments on commit 2d33492

Please sign in to comment.