Skip to content

Commit

Permalink
feat: update via SDK Studio (#145)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Mar 13, 2024
1 parent fea0c8a commit 4219181
Show file tree
Hide file tree
Showing 14 changed files with 679 additions and 466 deletions.
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
configured_endpoints: 1282
configured_endpoints: 1288
27 changes: 21 additions & 6 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -3880,6 +3880,7 @@ Methods:

Types:

- <code><a href="./src/resources/alerting/v3/destinations/pagerduty.ts">AaaPagerduty</a></code>
- <code><a href="./src/resources/alerting/v3/destinations/pagerduty.ts">PagerdutyCreateResponse</a></code>
- <code><a href="./src/resources/alerting/v3/destinations/pagerduty.ts">PagerdutyDeleteResponse</a></code>
- <code><a href="./src/resources/alerting/v3/destinations/pagerduty.ts">PagerdutyGetResponse</a></code>
Expand All @@ -3896,47 +3897,47 @@ Methods:

Types:

- <code><a href="./src/resources/alerting/v3/destinations/webhooks.ts">AaaWebhooks</a></code>
- <code><a href="./src/resources/alerting/v3/destinations/webhooks.ts">WebhookCreateResponse</a></code>
- <code><a href="./src/resources/alerting/v3/destinations/webhooks.ts">WebhookUpdateResponse</a></code>
- <code><a href="./src/resources/alerting/v3/destinations/webhooks.ts">WebhookListResponse</a></code>
- <code><a href="./src/resources/alerting/v3/destinations/webhooks.ts">WebhookDeleteResponse</a></code>
- <code><a href="./src/resources/alerting/v3/destinations/webhooks.ts">WebhookGetResponse</a></code>

Methods:

- <code title="post /accounts/{account_id}/alerting/v3/destinations/webhooks">client.alerting.v3.destinations.webhooks.<a href="./src/resources/alerting/v3/destinations/webhooks.ts">create</a>({ ...params }) -> WebhookCreateResponse</code>
- <code title="put /accounts/{account_id}/alerting/v3/destinations/webhooks/{webhook_id}">client.alerting.v3.destinations.webhooks.<a href="./src/resources/alerting/v3/destinations/webhooks.ts">update</a>(webhookId, { ...params }) -> WebhookUpdateResponse</code>
- <code title="get /accounts/{account_id}/alerting/v3/destinations/webhooks">client.alerting.v3.destinations.webhooks.<a href="./src/resources/alerting/v3/destinations/webhooks.ts">list</a>({ ...params }) -> WebhookListResponse | null</code>
- <code title="delete /accounts/{account_id}/alerting/v3/destinations/webhooks/{webhook_id}">client.alerting.v3.destinations.webhooks.<a href="./src/resources/alerting/v3/destinations/webhooks.ts">delete</a>(webhookId, { ...params }) -> WebhookDeleteResponse | null</code>
- <code title="get /accounts/{account_id}/alerting/v3/destinations/webhooks/{webhook_id}">client.alerting.v3.destinations.webhooks.<a href="./src/resources/alerting/v3/destinations/webhooks.ts">get</a>(webhookId, { ...params }) -> WebhookGetResponse</code>
- <code title="get /accounts/{account_id}/alerting/v3/destinations/webhooks/{webhook_id}">client.alerting.v3.destinations.webhooks.<a href="./src/resources/alerting/v3/destinations/webhooks.ts">get</a>(webhookId, { ...params }) -> AaaWebhooks</code>

### Histories

Types:

- <code><a href="./src/resources/alerting/v3/histories.ts">HistoryListResponse</a></code>
- <code><a href="./src/resources/alerting/v3/histories.ts">AaaHistory</a></code>

Methods:

- <code title="get /accounts/{account_id}/alerting/v3/history">client.alerting.v3.histories.<a href="./src/resources/alerting/v3/histories.ts">list</a>({ ...params }) -> HistoryListResponsesV4PagePaginationArray</code>
- <code title="get /accounts/{account_id}/alerting/v3/history">client.alerting.v3.histories.<a href="./src/resources/alerting/v3/histories.ts">list</a>({ ...params }) -> AaaHistoriesV4PagePaginationArray</code>

### Policies

Types:

- <code><a href="./src/resources/alerting/v3/policies.ts">AaaPolicies</a></code>
- <code><a href="./src/resources/alerting/v3/policies.ts">PolicyCreateResponse</a></code>
- <code><a href="./src/resources/alerting/v3/policies.ts">PolicyUpdateResponse</a></code>
- <code><a href="./src/resources/alerting/v3/policies.ts">PolicyListResponse</a></code>
- <code><a href="./src/resources/alerting/v3/policies.ts">PolicyDeleteResponse</a></code>
- <code><a href="./src/resources/alerting/v3/policies.ts">PolicyGetResponse</a></code>

Methods:

- <code title="post /accounts/{account_id}/alerting/v3/policies">client.alerting.v3.policies.<a href="./src/resources/alerting/v3/policies.ts">create</a>({ ...params }) -> PolicyCreateResponse</code>
- <code title="put /accounts/{account_id}/alerting/v3/policies/{policy_id}">client.alerting.v3.policies.<a href="./src/resources/alerting/v3/policies.ts">update</a>(policyId, { ...params }) -> PolicyUpdateResponse</code>
- <code title="get /accounts/{account_id}/alerting/v3/policies">client.alerting.v3.policies.<a href="./src/resources/alerting/v3/policies.ts">list</a>({ ...params }) -> PolicyListResponse | null</code>
- <code title="delete /accounts/{account_id}/alerting/v3/policies/{policy_id}">client.alerting.v3.policies.<a href="./src/resources/alerting/v3/policies.ts">delete</a>(policyId, { ...params }) -> PolicyDeleteResponse | null</code>
- <code title="get /accounts/{account_id}/alerting/v3/policies/{policy_id}">client.alerting.v3.policies.<a href="./src/resources/alerting/v3/policies.ts">get</a>(policyId, { ...params }) -> PolicyGetResponse</code>
- <code title="get /accounts/{account_id}/alerting/v3/policies/{policy_id}">client.alerting.v3.policies.<a href="./src/resources/alerting/v3/policies.ts">get</a>(policyId, { ...params }) -> AaaPolicies</code>

# D1

Expand Down Expand Up @@ -5013,6 +5014,20 @@ Methods:

## Widgets

Types:

- <code><a href="./src/resources/challenges/widgets.ts">NcChallengesAdminWidgetDetail</a></code>
- <code><a href="./src/resources/challenges/widgets.ts">NcChallengesAdminWidgetList</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>

# Hyperdrive

## Configs
Expand Down
3 changes: 2 additions & 1 deletion src/resources/alerting/v3/destinations/destinations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export namespace Destinations {
export import EligibleGetResponse = EligibleAPI.EligibleGetResponse;
export import EligibleGetParams = EligibleAPI.EligibleGetParams;
export import Pagerduty = PagerdutyAPI.Pagerduty;
export import AaaPagerduty = PagerdutyAPI.AaaPagerduty;
export import PagerdutyCreateResponse = PagerdutyAPI.PagerdutyCreateResponse;
export import PagerdutyDeleteResponse = PagerdutyAPI.PagerdutyDeleteResponse;
export import PagerdutyGetResponse = PagerdutyAPI.PagerdutyGetResponse;
Expand All @@ -25,11 +26,11 @@ export namespace Destinations {
export import PagerdutyGetParams = PagerdutyAPI.PagerdutyGetParams;
export import PagerdutyLinkParams = PagerdutyAPI.PagerdutyLinkParams;
export import Webhooks = WebhooksAPI.Webhooks;
export import AaaWebhooks = WebhooksAPI.AaaWebhooks;
export import WebhookCreateResponse = WebhooksAPI.WebhookCreateResponse;
export import WebhookUpdateResponse = WebhooksAPI.WebhookUpdateResponse;
export import WebhookListResponse = WebhooksAPI.WebhookListResponse;
export import WebhookDeleteResponse = WebhooksAPI.WebhookDeleteResponse;
export import WebhookGetResponse = WebhooksAPI.WebhookGetResponse;
export import WebhookCreateParams = WebhooksAPI.WebhookCreateParams;
export import WebhookUpdateParams = WebhooksAPI.WebhookUpdateParams;
export import WebhookListParams = WebhooksAPI.WebhookListParams;
Expand Down
7 changes: 4 additions & 3 deletions src/resources/alerting/v3/destinations/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
// File generated from our OpenAPI spec by Stainless.

export { Destinations } from './destinations';
export { EligibleGetResponse, EligibleGetParams, Eligible } from './eligible';
export {
AaaPagerduty,
PagerdutyCreateResponse,
PagerdutyDeleteResponse,
PagerdutyGetResponse,
Expand All @@ -14,15 +13,17 @@ export {
Pagerduty,
} from './pagerduty';
export {
AaaWebhooks,
WebhookCreateResponse,
WebhookUpdateResponse,
WebhookListResponse,
WebhookDeleteResponse,
WebhookGetResponse,
WebhookCreateParams,
WebhookUpdateParams,
WebhookListParams,
WebhookDeleteParams,
WebhookGetParams,
Webhooks,
} from './webhooks';
export { Destinations } from './destinations';
export { EligibleGetResponse, EligibleGetParams, Eligible } from './eligible';
29 changes: 14 additions & 15 deletions src/resources/alerting/v3/destinations/pagerduty.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,18 @@ export class Pagerduty extends APIResource {
}
}

export interface AaaPagerduty {
/**
* UUID
*/
id?: string;

/**
* The name of the pagerduty service.
*/
name?: string;
}

export interface PagerdutyCreateResponse {
/**
* token in form of UUID
Expand All @@ -80,21 +92,7 @@ export interface PagerdutyCreateResponse {

export type PagerdutyDeleteResponse = unknown | Array<unknown> | string;

export type PagerdutyGetResponse = Array<PagerdutyGetResponse.PagerdutyGetResponseItem>;

export namespace PagerdutyGetResponse {
export interface PagerdutyGetResponseItem {
/**
* UUID
*/
id?: string;

/**
* The name of the pagerduty service.
*/
name?: string;
}
}
export type PagerdutyGetResponse = Array<AaaPagerduty>;

export interface PagerdutyLinkResponse {
/**
Expand Down Expand Up @@ -132,6 +130,7 @@ export interface PagerdutyLinkParams {
}

export namespace Pagerduty {
export import AaaPagerduty = PagerdutyAPI.AaaPagerduty;
export import PagerdutyCreateResponse = PagerdutyAPI.PagerdutyCreateResponse;
export import PagerdutyDeleteResponse = PagerdutyAPI.PagerdutyDeleteResponse;
export import PagerdutyGetResponse = PagerdutyAPI.PagerdutyGetResponse;
Expand Down
93 changes: 22 additions & 71 deletions src/resources/alerting/v3/destinations/webhooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,85 +75,18 @@ export class Webhooks extends APIResource {
webhookId: string,
params: WebhookGetParams,
options?: Core.RequestOptions,
): Core.APIPromise<WebhookGetResponse> {
): Core.APIPromise<AaaWebhooks> {
const { account_id } = params;
return (
this._client.get(
`/accounts/${account_id}/alerting/v3/destinations/webhooks/${webhookId}`,
options,
) as Core.APIPromise<{ result: WebhookGetResponse }>
) as Core.APIPromise<{ result: AaaWebhooks }>
)._thenUnwrap((obj) => obj.result);
}
}

export interface WebhookCreateResponse {
/**
* UUID
*/
id?: string;
}

export interface WebhookUpdateResponse {
/**
* UUID
*/
id?: string;
}

export type WebhookListResponse = Array<WebhookListResponse.WebhookListResponseItem>;

export namespace WebhookListResponse {
export interface WebhookListResponseItem {
/**
* The unique identifier of a webhook
*/
id?: string;

/**
* Timestamp of when the webhook destination was created.
*/
created_at?: string;

/**
* Timestamp of the last time an attempt to dispatch a notification to this webhook
* failed.
*/
last_failure?: string;

/**
* Timestamp of the last time Cloudflare was able to successfully dispatch a
* notification using this webhook.
*/
last_success?: string;

/**
* The name of the webhook destination. This will be included in the request body
* when you receive a webhook notification.
*/
name?: string;

/**
* Optional secret that will be passed in the `cf-webhook-auth` header when
* dispatching generic webhook notifications or formatted for supported
* destinations. Secrets are not returned in any API response body.
*/
secret?: string;

/**
* Type of webhook endpoint.
*/
type?: 'slack' | 'generic' | 'gchat';

/**
* The POST endpoint to call when dispatching a notification.
*/
url?: string;
}
}

export type WebhookDeleteResponse = unknown | Array<unknown> | string;

export interface WebhookGetResponse {
export interface AaaWebhooks {
/**
* The unique identifier of a webhook
*/
Expand Down Expand Up @@ -200,6 +133,24 @@ export interface WebhookGetResponse {
url?: string;
}

export interface WebhookCreateResponse {
/**
* UUID
*/
id?: string;
}

export interface WebhookUpdateResponse {
/**
* UUID
*/
id?: string;
}

export type WebhookListResponse = Array<AaaWebhooks>;

export type WebhookDeleteResponse = unknown | Array<unknown> | string;

export interface WebhookCreateParams {
/**
* Path param: The account id
Expand Down Expand Up @@ -272,11 +223,11 @@ export interface WebhookGetParams {
}

export namespace Webhooks {
export import AaaWebhooks = WebhooksAPI.AaaWebhooks;
export import WebhookCreateResponse = WebhooksAPI.WebhookCreateResponse;
export import WebhookUpdateResponse = WebhooksAPI.WebhookUpdateResponse;
export import WebhookListResponse = WebhooksAPI.WebhookListResponse;
export import WebhookDeleteResponse = WebhooksAPI.WebhookDeleteResponse;
export import WebhookGetResponse = WebhooksAPI.WebhookGetResponse;
export import WebhookCreateParams = WebhooksAPI.WebhookCreateParams;
export import WebhookUpdateParams = WebhooksAPI.WebhookUpdateParams;
export import WebhookListParams = WebhooksAPI.WebhookListParams;
Expand Down
12 changes: 6 additions & 6 deletions src/resources/alerting/v3/histories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ export class Histories extends APIResource {
list(
params: HistoryListParams,
options?: Core.RequestOptions,
): Core.PagePromise<HistoryListResponsesV4PagePaginationArray, HistoryListResponse> {
): Core.PagePromise<AaaHistoriesV4PagePaginationArray, AaaHistory> {
const { account_id, ...query } = params;
return this._client.getAPIList(
`/accounts/${account_id}/alerting/v3/history`,
HistoryListResponsesV4PagePaginationArray,
AaaHistoriesV4PagePaginationArray,
{ query, ...options },
);
}
}

export class HistoryListResponsesV4PagePaginationArray extends V4PagePaginationArray<HistoryListResponse> {}
export class AaaHistoriesV4PagePaginationArray extends V4PagePaginationArray<AaaHistory> {}

export interface HistoryListResponse {
export interface AaaHistory {
/**
* UUID
*/
Expand Down Expand Up @@ -94,7 +94,7 @@ export interface HistoryListParams extends V4PagePaginationArrayParams {
}

export namespace Histories {
export import HistoryListResponse = HistoriesAPI.HistoryListResponse;
export import HistoryListResponsesV4PagePaginationArray = HistoriesAPI.HistoryListResponsesV4PagePaginationArray;
export import AaaHistory = HistoriesAPI.AaaHistory;
export import AaaHistoriesV4PagePaginationArray = HistoriesAPI.AaaHistoriesV4PagePaginationArray;
export import HistoryListParams = HistoriesAPI.HistoryListParams;
}
11 changes: 3 additions & 8 deletions src/resources/alerting/v3/index.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,18 @@
// File generated from our OpenAPI spec by Stainless.

export { Destinations } from './destinations/index';
export {
HistoryListResponse,
HistoryListParams,
HistoryListResponsesV4PagePaginationArray,
Histories,
} from './histories';
export { AaaHistory, HistoryListParams, AaaHistoriesV4PagePaginationArray, Histories } from './histories';
export {
AaaPolicies,
PolicyCreateResponse,
PolicyUpdateResponse,
PolicyListResponse,
PolicyDeleteResponse,
PolicyGetResponse,
PolicyCreateParams,
PolicyUpdateParams,
PolicyListParams,
PolicyDeleteParams,
PolicyGetParams,
Policies,
} from './policies';
export { Destinations } from './destinations/index';
export { V3ListResponse, V3ListParams, V3 } from './v3';
Loading

0 comments on commit 4219181

Please sign in to comment.