Skip to content

Commit

Permalink
feat(api): clean up missing model references (#2117)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and meorphis committed Jan 13, 2025
1 parent 715ae0b commit 4db7324
Show file tree
Hide file tree
Showing 6 changed files with 139 additions and 497 deletions.
9 changes: 5 additions & 4 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -3271,6 +3271,8 @@ Methods:

Types:

- <code><a href="./src/resources/magic-transit/pcaps/pcaps.ts">PCAP</a></code>
- <code><a href="./src/resources/magic-transit/pcaps/pcaps.ts">PCAPFilter</a></code>
- <code><a href="./src/resources/magic-transit/pcaps/pcaps.ts">PCAPCreateResponse</a></code>
- <code><a href="./src/resources/magic-transit/pcaps/pcaps.ts">PCAPListResponse</a></code>
- <code><a href="./src/resources/magic-transit/pcaps/pcaps.ts">PCAPGetResponse</a></code>
Expand All @@ -3285,16 +3287,15 @@ Methods:

Types:

- <code><a href="./src/resources/magic-transit/pcaps/ownership.ts">OwnershipCreateResponse</a></code>
- <code><a href="./src/resources/magic-transit/pcaps/ownership.ts">Ownership</a></code>
- <code><a href="./src/resources/magic-transit/pcaps/ownership.ts">OwnershipGetResponse</a></code>
- <code><a href="./src/resources/magic-transit/pcaps/ownership.ts">OwnershipValidateResponse</a></code>

Methods:

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

### Download

Expand Down
2 changes: 2 additions & 0 deletions src/resources/magic-transit/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ export { MagicTransit } from './magic-transit';
export {
PCAPListResponsesSinglePage,
PCAPs,
type PCAP,
type PCAPFilter,
type PCAPCreateResponse,
type PCAPListResponse,
type PCAPGetResponse,
Expand Down
4 changes: 4 additions & 0 deletions src/resources/magic-transit/magic-transit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,10 @@ import {
} from './routes';
import * as PCAPsAPI from './pcaps/pcaps';
import {
PCAP,
PCAPCreateParams,
PCAPCreateResponse,
PCAPFilter,
PCAPGetParams,
PCAPGetResponse,
PCAPListParams,
Expand Down Expand Up @@ -351,6 +353,8 @@ export declare namespace MagicTransit {

export {
PCAPs as PCAPs,
type PCAP as PCAP,
type PCAPFilter as PCAPFilter,
type PCAPCreateResponse as PCAPCreateResponse,
type PCAPListResponse as PCAPListResponse,
type PCAPGetResponse as PCAPGetResponse,
Expand Down
7 changes: 4 additions & 3 deletions src/resources/magic-transit/pcaps/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@

export { Download, type DownloadGetParams } from './download';
export {
Ownership,
type OwnershipCreateResponse,
OwnershipResource,
type Ownership,
type OwnershipGetResponse,
type OwnershipValidateResponse,
type OwnershipCreateParams,
type OwnershipDeleteParams,
type OwnershipGetParams,
Expand All @@ -14,6 +13,8 @@ export {
export {
PCAPListResponsesSinglePage,
PCAPs,
type PCAP,
type PCAPFilter,
type PCAPCreateResponse,
type PCAPListResponse,
type PCAPGetResponse,
Expand Down
91 changes: 9 additions & 82 deletions src/resources/magic-transit/pcaps/ownership.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,15 @@
import { APIResource } from '../../../resource';
import * as Core from '../../../core';

export class Ownership extends APIResource {
export class OwnershipResource extends APIResource {
/**
* Adds an AWS or GCP bucket to use with full packet captures.
*/
create(
params: OwnershipCreateParams,
options?: Core.RequestOptions,
): Core.APIPromise<OwnershipCreateResponse> {
create(params: OwnershipCreateParams, options?: Core.RequestOptions): Core.APIPromise<Ownership> {
const { account_id, ...body } = params;
return (
this._client.post(`/accounts/${account_id}/pcaps/ownership`, { body, ...options }) as Core.APIPromise<{
result: OwnershipCreateResponse;
result: Ownership;
}>
)._thenUnwrap((obj) => obj.result);
}
Expand Down Expand Up @@ -52,21 +49,18 @@ export class Ownership extends APIResource {
/**
* Validates buckets added to the packet captures API.
*/
validate(
params: OwnershipValidateParams,
options?: Core.RequestOptions,
): Core.APIPromise<OwnershipValidateResponse> {
validate(params: OwnershipValidateParams, options?: Core.RequestOptions): Core.APIPromise<Ownership> {
const { account_id, ...body } = params;
return (
this._client.post(`/accounts/${account_id}/pcaps/ownership/validate`, {
body,
...options,
}) as Core.APIPromise<{ result: OwnershipValidateResponse }>
}) as Core.APIPromise<{ result: Ownership }>
)._thenUnwrap((obj) => obj.result);
}
}

export interface OwnershipCreateResponse {
export interface Ownership {
/**
* The bucket ID associated with the packet captures API.
*/
Expand Down Expand Up @@ -98,73 +92,7 @@ export interface OwnershipCreateResponse {
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 type OwnershipGetResponse = Array<Ownership>;

export interface OwnershipCreateParams {
/**
Expand Down Expand Up @@ -211,11 +139,10 @@ export interface OwnershipValidateParams {
ownership_challenge: string;
}

export declare namespace Ownership {
export declare namespace OwnershipResource {
export {
type OwnershipCreateResponse as OwnershipCreateResponse,
type Ownership as Ownership,
type OwnershipGetResponse as OwnershipGetResponse,
type OwnershipValidateResponse as OwnershipValidateResponse,
type OwnershipCreateParams as OwnershipCreateParams,
type OwnershipDeleteParams as OwnershipDeleteParams,
type OwnershipGetParams as OwnershipGetParams,
Expand Down
Loading

0 comments on commit 4db7324

Please sign in to comment.