Skip to content

Commit

Permalink
feat(api): update via SDK Studio (#241)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Apr 4, 2024
1 parent 0019f33 commit 2b1161a
Show file tree
Hide file tree
Showing 399 changed files with 12,292 additions and 14,740 deletions.
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
configured_endpoints: 1292
configured_endpoints: 1299
825 changes: 385 additions & 440 deletions api.md

Large diffs are not rendered by default.

98 changes: 58 additions & 40 deletions src/index.ts

Large diffs are not rendered by default.

24 changes: 13 additions & 11 deletions src/resources/accounts/accounts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import * as Core from 'cloudflare/core';
import { APIResource } from 'cloudflare/resource';
import { isRequestOptions } from 'cloudflare/core';
import * as AccountsAPI from 'cloudflare/resources/accounts/accounts';
import * as Shared from 'cloudflare/resources/shared';
import * as MembersAPI from 'cloudflare/resources/accounts/members';
import * as RolesAPI from 'cloudflare/resources/accounts/roles';
import { V4PagePaginationArray, type V4PagePaginationArrayParams } from 'cloudflare/pagination';
Expand All @@ -15,11 +16,14 @@ export class Accounts extends APIResource {
/**
* Update an existing account.
*/
update(params: AccountUpdateParams, options?: Core.RequestOptions): Core.APIPromise<AccountUpdateResponse> {
update(
params: AccountUpdateParams,
options?: Core.RequestOptions,
): Core.APIPromise<Shared.UnnamedSchemaRef9444735ca60712dbcf8afd832eb5716a> {
const { account_id, ...body } = params;
return (
this._client.put(`/accounts/${account_id}`, { body, ...options }) as Core.APIPromise<{
result: AccountUpdateResponse;
result: Shared.UnnamedSchemaRef9444735ca60712dbcf8afd832eb5716a;
}>
)._thenUnwrap((obj) => obj.result);
}
Expand Down Expand Up @@ -50,10 +54,15 @@ export class Accounts extends APIResource {
/**
* Get information about a specific account that you are a member of.
*/
get(params: AccountGetParams, options?: Core.RequestOptions): Core.APIPromise<AccountGetResponse> {
get(
params: AccountGetParams,
options?: Core.RequestOptions,
): Core.APIPromise<Shared.UnnamedSchemaRef9444735ca60712dbcf8afd832eb5716a> {
const { account_id } = params;
return (
this._client.get(`/accounts/${account_id}`, options) as Core.APIPromise<{ result: AccountGetResponse }>
this._client.get(`/accounts/${account_id}`, options) as Core.APIPromise<{
result: Shared.UnnamedSchemaRef9444735ca60712dbcf8afd832eb5716a;
}>
)._thenUnwrap((obj) => obj.result);
}
}
Expand Down Expand Up @@ -117,12 +126,8 @@ export namespace Account {
}
}

export type AccountUpdateResponse = unknown | string | null;

export type AccountListResponse = unknown;

export type AccountGetResponse = unknown | string | null;

export interface AccountUpdateParams {
/**
* Path param:
Expand Down Expand Up @@ -193,9 +198,7 @@ export interface AccountGetParams {

export namespace Accounts {
export import Account = AccountsAPI.Account;
export import AccountUpdateResponse = AccountsAPI.AccountUpdateResponse;
export import AccountListResponse = AccountsAPI.AccountListResponse;
export import AccountGetResponse = AccountsAPI.AccountGetResponse;
export import AccountListResponsesV4PagePaginationArray = AccountsAPI.AccountListResponsesV4PagePaginationArray;
export import AccountUpdateParams = AccountsAPI.AccountUpdateParams;
export import AccountListParams = AccountsAPI.AccountListParams;
Expand All @@ -216,7 +219,6 @@ export namespace Accounts {
export import PermissionGrant = RolesAPI.PermissionGrant;
export import Role = RolesAPI.Role;
export import RoleListResponse = RolesAPI.RoleListResponse;
export import RoleGetResponse = RolesAPI.RoleGetResponse;
export import RoleListResponsesSinglePage = RolesAPI.RoleListResponsesSinglePage;
export import RoleListParams = RolesAPI.RoleListParams;
export import RoleGetParams = RolesAPI.RoleGetParams;
Expand Down
3 changes: 0 additions & 3 deletions src/resources/accounts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

export {
Account,
AccountUpdateResponse,
AccountListResponse,
AccountGetResponse,
AccountUpdateParams,
AccountListParams,
AccountGetParams,
Expand All @@ -29,7 +27,6 @@ export {
PermissionGrant,
Role,
RoleListResponse,
RoleGetResponse,
RoleListParams,
RoleGetParams,
RoleListResponsesSinglePage,
Expand Down
8 changes: 3 additions & 5 deletions src/resources/accounts/roles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import * as Core from 'cloudflare/core';
import { APIResource } from 'cloudflare/resource';
import * as RolesAPI from 'cloudflare/resources/accounts/roles';
import * as Shared from 'cloudflare/resources/shared';
import * as MembersAPI from 'cloudflare/resources/accounts/members';
import { SinglePage } from 'cloudflare/pagination';

Expand All @@ -25,11 +26,11 @@ export class Roles extends APIResource {
roleId: unknown,
params: RoleGetParams,
options?: Core.RequestOptions,
): Core.APIPromise<RoleGetResponse> {
): Core.APIPromise<Shared.UnnamedSchemaRef9444735ca60712dbcf8afd832eb5716a> {
const { account_id } = params;
return (
this._client.get(`/accounts/${account_id}/roles/${roleId}`, options) as Core.APIPromise<{
result: RoleGetResponse;
result: Shared.UnnamedSchemaRef9444735ca60712dbcf8afd832eb5716a;
}>
)._thenUnwrap((obj) => obj.result);
}
Expand Down Expand Up @@ -84,8 +85,6 @@ export interface RoleListResponse {
permissions: Array<string>;
}

export type RoleGetResponse = unknown | string | null;

export interface RoleListParams {
account_id: unknown;
}
Expand All @@ -98,7 +97,6 @@ export namespace Roles {
export import PermissionGrant = RolesAPI.PermissionGrant;
export import Role = RolesAPI.Role;
export import RoleListResponse = RolesAPI.RoleListResponse;
export import RoleGetResponse = RolesAPI.RoleGetResponse;
export import RoleListResponsesSinglePage = RolesAPI.RoleListResponsesSinglePage;
export import RoleListParams = RolesAPI.RoleListParams;
export import RoleGetParams = RolesAPI.RoleGetParams;
Expand Down
15 changes: 5 additions & 10 deletions src/resources/addressing/address-maps/accounts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import * as Core from 'cloudflare/core';
import { APIResource } from 'cloudflare/resource';
import * as AccountsAPI from 'cloudflare/resources/addressing/address-maps/accounts';
import * as Shared from 'cloudflare/resources/shared';

export class Accounts extends APIResource {
/**
Expand All @@ -12,13 +13,13 @@ export class Accounts extends APIResource {
addressMapId: string,
params: AccountUpdateParams,
options?: Core.RequestOptions,
): Core.APIPromise<AccountUpdateResponse | null> {
): Core.APIPromise<Shared.UnnamedSchemaRef67bbb1ccdd42c3e2937b9fd19f791151 | null> {
const { account_id, body } = params;
return (
this._client.put(
`/accounts/${account_id}/addressing/address_maps/${addressMapId}/accounts/${account_id}`,
{ body: body, ...options },
) as Core.APIPromise<{ result: AccountUpdateResponse | null }>
) as Core.APIPromise<{ result: Shared.UnnamedSchemaRef67bbb1ccdd42c3e2937b9fd19f791151 | null }>
)._thenUnwrap((obj) => obj.result);
}

Expand All @@ -29,21 +30,17 @@ export class Accounts extends APIResource {
addressMapId: string,
params: AccountDeleteParams,
options?: Core.RequestOptions,
): Core.APIPromise<AccountDeleteResponse | null> {
): Core.APIPromise<Shared.UnnamedSchemaRef67bbb1ccdd42c3e2937b9fd19f791151 | null> {
const { account_id, body } = params;
return (
this._client.delete(
`/accounts/${account_id}/addressing/address_maps/${addressMapId}/accounts/${account_id}`,
{ body: body, ...options },
) as Core.APIPromise<{ result: AccountDeleteResponse | null }>
) as Core.APIPromise<{ result: Shared.UnnamedSchemaRef67bbb1ccdd42c3e2937b9fd19f791151 | null }>
)._thenUnwrap((obj) => obj.result);
}
}

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

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

export interface AccountUpdateParams {
/**
* Path param: Identifier
Expand All @@ -69,8 +66,6 @@ export interface AccountDeleteParams {
}

export namespace Accounts {
export import AccountUpdateResponse = AccountsAPI.AccountUpdateResponse;
export import AccountDeleteResponse = AccountsAPI.AccountDeleteResponse;
export import AccountUpdateParams = AccountsAPI.AccountUpdateParams;
export import AccountDeleteParams = AccountsAPI.AccountDeleteParams;
}
14 changes: 3 additions & 11 deletions src/resources/addressing/address-maps/address-maps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import * as Core from 'cloudflare/core';
import { APIResource } from 'cloudflare/resource';
import * as AddressMapsAPI from 'cloudflare/resources/addressing/address-maps/address-maps';
import * as Shared from 'cloudflare/resources/shared';
import * as AccountsAPI from 'cloudflare/resources/addressing/address-maps/accounts';
import * as IPsAPI from 'cloudflare/resources/addressing/address-maps/ips';
import * as ZonesAPI from 'cloudflare/resources/addressing/address-maps/zones';
Expand Down Expand Up @@ -52,13 +53,13 @@ export class AddressMaps extends APIResource {
addressMapId: string,
params: AddressMapDeleteParams,
options?: Core.RequestOptions,
): Core.APIPromise<AddressMapDeleteResponse | null> {
): Core.APIPromise<Shared.UnnamedSchemaRef67bbb1ccdd42c3e2937b9fd19f791151 | null> {
const { account_id, body } = params;
return (
this._client.delete(`/accounts/${account_id}/addressing/address_maps/${addressMapId}`, {
body: body,
...options,
}) as Core.APIPromise<{ result: AddressMapDeleteResponse | null }>
}) as Core.APIPromise<{ result: Shared.UnnamedSchemaRef67bbb1ccdd42c3e2937b9fd19f791151 | null }>
)._thenUnwrap((obj) => obj.result);
}

Expand Down Expand Up @@ -228,8 +229,6 @@ export namespace AddressMapCreateResponse {
}
}

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

export interface AddressMapGetResponse {
/**
* Identifier
Expand Down Expand Up @@ -391,7 +390,6 @@ export interface AddressMapGetParams {
export namespace AddressMaps {
export import AddressingAddressMaps = AddressMapsAPI.AddressingAddressMaps;
export import AddressMapCreateResponse = AddressMapsAPI.AddressMapCreateResponse;
export import AddressMapDeleteResponse = AddressMapsAPI.AddressMapDeleteResponse;
export import AddressMapGetResponse = AddressMapsAPI.AddressMapGetResponse;
export import AddressingAddressMapsSinglePage = AddressMapsAPI.AddressingAddressMapsSinglePage;
export import AddressMapCreateParams = AddressMapsAPI.AddressMapCreateParams;
Expand All @@ -400,18 +398,12 @@ export namespace AddressMaps {
export import AddressMapEditParams = AddressMapsAPI.AddressMapEditParams;
export import AddressMapGetParams = AddressMapsAPI.AddressMapGetParams;
export import Accounts = AccountsAPI.Accounts;
export import AccountUpdateResponse = AccountsAPI.AccountUpdateResponse;
export import AccountDeleteResponse = AccountsAPI.AccountDeleteResponse;
export import AccountUpdateParams = AccountsAPI.AccountUpdateParams;
export import AccountDeleteParams = AccountsAPI.AccountDeleteParams;
export import IPs = IPsAPI.IPs;
export import IPUpdateResponse = IPsAPI.IPUpdateResponse;
export import IPDeleteResponse = IPsAPI.IPDeleteResponse;
export import IPUpdateParams = IPsAPI.IPUpdateParams;
export import IPDeleteParams = IPsAPI.IPDeleteParams;
export import Zones = ZonesAPI.Zones;
export import ZoneUpdateResponse = ZonesAPI.ZoneUpdateResponse;
export import ZoneDeleteResponse = ZonesAPI.ZoneDeleteResponse;
export import ZoneUpdateParams = ZonesAPI.ZoneUpdateParams;
export import ZoneDeleteParams = ZonesAPI.ZoneDeleteParams;
}
13 changes: 3 additions & 10 deletions src/resources/addressing/address-maps/index.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

export {
AccountUpdateResponse,
AccountDeleteResponse,
AccountUpdateParams,
AccountDeleteParams,
Accounts,
} from './accounts';
export { AccountUpdateParams, AccountDeleteParams, Accounts } from './accounts';
export {
AddressingAddressMaps,
AddressMapCreateResponse,
AddressMapDeleteResponse,
AddressMapGetResponse,
AddressMapCreateParams,
AddressMapListParams,
Expand All @@ -20,5 +13,5 @@ export {
AddressingAddressMapsSinglePage,
AddressMaps,
} from './address-maps';
export { IPUpdateResponse, IPDeleteResponse, IPUpdateParams, IPDeleteParams, IPs } from './ips';
export { ZoneUpdateResponse, ZoneDeleteResponse, ZoneUpdateParams, ZoneDeleteParams, Zones } from './zones';
export { IPUpdateParams, IPDeleteParams, IPs } from './ips';
export { ZoneUpdateParams, ZoneDeleteParams, Zones } from './zones';
15 changes: 5 additions & 10 deletions src/resources/addressing/address-maps/ips.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import * as Core from 'cloudflare/core';
import { APIResource } from 'cloudflare/resource';
import * as IPsAPI from 'cloudflare/resources/addressing/address-maps/ips';
import * as Shared from 'cloudflare/resources/shared';

export class IPs extends APIResource {
/**
Expand All @@ -13,13 +14,13 @@ export class IPs extends APIResource {
ipAddress: string,
params: IPUpdateParams,
options?: Core.RequestOptions,
): Core.APIPromise<IPUpdateResponse | null> {
): Core.APIPromise<Shared.UnnamedSchemaRef67bbb1ccdd42c3e2937b9fd19f791151 | null> {
const { account_id, body } = params;
return (
this._client.put(`/accounts/${account_id}/addressing/address_maps/${addressMapId}/ips/${ipAddress}`, {
body: body,
...options,
}) as Core.APIPromise<{ result: IPUpdateResponse | null }>
}) as Core.APIPromise<{ result: Shared.UnnamedSchemaRef67bbb1ccdd42c3e2937b9fd19f791151 | null }>
)._thenUnwrap((obj) => obj.result);
}

Expand All @@ -31,21 +32,17 @@ export class IPs extends APIResource {
ipAddress: string,
params: IPDeleteParams,
options?: Core.RequestOptions,
): Core.APIPromise<IPDeleteResponse | null> {
): Core.APIPromise<Shared.UnnamedSchemaRef67bbb1ccdd42c3e2937b9fd19f791151 | null> {
const { account_id, body } = params;
return (
this._client.delete(
`/accounts/${account_id}/addressing/address_maps/${addressMapId}/ips/${ipAddress}`,
{ body: body, ...options },
) as Core.APIPromise<{ result: IPDeleteResponse | null }>
) as Core.APIPromise<{ result: Shared.UnnamedSchemaRef67bbb1ccdd42c3e2937b9fd19f791151 | null }>
)._thenUnwrap((obj) => obj.result);
}
}

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

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

export interface IPUpdateParams {
/**
* Path param: Identifier
Expand All @@ -71,8 +68,6 @@ export interface IPDeleteParams {
}

export namespace IPs {
export import IPUpdateResponse = IPsAPI.IPUpdateResponse;
export import IPDeleteResponse = IPsAPI.IPDeleteResponse;
export import IPUpdateParams = IPsAPI.IPUpdateParams;
export import IPDeleteParams = IPsAPI.IPDeleteParams;
}
15 changes: 5 additions & 10 deletions src/resources/addressing/address-maps/zones.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import * as Core from 'cloudflare/core';
import { APIResource } from 'cloudflare/resource';
import * as ZonesAPI from 'cloudflare/resources/addressing/address-maps/zones';
import * as Shared from 'cloudflare/resources/shared';

export class Zones extends APIResource {
/**
Expand All @@ -12,13 +13,13 @@ export class Zones extends APIResource {
addressMapId: string,
params: ZoneUpdateParams,
options?: Core.RequestOptions,
): Core.APIPromise<ZoneUpdateResponse | null> {
): Core.APIPromise<Shared.UnnamedSchemaRef67bbb1ccdd42c3e2937b9fd19f791151 | null> {
const { zone_id, account_id, body } = params;
return (
this._client.put(`/accounts/${account_id}/addressing/address_maps/${addressMapId}/zones/${zone_id}`, {
body: body,
...options,
}) as Core.APIPromise<{ result: ZoneUpdateResponse | null }>
}) as Core.APIPromise<{ result: Shared.UnnamedSchemaRef67bbb1ccdd42c3e2937b9fd19f791151 | null }>
)._thenUnwrap((obj) => obj.result);
}

Expand All @@ -29,21 +30,17 @@ export class Zones extends APIResource {
addressMapId: string,
params: ZoneDeleteParams,
options?: Core.RequestOptions,
): Core.APIPromise<ZoneDeleteResponse | null> {
): Core.APIPromise<Shared.UnnamedSchemaRef67bbb1ccdd42c3e2937b9fd19f791151 | null> {
const { zone_id, account_id, body } = params;
return (
this._client.delete(
`/accounts/${account_id}/addressing/address_maps/${addressMapId}/zones/${zone_id}`,
{ body: body, ...options },
) as Core.APIPromise<{ result: ZoneDeleteResponse | null }>
) as Core.APIPromise<{ result: Shared.UnnamedSchemaRef67bbb1ccdd42c3e2937b9fd19f791151 | null }>
)._thenUnwrap((obj) => obj.result);
}
}

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

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

export interface ZoneUpdateParams {
/**
* Path param: Identifier
Expand Down Expand Up @@ -79,8 +76,6 @@ export interface ZoneDeleteParams {
}

export namespace Zones {
export import ZoneUpdateResponse = ZonesAPI.ZoneUpdateResponse;
export import ZoneDeleteResponse = ZonesAPI.ZoneDeleteResponse;
export import ZoneUpdateParams = ZonesAPI.ZoneUpdateParams;
export import ZoneDeleteParams = ZonesAPI.ZoneDeleteParams;
}
Loading

0 comments on commit 2b1161a

Please sign in to comment.