Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 1281
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-233400c5ae165d478f6a8ca3dfc099961cbca90f3b175f1e14b631a7cb298f41.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e9768930aab7041f58b5f317137699bbd040d5be0864adcee08df4a026b99300.yml
62 changes: 21 additions & 41 deletions src/resources/ai-gateway/ai-gateway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ export interface AIGatewayCreateResponse {

export namespace AIGatewayCreateResponse {
export interface Task {
/**
* gateway slug
*/
id: string;

cache_invalidate_on_update: boolean;
Expand All @@ -109,10 +112,6 @@ export namespace AIGatewayCreateResponse {

modified_at: string;

name: string;

slug: string;

rate_limiting_interval?: number;

rate_limiting_limit?: number;
Expand All @@ -122,6 +121,9 @@ export namespace AIGatewayCreateResponse {
}

export interface AIGatewayUpdateResponse {
/**
* gateway slug
*/
id: string;

cache_invalidate_on_update: boolean;
Expand All @@ -134,10 +136,6 @@ export interface AIGatewayUpdateResponse {

modified_at: string;

name: string;

slug: string;

rate_limiting_interval?: number;

rate_limiting_limit?: number;
Expand All @@ -146,6 +144,9 @@ export interface AIGatewayUpdateResponse {
}

export interface AIGatewayListResponse {
/**
* gateway slug
*/
id: string;

cache_invalidate_on_update: boolean;
Expand All @@ -158,10 +159,6 @@ export interface AIGatewayListResponse {

modified_at: string;

name: string;

slug: string;

rate_limiting_interval?: number;

rate_limiting_limit?: number;
Expand All @@ -170,6 +167,9 @@ export interface AIGatewayListResponse {
}

export interface AIGatewayDeleteResponse {
/**
* gateway slug
*/
id: string;

cache_invalidate_on_update: boolean;
Expand All @@ -182,10 +182,6 @@ export interface AIGatewayDeleteResponse {

modified_at: string;

name: string;

slug: string;

rate_limiting_interval?: number;

rate_limiting_limit?: number;
Expand All @@ -194,6 +190,9 @@ export interface AIGatewayDeleteResponse {
}

export interface AIGatewayGetResponse {
/**
* gateway slug
*/
id: string;

cache_invalidate_on_update: boolean;
Expand All @@ -206,10 +205,6 @@ export interface AIGatewayGetResponse {

modified_at: string;

name: string;

slug: string;

rate_limiting_interval?: number;

rate_limiting_limit?: number;
Expand All @@ -224,29 +219,24 @@ export interface AIGatewayCreateParams {
account_id: string;

/**
* Body param:
*/
cache_invalidate_on_update: boolean;

/**
* Body param:
* Body param: gateway slug
*/
cache_ttl: number;
id: string;

/**
* Body param:
*/
collect_logs: boolean;
cache_invalidate_on_update: boolean;

/**
* Body param:
*/
name: string;
cache_ttl: number;

/**
* Body param:
*/
slug: string;
collect_logs: boolean;

/**
* Body param:
Expand Down Expand Up @@ -285,16 +275,6 @@ export interface AIGatewayUpdateParams {
*/
collect_logs: boolean;

/**
* Body param:
*/
name: string;

/**
* Body param:
*/
slug: string;

/**
* Body param:
*/
Expand All @@ -318,7 +298,7 @@ export interface AIGatewayListParams extends V4PagePaginationArrayParams {
account_id: string;

/**
* Query param:
* Query param: gateway slug
*/
id?: string;

Expand Down
24 changes: 9 additions & 15 deletions tests/api-resources/ai-gateway/ai-gateway.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@ describe('resource aiGateway', () => {
test('create: only required params', async () => {
const responsePromise = cloudflare.aiGateway.create({
account_id: '0d37909e38d3e99c29fa2cd343ac421a',
id: 'my-gateway',
cache_invalidate_on_update: true,
cache_ttl: 0,
collect_logs: true,
name: 'string',
slug: 'string',
});
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
Expand All @@ -31,25 +30,22 @@ describe('resource aiGateway', () => {
test('create: required and optional params', async () => {
const response = await cloudflare.aiGateway.create({
account_id: '0d37909e38d3e99c29fa2cd343ac421a',
id: 'my-gateway',
cache_invalidate_on_update: true,
cache_ttl: 0,
collect_logs: true,
name: 'string',
slug: 'string',
rate_limiting_interval: 0,
rate_limiting_limit: 0,
rate_limiting_technique: 'string',
});
});

test('update: only required params', async () => {
const responsePromise = cloudflare.aiGateway.update('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {
const responsePromise = cloudflare.aiGateway.update('my-gateway', {
account_id: '0d37909e38d3e99c29fa2cd343ac421a',
cache_invalidate_on_update: true,
cache_ttl: 0,
collect_logs: true,
name: 'string',
slug: 'string',
});
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
Expand All @@ -61,13 +57,11 @@ describe('resource aiGateway', () => {
});

test('update: required and optional params', async () => {
const response = await cloudflare.aiGateway.update('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {
const response = await cloudflare.aiGateway.update('my-gateway', {
account_id: '0d37909e38d3e99c29fa2cd343ac421a',
cache_invalidate_on_update: true,
cache_ttl: 0,
collect_logs: true,
name: 'string',
slug: 'string',
rate_limiting_interval: 0,
rate_limiting_limit: 0,
rate_limiting_technique: 'string',
Expand All @@ -88,15 +82,15 @@ describe('resource aiGateway', () => {
test('list: required and optional params', async () => {
const response = await cloudflare.aiGateway.list({
account_id: '0d37909e38d3e99c29fa2cd343ac421a',
id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
id: 'my-gateway',
order_by: 'string',
page: 1,
per_page: 5,
});
});

test('delete: only required params', async () => {
const responsePromise = cloudflare.aiGateway.delete('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {
const responsePromise = cloudflare.aiGateway.delete('my-gateway', {
account_id: '0d37909e38d3e99c29fa2cd343ac421a',
});
const rawResponse = await responsePromise.asResponse();
Expand All @@ -109,13 +103,13 @@ describe('resource aiGateway', () => {
});

test('delete: required and optional params', async () => {
const response = await cloudflare.aiGateway.delete('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {
const response = await cloudflare.aiGateway.delete('my-gateway', {
account_id: '0d37909e38d3e99c29fa2cd343ac421a',
});
});

test('get: only required params', async () => {
const responsePromise = cloudflare.aiGateway.get('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {
const responsePromise = cloudflare.aiGateway.get('my-gateway', {
account_id: '0d37909e38d3e99c29fa2cd343ac421a',
});
const rawResponse = await responsePromise.asResponse();
Expand All @@ -128,7 +122,7 @@ describe('resource aiGateway', () => {
});

test('get: required and optional params', async () => {
const response = await cloudflare.aiGateway.get('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {
const response = await cloudflare.aiGateway.get('my-gateway', {
account_id: '0d37909e38d3e99c29fa2cd343ac421a',
});
});
Expand Down
4 changes: 2 additions & 2 deletions tests/api-resources/ai-gateway/logs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const cloudflare = new Cloudflare({

describe('resource logs', () => {
test('get: only required params', async () => {
const responsePromise = cloudflare.aiGateway.logs.get('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {
const responsePromise = cloudflare.aiGateway.logs.get('my-gateway', {
account_id: '0d37909e38d3e99c29fa2cd343ac421a',
});
const rawResponse = await responsePromise.asResponse();
Expand All @@ -24,7 +24,7 @@ describe('resource logs', () => {
});

test('get: required and optional params', async () => {
const response = await cloudflare.aiGateway.logs.get('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {
const response = await cloudflare.aiGateway.logs.get('my-gateway', {
account_id: '0d37909e38d3e99c29fa2cd343ac421a',
cached: true,
direction: 'asc',
Expand Down