From f4300ab95a042741a67cb919eff12ab0ea7afc4d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 31 May 2024 23:20:30 +0000 Subject: [PATCH] feat(api): OpenAPI spec update via Stainless API (#704) --- .stats.yml | 2 +- src/resources/zero-trust/dex/colos.ts | 8 ++--- .../zero-trust/dex/fleet-status/devices.ts | 13 ++++++-- .../dex/fleet-status/fleet-status.ts | 4 +-- .../zero-trust/dex/http-tests/http-tests.ts | 12 +++---- .../zero-trust/dex/http-tests/percentiles.ts | 8 ++--- .../traceroute-test-results/network-path.ts | 5 --- .../zero-trust/dex/traceroute-tests.ts | 32 +++++++++---------- .../zero-trust/dex/colos.test.ts | 8 ++--- .../dex/fleet-status/devices.test.ts | 10 +++--- .../dex/fleet-status/fleet-status.test.ts | 8 ++--- .../dex/http-tests/http-tests.test.ts | 8 ++--- .../dex/http-tests/percentiles.test.ts | 8 ++--- .../zero-trust/dex/traceroute-tests.test.ts | 24 +++++++------- 14 files changed, 78 insertions(+), 72 deletions(-) diff --git a/.stats.yml b/.stats.yml index b3c2fa72c4..62a18d0f9d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1321 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a18a8d7f1f80a39beb83a6541eb29dea4a69df37444aeb85493c94256c11d3a6.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-7080386fb1d04dafc80523803a44e41bab56e2907c13694ced938d02a3abb9d5.yml diff --git a/src/resources/zero-trust/dex/colos.ts b/src/resources/zero-trust/dex/colos.ts index 6b3118b3c4..fc346633b7 100644 --- a/src/resources/zero-trust/dex/colos.ts +++ b/src/resources/zero-trust/dex/colos.ts @@ -34,14 +34,14 @@ export interface ColoListParams { account_id: string; /** - * Query param: End time for connection period in RFC3339 (ISO 8601) format. + * Query param: Start time for connection period in RFC3339 (ISO 8601) format. */ - timeEnd: string; + from: string; /** - * Query param: Start time for connection period in RFC3339 (ISO 8601) format. + * Query param: End time for connection period in RFC3339 (ISO 8601) format. */ - timeStart: string; + to: string; /** * Query param: Type of usage that colos should be sorted by. If unspecified, diff --git a/src/resources/zero-trust/dex/fleet-status/devices.ts b/src/resources/zero-trust/dex/fleet-status/devices.ts index c00efc5891..56673bb399 100644 --- a/src/resources/zero-trust/dex/fleet-status/devices.ts +++ b/src/resources/zero-trust/dex/fleet-status/devices.ts @@ -70,12 +70,21 @@ export interface DeviceListParams extends V4PagePaginationArrayParams { /** * Query param: Timestamp in ISO format */ - time_end: string; + from: string; + + /** + * Query param: Source: + * + * - `hourly` - device details aggregated hourly, up to 7 days prior + * - `last_seen` - device details, up to 24 hours prior + * - `raw` - device details, up to 7 days prior + */ + source: 'last_seen' | 'hourly' | 'raw'; /** * Query param: Timestamp in ISO format */ - time_start: string; + to: string; /** * Query param: Cloudflare colo diff --git a/src/resources/zero-trust/dex/fleet-status/fleet-status.ts b/src/resources/zero-trust/dex/fleet-status/fleet-status.ts index e97748168c..375c6dad38 100644 --- a/src/resources/zero-trust/dex/fleet-status/fleet-status.ts +++ b/src/resources/zero-trust/dex/fleet-status/fleet-status.ts @@ -90,12 +90,12 @@ export interface FleetStatusOverTimeParams { /** * Query param: Timestamp in ISO format */ - time_end: string; + from: string; /** * Query param: Timestamp in ISO format */ - time_start: string; + to: string; /** * Query param: Cloudflare colo diff --git a/src/resources/zero-trust/dex/http-tests/http-tests.ts b/src/resources/zero-trust/dex/http-tests/http-tests.ts index a13d165644..67896668ab 100644 --- a/src/resources/zero-trust/dex/http-tests/http-tests.ts +++ b/src/resources/zero-trust/dex/http-tests/http-tests.ts @@ -187,19 +187,19 @@ export interface HTTPTestGetParams { account_id: string; /** - * Query param: Time interval for aggregate time slots. + * Query param: Start time for aggregate metrics in ISO ms */ - interval: 'minute' | 'hour'; + from: string; /** - * Query param: End time for aggregate metrics in ISO ms + * Query param: Time interval for aggregate time slots. */ - timeEnd: string; + interval: 'minute' | 'hour'; /** - * Query param: Start time for aggregate metrics in ISO ms + * Query param: End time for aggregate metrics in ISO ms */ - timeStart: string; + to: string; /** * Query param: Optionally filter result stats to a Cloudflare colo. Cannot be used diff --git a/src/resources/zero-trust/dex/http-tests/percentiles.ts b/src/resources/zero-trust/dex/http-tests/percentiles.ts index 338c444690..17da53d347 100644 --- a/src/resources/zero-trust/dex/http-tests/percentiles.ts +++ b/src/resources/zero-trust/dex/http-tests/percentiles.ts @@ -67,14 +67,14 @@ export interface PercentileGetParams { account_id: string; /** - * Query param: End time for aggregate metrics in ISO format + * Query param: Start time for aggregate metrics in ISO format */ - timeEnd: string; + from: string; /** - * Query param: Start time for aggregate metrics in ISO format + * Query param: End time for aggregate metrics in ISO format */ - timeStart: string; + to: string; /** * Query param: Optionally filter result stats to a Cloudflare colo. Cannot be used diff --git a/src/resources/zero-trust/dex/traceroute-test-results/network-path.ts b/src/resources/zero-trust/dex/traceroute-test-results/network-path.ts index 556051e047..8b9c96a598 100644 --- a/src/resources/zero-trust/dex/traceroute-test-results/network-path.ts +++ b/src/resources/zero-trust/dex/traceroute-test-results/network-path.ts @@ -35,11 +35,6 @@ export interface NetworkPathGetResponse { */ resultId: string; - /** - * date time of this traceroute test - */ - time_start: string; - /** * name of the device associated with this network path response */ diff --git a/src/resources/zero-trust/dex/traceroute-tests.ts b/src/resources/zero-trust/dex/traceroute-tests.ts index bc48c0494e..a8c705c63c 100644 --- a/src/resources/zero-trust/dex/traceroute-tests.ts +++ b/src/resources/zero-trust/dex/traceroute-tests.ts @@ -249,19 +249,19 @@ export interface TracerouteTestGetParams { account_id: string; /** - * Query param: Time interval for aggregate time slots. + * Query param: Start time for aggregate metrics in ISO ms */ - interval: 'minute' | 'hour'; + from: string; /** - * Query param: End time for aggregate metrics in ISO ms + * Query param: Time interval for aggregate time slots. */ - timeEnd: string; + interval: 'minute' | 'hour'; /** - * Query param: Start time for aggregate metrics in ISO ms + * Query param: End time for aggregate metrics in ISO ms */ - timeStart: string; + to: string; /** * Query param: Optionally filter result stats to a Cloudflare colo. Cannot be used @@ -288,19 +288,19 @@ export interface TracerouteTestNetworkPathParams { deviceId: string; /** - * Query param: Time interval for aggregate time slots. + * Query param: Start time for aggregate metrics in ISO ms */ - interval: 'minute' | 'hour'; + from: string; /** - * Query param: End time for aggregate metrics in ISO ms + * Query param: Time interval for aggregate time slots. */ - timeEnd: string; + interval: 'minute' | 'hour'; /** - * Query param: Start time for aggregate metrics in ISO ms + * Query param: End time for aggregate metrics in ISO ms */ - timeStart: string; + to: string; } export interface TracerouteTestPercentilesParams { @@ -310,14 +310,14 @@ export interface TracerouteTestPercentilesParams { account_id: string; /** - * Query param: End time for aggregate metrics in ISO format + * Query param: Start time for aggregate metrics in ISO format */ - timeEnd: string; + from: string; /** - * Query param: Start time for aggregate metrics in ISO format + * Query param: End time for aggregate metrics in ISO format */ - timeStart: string; + to: string; /** * Query param: Optionally filter result stats to a Cloudflare colo. Cannot be used diff --git a/tests/api-resources/zero-trust/dex/colos.test.ts b/tests/api-resources/zero-trust/dex/colos.test.ts index a581c19e97..bb9a5e195f 100644 --- a/tests/api-resources/zero-trust/dex/colos.test.ts +++ b/tests/api-resources/zero-trust/dex/colos.test.ts @@ -13,8 +13,8 @@ describe('resource colos', () => { test('list: only required params', async () => { const responsePromise = cloudflare.zeroTrust.dex.colos.list({ account_id: '01a7362d577a6c3019a474fd6f485823', - timeEnd: '2023-08-24T20:45:00Z', - timeStart: '2023-08-20T20:45:00Z', + from: '2023-08-20T20:45:00Z', + to: '2023-08-24T20:45:00Z', }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -28,8 +28,8 @@ describe('resource colos', () => { test('list: required and optional params', async () => { const response = await cloudflare.zeroTrust.dex.colos.list({ account_id: '01a7362d577a6c3019a474fd6f485823', - timeEnd: '2023-08-24T20:45:00Z', - timeStart: '2023-08-20T20:45:00Z', + from: '2023-08-20T20:45:00Z', + to: '2023-08-24T20:45:00Z', sortBy: 'fleet-status-usage', }); }); diff --git a/tests/api-resources/zero-trust/dex/fleet-status/devices.test.ts b/tests/api-resources/zero-trust/dex/fleet-status/devices.test.ts index ccde92e202..56c104301e 100644 --- a/tests/api-resources/zero-trust/dex/fleet-status/devices.test.ts +++ b/tests/api-resources/zero-trust/dex/fleet-status/devices.test.ts @@ -14,10 +14,11 @@ describe('resource devices', () => { test.skip('list: only required params', async () => { const responsePromise = cloudflare.zeroTrust.dex.fleetStatus.devices.list({ account_id: '01a7362d577a6c3019a474fd6f485823', + from: '2023-10-11T00:00:00Z', page: 1, per_page: 10, - time_end: '2023-10-11T00:00:00Z', - time_start: '2023-10-11T00:00:00Z', + source: 'last_seen', + to: '2023-10-11T00:00:00Z', }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -32,10 +33,11 @@ describe('resource devices', () => { test.skip('list: required and optional params', async () => { const response = await cloudflare.zeroTrust.dex.fleetStatus.devices.list({ account_id: '01a7362d577a6c3019a474fd6f485823', + from: '2023-10-11T00:00:00Z', page: 1, per_page: 10, - time_end: '2023-10-11T00:00:00Z', - time_start: '2023-10-11T00:00:00Z', + source: 'last_seen', + to: '2023-10-11T00:00:00Z', colo: 'SJC', device_id: 'cb49c27f-7f97-49c5-b6f3-f7c01ead0fd7', mode: 'proxy', diff --git a/tests/api-resources/zero-trust/dex/fleet-status/fleet-status.test.ts b/tests/api-resources/zero-trust/dex/fleet-status/fleet-status.test.ts index c2f6a67ffb..6dd8dbd1ee 100644 --- a/tests/api-resources/zero-trust/dex/fleet-status/fleet-status.test.ts +++ b/tests/api-resources/zero-trust/dex/fleet-status/fleet-status.test.ts @@ -34,8 +34,8 @@ describe('resource fleetStatus', () => { test('overTime: only required params', async () => { const responsePromise = cloudflare.zeroTrust.dex.fleetStatus.overTime({ account_id: '01a7362d577a6c3019a474fd6f485823', - time_end: '2023-10-11T00:00:00Z', - time_start: '2023-10-11T00:00:00Z', + from: '2023-10-11T00:00:00Z', + to: '2023-10-11T00:00:00Z', }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -49,8 +49,8 @@ describe('resource fleetStatus', () => { test('overTime: required and optional params', async () => { const response = await cloudflare.zeroTrust.dex.fleetStatus.overTime({ account_id: '01a7362d577a6c3019a474fd6f485823', - time_end: '2023-10-11T00:00:00Z', - time_start: '2023-10-11T00:00:00Z', + from: '2023-10-11T00:00:00Z', + to: '2023-10-11T00:00:00Z', colo: 'SJC', device_id: 'cb49c27f-7f97-49c5-b6f3-f7c01ead0fd7', }); diff --git a/tests/api-resources/zero-trust/dex/http-tests/http-tests.test.ts b/tests/api-resources/zero-trust/dex/http-tests/http-tests.test.ts index 1c99e460e3..97c2cf14b6 100644 --- a/tests/api-resources/zero-trust/dex/http-tests/http-tests.test.ts +++ b/tests/api-resources/zero-trust/dex/http-tests/http-tests.test.ts @@ -13,9 +13,9 @@ describe('resource httpTests', () => { test('get: only required params', async () => { const responsePromise = cloudflare.zeroTrust.dex.httpTests.get('f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { account_id: '01a7362d577a6c3019a474fd6f485823', + from: '1689520412000', interval: 'minute', - timeEnd: '1689606812000', - timeStart: '1689520412000', + to: '1689606812000', }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -29,9 +29,9 @@ describe('resource httpTests', () => { test('get: required and optional params', async () => { const response = await cloudflare.zeroTrust.dex.httpTests.get('f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { account_id: '01a7362d577a6c3019a474fd6f485823', + from: '1689520412000', interval: 'minute', - timeEnd: '1689606812000', - timeStart: '1689520412000', + to: '1689606812000', colo: 'string', deviceId: ['string', 'string', 'string'], }); diff --git a/tests/api-resources/zero-trust/dex/http-tests/percentiles.test.ts b/tests/api-resources/zero-trust/dex/http-tests/percentiles.test.ts index ec7f21993a..323cdc1fb4 100644 --- a/tests/api-resources/zero-trust/dex/http-tests/percentiles.test.ts +++ b/tests/api-resources/zero-trust/dex/http-tests/percentiles.test.ts @@ -15,8 +15,8 @@ describe('resource percentiles', () => { 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { account_id: '01a7362d577a6c3019a474fd6f485823', - timeEnd: '2023-09-20T17:00:00Z', - timeStart: '2023-09-20T17:00:00Z', + from: '2023-09-20T17:00:00Z', + to: '2023-09-20T17:00:00Z', }, ); const rawResponse = await responsePromise.asResponse(); @@ -33,8 +33,8 @@ describe('resource percentiles', () => { 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { account_id: '01a7362d577a6c3019a474fd6f485823', - timeEnd: '2023-09-20T17:00:00Z', - timeStart: '2023-09-20T17:00:00Z', + from: '2023-09-20T17:00:00Z', + to: '2023-09-20T17:00:00Z', colo: 'string', deviceId: ['string', 'string', 'string'], }, diff --git a/tests/api-resources/zero-trust/dex/traceroute-tests.test.ts b/tests/api-resources/zero-trust/dex/traceroute-tests.test.ts index 44fdd4a7c9..d51cba88eb 100644 --- a/tests/api-resources/zero-trust/dex/traceroute-tests.test.ts +++ b/tests/api-resources/zero-trust/dex/traceroute-tests.test.ts @@ -15,9 +15,9 @@ describe('resource tracerouteTests', () => { 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { account_id: '01a7362d577a6c3019a474fd6f485823', + from: '1689520412000', interval: 'minute', - timeEnd: '1689606812000', - timeStart: '1689520412000', + to: '1689606812000', }, ); const rawResponse = await responsePromise.asResponse(); @@ -34,9 +34,9 @@ describe('resource tracerouteTests', () => { 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { account_id: '01a7362d577a6c3019a474fd6f485823', + from: '1689520412000', interval: 'minute', - timeEnd: '1689606812000', - timeStart: '1689520412000', + to: '1689606812000', colo: 'string', deviceId: ['string', 'string', 'string'], }, @@ -49,9 +49,9 @@ describe('resource tracerouteTests', () => { { account_id: '01a7362d577a6c3019a474fd6f485823', deviceId: 'string', + from: '1689520412000', interval: 'minute', - timeEnd: '1689606812000', - timeStart: '1689520412000', + to: '1689606812000', }, ); const rawResponse = await responsePromise.asResponse(); @@ -69,9 +69,9 @@ describe('resource tracerouteTests', () => { { account_id: '01a7362d577a6c3019a474fd6f485823', deviceId: 'string', + from: '1689520412000', interval: 'minute', - timeEnd: '1689606812000', - timeStart: '1689520412000', + to: '1689606812000', }, ); }); @@ -81,8 +81,8 @@ describe('resource tracerouteTests', () => { 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { account_id: '01a7362d577a6c3019a474fd6f485823', - timeEnd: '2023-09-20T17:00:00Z', - timeStart: '2023-09-20T17:00:00Z', + from: '2023-09-20T17:00:00Z', + to: '2023-09-20T17:00:00Z', }, ); const rawResponse = await responsePromise.asResponse(); @@ -99,8 +99,8 @@ describe('resource tracerouteTests', () => { 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { account_id: '01a7362d577a6c3019a474fd6f485823', - timeEnd: '2023-09-20T17:00:00Z', - timeStart: '2023-09-20T17:00:00Z', + from: '2023-09-20T17:00:00Z', + to: '2023-09-20T17:00:00Z', colo: 'string', deviceId: ['string', 'string', 'string'], },