Skip to content

Commit

Permalink
feat: update via SDK Studio (#112)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored Mar 5, 2024
1 parent 09fb773 commit d59a7a8
Show file tree
Hide file tree
Showing 457 changed files with 7,551 additions and 66,047 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ const cloudflare = new Cloudflare({
});

async function main() {
const zoneCreateResponse = await cloudflare.zones.create({
const zonesZone = await cloudflare.zones.create({
account: { id: '023e105f4ecef8ad9ca31a8372d0c353' },
name: 'example.com',
type: 'full',
});

console.log(zoneCreateResponse.id);
console.log(zonesZone.id);
}

main();
Expand All @@ -60,7 +60,7 @@ async function main() {
name: 'example.com',
type: 'full',
};
const zoneCreateResponse: Cloudflare.ZoneCreateResponse = await cloudflare.zones.create(params);
const zonesZone: Cloudflare.ZonesZone = await cloudflare.zones.create(params);
}

main();
Expand Down Expand Up @@ -166,11 +166,11 @@ const response = await cloudflare.zones
console.log(response.headers.get('X-My-Header'));
console.log(response.statusText); // access the underlying Response object

const { data: zoneCreateResponse, response: raw } = await cloudflare.zones
const { data: zonesZone, response: raw } = await cloudflare.zones
.create({ account: { id: '023e105f4ecef8ad9ca31a8372d0c353' }, name: 'example.com', type: 'full' })
.withResponse();
console.log(raw.headers.get('X-My-Header'));
console.log(zoneCreateResponse.id);
console.log(zonesZone.id);
```

## Customizing the fetch client
Expand Down
1,773 changes: 760 additions & 1,013 deletions api.md

Large diffs are not rendered by default.

93 changes: 37 additions & 56 deletions src/index.ts

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions src/resources/accounts/accounts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,15 +198,16 @@ export namespace Accounts {
export import Members = MembersAPI.Members;
export import AccountMember = MembersAPI.AccountMember;
export import AccountMemberWithID = MembersAPI.AccountMemberWithID;
export import MemberListResponse = MembersAPI.MemberListResponse;
export import IamComponentsSchemasMember = MembersAPI.IamComponentsSchemasMember;
export import MemberDeleteResponse = MembersAPI.MemberDeleteResponse;
export import MemberListResponsesV4PagePaginationArray = MembersAPI.MemberListResponsesV4PagePaginationArray;
export import IamComponentsSchemasMembersV4PagePaginationArray = MembersAPI.IamComponentsSchemasMembersV4PagePaginationArray;
export import MemberCreateParams = MembersAPI.MemberCreateParams;
export import MemberUpdateParams = MembersAPI.MemberUpdateParams;
export import MemberListParams = MembersAPI.MemberListParams;
export import MemberDeleteParams = MembersAPI.MemberDeleteParams;
export import MemberGetParams = MembersAPI.MemberGetParams;
export import Roles = RolesAPI.Roles;
export import IamSchemasRole = RolesAPI.IamSchemasRole;
export import RoleListResponse = RolesAPI.RoleListResponse;
export import RoleGetResponse = RolesAPI.RoleGetResponse;
export import RoleListParams = RolesAPI.RoleListParams;
Expand Down
13 changes: 10 additions & 3 deletions src/resources/accounts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,21 @@ export {
export {
AccountMember,
AccountMemberWithID,
MemberListResponse,
IamComponentsSchemasMember,
MemberDeleteResponse,
MemberCreateParams,
MemberUpdateParams,
MemberListParams,
MemberDeleteParams,
MemberGetParams,
MemberListResponsesV4PagePaginationArray,
IamComponentsSchemasMembersV4PagePaginationArray,
Members,
} from './members';
export { RoleListResponse, RoleGetResponse, RoleListParams, RoleGetParams, Roles } from './roles';
export {
IamSchemasRole,
RoleListResponse,
RoleGetResponse,
RoleListParams,
RoleGetParams,
Roles,
} from './roles';
39 changes: 8 additions & 31 deletions src/resources/accounts/members.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 MembersAPI from 'cloudflare/resources/accounts/members';
import * as RolesAPI from 'cloudflare/resources/accounts/roles';
import { V4PagePaginationArray, type V4PagePaginationArrayParams } from 'cloudflare/pagination';

export class Members extends APIResource {
Expand Down Expand Up @@ -41,11 +42,11 @@ export class Members extends APIResource {
list(
params: MemberListParams,
options?: Core.RequestOptions,
): Core.PagePromise<MemberListResponsesV4PagePaginationArray, MemberListResponse> {
): Core.PagePromise<IamComponentsSchemasMembersV4PagePaginationArray, IamComponentsSchemasMember> {
const { account_id, ...query } = params;
return this._client.getAPIList(
`/accounts/${account_id}/members`,
MemberListResponsesV4PagePaginationArray,
IamComponentsSchemasMembersV4PagePaginationArray,
{ query, ...options },
);
}
Expand Down Expand Up @@ -83,7 +84,7 @@ export class Members extends APIResource {
}
}

export class MemberListResponsesV4PagePaginationArray extends V4PagePaginationArray<MemberListResponse> {}
export class IamComponentsSchemasMembersV4PagePaginationArray extends V4PagePaginationArray<IamComponentsSchemasMember> {}

export interface AccountMember {
/**
Expand Down Expand Up @@ -424,7 +425,7 @@ export namespace AccountMemberWithID {
}
}

export interface MemberListResponse {
export interface IamComponentsSchemasMember {
/**
* Identifier
*/
Expand All @@ -443,38 +444,14 @@ export interface MemberListResponse {
/**
* Roles assigned to this Member.
*/
roles: Array<MemberListResponse.Role>;
roles: Array<RolesAPI.IamSchemasRole>;

/**
* A member's status in the organization.
*/
status: 'accepted' | 'invited';
}

export namespace MemberListResponse {
export interface Role {
/**
* Role identifier tag.
*/
id: string;

/**
* Description of role's permissions.
*/
description: string;

/**
* Role Name.
*/
name: string;

/**
* Access permissions for this User.
*/
permissions: Array<string>;
}
}

export interface MemberDeleteResponse {
/**
* Identifier
Expand Down Expand Up @@ -558,9 +535,9 @@ export interface MemberGetParams {
export namespace Members {
export import AccountMember = MembersAPI.AccountMember;
export import AccountMemberWithID = MembersAPI.AccountMemberWithID;
export import MemberListResponse = MembersAPI.MemberListResponse;
export import IamComponentsSchemasMember = MembersAPI.IamComponentsSchemasMember;
export import MemberDeleteResponse = MembersAPI.MemberDeleteResponse;
export import MemberListResponsesV4PagePaginationArray = MembersAPI.MemberListResponsesV4PagePaginationArray;
export import IamComponentsSchemasMembersV4PagePaginationArray = MembersAPI.IamComponentsSchemasMembersV4PagePaginationArray;
export import MemberCreateParams = MembersAPI.MemberCreateParams;
export import MemberUpdateParams = MembersAPI.MemberUpdateParams;
export import MemberListParams = MembersAPI.MemberListParams;
Expand Down
41 changes: 20 additions & 21 deletions src/resources/accounts/roles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,32 +34,30 @@ export class Roles extends APIResource {
}
}

export type RoleListResponse = Array<RoleListResponse.RoleListResponseItem>;

export namespace RoleListResponse {
export interface RoleListResponseItem {
/**
* Role identifier tag.
*/
id: string;
export interface IamSchemasRole {
/**
* Role identifier tag.
*/
id: string;

/**
* Description of role's permissions.
*/
description: string;
/**
* Description of role's permissions.
*/
description: string;

/**
* Role Name.
*/
name: string;
/**
* Role Name.
*/
name: string;

/**
* Access permissions for this User.
*/
permissions: Array<string>;
}
/**
* Access permissions for this User.
*/
permissions: Array<string>;
}

export type RoleListResponse = Array<IamSchemasRole>;

export type RoleGetResponse = unknown | string | null;

export interface RoleListParams {
Expand All @@ -71,6 +69,7 @@ export interface RoleGetParams {
}

export namespace Roles {
export import IamSchemasRole = RolesAPI.IamSchemasRole;
export import RoleListResponse = RolesAPI.RoleListResponse;
export import RoleGetResponse = RolesAPI.RoleGetResponse;
export import RoleListParams = RolesAPI.RoleListParams;
Expand Down
Loading

0 comments on commit d59a7a8

Please sign in to comment.