Skip to content

Commit

Permalink
feat(api): update via SDK Studio (#309)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Apr 11, 2024
1 parent ea263f3 commit 99d8c1a
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 167 deletions.
13 changes: 5 additions & 8 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -2076,19 +2076,16 @@ Methods:
Types:

- <code><a href="./src/resources/secondary-dns/peers.ts">Peer</a></code>
- <code><a href="./src/resources/secondary-dns/peers.ts">PeerCreateResponse</a></code>
- <code><a href="./src/resources/secondary-dns/peers.ts">PeerUpdateResponse</a></code>
- <code><a href="./src/resources/secondary-dns/peers.ts">PeerListResponse</a></code>
- <code><a href="./src/resources/secondary-dns/peers.ts">Peers</a></code>
- <code><a href="./src/resources/secondary-dns/peers.ts">PeerDeleteResponse</a></code>
- <code><a href="./src/resources/secondary-dns/peers.ts">PeerGetResponse</a></code>

Methods:

- <code title="post /accounts/{account_id}/secondary_dns/peers">client.secondaryDNS.peers.<a href="./src/resources/secondary-dns/peers.ts">create</a>({ ...params }) -> PeerCreateResponse</code>
- <code title="put /accounts/{account_id}/secondary_dns/peers/{peer_id}">client.secondaryDNS.peers.<a href="./src/resources/secondary-dns/peers.ts">update</a>(peerId, { ...params }) -> PeerUpdateResponse</code>
- <code title="get /accounts/{account_id}/secondary_dns/peers">client.secondaryDNS.peers.<a href="./src/resources/secondary-dns/peers.ts">list</a>({ ...params }) -> PeerListResponsesSinglePage</code>
- <code title="post /accounts/{account_id}/secondary_dns/peers">client.secondaryDNS.peers.<a href="./src/resources/secondary-dns/peers.ts">create</a>({ ...params }) -> Peer</code>
- <code title="put /accounts/{account_id}/secondary_dns/peers/{peer_id}">client.secondaryDNS.peers.<a href="./src/resources/secondary-dns/peers.ts">update</a>(peerId, { ...params }) -> Peer</code>
- <code title="get /accounts/{account_id}/secondary_dns/peers">client.secondaryDNS.peers.<a href="./src/resources/secondary-dns/peers.ts">list</a>({ ...params }) -> PeersSinglePage</code>
- <code title="delete /accounts/{account_id}/secondary_dns/peers/{peer_id}">client.secondaryDNS.peers.<a href="./src/resources/secondary-dns/peers.ts">delete</a>(peerId, { ...params }) -> PeerDeleteResponse</code>
- <code title="get /accounts/{account_id}/secondary_dns/peers/{peer_id}">client.secondaryDNS.peers.<a href="./src/resources/secondary-dns/peers.ts">get</a>(peerId, { ...params }) -> PeerGetResponse</code>
- <code title="get /accounts/{account_id}/secondary_dns/peers/{peer_id}">client.secondaryDNS.peers.<a href="./src/resources/secondary-dns/peers.ts">get</a>(peerId, { ...params }) -> Peer</code>

## TSIGs

Expand Down
12 changes: 6 additions & 6 deletions src/resources/secondary-dns/incoming.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export interface Incoming {
/**
* A list of peer tags.
*/
peers?: Array<PeersAPI.Peer>;
peers?: Array<PeersAPI.Peers>;

/**
* The serial number of the SOA for the given zone.
Expand Down Expand Up @@ -137,7 +137,7 @@ export interface IncomingCreateResponse {
/**
* A list of peer tags.
*/
peers?: Array<PeersAPI.Peer>;
peers?: Array<PeersAPI.Peers>;

/**
* The serial number of the SOA for the given zone.
Expand Down Expand Up @@ -177,7 +177,7 @@ export interface IncomingUpdateResponse {
/**
* A list of peer tags.
*/
peers?: Array<PeersAPI.Peer>;
peers?: Array<PeersAPI.Peers>;

/**
* The serial number of the SOA for the given zone.
Expand Down Expand Up @@ -221,7 +221,7 @@ export interface IncomingGetResponse {
/**
* A list of peer tags.
*/
peers?: Array<PeersAPI.Peer>;
peers?: Array<PeersAPI.Peers>;

/**
* The serial number of the SOA for the given zone.
Expand Down Expand Up @@ -249,7 +249,7 @@ export interface IncomingCreateParams {
/**
* Body param: A list of peer tags.
*/
peers: Array<PeersAPI.Peer>;
peers: Array<PeersAPI.Peers>;
}

export interface IncomingUpdateParams {
Expand All @@ -272,7 +272,7 @@ export interface IncomingUpdateParams {
/**
* Body param: A list of peer tags.
*/
peers: Array<PeersAPI.Peer>;
peers: Array<PeersAPI.Peers>;
}

export interface IncomingDeleteParams {
Expand Down
8 changes: 2 additions & 6 deletions src/resources/secondary-dns/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,14 @@ export {
} from './incoming';
export {
Peer,
PeerCreateResponse,
PeerUpdateResponse,
PeerListResponse,
Peers,
PeerDeleteResponse,
PeerGetResponse,
PeerCreateParams,
PeerUpdateParams,
PeerListParams,
PeerDeleteParams,
PeerGetParams,
PeerListResponsesSinglePage,
Peers,
PeersSinglePage,
} from './peers';
export { SecondaryDNS } from './secondary-dns';
export {
Expand Down
12 changes: 6 additions & 6 deletions src/resources/secondary-dns/outgoing/outgoing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ export interface Outgoing {
/**
* A list of peer tags.
*/
peers?: Array<PeersAPI.Peer>;
peers?: Array<PeersAPI.Peers>;

/**
* The serial number of the SOA for the given zone.
Expand Down Expand Up @@ -186,7 +186,7 @@ export interface OutgoingCreateResponse {
/**
* A list of peer tags.
*/
peers?: Array<PeersAPI.Peer>;
peers?: Array<PeersAPI.Peers>;

/**
* The serial number of the SOA for the given zone.
Expand Down Expand Up @@ -220,7 +220,7 @@ export interface OutgoingUpdateResponse {
/**
* A list of peer tags.
*/
peers?: Array<PeersAPI.Peer>;
peers?: Array<PeersAPI.Peers>;

/**
* The serial number of the SOA for the given zone.
Expand Down Expand Up @@ -264,7 +264,7 @@ export interface OutgoingGetResponse {
/**
* A list of peer tags.
*/
peers?: Array<PeersAPI.Peer>;
peers?: Array<PeersAPI.Peers>;

/**
* The serial number of the SOA for the given zone.
Expand All @@ -286,7 +286,7 @@ export interface OutgoingCreateParams {
/**
* Body param: A list of peer tags.
*/
peers: Array<PeersAPI.Peer>;
peers: Array<PeersAPI.Peers>;
}

export interface OutgoingUpdateParams {
Expand All @@ -303,7 +303,7 @@ export interface OutgoingUpdateParams {
/**
* Body param: A list of peer tags.
*/
peers: Array<PeersAPI.Peer>;
peers: Array<PeersAPI.Peers>;
}

export interface OutgoingDeleteParams {
Expand Down
149 changes: 13 additions & 136 deletions src/resources/secondary-dns/peers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,46 +9,35 @@ export class Peers extends APIResource {
/**
* Create Peer.
*/
create(params: PeerCreateParams, options?: Core.RequestOptions): Core.APIPromise<PeerCreateResponse> {
create(params: PeerCreateParams, options?: Core.RequestOptions): Core.APIPromise<Peer> {
const { account_id, body } = params;
return (
this._client.post(`/accounts/${account_id}/secondary_dns/peers`, {
body: body,
...options,
}) as Core.APIPromise<{ result: PeerCreateResponse }>
}) as Core.APIPromise<{ result: Peer }>
)._thenUnwrap((obj) => obj.result);
}

/**
* Modify Peer.
*/
update(
peerId: string,
params: PeerUpdateParams,
options?: Core.RequestOptions,
): Core.APIPromise<PeerUpdateResponse> {
update(peerId: string, params: PeerUpdateParams, options?: Core.RequestOptions): Core.APIPromise<Peer> {
const { account_id, ...body } = params;
return (
this._client.put(`/accounts/${account_id}/secondary_dns/peers/${peerId}`, {
body,
...options,
}) as Core.APIPromise<{ result: PeerUpdateResponse }>
}) as Core.APIPromise<{ result: Peer }>
)._thenUnwrap((obj) => obj.result);
}

/**
* List Peers.
*/
list(
params: PeerListParams,
options?: Core.RequestOptions,
): Core.PagePromise<PeerListResponsesSinglePage, PeerListResponse> {
list(params: PeerListParams, options?: Core.RequestOptions): Core.PagePromise<PeersSinglePage, Peer> {
const { account_id } = params;
return this._client.getAPIList(
`/accounts/${account_id}/secondary_dns/peers`,
PeerListResponsesSinglePage,
options,
);
return this._client.getAPIList(`/accounts/${account_id}/secondary_dns/peers`, PeersSinglePage, options);
}

/**
Expand All @@ -71,60 +60,19 @@ export class Peers extends APIResource {
/**
* Get Peer.
*/
get(
peerId: string,
params: PeerGetParams,
options?: Core.RequestOptions,
): Core.APIPromise<PeerGetResponse> {
get(peerId: string, params: PeerGetParams, options?: Core.RequestOptions): Core.APIPromise<Peer> {
const { account_id } = params;
return (
this._client.get(`/accounts/${account_id}/secondary_dns/peers/${peerId}`, options) as Core.APIPromise<{
result: PeerGetResponse;
result: Peer;
}>
)._thenUnwrap((obj) => obj.result);
}
}

export class PeerListResponsesSinglePage extends SinglePage<PeerListResponse> {}

export type Peer = unknown;

export interface PeerCreateResponse {
id: string;

/**
* The name of the peer.
*/
name: string;

/**
* IPv4/IPv6 address of primary or secondary nameserver, depending on what zone
* this peer is linked to. For primary zones this IP defines the IP of the
* secondary nameserver Cloudflare will NOTIFY upon zone changes. For secondary
* zones this IP defines the IP of the primary nameserver Cloudflare will send
* AXFR/IXFR requests to.
*/
ip?: string;

/**
* Enable IXFR transfer protocol, default is AXFR. Only applicable to secondary
* zones.
*/
ixfr_enable?: boolean;

/**
* DNS port of primary or secondary nameserver, depending on what zone this peer is
* linked to.
*/
port?: number;

/**
* TSIG authentication will be used for zone transfer if configured.
*/
tsig_id?: string;
}
export class PeersSinglePage extends SinglePage<Peer> {}

export interface PeerUpdateResponse {
export interface Peer {
id: string;

/**
Expand Down Expand Up @@ -159,80 +107,12 @@ export interface PeerUpdateResponse {
tsig_id?: string;
}

export interface PeerListResponse {
id: string;

/**
* The name of the peer.
*/
name: string;

/**
* IPv4/IPv6 address of primary or secondary nameserver, depending on what zone
* this peer is linked to. For primary zones this IP defines the IP of the
* secondary nameserver Cloudflare will NOTIFY upon zone changes. For secondary
* zones this IP defines the IP of the primary nameserver Cloudflare will send
* AXFR/IXFR requests to.
*/
ip?: string;

/**
* Enable IXFR transfer protocol, default is AXFR. Only applicable to secondary
* zones.
*/
ixfr_enable?: boolean;

/**
* DNS port of primary or secondary nameserver, depending on what zone this peer is
* linked to.
*/
port?: number;

/**
* TSIG authentication will be used for zone transfer if configured.
*/
tsig_id?: string;
}
export type Peers = unknown;

export interface PeerDeleteResponse {
id?: string;
}

export interface PeerGetResponse {
id: string;

/**
* The name of the peer.
*/
name: string;

/**
* IPv4/IPv6 address of primary or secondary nameserver, depending on what zone
* this peer is linked to. For primary zones this IP defines the IP of the
* secondary nameserver Cloudflare will NOTIFY upon zone changes. For secondary
* zones this IP defines the IP of the primary nameserver Cloudflare will send
* AXFR/IXFR requests to.
*/
ip?: string;

/**
* Enable IXFR transfer protocol, default is AXFR. Only applicable to secondary
* zones.
*/
ixfr_enable?: boolean;

/**
* DNS port of primary or secondary nameserver, depending on what zone this peer is
* linked to.
*/
port?: number;

/**
* TSIG authentication will be used for zone transfer if configured.
*/
tsig_id?: string;
}

export interface PeerCreateParams {
/**
* Path param:
Expand Down Expand Up @@ -305,12 +185,9 @@ export interface PeerGetParams {

export namespace Peers {
export import Peer = PeersAPI.Peer;
export import PeerCreateResponse = PeersAPI.PeerCreateResponse;
export import PeerUpdateResponse = PeersAPI.PeerUpdateResponse;
export import PeerListResponse = PeersAPI.PeerListResponse;
export import Peers = PeersAPI.Peers;
export import PeerDeleteResponse = PeersAPI.PeerDeleteResponse;
export import PeerGetResponse = PeersAPI.PeerGetResponse;
export import PeerListResponsesSinglePage = PeersAPI.PeerListResponsesSinglePage;
export import PeersSinglePage = PeersAPI.PeersSinglePage;
export import PeerCreateParams = PeersAPI.PeerCreateParams;
export import PeerUpdateParams = PeersAPI.PeerUpdateParams;
export import PeerListParams = PeersAPI.PeerListParams;
Expand Down
6 changes: 1 addition & 5 deletions src/resources/secondary-dns/secondary-dns.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,8 @@ export namespace SecondaryDNS {
export import ACLGetParams = ACLsAPI.ACLGetParams;
export import Peers = PeersAPI.Peers;
export import Peer = PeersAPI.Peer;
export import PeerCreateResponse = PeersAPI.PeerCreateResponse;
export import PeerUpdateResponse = PeersAPI.PeerUpdateResponse;
export import PeerListResponse = PeersAPI.PeerListResponse;
export import PeerDeleteResponse = PeersAPI.PeerDeleteResponse;
export import PeerGetResponse = PeersAPI.PeerGetResponse;
export import PeerListResponsesSinglePage = PeersAPI.PeerListResponsesSinglePage;
export import PeersSinglePage = PeersAPI.PeersSinglePage;
export import PeerCreateParams = PeersAPI.PeerCreateParams;
export import PeerUpdateParams = PeersAPI.PeerUpdateParams;
export import PeerListParams = PeersAPI.PeerListParams;
Expand Down

0 comments on commit 99d8c1a

Please sign in to comment.