Skip to content

Commit

Permalink
feat: update via SDK Studio (#67)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored Feb 22, 2024
1 parent 6ad6ec3 commit dcafa07
Show file tree
Hide file tree
Showing 105 changed files with 1,475 additions and 1,576 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ jobs:


steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '18'

Expand Down
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
configured_endpoints: 1209
configured_endpoints: 1210
423 changes: 194 additions & 229 deletions api.md

Large diffs are not rendered by default.

41 changes: 8 additions & 33 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ export class Cloudflare extends Core.APIClient {
certificates: API.Certificates = new API.Certificates(this);
ips: API.IPs = new API.IPs(this);
memberships: API.Memberships = new API.Memberships(this);
users: API.Users = new API.Users(this);
user: API.User = new API.User(this);
zones: API.Zones = new API.Zones(this);
ai: API.AI = new API.AI(this);
loadBalancers: API.LoadBalancers = new API.LoadBalancers(this);
Expand All @@ -185,7 +185,7 @@ export class Cloudflare extends Core.APIClient {
customCertificates: API.CustomCertificates = new API.CustomCertificates(this);
customHostnames: API.CustomHostnames = new API.CustomHostnames(this);
customNameservers: API.CustomNameservers = new API.CustomNameservers(this);
dnsRecords: API.DNSRecords = new API.DNSRecords(this);
dns: API.DNS = new API.DNS(this);
dnssec: API.DNSSEC = new API.DNSSEC(this);
emails: API.Emails = new API.Emails(this);
filters: API.Filters = new API.Filters(this);
Expand All @@ -210,12 +210,11 @@ export class Cloudflare extends Core.APIClient {
spectrum: API.Spectrum = new API.Spectrum(this);
addresses: API.Addresses = new API.Addresses(this);
auditLogs: API.AuditLogs = new API.AuditLogs(this);
billings: API.Billings = new API.Billings(this);
billing: API.Billing = new API.Billing(this);
brandProtection: API.BrandProtection = new API.BrandProtection(this);
tunnels: API.Tunnels = new API.Tunnels(this);
diagnostics: API.Diagnostics = new API.Diagnostics(this);
dlp: API.DLP = new API.DLP(this);
dnsFirewall: API.DNSFirewall = new API.DNSFirewall(this);
images: API.Images = new API.Images(this);
intel: API.Intel = new API.Intel(this);
magics: API.Magics = new API.Magics(this);
Expand Down Expand Up @@ -380,7 +379,7 @@ export namespace Cloudflare {
export import MembershipUpdateParams = API.MembershipUpdateParams;
export import MembershipListParams = API.MembershipListParams;

export import Users = API.Users;
export import User = API.User;
export import UserListResponse = API.UserListResponse;
export import UserEditResponse = API.UserEditResponse;
export import UserEditParams = API.UserEditParams;
Expand All @@ -397,8 +396,8 @@ export namespace Cloudflare {
export import ZoneEditParams = API.ZoneEditParams;

export import AI = API.AI;
export import AICreateResponse = API.AICreateResponse;
export import AICreateParams = API.AICreateParams;
export import AIRunResponse = API.AIRunResponse;
export import AIRunParams = API.AIRunParams;

export import LoadBalancers = API.LoadBalancers;
export import LoadBalancerCreateResponse = API.LoadBalancerCreateResponse;
Expand Down Expand Up @@ -481,20 +480,7 @@ export namespace Cloudflare {
export import CustomNameserverVerifyResponse = API.CustomNameserverVerifyResponse;
export import CustomNameserverCreateParams = API.CustomNameserverCreateParams;

export import DNSRecords = API.DNSRecords;
export import DNSRecordCreateResponse = API.DNSRecordCreateResponse;
export import DNSRecordUpdateResponse = API.DNSRecordUpdateResponse;
export import DNSRecordListResponse = API.DNSRecordListResponse;
export import DNSRecordDeleteResponse = API.DNSRecordDeleteResponse;
export import DNSRecordExportResponse = API.DNSRecordExportResponse;
export import DNSRecordGetResponse = API.DNSRecordGetResponse;
export import DNSRecordImportResponse = API.DNSRecordImportResponse;
export import DNSRecordScanResponse = API.DNSRecordScanResponse;
export import DNSRecordListResponsesV4PagePaginationArray = API.DNSRecordListResponsesV4PagePaginationArray;
export import DNSRecordCreateParams = API.DNSRecordCreateParams;
export import DNSRecordUpdateParams = API.DNSRecordUpdateParams;
export import DNSRecordListParams = API.DNSRecordListParams;
export import DNSRecordImportParams = API.DNSRecordImportParams;
export import DNS = API.DNS;

export import DNSSEC = API.DNSSEC;
export import DNSSECDeleteResponse = API.DNSSECDeleteResponse;
Expand Down Expand Up @@ -627,7 +613,7 @@ export namespace Cloudflare {
export import AuditLogListResponsesV4PagePaginationArray = API.AuditLogListResponsesV4PagePaginationArray;
export import AuditLogListParams = API.AuditLogListParams;

export import Billings = API.Billings;
export import Billing = API.Billing;

export import BrandProtection = API.BrandProtection;

Expand All @@ -647,17 +633,6 @@ export namespace Cloudflare {

export import DLP = API.DLP;

export import DNSFirewall = API.DNSFirewall;
export import DNSFirewallCreateResponse = API.DNSFirewallCreateResponse;
export import DNSFirewallListResponse = API.DNSFirewallListResponse;
export import DNSFirewallDeleteResponse = API.DNSFirewallDeleteResponse;
export import DNSFirewallEditResponse = API.DNSFirewallEditResponse;
export import DNSFirewallGetResponse = API.DNSFirewallGetResponse;
export import DNSFirewallListResponsesV4PagePaginationArray = API.DNSFirewallListResponsesV4PagePaginationArray;
export import DNSFirewallCreateParams = API.DNSFirewallCreateParams;
export import DNSFirewallListParams = API.DNSFirewallListParams;
export import DNSFirewallEditParams = API.DNSFirewallEditParams;

export import Images = API.Images;

export import Intel = API.Intel;
Expand Down
6 changes: 3 additions & 3 deletions src/pagination.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
import { AbstractPage, Response, APIClient, FinalRequestOptions, PageInfo } from './core';

export interface V4PagePaginationResponse<Item> {
result: V4PagePaginationResponse.Result;
result: V4PagePaginationResponse.Result<Item>;

result_info: V4PagePaginationResponse.ResultInfo;
}

export namespace V4PagePaginationResponse {
export interface Result {
export interface Result<Item> {
items?: Array<Item>;
}

Expand All @@ -27,7 +27,7 @@ export interface V4PagePaginationParams {
}

export class V4PagePagination<Item> extends AbstractPage<Item> implements V4PagePaginationResponse<Item> {
result: V4PagePaginationResponse.Result;
result: V4PagePaginationResponse.Result<Item>;

result_info: V4PagePaginationResponse.ResultInfo;

Expand Down
16 changes: 8 additions & 8 deletions src/resources/ai.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,26 @@ export class AI extends APIResource {
* or results generated by the chosen AI model. The endpoint supports various AI
* model types, ensuring flexibility and adaptability for diverse use cases.
*/
create(
run(
accountId: string,
modelName: string,
body: AICreateParams,
body: AIRunParams,
options?: Core.RequestOptions,
): Core.APIPromise<AICreateResponse> {
): Core.APIPromise<AIRunResponse> {
return (
this._client.post(`/accounts/${accountId}/ai/run/${modelName}`, {
body,
...options,
}) as Core.APIPromise<{ result: AICreateResponse }>
}) as Core.APIPromise<{ result: AIRunResponse }>
)._thenUnwrap((obj) => obj.result);
}
}

export type AICreateResponse = unknown;
export type AIRunResponse = unknown;

export type AICreateParams = unknown;
export type AIRunParams = unknown;

export namespace AI {
export import AICreateResponse = AIAPI.AICreateResponse;
export import AICreateParams = AIAPI.AICreateParams;
export import AIRunResponse = AIAPI.AIRunResponse;
export import AIRunParams = AIAPI.AIRunParams;
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// File generated from our OpenAPI spec by Stainless.

import { APIResource } from 'cloudflare/resource';
import * as ProfilesAPI from 'cloudflare/resources/billings/profiles';
import * as ProfilesAPI from 'cloudflare/resources/billing/profiles';

export class Billings extends APIResource {
export class Billing extends APIResource {
profiles: ProfilesAPI.Profiles = new ProfilesAPI.Profiles(this._client);
}

export namespace Billings {
export namespace Billing {
export import Profiles = ProfilesAPI.Profiles;
export import ProfileGetResponse = ProfilesAPI.ProfileGetResponse;
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// File generated from our OpenAPI spec by Stainless.

export { Billings } from './billings';
export { Billing } from './billing';
export { ProfileGetResponse, Profiles } from './profiles';
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import * as Core from 'cloudflare/core';
import { APIResource } from 'cloudflare/resource';
import * as ProfilesAPI from 'cloudflare/resources/billings/profiles';
import * as ProfilesAPI from 'cloudflare/resources/billing/profiles';

export class Profiles extends APIResource {
/**
Expand Down
10 changes: 5 additions & 5 deletions src/resources/devices/devices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ export class Devices extends APIResource {
* Fetches a list of enrolled devices.
*/
devicesListDevices(
identifier: unknown,
accountId: unknown,
options?: Core.RequestOptions,
): Core.APIPromise<DeviceDevicesListDevicesResponse | null> {
return (
this._client.get(`/accounts/${identifier}/devices`, options) as Core.APIPromise<{
this._client.get(`/accounts/${accountId}/devices`, options) as Core.APIPromise<{
result: DeviceDevicesListDevicesResponse | null;
}>
)._thenUnwrap((obj) => obj.result);
Expand All @@ -40,12 +40,12 @@ export class Devices extends APIResource {
* Fetches details for a single device.
*/
get(
identifier: unknown,
uuid: string,
accountId: unknown,
deviceId: string,
options?: Core.RequestOptions,
): Core.APIPromise<DeviceGetResponse | null> {
return (
this._client.get(`/accounts/${identifier}/devices/${uuid}`, options) as Core.APIPromise<{
this._client.get(`/accounts/${accountId}/devices/${deviceId}`, options) as Core.APIPromise<{
result: DeviceGetResponse | null;
}>
)._thenUnwrap((obj) => obj.result);
Expand Down
36 changes: 18 additions & 18 deletions src/resources/devices/dex-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,28 @@ export class DEXTests extends APIResource {
* Create a DEX test.
*/
create(
identifier: unknown,
accountId: unknown,
body: DEXTestCreateParams,
options?: Core.RequestOptions,
): Core.APIPromise<DEXTestCreateResponse | null> {
return (
this._client.post(`/accounts/${identifier}/devices/dex_tests`, {
body,
...options,
}) as Core.APIPromise<{ result: DEXTestCreateResponse | null }>
this._client.post(`/accounts/${accountId}/devices/dex_tests`, { body, ...options }) as Core.APIPromise<{
result: DEXTestCreateResponse | null;
}>
)._thenUnwrap((obj) => obj.result);
}

/**
* Update a DEX test.
*/
update(
identifier: unknown,
uuid: string,
accountId: unknown,
dexTestId: string,
body: DEXTestUpdateParams,
options?: Core.RequestOptions,
): Core.APIPromise<DEXTestUpdateResponse | null> {
return (
this._client.put(`/accounts/${identifier}/devices/dex_tests/${uuid}`, {
this._client.put(`/accounts/${accountId}/devices/dex_tests/${dexTestId}`, {
body,
...options,
}) as Core.APIPromise<{ result: DEXTestUpdateResponse | null }>
Expand All @@ -41,9 +40,9 @@ export class DEXTests extends APIResource {
/**
* Fetch all DEX tests.
*/
list(identifier: unknown, options?: Core.RequestOptions): Core.APIPromise<DEXTestListResponse | null> {
list(accountId: unknown, options?: Core.RequestOptions): Core.APIPromise<DEXTestListResponse | null> {
return (
this._client.get(`/accounts/${identifier}/devices/dex_tests`, options) as Core.APIPromise<{
this._client.get(`/accounts/${accountId}/devices/dex_tests`, options) as Core.APIPromise<{
result: DEXTestListResponse | null;
}>
)._thenUnwrap((obj) => obj.result);
Expand All @@ -54,27 +53,28 @@ export class DEXTests extends APIResource {
* account.
*/
delete(
identifier: unknown,
uuid: string,
accountId: unknown,
dexTestId: string,
options?: Core.RequestOptions,
): Core.APIPromise<DEXTestDeleteResponse | null> {
return (
this._client.delete(`/accounts/${identifier}/devices/dex_tests/${uuid}`, options) as Core.APIPromise<{
result: DEXTestDeleteResponse | null;
}>
this._client.delete(
`/accounts/${accountId}/devices/dex_tests/${dexTestId}`,
options,
) as Core.APIPromise<{ result: DEXTestDeleteResponse | null }>
)._thenUnwrap((obj) => obj.result);
}

/**
* Fetch a single DEX test.
*/
get(
identifier: unknown,
uuid: string,
accountId: unknown,
dexTestId: string,
options?: Core.RequestOptions,
): Core.APIPromise<DEXTestGetResponse | null> {
return (
this._client.get(`/accounts/${identifier}/devices/dex_tests/${uuid}`, options) as Core.APIPromise<{
this._client.get(`/accounts/${accountId}/devices/dex_tests/${dexTestId}`, options) as Core.APIPromise<{
result: DEXTestGetResponse | null;
}>
)._thenUnwrap((obj) => obj.result);
Expand Down
Loading

0 comments on commit dcafa07

Please sign in to comment.