From d14e435b95042f367854b2b382186028382c7170 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Mon, 13 May 2024 13:57:17 +0000 Subject: [PATCH] feat(api): OpenAPI spec update via Stainless API --- .stats.yml | 2 +- src/resources/ai-gateway/ai-gateway.ts | 62 +++++++------------ .../ai-gateway/ai-gateway.test.ts | 24 +++---- tests/api-resources/ai-gateway/logs.test.ts | 4 +- 4 files changed, 33 insertions(+), 59 deletions(-) diff --git a/.stats.yml b/.stats.yml index 63842570e7..df3052cd59 100644 --- a/.stats.yml +++ b/.stats.yml @@ -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 diff --git a/src/resources/ai-gateway/ai-gateway.ts b/src/resources/ai-gateway/ai-gateway.ts index ab77108e13..1c159d6674 100644 --- a/src/resources/ai-gateway/ai-gateway.ts +++ b/src/resources/ai-gateway/ai-gateway.ts @@ -97,6 +97,9 @@ export interface AIGatewayCreateResponse { export namespace AIGatewayCreateResponse { export interface Task { + /** + * gateway slug + */ id: string; cache_invalidate_on_update: boolean; @@ -109,10 +112,6 @@ export namespace AIGatewayCreateResponse { modified_at: string; - name: string; - - slug: string; - rate_limiting_interval?: number; rate_limiting_limit?: number; @@ -122,6 +121,9 @@ export namespace AIGatewayCreateResponse { } export interface AIGatewayUpdateResponse { + /** + * gateway slug + */ id: string; cache_invalidate_on_update: boolean; @@ -134,10 +136,6 @@ export interface AIGatewayUpdateResponse { modified_at: string; - name: string; - - slug: string; - rate_limiting_interval?: number; rate_limiting_limit?: number; @@ -146,6 +144,9 @@ export interface AIGatewayUpdateResponse { } export interface AIGatewayListResponse { + /** + * gateway slug + */ id: string; cache_invalidate_on_update: boolean; @@ -158,10 +159,6 @@ export interface AIGatewayListResponse { modified_at: string; - name: string; - - slug: string; - rate_limiting_interval?: number; rate_limiting_limit?: number; @@ -170,6 +167,9 @@ export interface AIGatewayListResponse { } export interface AIGatewayDeleteResponse { + /** + * gateway slug + */ id: string; cache_invalidate_on_update: boolean; @@ -182,10 +182,6 @@ export interface AIGatewayDeleteResponse { modified_at: string; - name: string; - - slug: string; - rate_limiting_interval?: number; rate_limiting_limit?: number; @@ -194,6 +190,9 @@ export interface AIGatewayDeleteResponse { } export interface AIGatewayGetResponse { + /** + * gateway slug + */ id: string; cache_invalidate_on_update: boolean; @@ -206,10 +205,6 @@ export interface AIGatewayGetResponse { modified_at: string; - name: string; - - slug: string; - rate_limiting_interval?: number; rate_limiting_limit?: number; @@ -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: @@ -285,16 +275,6 @@ export interface AIGatewayUpdateParams { */ collect_logs: boolean; - /** - * Body param: - */ - name: string; - - /** - * Body param: - */ - slug: string; - /** * Body param: */ @@ -318,7 +298,7 @@ export interface AIGatewayListParams extends V4PagePaginationArrayParams { account_id: string; /** - * Query param: + * Query param: gateway slug */ id?: string; diff --git a/tests/api-resources/ai-gateway/ai-gateway.test.ts b/tests/api-resources/ai-gateway/ai-gateway.test.ts index 524948e094..80304c3da7 100644 --- a/tests/api-resources/ai-gateway/ai-gateway.test.ts +++ b/tests/api-resources/ai-gateway/ai-gateway.test.ts @@ -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); @@ -31,11 +30,10 @@ 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', @@ -43,13 +41,11 @@ describe('resource aiGateway', () => { }); 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); @@ -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', @@ -88,7 +82,7 @@ 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, @@ -96,7 +90,7 @@ describe('resource aiGateway', () => { }); 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(); @@ -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(); @@ -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', }); }); diff --git a/tests/api-resources/ai-gateway/logs.test.ts b/tests/api-resources/ai-gateway/logs.test.ts index 8219a5f916..1729e9e4d1 100644 --- a/tests/api-resources/ai-gateway/logs.test.ts +++ b/tests/api-resources/ai-gateway/logs.test.ts @@ -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(); @@ -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',