Skip to content

Commit

Permalink
feat(api): update via SDK Studio (#310)
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 99d8c1a commit 1466127
Show file tree
Hide file tree
Showing 13 changed files with 127 additions and 79 deletions.
12 changes: 5 additions & 7 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ Types:
- <code><a href="./src/resources/user/subscriptions.ts">RatePlan</a></code>
- <code><a href="./src/resources/user/subscriptions.ts">Subscription</a></code>
- <code><a href="./src/resources/user/subscriptions.ts">SubscriptionComponent</a></code>
- <code><a href="./src/resources/user/subscriptions.ts">SubscriptionComponentValue</a></code>
- <code><a href="./src/resources/user/subscriptions.ts">SubscriptionZone</a></code>
- <code><a href="./src/resources/user/subscriptions.ts">SubscriptionUpdateResponse</a></code>
- <code><a href="./src/resources/user/subscriptions.ts">SubscriptionDeleteResponse</a></code>
Expand Down Expand Up @@ -1741,11 +1740,11 @@ Types:

Methods:

- <code title="post /zones/{zone_id}/keyless_certificates">client.keylessCertificates.<a href="./src/resources/keyless-certificates.ts">create</a>({ ...params }) -> Hostname</code>
- <code title="post /zones/{zone_id}/keyless_certificates">client.keylessCertificates.<a href="./src/resources/keyless-certificates.ts">create</a>({ ...params }) -> KeylessCertificate</code>
- <code title="get /zones/{zone_id}/keyless_certificates">client.keylessCertificates.<a href="./src/resources/keyless-certificates.ts">list</a>({ ...params }) -> KeylessCertificatesSinglePage</code>
- <code title="delete /zones/{zone_id}/keyless_certificates/{keyless_certificate_id}">client.keylessCertificates.<a href="./src/resources/keyless-certificates.ts">delete</a>(keylessCertificateId, { ...params }) -> KeylessCertificateDeleteResponse</code>
- <code title="patch /zones/{zone_id}/keyless_certificates/{keyless_certificate_id}">client.keylessCertificates.<a href="./src/resources/keyless-certificates.ts">edit</a>(keylessCertificateId, { ...params }) -> Hostname</code>
- <code title="get /zones/{zone_id}/keyless_certificates/{keyless_certificate_id}">client.keylessCertificates.<a href="./src/resources/keyless-certificates.ts">get</a>(keylessCertificateId, { ...params }) -> Hostname</code>
- <code title="patch /zones/{zone_id}/keyless_certificates/{keyless_certificate_id}">client.keylessCertificates.<a href="./src/resources/keyless-certificates.ts">edit</a>(keylessCertificateId, { ...params }) -> KeylessCertificate</code>
- <code title="get /zones/{zone_id}/keyless_certificates/{keyless_certificate_id}">client.keylessCertificates.<a href="./src/resources/keyless-certificates.ts">get</a>(keylessCertificateId, { ...params }) -> KeylessCertificate</code>

# Logpush

Expand Down Expand Up @@ -1913,7 +1912,7 @@ Types:
Methods:

- <code title="put /zones/{zone_id}/origin_tls_client_auth/hostnames">client.originTLSClientAuth.hostnames.<a href="./src/resources/origin-tls-client-auth/hostnames/hostnames.ts">update</a>({ ...params }) -> HostnameUpdateResponse | null</code>
- <code title="get /zones/{zone_id}/origin_tls_client_auth/hostnames/{hostname}">client.originTLSClientAuth.hostnames.<a href="./src/resources/origin-tls-client-auth/hostnames/hostnames.ts">get</a>(hostname, { ...params }) -> ID</code>
- <code title="get /zones/{zone_id}/origin_tls_client_auth/hostnames/{hostname}">client.originTLSClientAuth.hostnames.<a href="./src/resources/origin-tls-client-auth/hostnames/hostnames.ts">get</a>(hostname, { ...params }) -> AuthenticatedOriginPull</code>

### Certificates

Expand Down Expand Up @@ -1949,7 +1948,7 @@ Types:

- <code><a href="./src/resources/pagerules/pagerules.ts">PageRule</a></code>
- <code><a href="./src/resources/pagerules/pagerules.ts">Route</a></code>
- <code><a href="./src/resources/pagerules/pagerules.ts">Targes</a></code>
- <code><a href="./src/resources/pagerules/pagerules.ts">Target</a></code>
- <code><a href="./src/resources/pagerules/pagerules.ts">URLTarget</a></code>
- <code><a href="./src/resources/pagerules/pagerules.ts">PageruleCreateResponse</a></code>
- <code><a href="./src/resources/pagerules/pagerules.ts">PageruleUpdateResponse</a></code>
Expand Down Expand Up @@ -2076,7 +2075,6 @@ Methods:
Types:

- <code><a href="./src/resources/secondary-dns/peers.ts">Peer</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>

Methods:
Expand Down
4 changes: 2 additions & 2 deletions src/resources/firewall/waf/packages/rules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ export namespace RuleListResponse {
* When set to `on`, the current WAF rule will be used when evaluating the request.
* Applies to anomaly detection WAF rules.
*/
mode: 'on' | 'off';
mode: RulesAPI.AllowedModesAnomaly;

/**
* The unique identifier of a WAF package.
Expand Down Expand Up @@ -287,7 +287,7 @@ export namespace RuleEditResponse {
* When set to `on`, the current WAF rule will be used when evaluating the request.
* Applies to anomaly detection WAF rules.
*/
mode: 'on' | 'off';
mode: RulesAPI.AllowedModesAnomaly;

/**
* The unique identifier of a WAF package.
Expand Down
15 changes: 9 additions & 6 deletions src/resources/keyless-certificates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,14 @@ export class KeylessCertificates extends APIResource {
/**
* Create Keyless SSL Configuration
*/
create(params: KeylessCertificateCreateParams, options?: Core.RequestOptions): Core.APIPromise<Hostname> {
create(
params: KeylessCertificateCreateParams,
options?: Core.RequestOptions,
): Core.APIPromise<KeylessCertificate> {
const { zone_id, ...body } = params;
return (
this._client.post(`/zones/${zone_id}/keyless_certificates`, { body, ...options }) as Core.APIPromise<{
result: Hostname;
result: KeylessCertificate;
}>
)._thenUnwrap((obj) => obj.result);
}
Expand Down Expand Up @@ -58,13 +61,13 @@ export class KeylessCertificates extends APIResource {
keylessCertificateId: string,
params: KeylessCertificateEditParams,
options?: Core.RequestOptions,
): Core.APIPromise<Hostname> {
): Core.APIPromise<KeylessCertificate> {
const { zone_id, ...body } = params;
return (
this._client.patch(`/zones/${zone_id}/keyless_certificates/${keylessCertificateId}`, {
body,
...options,
}) as Core.APIPromise<{ result: Hostname }>
}) as Core.APIPromise<{ result: KeylessCertificate }>
)._thenUnwrap((obj) => obj.result);
}

Expand All @@ -75,13 +78,13 @@ export class KeylessCertificates extends APIResource {
keylessCertificateId: string,
params: KeylessCertificateGetParams,
options?: Core.RequestOptions,
): Core.APIPromise<Hostname> {
): Core.APIPromise<KeylessCertificate> {
const { zone_id } = params;
return (
this._client.get(
`/zones/${zone_id}/keyless_certificates/${keylessCertificateId}`,
options,
) as Core.APIPromise<{ result: Hostname }>
) as Core.APIPromise<{ result: KeylessCertificate }>
)._thenUnwrap((obj) => obj.result);
}
}
Expand Down
72 changes: 65 additions & 7 deletions src/resources/origin-tls-client-auth/hostnames/hostnames.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,17 @@ export class Hostnames extends APIResource {
/**
* Get the Hostname Status for Client Authentication
*/
get(hostname: string, params: HostnameGetParams, options?: Core.RequestOptions): Core.APIPromise<ID> {
get(
hostname: string,
params: HostnameGetParams,
options?: Core.RequestOptions,
): Core.APIPromise<AuthenticatedOriginPull> {
const { zone_id } = params;
return (
this._client.get(
`/zones/${zone_id}/origin_tls_client_auth/hostnames/${hostname}`,
options,
) as Core.APIPromise<{ result: ID }>
) as Core.APIPromise<{ result: AuthenticatedOriginPull }>
)._thenUnwrap((obj) => obj.result);
}
}
Expand All @@ -49,34 +53,88 @@ export interface AuthenticatedOriginPull {
/**
* Identifier
*/
id?: string;
cert_id?: string;

/**
* Identifier
* Status of the certificate or the association.
*/
cert_id?: string;
cert_status?:
| 'initializing'
| 'pending_deployment'
| 'pending_deletion'
| 'active'
| 'deleted'
| 'deployment_timed_out'
| 'deletion_timed_out';

/**
* The time when the certificate was updated.
*/
cert_updated_at?: string;

/**
* The time when the certificate was uploaded.
*/
cert_uploaded_on?: string;

/**
* The hostname certificate.
*/
certificate?: string;

/**
* The time when the certificate was created.
*/
created_at?: string;

/**
* Indicates whether hostname-level authenticated origin pulls is enabled. A null
* value voids the association.
*/
enabled?: boolean | null;

/**
* The date when the certificate expires.
*/
expires_on?: string;

/**
* The hostname on the origin for which the client certificate uploaded will be
* used.
*/
hostname?: string;

/**
* The hostname certificate's private key.
* The certificate authority that issued the certificate.
*/
issuer?: string;

/**
* The serial number on the uploaded certificate.
*/
serial_number?: string;

/**
* The type of hash used for the certificate.
*/
private_key?: string;
signature?: string;

/**
* Status of the certificate or the association.
*/
status?:
| 'initializing'
| 'pending_deployment'
| 'pending_deletion'
| 'active'
| 'deleted'
| 'deployment_timed_out'
| 'deletion_timed_out';

/**
* The time when the certificate was updated.
*/
updated_at?: string;
}

export interface ID {
Expand Down
30 changes: 26 additions & 4 deletions src/resources/origin-tls-client-auth/origin-tls-client-auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,36 @@ export interface ZoneAuthenticatedOriginPull {
certificate?: string;

/**
* Indicates whether zone-level authenticated origin pulls is enabled.
* When the certificate from the authority expires.
*/
enabled?: boolean;
expires_on?: string;

/**
* The zone's private key.
* The certificate authority that issued the certificate.
*/
private_key?: string;
issuer?: string;

/**
* The type of hash used for the certificate.
*/
signature?: string;

/**
* Status of the certificate activation.
*/
status?:
| 'initializing'
| 'pending_deployment'
| 'pending_deletion'
| 'active'
| 'deleted'
| 'deployment_timed_out'
| 'deletion_timed_out';

/**
* This is the time the certificate was uploaded.
*/
uploaded_on?: string;
}

export type OriginTLSClientAuthCreateResponse = unknown | string | null;
Expand Down
14 changes: 7 additions & 7 deletions src/resources/pagerules/pagerules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export interface PageRule {
/**
* The rule targets to evaluate on each request.
*/
targets: Array<Targes>;
targets: Array<Target>;
}

export interface Route {
Expand Down Expand Up @@ -176,19 +176,19 @@ export namespace Route {
/**
* A request condition target.
*/
export interface Targes {
export interface Target {
/**
* String constraint.
*/
constraint: Targes.Constraint;
constraint: Target.Constraint;

/**
* A target based on the URL of the request.
*/
target: 'url';
}

export namespace Targes {
export namespace Target {
/**
* String constraint.
*/
Expand Down Expand Up @@ -271,7 +271,7 @@ export interface PageruleCreateParams {
/**
* Body param: The rule targets to evaluate on each request.
*/
targets: Array<Targes>;
targets: Array<Target>;

/**
* Body param: The priority of the rule, used to define which Page Rule is
Expand Down Expand Up @@ -303,7 +303,7 @@ export interface PageruleUpdateParams {
/**
* Body param: The rule targets to evaluate on each request.
*/
targets: Array<Targes>;
targets: Array<Target>;

/**
* Body param: The priority of the rule, used to define which Page Rule is
Expand Down Expand Up @@ -389,7 +389,7 @@ export interface PageruleEditParams {
/**
* Body param: The rule targets to evaluate on each request.
*/
targets?: Array<Targes>;
targets?: Array<Target>;
}

export interface PageruleGetParams {
Expand Down
13 changes: 6 additions & 7 deletions src/resources/secondary-dns/incoming.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import * as Core from 'cloudflare/core';
import { APIResource } from 'cloudflare/resource';
import * as IncomingAPI from 'cloudflare/resources/secondary-dns/incoming';
import * as PeersAPI from 'cloudflare/resources/secondary-dns/peers';

export class IncomingResource extends APIResource {
/**
Expand Down Expand Up @@ -97,7 +96,7 @@ export interface Incoming {
/**
* A list of peer tags.
*/
peers?: Array<PeersAPI.Peers>;
peers?: Array<unknown>;

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

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

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

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

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

export interface IncomingDeleteParams {
Expand Down
Loading

0 comments on commit 1466127

Please sign in to comment.