Skip to content

Commit

Permalink
feat(api): update via SDK Studio (#361)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Apr 22, 2024
1 parent 8f10216 commit 625ce8f
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 16 deletions.
7 changes: 2 additions & 5 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

Types:

- <code><a href="./src/resources/shared.ts">ASN</a></code>
- <code><a href="./src/resources/shared.ts">AuditLog</a></code>
- <code><a href="./src/resources/shared.ts">CloudflareTunnel</a></code>
- <code><a href="./src/resources/shared.ts">ErrorData</a></code>
Expand Down Expand Up @@ -3049,13 +3050,9 @@ Methods:

## ASN

Types:

- <code><a href="./src/resources/intel/asn/asn.ts">IntelASN</a></code>

Methods:

- <code title="get /accounts/{account_id}/intel/asn/{asn}">client.intel.asn.<a href="./src/resources/intel/asn/asn.ts">get</a>(asn, { ...params }) -> IntelASN</code>
- <code title="get /accounts/{account_id}/intel/asn/{asn}">client.intel.asn.<a href="./src/resources/intel/asn/asn.ts">get</a>(asn, { ...params }) -> ASN</code>

### Subnets

Expand Down
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,7 @@ export namespace Cloudflare {

export import EventNotifications = API.EventNotifications;

export import ASN = API.ASN;
export import AuditLog = API.AuditLog;
export import CloudflareTunnel = API.CloudflareTunnel;
export import ErrorData = API.ErrorData;
Expand Down
8 changes: 3 additions & 5 deletions src/resources/intel/asn/asn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import * as Core from 'cloudflare/core';
import { APIResource } from 'cloudflare/resource';
import * as ASNAPI from 'cloudflare/resources/intel/asn/asn';
import * as Shared from 'cloudflare/resources/shared';
import * as SubnetsAPI from 'cloudflare/resources/intel/asn/subnets';

export class ASN extends APIResource {
Expand All @@ -11,18 +12,16 @@ export class ASN extends APIResource {
/**
* Get ASN Overview
*/
get(asn: IntelASN, params: ASNGetParams, options?: Core.RequestOptions): Core.APIPromise<IntelASN> {
get(asn: Shared.ASN, params: ASNGetParams, options?: Core.RequestOptions): Core.APIPromise<Shared.ASN> {
const { account_id } = params;
return (
this._client.get(`/accounts/${account_id}/intel/asn/${asn}`, options) as Core.APIPromise<{
result: IntelASN;
result: Shared.ASN;
}>
)._thenUnwrap((obj) => obj.result);
}
}

export type IntelASN = number;

export interface ASNGetParams {
/**
* Identifier
Expand All @@ -31,7 +30,6 @@ export interface ASNGetParams {
}

export namespace ASN {
export import IntelASN = ASNAPI.IntelASN;
export import ASNGetParams = ASNAPI.ASNGetParams;
export import Subnets = SubnetsAPI.Subnets;
export import SubnetGetResponse = SubnetsAPI.SubnetGetResponse;
Expand Down
2 changes: 1 addition & 1 deletion src/resources/intel/asn/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

export { IntelASN, ASNGetParams, ASN } from './asn';
export { ASNGetParams, ASN } from './asn';
export { SubnetGetResponse, SubnetGetParams, Subnets } from './subnets';
6 changes: 3 additions & 3 deletions src/resources/intel/asn/subnets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
import * as Core from 'cloudflare/core';
import { APIResource } from 'cloudflare/resource';
import * as SubnetsAPI from 'cloudflare/resources/intel/asn/subnets';
import * as ASNAPI from 'cloudflare/resources/intel/asn/asn';
import * as Shared from 'cloudflare/resources/shared';

export class Subnets extends APIResource {
/**
* Get ASN Subnets
*/
get(
asn: ASNAPI.IntelASN,
asn: Shared.ASN,
params: SubnetGetParams,
options?: Core.RequestOptions,
): Core.APIPromise<SubnetGetResponse> {
Expand All @@ -20,7 +20,7 @@ export class Subnets extends APIResource {
}

export interface SubnetGetResponse {
asn?: ASNAPI.IntelASN;
asn?: Shared.ASN;

/**
* Total results returned based on your search parameters.
Expand Down
2 changes: 1 addition & 1 deletion src/resources/intel/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

export { ASNGetParams, ASN } from './asn/index';
export { AttackSurfaceReport } from './attack-surface-report/index';
export { DNS, DNSListResponse, DNSListParams, DNSListResponsesV4PagePagination } from './dns';
export { Domain, DomainGetParams, Domains } from './domains/index';
Expand All @@ -26,7 +27,6 @@ export {
IndicatorFeeds,
} from './indicator-feeds/index';
export { Intel } from './intel';
export { IntelASN, ASNGetParams, ASN } from './asn/index';
export {
MiscategorizationCreateResponse,
MiscategorizationCreateParams,
Expand Down
1 change: 0 additions & 1 deletion src/resources/intel/intel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ export class Intel extends APIResource {

export namespace Intel {
export import ASN = ASNAPI.ASN;
export import IntelASN = ASNAPI.IntelASN;
export import ASNGetParams = ASNAPI.ASNGetParams;
export import DNS = DNSAPI.DNS;
export import DNSListResponse = DNSAPI.DNSListResponse;
Expand Down
2 changes: 2 additions & 0 deletions src/resources/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import * as Shared from 'cloudflare/resources/shared';
import { SinglePage, V4PagePaginationArray } from 'cloudflare/pagination';

export type ASN = number;

export interface AuditLog {
/**
* A string that uniquely identifies the audit log.
Expand Down

0 comments on commit 625ce8f

Please sign in to comment.