Skip to content

Commit

Permalink
feat: update via SDK Studio (#77)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored Feb 26, 2024
1 parent e6ff65b commit 21f4afa
Show file tree
Hide file tree
Showing 14 changed files with 1,205 additions and 69 deletions.
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
configured_endpoints: 1192
configured_endpoints: 1200
36 changes: 36 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -3880,6 +3880,41 @@ Methods:
- <code title="patch /accounts/{account_id}/pages/projects/{project_name}/domains/{domain_name}">client.pages.projects.domains.<a href="./src/resources/pages/projects/domains.ts">edit</a>(accountId, projectName, domainName) -> DomainEditResponse | null</code>
- <code title="get /accounts/{account_id}/pages/projects/{project_name}/domains/{domain_name}">client.pages.projects.domains.<a href="./src/resources/pages/projects/domains.ts">get</a>(accountId, projectName, domainName) -> DomainGetResponse | null</code>

# PCAPs

Types:

- <code><a href="./src/resources/pcaps/pcaps.ts">PCAPCreateResponse</a></code>
- <code><a href="./src/resources/pcaps/pcaps.ts">PCAPListResponse</a></code>
- <code><a href="./src/resources/pcaps/pcaps.ts">PCAPGetResponse</a></code>

Methods:

- <code title="post /accounts/{account_id}/pcaps">client.pcaps.<a href="./src/resources/pcaps/pcaps.ts">create</a>(accountId, { ...params }) -> PCAPCreateResponse</code>
- <code title="get /accounts/{account_id}/pcaps">client.pcaps.<a href="./src/resources/pcaps/pcaps.ts">list</a>(accountId) -> PCAPListResponse | null</code>
- <code title="get /accounts/{account_id}/pcaps/{pcap_id}">client.pcaps.<a href="./src/resources/pcaps/pcaps.ts">get</a>(accountId, pcapId) -> PCAPGetResponse</code>

## Ownerships

Types:

- <code><a href="./src/resources/pcaps/ownerships.ts">OwnershipCreateResponse</a></code>
- <code><a href="./src/resources/pcaps/ownerships.ts">OwnershipGetResponse</a></code>
- <code><a href="./src/resources/pcaps/ownerships.ts">OwnershipValidateResponse</a></code>

Methods:

- <code title="post /accounts/{account_id}/pcaps/ownership">client.pcaps.ownerships.<a href="./src/resources/pcaps/ownerships.ts">create</a>(accountId, { ...params }) -> OwnershipCreateResponse</code>
- <code title="delete /accounts/{account_id}/pcaps/ownership/{ownership_id}">client.pcaps.ownerships.<a href="./src/resources/pcaps/ownerships.ts">delete</a>(accountId, ownershipId) -> void</code>
- <code title="get /accounts/{account_id}/pcaps/ownership">client.pcaps.ownerships.<a href="./src/resources/pcaps/ownerships.ts">get</a>(accountId) -> OwnershipGetResponse | null</code>
- <code title="post /accounts/{account_id}/pcaps/ownership/validate">client.pcaps.ownerships.<a href="./src/resources/pcaps/ownerships.ts">validate</a>(accountId, { ...params }) -> OwnershipValidateResponse</code>

## Downloads

Methods:

- <code title="get /accounts/{account_id}/pcaps/{pcap_id}/download">client.pcaps.downloads.<a href="./src/resources/pcaps/downloads.ts">get</a>(accountId, pcapId) -> Response</code>

# Registrar

## Domains
Expand All @@ -3902,6 +3937,7 @@ Methods:

Types:

- <code><a href="./src/resources/request-tracers/traces.ts">WyxwHh0jTrace</a></code>
- <code><a href="./src/resources/request-tracers/traces.ts">TraceCreateResponse</a></code>

Methods:
Expand Down
7 changes: 7 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ export class Cloudflare extends Core.APIClient {
mnms: API.MNMs = new API.MNMs(this);
mtlsCertificates: API.MTLSCertificates = new API.MTLSCertificates(this);
pages: API.Pages = new API.Pages(this);
pcaps: API.PCAPs = new API.PCAPs(this);
registrar: API.Registrar = new API.Registrar(this);
requestTracers: API.RequestTracers = new API.RequestTracers(this);
roles: API.Roles = new API.Roles(this);
Expand Down Expand Up @@ -654,6 +655,12 @@ export namespace Cloudflare {

export import Pages = API.Pages;

export import PCAPs = API.PCAPs;
export import PCAPCreateResponse = API.PCAPCreateResponse;
export import PCAPListResponse = API.PCAPListResponse;
export import PCAPGetResponse = API.PCAPGetResponse;
export import PCAPCreateParams = API.PCAPCreateParams;

export import Registrar = API.Registrar;

export import RequestTracers = API.RequestTracers;
Expand Down
7 changes: 7 additions & 0 deletions src/resources/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,13 @@ export {
OriginTLSClientAuthCreateParams,
OriginTLSClientAuth,
} from './origin-tls-client-auth/origin-tls-client-auth';
export {
PCAPCreateResponse,
PCAPListResponse,
PCAPGetResponse,
PCAPCreateParams,
PCAPs,
} from './pcaps/pcaps';
export {
PageShieldUpdateResponse,
PageShieldListResponse,
Expand Down
17 changes: 17 additions & 0 deletions src/resources/pcaps/downloads.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// File generated from our OpenAPI spec by Stainless.

import * as Core from 'cloudflare/core';
import { APIResource } from 'cloudflare/resource';
import { type Response } from 'cloudflare/_shims/index';

export class Downloads extends APIResource {
/**
* Download PCAP information into a file. Response is a binary PCAP file.
*/
get(accountId: string, pcapId: string, options?: Core.RequestOptions): Core.APIPromise<Response> {
return this._client.get(`/accounts/${accountId}/pcaps/${pcapId}/download`, {
...options,
__binaryResponse: true,
});
}
}
12 changes: 12 additions & 0 deletions src/resources/pcaps/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// File generated from our OpenAPI spec by Stainless.

export { Downloads } from './downloads';
export {
OwnershipCreateResponse,
OwnershipGetResponse,
OwnershipValidateResponse,
OwnershipCreateParams,
OwnershipValidateParams,
Ownerships,
} from './ownerships';
export { PCAPCreateResponse, PCAPListResponse, PCAPGetResponse, PCAPCreateParams, PCAPs } from './pcaps';
186 changes: 186 additions & 0 deletions src/resources/pcaps/ownerships.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,186 @@
// File generated from our OpenAPI spec by Stainless.

import * as Core from 'cloudflare/core';
import { APIResource } from 'cloudflare/resource';
import * as OwnershipsAPI from 'cloudflare/resources/pcaps/ownerships';

export class Ownerships extends APIResource {
/**
* Adds an AWS or GCP bucket to use with full packet captures.
*/
create(
accountId: string,
body: OwnershipCreateParams,
options?: Core.RequestOptions,
): Core.APIPromise<OwnershipCreateResponse> {
return (
this._client.post(`/accounts/${accountId}/pcaps/ownership`, { body, ...options }) as Core.APIPromise<{
result: OwnershipCreateResponse;
}>
)._thenUnwrap((obj) => obj.result);
}

/**
* Deletes buckets added to the packet captures API.
*/
delete(accountId: string, ownershipId: string, options?: Core.RequestOptions): Core.APIPromise<void> {
return this._client.delete(`/accounts/${accountId}/pcaps/ownership/${ownershipId}`, {
...options,
headers: { Accept: '*/*', ...options?.headers },
});
}

/**
* List all buckets configured for use with PCAPs API.
*/
get(accountId: string, options?: Core.RequestOptions): Core.APIPromise<OwnershipGetResponse | null> {
return (
this._client.get(`/accounts/${accountId}/pcaps/ownership`, options) as Core.APIPromise<{
result: OwnershipGetResponse | null;
}>
)._thenUnwrap((obj) => obj.result);
}

/**
* Validates buckets added to the packet captures API.
*/
validate(
accountId: string,
body: OwnershipValidateParams,
options?: Core.RequestOptions,
): Core.APIPromise<OwnershipValidateResponse> {
return (
this._client.post(`/accounts/${accountId}/pcaps/ownership/validate`, {
body,
...options,
}) as Core.APIPromise<{ result: OwnershipValidateResponse }>
)._thenUnwrap((obj) => obj.result);
}
}

export interface OwnershipCreateResponse {
/**
* The bucket ID associated with the packet captures API.
*/
id: string;

/**
* The full URI for the bucket. This field only applies to `full` packet captures.
*/
destination_conf: string;

/**
* The ownership challenge filename stored in the bucket.
*/
filename: string;

/**
* The status of the ownership challenge. Can be pending, success or failed.
*/
status: 'pending' | 'success' | 'failed';

/**
* The RFC 3339 timestamp when the bucket was added to packet captures API.
*/
submitted: string;

/**
* The RFC 3339 timestamp when the bucket was validated.
*/
validated?: string;
}

export type OwnershipGetResponse = Array<OwnershipGetResponse.OwnershipGetResponseItem>;

export namespace OwnershipGetResponse {
export interface OwnershipGetResponseItem {
/**
* The bucket ID associated with the packet captures API.
*/
id: string;

/**
* The full URI for the bucket. This field only applies to `full` packet captures.
*/
destination_conf: string;

/**
* The ownership challenge filename stored in the bucket.
*/
filename: string;

/**
* The status of the ownership challenge. Can be pending, success or failed.
*/
status: 'pending' | 'success' | 'failed';

/**
* The RFC 3339 timestamp when the bucket was added to packet captures API.
*/
submitted: string;

/**
* The RFC 3339 timestamp when the bucket was validated.
*/
validated?: string;
}
}

export interface OwnershipValidateResponse {
/**
* The bucket ID associated with the packet captures API.
*/
id: string;

/**
* The full URI for the bucket. This field only applies to `full` packet captures.
*/
destination_conf: string;

/**
* The ownership challenge filename stored in the bucket.
*/
filename: string;

/**
* The status of the ownership challenge. Can be pending, success or failed.
*/
status: 'pending' | 'success' | 'failed';

/**
* The RFC 3339 timestamp when the bucket was added to packet captures API.
*/
submitted: string;

/**
* The RFC 3339 timestamp when the bucket was validated.
*/
validated?: string;
}

export interface OwnershipCreateParams {
/**
* The full URI for the bucket. This field only applies to `full` packet captures.
*/
destination_conf: string;
}

export interface OwnershipValidateParams {
/**
* The full URI for the bucket. This field only applies to `full` packet captures.
*/
destination_conf: string;

/**
* The ownership challenge filename stored in the bucket.
*/
ownership_challenge: string;
}

export namespace Ownerships {
export import OwnershipCreateResponse = OwnershipsAPI.OwnershipCreateResponse;
export import OwnershipGetResponse = OwnershipsAPI.OwnershipGetResponse;
export import OwnershipValidateResponse = OwnershipsAPI.OwnershipValidateResponse;
export import OwnershipCreateParams = OwnershipsAPI.OwnershipCreateParams;
export import OwnershipValidateParams = OwnershipsAPI.OwnershipValidateParams;
}
Loading

0 comments on commit 21f4afa

Please sign in to comment.