Skip to content

Commit

Permalink
feat(api): update via SDK Studio (#286)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Apr 10, 2024
1 parent e9b10b4 commit 4c56e68
Show file tree
Hide file tree
Showing 53 changed files with 1,218 additions and 878 deletions.
83 changes: 40 additions & 43 deletions api.md

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions src/resources/addressing/addressing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,12 @@ export namespace Addressing {
export import LOADocumentCreateParams = LOADocumentsAPI.LOADocumentCreateParams;
export import Prefixes = PrefixesAPI.Prefixes;
export import Prefix = PrefixesAPI.Prefix;
export import UnnamedSchemaRefE358666e049bf8f9281c0a4f89b5fe46 = PrefixesAPI.UnnamedSchemaRefE358666e049bf8f9281c0a4f89b5fe46;
export import PrefixCreateResponse = PrefixesAPI.PrefixCreateResponse;
export import PrefixListResponse = PrefixesAPI.PrefixListResponse;
export import PrefixDeleteResponse = PrefixesAPI.PrefixDeleteResponse;
export import PrefixesSinglePage = PrefixesAPI.PrefixesSinglePage;
export import PrefixEditResponse = PrefixesAPI.PrefixEditResponse;
export import PrefixGetResponse = PrefixesAPI.PrefixGetResponse;
export import PrefixListResponsesSinglePage = PrefixesAPI.PrefixListResponsesSinglePage;
export import PrefixCreateParams = PrefixesAPI.PrefixCreateParams;
export import PrefixListParams = PrefixesAPI.PrefixListParams;
export import PrefixDeleteParams = PrefixesAPI.PrefixDeleteParams;
Expand Down
7 changes: 5 additions & 2 deletions src/resources/addressing/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,17 @@ export { Addressing } from './addressing';
export { LOADocumentCreateResponse, LOADocumentCreateParams, LOADocuments } from './loa-documents/index';
export {
Prefix,
UnnamedSchemaRefE358666e049bf8f9281c0a4f89b5fe46,
PrefixCreateResponse,
PrefixListResponse,
PrefixDeleteResponse,
PrefixEditResponse,
PrefixGetResponse,
PrefixCreateParams,
PrefixListParams,
PrefixDeleteParams,
PrefixEditParams,
PrefixGetParams,
PrefixesSinglePage,
PrefixListResponsesSinglePage,
Prefixes,
} from './prefixes/index';
export { ServiceListResponse, ServiceListParams, ServiceListResponsesSinglePage, Services } from './services';
7 changes: 5 additions & 2 deletions src/resources/addressing/prefixes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,16 @@ export {
} from './delegations';
export {
Prefix,
UnnamedSchemaRefE358666e049bf8f9281c0a4f89b5fe46,
PrefixCreateResponse,
PrefixListResponse,
PrefixDeleteResponse,
PrefixEditResponse,
PrefixGetResponse,
PrefixCreateParams,
PrefixListParams,
PrefixDeleteParams,
PrefixEditParams,
PrefixGetParams,
PrefixesSinglePage,
PrefixListResponsesSinglePage,
Prefixes,
} from './prefixes';
230 changes: 218 additions & 12 deletions src/resources/addressing/prefixes/prefixes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ export class Prefixes extends APIResource {
/**
* Add a new prefix under the account.
*/
create(params: PrefixCreateParams, options?: Core.RequestOptions): Core.APIPromise<Prefix> {
create(params: PrefixCreateParams, options?: Core.RequestOptions): Core.APIPromise<PrefixCreateResponse> {
const { account_id, ...body } = params;
return (
this._client.post(`/accounts/${account_id}/addressing/prefixes`, {
body,
...options,
}) as Core.APIPromise<{ result: Prefix }>
}) as Core.APIPromise<{ result: PrefixCreateResponse }>
)._thenUnwrap((obj) => obj.result);
}

Expand All @@ -30,11 +30,11 @@ export class Prefixes extends APIResource {
list(
params: PrefixListParams,
options?: Core.RequestOptions,
): Core.PagePromise<PrefixesSinglePage, Prefix> {
): Core.PagePromise<PrefixListResponsesSinglePage, PrefixListResponse> {
const { account_id } = params;
return this._client.getAPIList(
`/accounts/${account_id}/addressing/prefixes`,
PrefixesSinglePage,
PrefixListResponsesSinglePage,
options,
);
}
Expand All @@ -59,31 +59,39 @@ export class Prefixes extends APIResource {
/**
* Modify the description for a prefix owned by the account.
*/
edit(prefixId: string, params: PrefixEditParams, options?: Core.RequestOptions): Core.APIPromise<Prefix> {
edit(
prefixId: string,
params: PrefixEditParams,
options?: Core.RequestOptions,
): Core.APIPromise<PrefixEditResponse> {
const { account_id, ...body } = params;
return (
this._client.patch(`/accounts/${account_id}/addressing/prefixes/${prefixId}`, {
body,
...options,
}) as Core.APIPromise<{ result: Prefix }>
}) as Core.APIPromise<{ result: PrefixEditResponse }>
)._thenUnwrap((obj) => obj.result);
}

/**
* List a particular prefix owned by the account.
*/
get(prefixId: string, params: PrefixGetParams, options?: Core.RequestOptions): Core.APIPromise<Prefix> {
get(
prefixId: string,
params: PrefixGetParams,
options?: Core.RequestOptions,
): Core.APIPromise<PrefixGetResponse> {
const { account_id } = params;
return (
this._client.get(
`/accounts/${account_id}/addressing/prefixes/${prefixId}`,
options,
) as Core.APIPromise<{ result: Prefix }>
) as Core.APIPromise<{ result: PrefixGetResponse }>
)._thenUnwrap((obj) => obj.result);
}
}

export class PrefixesSinglePage extends SinglePage<Prefix> {}
export class PrefixListResponsesSinglePage extends SinglePage<PrefixListResponse> {}

export interface Prefix {
/**
Expand Down Expand Up @@ -150,7 +158,72 @@ export interface Prefix {
on_demand_locked?: boolean;
}

export interface UnnamedSchemaRefE358666e049bf8f9281c0a4f89b5fe46 {
export interface PrefixCreateResponse {
/**
* Identifier
*/
id?: string;

/**
* Identifier
*/
account_id?: string;

/**
* Prefix advertisement status to the Internet. This field is only not 'null' if on
* demand is enabled.
*/
advertised?: boolean | null;

/**
* Last time the advertisement status was changed. This field is only not 'null' if
* on demand is enabled.
*/
advertised_modified_at?: string | null;

/**
* Approval state of the prefix (P = pending, V = active).
*/
approved?: string;

/**
* Autonomous System Number (ASN) the prefix will be advertised under.
*/
asn?: number | null;

/**
* IP Prefix in Classless Inter-Domain Routing format.
*/
cidr?: string;

created_at?: string;

/**
* Description of the prefix.
*/
description?: string;

/**
* Identifier for the uploaded LOA document.
*/
loa_document_id?: string | null;

modified_at?: string;

/**
* Whether advertisement of the prefix to the Internet may be dynamically enabled
* or disabled.
*/
on_demand_enabled?: boolean;

/**
* Whether advertisement status of the prefix is locked, meaning it cannot be
* changed.
*/
on_demand_locked?: boolean;
}

export interface PrefixListResponse {
/**
* Identifier
*/
Expand Down Expand Up @@ -217,6 +290,136 @@ export interface UnnamedSchemaRefE358666e049bf8f9281c0a4f89b5fe46 {

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

export interface PrefixEditResponse {
/**
* Identifier
*/
id?: string;

/**
* Identifier
*/
account_id?: string;

/**
* Prefix advertisement status to the Internet. This field is only not 'null' if on
* demand is enabled.
*/
advertised?: boolean | null;

/**
* Last time the advertisement status was changed. This field is only not 'null' if
* on demand is enabled.
*/
advertised_modified_at?: string | null;

/**
* Approval state of the prefix (P = pending, V = active).
*/
approved?: string;

/**
* Autonomous System Number (ASN) the prefix will be advertised under.
*/
asn?: number | null;

/**
* IP Prefix in Classless Inter-Domain Routing format.
*/
cidr?: string;

created_at?: string;

/**
* Description of the prefix.
*/
description?: string;

/**
* Identifier for the uploaded LOA document.
*/
loa_document_id?: string | null;

modified_at?: string;

/**
* Whether advertisement of the prefix to the Internet may be dynamically enabled
* or disabled.
*/
on_demand_enabled?: boolean;

/**
* Whether advertisement status of the prefix is locked, meaning it cannot be
* changed.
*/
on_demand_locked?: boolean;
}

export interface PrefixGetResponse {
/**
* Identifier
*/
id?: string;

/**
* Identifier
*/
account_id?: string;

/**
* Prefix advertisement status to the Internet. This field is only not 'null' if on
* demand is enabled.
*/
advertised?: boolean | null;

/**
* Last time the advertisement status was changed. This field is only not 'null' if
* on demand is enabled.
*/
advertised_modified_at?: string | null;

/**
* Approval state of the prefix (P = pending, V = active).
*/
approved?: string;

/**
* Autonomous System Number (ASN) the prefix will be advertised under.
*/
asn?: number | null;

/**
* IP Prefix in Classless Inter-Domain Routing format.
*/
cidr?: string;

created_at?: string;

/**
* Description of the prefix.
*/
description?: string;

/**
* Identifier for the uploaded LOA document.
*/
loa_document_id?: string | null;

modified_at?: string;

/**
* Whether advertisement of the prefix to the Internet may be dynamically enabled
* or disabled.
*/
on_demand_enabled?: boolean;

/**
* Whether advertisement status of the prefix is locked, meaning it cannot be
* changed.
*/
on_demand_locked?: boolean;
}

export interface PrefixCreateParams {
/**
* Path param: Identifier
Expand Down Expand Up @@ -279,9 +482,12 @@ export interface PrefixGetParams {

export namespace Prefixes {
export import Prefix = PrefixesAPI.Prefix;
export import UnnamedSchemaRefE358666e049bf8f9281c0a4f89b5fe46 = PrefixesAPI.UnnamedSchemaRefE358666e049bf8f9281c0a4f89b5fe46;
export import PrefixCreateResponse = PrefixesAPI.PrefixCreateResponse;
export import PrefixListResponse = PrefixesAPI.PrefixListResponse;
export import PrefixDeleteResponse = PrefixesAPI.PrefixDeleteResponse;
export import PrefixesSinglePage = PrefixesAPI.PrefixesSinglePage;
export import PrefixEditResponse = PrefixesAPI.PrefixEditResponse;
export import PrefixGetResponse = PrefixesAPI.PrefixGetResponse;
export import PrefixListResponsesSinglePage = PrefixesAPI.PrefixListResponsesSinglePage;
export import PrefixCreateParams = PrefixesAPI.PrefixCreateParams;
export import PrefixListParams = PrefixesAPI.PrefixListParams;
export import PrefixDeleteParams = PrefixesAPI.PrefixDeleteParams;
Expand Down
Loading

0 comments on commit 4c56e68

Please sign in to comment.