Skip to content

Commit

Permalink
feat(api): update via SDK Studio (#209)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Mar 28, 2024
1 parent d0bb567 commit 2e4a3ce
Show file tree
Hide file tree
Showing 14 changed files with 73 additions and 79 deletions.
30 changes: 15 additions & 15 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -5038,25 +5038,25 @@ Methods:

Types:

- <code><a href="./src/resources/challenges/widgets.ts">NcChallengesAdminWidgetDetail</a></code>
- <code><a href="./src/resources/challenges/widgets.ts">NcChallengesAdminWidgetList</a></code>
- <code><a href="./src/resources/challenges/widgets.ts">ChallengesWidget</a></code>
- <code><a href="./src/resources/challenges/widgets.ts">ChallengesWidgetList</a></code>

Methods:

- <code title="post /accounts/{account_id}/challenges/widgets">client.challenges.widgets.<a href="./src/resources/challenges/widgets.ts">create</a>({ ...params }) -> NcChallengesAdminWidgetDetail</code>
- <code title="put /accounts/{account_id}/challenges/widgets/{sitekey}">client.challenges.widgets.<a href="./src/resources/challenges/widgets.ts">update</a>(sitekey, { ...params }) -> NcChallengesAdminWidgetDetail</code>
- <code title="get /accounts/{account_id}/challenges/widgets">client.challenges.widgets.<a href="./src/resources/challenges/widgets.ts">list</a>({ ...params }) -> NcChallengesAdminWidgetListsV4PagePaginationArray</code>
- <code title="delete /accounts/{account_id}/challenges/widgets/{sitekey}">client.challenges.widgets.<a href="./src/resources/challenges/widgets.ts">delete</a>(sitekey, { ...params }) -> NcChallengesAdminWidgetDetail</code>
- <code title="get /accounts/{account_id}/challenges/widgets/{sitekey}">client.challenges.widgets.<a href="./src/resources/challenges/widgets.ts">get</a>(sitekey, { ...params }) -> NcChallengesAdminWidgetDetail</code>
- <code title="post /accounts/{account_id}/challenges/widgets/{sitekey}/rotate_secret">client.challenges.widgets.<a href="./src/resources/challenges/widgets.ts">rotateSecret</a>(sitekey, { ...params }) -> NcChallengesAdminWidgetDetail</code>
- <code title="post /accounts/{account_id}/challenges/widgets">client.challenges.widgets.<a href="./src/resources/challenges/widgets.ts">create</a>({ ...params }) -> ChallengesWidget</code>
- <code title="put /accounts/{account_id}/challenges/widgets/{sitekey}">client.challenges.widgets.<a href="./src/resources/challenges/widgets.ts">update</a>(sitekey, { ...params }) -> ChallengesWidget</code>
- <code title="get /accounts/{account_id}/challenges/widgets">client.challenges.widgets.<a href="./src/resources/challenges/widgets.ts">list</a>({ ...params }) -> ChallengesWidgetListsV4PagePaginationArray</code>
- <code title="delete /accounts/{account_id}/challenges/widgets/{sitekey}">client.challenges.widgets.<a href="./src/resources/challenges/widgets.ts">delete</a>(sitekey, { ...params }) -> ChallengesWidget</code>
- <code title="get /accounts/{account_id}/challenges/widgets/{sitekey}">client.challenges.widgets.<a href="./src/resources/challenges/widgets.ts">get</a>(sitekey, { ...params }) -> ChallengesWidget</code>
- <code title="post /accounts/{account_id}/challenges/widgets/{sitekey}/rotate_secret">client.challenges.widgets.<a href="./src/resources/challenges/widgets.ts">rotateSecret</a>(sitekey, { ...params }) -> ChallengesWidget</code>

# Hyperdrive

## Configs

Types:

- <code><a href="./src/resources/hyperdrive/configs.ts">HyperdriveHyperdriveWithIdentifier</a></code>
- <code><a href="./src/resources/hyperdrive/configs.ts">Hyperdrive</a></code>
- <code><a href="./src/resources/hyperdrive/configs.ts">ConfigCreateResponse</a></code>
- <code><a href="./src/resources/hyperdrive/configs.ts">ConfigUpdateResponse</a></code>
- <code><a href="./src/resources/hyperdrive/configs.ts">ConfigListResponse</a></code>
Expand Down Expand Up @@ -6135,11 +6135,11 @@ Methods:

Types:

- <code><a href="./src/resources/dcv-delegation/uuid.ts">TLSCertificatesAndHostnamesUUIDObject</a></code>
- <code><a href="./src/resources/dcv-delegation/uuid.ts">DCVDelegationUUID</a></code>

Methods:

- <code title="get /zones/{zone_id}/dcv_delegation/uuid">client.dcvDelegation.uuid.<a href="./src/resources/dcv-delegation/uuid.ts">get</a>({ ...params }) -> TLSCertificatesAndHostnamesUUIDObject</code>
- <code title="get /zones/{zone_id}/dcv_delegation/uuid">client.dcvDelegation.uuid.<a href="./src/resources/dcv-delegation/uuid.ts">get</a>({ ...params }) -> DCVDelegationUUID</code>

# Hostnames

Expand All @@ -6149,14 +6149,14 @@ Methods:

Types:

- <code><a href="./src/resources/hostnames/settings/tls.ts">TLSCertificatesAndHostnamesSettingObject</a></code>
- <code><a href="./src/resources/hostnames/settings/tls.ts">TLSCertificatesAndHostnamesSettingObjectDelete</a></code>
- <code><a href="./src/resources/hostnames/settings/tls.ts">HostnameSettingDelete</a></code>
- <code><a href="./src/resources/hostnames/settings/tls.ts">HostnameStting</a></code>
- <code><a href="./src/resources/hostnames/settings/tls.ts">TLSGetResponse</a></code>

Methods:

- <code title="put /zones/{zone_id}/hostnames/settings/{setting_id}/{hostname}">client.hostnames.settings.tls.<a href="./src/resources/hostnames/settings/tls.ts">update</a>(settingId, hostname, { ...params }) -> TLSCertificatesAndHostnamesSettingObject</code>
- <code title="delete /zones/{zone_id}/hostnames/settings/{setting_id}/{hostname}">client.hostnames.settings.tls.<a href="./src/resources/hostnames/settings/tls.ts">delete</a>(settingId, hostname, { ...params }) -> TLSCertificatesAndHostnamesSettingObjectDelete</code>
- <code title="put /zones/{zone_id}/hostnames/settings/{setting_id}/{hostname}">client.hostnames.settings.tls.<a href="./src/resources/hostnames/settings/tls.ts">update</a>(settingId, hostname, { ...params }) -> HostnameStting</code>
- <code title="delete /zones/{zone_id}/hostnames/settings/{setting_id}/{hostname}">client.hostnames.settings.tls.<a href="./src/resources/hostnames/settings/tls.ts">delete</a>(settingId, hostname, { ...params }) -> HostnameSettingDelete</code>
- <code title="get /zones/{zone_id}/hostnames/settings/{setting_id}">client.hostnames.settings.tls.<a href="./src/resources/hostnames/settings/tls.ts">get</a>(settingId, { ...params }) -> TLSGetResponse | null</code>

# Snippets
Expand Down
6 changes: 3 additions & 3 deletions src/pagination.ts
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ export class CursorLimitPagination<Item>
export type SinglePageResponse<Item> = Item[];

export class SinglePage<Item> extends AbstractPage<Item> {
result: Array<Item>;
items: Array<Item>;

constructor(
client: APIClient,
Expand All @@ -277,11 +277,11 @@ export class SinglePage<Item> extends AbstractPage<Item> {
) {
super(client, response, body, options);

this.result = body || [];
this.items = body || [];
}

getPaginatedItems(): Item[] {
return this.result ?? [];
return this.items ?? [];
}

// @deprecated Please use `nextPageInfo()` instead
Expand Down
6 changes: 3 additions & 3 deletions src/resources/challenges/challenges.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ export class Challenges extends APIResource {

export namespace Challenges {
export import Widgets = WidgetsAPI.Widgets;
export import NcChallengesAdminWidgetDetail = WidgetsAPI.NcChallengesAdminWidgetDetail;
export import NcChallengesAdminWidgetList = WidgetsAPI.NcChallengesAdminWidgetList;
export import NcChallengesAdminWidgetListsV4PagePaginationArray = WidgetsAPI.NcChallengesAdminWidgetListsV4PagePaginationArray;
export import ChallengesWidget = WidgetsAPI.ChallengesWidget;
export import ChallengesWidgetList = WidgetsAPI.ChallengesWidgetList;
export import ChallengesWidgetListsV4PagePaginationArray = WidgetsAPI.ChallengesWidgetListsV4PagePaginationArray;
export import WidgetCreateParams = WidgetsAPI.WidgetCreateParams;
export import WidgetUpdateParams = WidgetsAPI.WidgetUpdateParams;
export import WidgetListParams = WidgetsAPI.WidgetListParams;
Expand Down
6 changes: 3 additions & 3 deletions src/resources/challenges/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

export { Challenges } from './challenges';
export {
NcChallengesAdminWidgetDetail,
NcChallengesAdminWidgetList,
ChallengesWidget,
ChallengesWidgetList,
WidgetCreateParams,
WidgetUpdateParams,
WidgetListParams,
WidgetDeleteParams,
WidgetGetParams,
WidgetRotateSecretParams,
NcChallengesAdminWidgetListsV4PagePaginationArray,
ChallengesWidgetListsV4PagePaginationArray,
Widgets,
} from './widgets';
39 changes: 18 additions & 21 deletions src/resources/challenges/widgets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,14 @@ export class Widgets extends APIResource {
/**
* Lists challenge widgets.
*/
create(
params: WidgetCreateParams,
options?: Core.RequestOptions,
): Core.APIPromise<NcChallengesAdminWidgetDetail> {
create(params: WidgetCreateParams, options?: Core.RequestOptions): Core.APIPromise<ChallengesWidget> {
const { account_id, direction, order, page, per_page, ...body } = params;
return (
this._client.post(`/accounts/${account_id}/challenges/widgets`, {
query: { direction, order, page, per_page },
body,
...options,
}) as Core.APIPromise<{ result: NcChallengesAdminWidgetDetail }>
}) as Core.APIPromise<{ result: ChallengesWidget }>
)._thenUnwrap((obj) => obj.result);
}

Expand All @@ -30,13 +27,13 @@ export class Widgets extends APIResource {
sitekey: string,
params: WidgetUpdateParams,
options?: Core.RequestOptions,
): Core.APIPromise<NcChallengesAdminWidgetDetail> {
): Core.APIPromise<ChallengesWidget> {
const { account_id, ...body } = params;
return (
this._client.put(`/accounts/${account_id}/challenges/widgets/${sitekey}`, {
body,
...options,
}) as Core.APIPromise<{ result: NcChallengesAdminWidgetDetail }>
}) as Core.APIPromise<{ result: ChallengesWidget }>
)._thenUnwrap((obj) => obj.result);
}

Expand All @@ -46,11 +43,11 @@ export class Widgets extends APIResource {
list(
params: WidgetListParams,
options?: Core.RequestOptions,
): Core.PagePromise<NcChallengesAdminWidgetListsV4PagePaginationArray, NcChallengesAdminWidgetList> {
): Core.PagePromise<ChallengesWidgetListsV4PagePaginationArray, ChallengesWidgetList> {
const { account_id, ...query } = params;
return this._client.getAPIList(
`/accounts/${account_id}/challenges/widgets`,
NcChallengesAdminWidgetListsV4PagePaginationArray,
ChallengesWidgetListsV4PagePaginationArray,
{ query, ...options },
);
}
Expand All @@ -62,13 +59,13 @@ export class Widgets extends APIResource {
sitekey: string,
params: WidgetDeleteParams,
options?: Core.RequestOptions,
): Core.APIPromise<NcChallengesAdminWidgetDetail> {
): Core.APIPromise<ChallengesWidget> {
const { account_id } = params;
return (
this._client.delete(
`/accounts/${account_id}/challenges/widgets/${sitekey}`,
options,
) as Core.APIPromise<{ result: NcChallengesAdminWidgetDetail }>
) as Core.APIPromise<{ result: ChallengesWidget }>
)._thenUnwrap((obj) => obj.result);
}

Expand All @@ -79,11 +76,11 @@ export class Widgets extends APIResource {
sitekey: string,
params: WidgetGetParams,
options?: Core.RequestOptions,
): Core.APIPromise<NcChallengesAdminWidgetDetail> {
): Core.APIPromise<ChallengesWidget> {
const { account_id } = params;
return (
this._client.get(`/accounts/${account_id}/challenges/widgets/${sitekey}`, options) as Core.APIPromise<{
result: NcChallengesAdminWidgetDetail;
result: ChallengesWidget;
}>
)._thenUnwrap((obj) => obj.result);
}
Expand All @@ -98,23 +95,23 @@ export class Widgets extends APIResource {
sitekey: string,
params: WidgetRotateSecretParams,
options?: Core.RequestOptions,
): Core.APIPromise<NcChallengesAdminWidgetDetail> {
): Core.APIPromise<ChallengesWidget> {
const { account_id, ...body } = params;
return (
this._client.post(`/accounts/${account_id}/challenges/widgets/${sitekey}/rotate_secret`, {
body,
...options,
}) as Core.APIPromise<{ result: NcChallengesAdminWidgetDetail }>
}) as Core.APIPromise<{ result: ChallengesWidget }>
)._thenUnwrap((obj) => obj.result);
}
}

export class NcChallengesAdminWidgetListsV4PagePaginationArray extends V4PagePaginationArray<NcChallengesAdminWidgetList> {}
export class ChallengesWidgetListsV4PagePaginationArray extends V4PagePaginationArray<ChallengesWidgetList> {}

/**
* A Turnstile widget's detailed configuration
*/
export interface NcChallengesAdminWidgetDetail {
export interface ChallengesWidget {
/**
* If bot_fight_mode is set to `true`, Cloudflare issues computationally expensive
* challenges in response to malicious bots (ENT only).
Expand Down Expand Up @@ -175,7 +172,7 @@ export interface NcChallengesAdminWidgetDetail {
/**
* A Turnstile Widgets configuration as it appears in listings
*/
export interface NcChallengesAdminWidgetList {
export interface ChallengesWidgetList {
/**
* If bot_fight_mode is set to `true`, Cloudflare issues computationally expensive
* challenges in response to malicious bots (ENT only).
Expand Down Expand Up @@ -383,9 +380,9 @@ export interface WidgetRotateSecretParams {
}

export namespace Widgets {
export import NcChallengesAdminWidgetDetail = WidgetsAPI.NcChallengesAdminWidgetDetail;
export import NcChallengesAdminWidgetList = WidgetsAPI.NcChallengesAdminWidgetList;
export import NcChallengesAdminWidgetListsV4PagePaginationArray = WidgetsAPI.NcChallengesAdminWidgetListsV4PagePaginationArray;
export import ChallengesWidget = WidgetsAPI.ChallengesWidget;
export import ChallengesWidgetList = WidgetsAPI.ChallengesWidgetList;
export import ChallengesWidgetListsV4PagePaginationArray = WidgetsAPI.ChallengesWidgetListsV4PagePaginationArray;
export import WidgetCreateParams = WidgetsAPI.WidgetCreateParams;
export import WidgetUpdateParams = WidgetsAPI.WidgetUpdateParams;
export import WidgetListParams = WidgetsAPI.WidgetListParams;
Expand Down
2 changes: 1 addition & 1 deletion src/resources/dcv-delegation/dcv-delegation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ export class DCVDelegation extends APIResource {

export namespace DCVDelegation {
export import UUID = UUIDAPI.UUID;
export import TLSCertificatesAndHostnamesUUIDObject = UUIDAPI.TLSCertificatesAndHostnamesUUIDObject;
export import DCVDelegationUUID = UUIDAPI.DCVDelegationUUID;
export import UUIDGetParams = UUIDAPI.UUIDGetParams;
}
2 changes: 1 addition & 1 deletion src/resources/dcv-delegation/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

export { DCVDelegation } from './dcv-delegation';
export { TLSCertificatesAndHostnamesUUIDObject, UUIDGetParams, UUID } from './uuid';
export { DCVDelegationUUID, UUIDGetParams, UUID } from './uuid';
11 changes: 4 additions & 7 deletions src/resources/dcv-delegation/uuid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,17 @@ export class UUID extends APIResource {
* Retrieve the account and zone specific unique identifier used as part of the
* CNAME target for DCV Delegation.
*/
get(
params: UUIDGetParams,
options?: Core.RequestOptions,
): Core.APIPromise<TLSCertificatesAndHostnamesUUIDObject> {
get(params: UUIDGetParams, options?: Core.RequestOptions): Core.APIPromise<DCVDelegationUUID> {
const { zone_id } = params;
return (
this._client.get(`/zones/${zone_id}/dcv_delegation/uuid`, options) as Core.APIPromise<{
result: TLSCertificatesAndHostnamesUUIDObject;
result: DCVDelegationUUID;
}>
)._thenUnwrap((obj) => obj.result);
}
}

export interface TLSCertificatesAndHostnamesUUIDObject {
export interface DCVDelegationUUID {
/**
* The DCV Delegation unique identifier.
*/
Expand All @@ -37,6 +34,6 @@ export interface UUIDGetParams {
}

export namespace UUID {
export import TLSCertificatesAndHostnamesUUIDObject = UUIDAPI.TLSCertificatesAndHostnamesUUIDObject;
export import DCVDelegationUUID = UUIDAPI.DCVDelegationUUID;
export import UUIDGetParams = UUIDAPI.UUIDGetParams;
}
6 changes: 3 additions & 3 deletions src/resources/hostnames/settings/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

export { Settings } from './settings';
export {
TLSCertificatesAndHostnamesSettingObject,
TLSCertificatesAndHostnamesSettingObjectDelete,
HostnameSettingDelete,
HostnameStting,
TLSGetResponse,
TLSUpdateParams,
TLSDeleteParams,
TLSGetParams,
TLS,
} from './tls';
export { Settings } from './settings';
4 changes: 2 additions & 2 deletions src/resources/hostnames/settings/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ export class Settings extends APIResource {

export namespace Settings {
export import TLS = TLSAPI.TLS;
export import TLSCertificatesAndHostnamesSettingObject = TLSAPI.TLSCertificatesAndHostnamesSettingObject;
export import TLSCertificatesAndHostnamesSettingObjectDelete = TLSAPI.TLSCertificatesAndHostnamesSettingObjectDelete;
export import HostnameSettingDelete = TLSAPI.HostnameSettingDelete;
export import HostnameStting = TLSAPI.HostnameStting;
export import TLSGetResponse = TLSAPI.TLSGetResponse;
export import TLSUpdateParams = TLSAPI.TLSUpdateParams;
export import TLSDeleteParams = TLSAPI.TLSDeleteParams;
Expand Down
Loading

0 comments on commit 2e4a3ce

Please sign in to comment.