From 7da6798ec1aea235d24e4f7911e8676db296ed8f Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Fri, 15 Mar 2024 02:56:48 +0000
Subject: [PATCH] feat(api): update via SDK Studio (#154)
---
api.md | 8 +++---
src/resources/zero-trust/access/access.ts | 2 +-
.../access/certificates/certificates.ts | 4 +--
.../zero-trust/access/certificates/index.ts | 4 +--
.../access/certificates/settings.ts | 25 ++++++++-----------
src/resources/zero-trust/access/index.ts | 2 +-
src/resources/zero-trust/access/keys.ts | 8 +++---
.../access/certificates/settings.test.ts | 12 ++++-----
.../zero-trust/access/keys.test.ts | 8 +++---
9 files changed, 35 insertions(+), 38 deletions(-)
diff --git a/api.md b/api.md
index 571646a9da..beac4f5543 100644
--- a/api.md
+++ b/api.md
@@ -4388,12 +4388,12 @@ Types:
- AccessSettings
- SettingUpdateResponse
-- SettingListResponse
+- SettingGetResponse
Methods:
- client.zeroTrust.access.certificates.settings.update({ ...params }) -> SettingUpdateResponse | null
-- client.zeroTrust.access.certificates.settings.list({ ...params }) -> SettingListResponse | null
+- client.zeroTrust.access.certificates.settings.get({ ...params }) -> SettingGetResponse | null
### Groups
@@ -4450,13 +4450,13 @@ Methods:
Types:
- KeyUpdateResponse
-- KeyListResponse
+- KeyGetResponse
- KeyRotateResponse
Methods:
- client.zeroTrust.access.keys.update(identifier, { ...params }) -> KeyUpdateResponse
-- client.zeroTrust.access.keys.list(identifier) -> KeyListResponse
+- client.zeroTrust.access.keys.get(identifier) -> KeyGetResponse
- client.zeroTrust.access.keys.rotate(identifier) -> KeyRotateResponse
### Logs
diff --git a/src/resources/zero-trust/access/access.ts b/src/resources/zero-trust/access/access.ts
index fd25e9cc95..6a6e91feae 100644
--- a/src/resources/zero-trust/access/access.ts
+++ b/src/resources/zero-trust/access/access.ts
@@ -70,7 +70,7 @@ export namespace Access {
export import BookmarkDeleteResponse = BookmarksAPI.BookmarkDeleteResponse;
export import Keys = KeysAPI.Keys;
export import KeyUpdateResponse = KeysAPI.KeyUpdateResponse;
- export import KeyListResponse = KeysAPI.KeyListResponse;
+ export import KeyGetResponse = KeysAPI.KeyGetResponse;
export import KeyRotateResponse = KeysAPI.KeyRotateResponse;
export import KeyUpdateParams = KeysAPI.KeyUpdateParams;
export import Logs = LogsAPI.Logs;
diff --git a/src/resources/zero-trust/access/certificates/certificates.ts b/src/resources/zero-trust/access/certificates/certificates.ts
index e632ac3710..f376eb9ca8 100644
--- a/src/resources/zero-trust/access/certificates/certificates.ts
+++ b/src/resources/zero-trust/access/certificates/certificates.ts
@@ -338,7 +338,7 @@ export namespace Certificates {
export import Settings = SettingsAPI.Settings;
export import AccessSettings = SettingsAPI.AccessSettings;
export import SettingUpdateResponse = SettingsAPI.SettingUpdateResponse;
- export import SettingListResponse = SettingsAPI.SettingListResponse;
+ export import SettingGetResponse = SettingsAPI.SettingGetResponse;
export import SettingUpdateParams = SettingsAPI.SettingUpdateParams;
- export import SettingListParams = SettingsAPI.SettingListParams;
+ export import SettingGetParams = SettingsAPI.SettingGetParams;
}
diff --git a/src/resources/zero-trust/access/certificates/index.ts b/src/resources/zero-trust/access/certificates/index.ts
index 4875337e24..1f6f86d2a0 100644
--- a/src/resources/zero-trust/access/certificates/index.ts
+++ b/src/resources/zero-trust/access/certificates/index.ts
@@ -14,8 +14,8 @@ export {
export {
AccessSettings,
SettingUpdateResponse,
- SettingListResponse,
+ SettingGetResponse,
SettingUpdateParams,
- SettingListParams,
+ SettingGetParams,
Settings,
} from './settings';
diff --git a/src/resources/zero-trust/access/certificates/settings.ts b/src/resources/zero-trust/access/certificates/settings.ts
index a88a0a0b05..d5f72fb9da 100644
--- a/src/resources/zero-trust/access/certificates/settings.ts
+++ b/src/resources/zero-trust/access/certificates/settings.ts
@@ -42,17 +42,14 @@ export class Settings extends APIResource {
/**
* List all mTLS hostname settings for this account or zone.
*/
- list(
- params?: SettingListParams,
+ get(params?: SettingGetParams, options?: Core.RequestOptions): Core.APIPromise;
+ get(options?: Core.RequestOptions): Core.APIPromise;
+ get(
+ params: SettingGetParams | Core.RequestOptions = {},
options?: Core.RequestOptions,
- ): Core.APIPromise;
- list(options?: Core.RequestOptions): Core.APIPromise;
- list(
- params: SettingListParams | Core.RequestOptions = {},
- options?: Core.RequestOptions,
- ): Core.APIPromise {
+ ): Core.APIPromise {
if (isRequestOptions(params)) {
- return this.list({}, params);
+ return this.get({}, params);
}
const { account_id, zone_id } = params;
if (!account_id && !zone_id) {
@@ -75,7 +72,7 @@ export class Settings extends APIResource {
this._client.get(
`/${accountOrZone}/${accountOrZoneId}/access/certificates/settings`,
options,
- ) as Core.APIPromise<{ result: SettingListResponse | null }>
+ ) as Core.APIPromise<{ result: SettingGetResponse | null }>
)._thenUnwrap((obj) => obj.result);
}
}
@@ -102,7 +99,7 @@ export interface AccessSettings {
export type SettingUpdateResponse = Array;
-export type SettingListResponse = Array;
+export type SettingGetResponse = Array;
export interface SettingUpdateParams {
/**
@@ -123,7 +120,7 @@ export interface SettingUpdateParams {
zone_id?: string;
}
-export interface SettingListParams {
+export interface SettingGetParams {
/**
* The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
*/
@@ -138,7 +135,7 @@ export interface SettingListParams {
export namespace Settings {
export import AccessSettings = SettingsAPI.AccessSettings;
export import SettingUpdateResponse = SettingsAPI.SettingUpdateResponse;
- export import SettingListResponse = SettingsAPI.SettingListResponse;
+ export import SettingGetResponse = SettingsAPI.SettingGetResponse;
export import SettingUpdateParams = SettingsAPI.SettingUpdateParams;
- export import SettingListParams = SettingsAPI.SettingListParams;
+ export import SettingGetParams = SettingsAPI.SettingGetParams;
}
diff --git a/src/resources/zero-trust/access/index.ts b/src/resources/zero-trust/access/index.ts
index e4bb426d57..7accc6ee7c 100644
--- a/src/resources/zero-trust/access/index.ts
+++ b/src/resources/zero-trust/access/index.ts
@@ -66,5 +66,5 @@ export {
Tags,
} from './tags';
export { AccessUsers, UserListResponse, Users } from './users/index';
-export { KeyUpdateResponse, KeyListResponse, KeyRotateResponse, KeyUpdateParams, Keys } from './keys';
+export { KeyUpdateResponse, KeyGetResponse, KeyRotateResponse, KeyUpdateParams, Keys } from './keys';
export { Logs } from './logs/index';
diff --git a/src/resources/zero-trust/access/keys.ts b/src/resources/zero-trust/access/keys.ts
index 151dfacd63..63b2d18a9d 100644
--- a/src/resources/zero-trust/access/keys.ts
+++ b/src/resources/zero-trust/access/keys.ts
@@ -23,10 +23,10 @@ export class Keys extends APIResource {
/**
* Gets the Access key rotation settings for an account.
*/
- list(identifier: string, options?: Core.RequestOptions): Core.APIPromise {
+ get(identifier: string, options?: Core.RequestOptions): Core.APIPromise {
return (
this._client.get(`/accounts/${identifier}/access/keys`, options) as Core.APIPromise<{
- result: KeyListResponse;
+ result: KeyGetResponse;
}>
)._thenUnwrap((obj) => obj.result);
}
@@ -45,7 +45,7 @@ export class Keys extends APIResource {
export type KeyUpdateResponse = unknown | string;
-export type KeyListResponse = unknown | string;
+export type KeyGetResponse = unknown | string;
export type KeyRotateResponse = unknown | string;
@@ -58,7 +58,7 @@ export interface KeyUpdateParams {
export namespace Keys {
export import KeyUpdateResponse = KeysAPI.KeyUpdateResponse;
- export import KeyListResponse = KeysAPI.KeyListResponse;
+ export import KeyGetResponse = KeysAPI.KeyGetResponse;
export import KeyRotateResponse = KeysAPI.KeyRotateResponse;
export import KeyUpdateParams = KeysAPI.KeyUpdateParams;
}
diff --git a/tests/api-resources/zero-trust/access/certificates/settings.test.ts b/tests/api-resources/zero-trust/access/certificates/settings.test.ts
index 076f7f9f78..d92ceb0c95 100644
--- a/tests/api-resources/zero-trust/access/certificates/settings.test.ts
+++ b/tests/api-resources/zero-trust/access/certificates/settings.test.ts
@@ -42,8 +42,8 @@ describe('resource settings', () => {
});
// skipped: tests are disabled for the time being
- test.skip('list', async () => {
- const responsePromise = cloudflare.zeroTrust.access.certificates.settings.list();
+ test.skip('get', async () => {
+ const responsePromise = cloudflare.zeroTrust.access.certificates.settings.get();
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -54,18 +54,18 @@ describe('resource settings', () => {
});
// skipped: tests are disabled for the time being
- test.skip('list: request options instead of params are passed correctly', async () => {
+ test.skip('get: request options instead of params are passed correctly', async () => {
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
await expect(
- cloudflare.zeroTrust.access.certificates.settings.list({ path: '/_stainless_unknown_path' }),
+ cloudflare.zeroTrust.access.certificates.settings.get({ path: '/_stainless_unknown_path' }),
).rejects.toThrow(Cloudflare.NotFoundError);
});
// skipped: tests are disabled for the time being
- test.skip('list: request options and params are passed correctly', async () => {
+ test.skip('get: request options and params are passed correctly', async () => {
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
await expect(
- cloudflare.zeroTrust.access.certificates.settings.list(
+ cloudflare.zeroTrust.access.certificates.settings.get(
{ account_id: 'string', zone_id: 'string' },
{ path: '/_stainless_unknown_path' },
),
diff --git a/tests/api-resources/zero-trust/access/keys.test.ts b/tests/api-resources/zero-trust/access/keys.test.ts
index d8ed0ee5d3..ba14393c67 100644
--- a/tests/api-resources/zero-trust/access/keys.test.ts
+++ b/tests/api-resources/zero-trust/access/keys.test.ts
@@ -32,8 +32,8 @@ describe('resource keys', () => {
});
// skipped: tests are disabled for the time being
- test.skip('list', async () => {
- const responsePromise = cloudflare.zeroTrust.access.keys.list('023e105f4ecef8ad9ca31a8372d0c353');
+ test.skip('get', async () => {
+ const responsePromise = cloudflare.zeroTrust.access.keys.get('023e105f4ecef8ad9ca31a8372d0c353');
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -44,10 +44,10 @@ describe('resource keys', () => {
});
// skipped: tests are disabled for the time being
- test.skip('list: request options instead of params are passed correctly', async () => {
+ test.skip('get: request options instead of params are passed correctly', async () => {
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
await expect(
- cloudflare.zeroTrust.access.keys.list('023e105f4ecef8ad9ca31a8372d0c353', {
+ cloudflare.zeroTrust.access.keys.get('023e105f4ecef8ad9ca31a8372d0c353', {
path: '/_stainless_unknown_path',
}),
).rejects.toThrow(Cloudflare.NotFoundError);