Skip to content

Commit

Permalink
feat(api): update via SDK Studio (#429)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed May 7, 2024
1 parent 3e39431 commit 9c2b961
Show file tree
Hide file tree
Showing 12 changed files with 367 additions and 356 deletions.
45 changes: 21 additions & 24 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -6198,39 +6198,20 @@ Types:
- <code><a href="./src/resources/speed/speed.ts">LabeledRegion</a></code>
- <code><a href="./src/resources/speed/speed.ts">LighthouseReport</a></code>
- <code><a href="./src/resources/speed/speed.ts">Trend</a></code>
- <code><a href="./src/resources/speed/speed.ts">SpeedDeleteResponse</a></code>

Methods:

- <code title="delete /zones/{zone_id}/speed_api/schedule/{url}">client.speed.<a href="./src/resources/speed/speed.ts">delete</a>(url, { ...params }) -> SpeedDeleteResponse</code>
- <code title="get /zones/{zone_id}/speed_api/schedule/{url}">client.speed.<a href="./src/resources/speed/speed.ts">scheduleGet</a>(url, { ...params }) -> Schedule</code>
- <code title="get /zones/{zone_id}/speed_api/pages/{url}/trend">client.speed.<a href="./src/resources/speed/speed.ts">trendsList</a>(url, { ...params }) -> Trend</code>

## Tests

Types:

- <code><a href="./src/resources/speed/tests.ts">Test</a></code>
- <code><a href="./src/resources/speed/tests.ts">TestListResponse</a></code>
- <code><a href="./src/resources/speed/tests.ts">TestDeleteResponse</a></code>

Methods:

- <code title="post /zones/{zone_id}/speed_api/pages/{url}/tests">client.speed.tests.<a href="./src/resources/speed/tests.ts">create</a>(url, { ...params }) -> Test</code>
- <code title="get /zones/{zone_id}/speed_api/pages/{url}/tests">client.speed.tests.<a href="./src/resources/speed/tests.ts">list</a>(url, { ...params }) -> TestListResponse</code>
- <code title="delete /zones/{zone_id}/speed_api/pages/{url}/tests">client.speed.tests.<a href="./src/resources/speed/tests.ts">delete</a>(url, { ...params }) -> TestDeleteResponse</code>
- <code title="get /zones/{zone_id}/speed_api/pages/{url}/tests/{test_id}">client.speed.tests.<a href="./src/resources/speed/tests.ts">get</a>(url, testId, { ...params }) -> Test</code>

## Schedule

Types:

- <code><a href="./src/resources/speed/schedule.ts">Schedule</a></code>
- <code><a href="./src/resources/speed/schedule.ts">ScheduleCreateResponse</a></code>
- <code><a href="./src/resources/speed/schedule.ts">ScheduleDeleteResponse</a></code>

Methods:

- <code title="post /zones/{zone_id}/speed_api/schedule/{url}">client.speed.schedule.<a href="./src/resources/speed/schedule.ts">create</a>(url, { ...params }) -> ScheduleCreateResponse</code>
- <code title="delete /zones/{zone_id}/speed_api/schedule/{url}">client.speed.schedule.<a href="./src/resources/speed/schedule.ts">delete</a>(url, { ...params }) -> ScheduleDeleteResponse</code>
- <code title="get /zones/{zone_id}/speed_api/schedule/{url}">client.speed.schedule.<a href="./src/resources/speed/schedule.ts">get</a>(url, { ...params }) -> Schedule</code>

## Availabilities

Expand All @@ -6246,11 +6227,27 @@ Methods:

Types:

- <code><a href="./src/resources/speed/pages.ts">PageListResponse</a></code>
- <code><a href="./src/resources/speed/pages/pages.ts">PageListResponse</a></code>

Methods:

- <code title="get /zones/{zone_id}/speed_api/pages">client.speed.pages.<a href="./src/resources/speed/pages/pages.ts">list</a>({ ...params }) -> PageListResponsesSinglePage</code>
- <code title="get /zones/{zone_id}/speed_api/pages/{url}/trend">client.speed.pages.<a href="./src/resources/speed/pages/pages.ts">trend</a>(url, { ...params }) -> Trend</code>

### Tests

Types:

- <code><a href="./src/resources/speed/pages/tests.ts">Test</a></code>
- <code><a href="./src/resources/speed/pages/tests.ts">TestListResponse</a></code>
- <code><a href="./src/resources/speed/pages/tests.ts">TestDeleteResponse</a></code>

Methods:

- <code title="get /zones/{zone_id}/speed_api/pages">client.speed.pages.<a href="./src/resources/speed/pages.ts">list</a>({ ...params }) -> PageListResponsesSinglePage</code>
- <code title="post /zones/{zone_id}/speed_api/pages/{url}/tests">client.speed.pages.tests.<a href="./src/resources/speed/pages/tests.ts">create</a>(url, { ...params }) -> Test</code>
- <code title="get /zones/{zone_id}/speed_api/pages/{url}/tests">client.speed.pages.tests.<a href="./src/resources/speed/pages/tests.ts">list</a>(url, { ...params }) -> TestListResponse</code>
- <code title="delete /zones/{zone_id}/speed_api/pages/{url}/tests">client.speed.pages.tests.<a href="./src/resources/speed/pages/tests.ts">delete</a>(url, { ...params }) -> TestDeleteResponse</code>
- <code title="get /zones/{zone_id}/speed_api/pages/{url}/tests/{test_id}">client.speed.pages.tests.<a href="./src/resources/speed/pages/tests.ts">get</a>(url, testId, { ...params }) -> Test</code>

# DCVDelegation

Expand Down
28 changes: 16 additions & 12 deletions src/resources/speed/index.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

export { Availability, AvailabilityListParams, Availabilities } from './availabilities';
export { PageListResponse, PageListParams, PageListResponsesSinglePage, Pages } from './pages';
export { Schedule, ScheduleCreateResponse, ScheduleCreateParams, ScheduleResource } from './schedule';
export { Speed } from './speed';
export {
Test,
TestListResponse,
TestDeleteResponse,
TestCreateParams,
TestListParams,
TestDeleteParams,
TestGetParams,
Tests,
} from './tests';
PageListResponse,
PageListParams,
PageTrendParams,
PageListResponsesSinglePage,
Pages,
} from './pages/index';
export {
Schedule,
ScheduleCreateResponse,
ScheduleDeleteResponse,
ScheduleCreateParams,
ScheduleDeleteParams,
ScheduleGetParams,
ScheduleResource,
} from './schedule';
export { Speed } from './speed';
55 changes: 0 additions & 55 deletions src/resources/speed/pages.ts

This file was deleted.

19 changes: 19 additions & 0 deletions src/resources/speed/pages/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

export {
PageListResponse,
PageListParams,
PageTrendParams,
PageListResponsesSinglePage,
Pages,
} from './pages';
export {
Test,
TestListResponse,
TestDeleteResponse,
TestCreateParams,
TestListParams,
TestDeleteParams,
TestGetParams,
Tests,
} from './tests';
141 changes: 141 additions & 0 deletions src/resources/speed/pages/pages.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

import * as Core from 'cloudflare/core';
import { APIResource } from 'cloudflare/resource';
import * as PagesAPI from 'cloudflare/resources/speed/pages/pages';
import * as SpeedAPI from 'cloudflare/resources/speed/speed';
import * as TestsAPI from 'cloudflare/resources/speed/pages/tests';
import { SinglePage } from 'cloudflare/pagination';

export class Pages extends APIResource {
tests: TestsAPI.Tests = new TestsAPI.Tests(this._client);

/**
* Lists all webpages which have been tested.
*/
list(
params: PageListParams,
options?: Core.RequestOptions,
): Core.PagePromise<PageListResponsesSinglePage, PageListResponse> {
const { zone_id } = params;
return this._client.getAPIList(`/zones/${zone_id}/speed_api/pages`, PageListResponsesSinglePage, options);
}

/**
* Lists the core web vital metrics trend over time for a specific page.
*/
trend(
url: string,
params: PageTrendParams,
options?: Core.RequestOptions,
): Core.APIPromise<SpeedAPI.Trend> {
const { zone_id, ...query } = params;
return (
this._client.get(`/zones/${zone_id}/speed_api/pages/${url}/trend`, {
query,
...options,
}) as Core.APIPromise<{ result: SpeedAPI.Trend }>
)._thenUnwrap((obj) => obj.result);
}
}

export class PageListResponsesSinglePage extends SinglePage<PageListResponse> {}

export interface PageListResponse {
/**
* A test region with a label.
*/
region?: SpeedAPI.LabeledRegion;

/**
* The frequency of the test.
*/
scheduleFrequency?: 'DAILY' | 'WEEKLY';

tests?: Array<TestsAPI.Test>;

/**
* A URL.
*/
url?: string;
}

export interface PageListParams {
/**
* Identifier
*/
zone_id: string;
}

export interface PageTrendParams {
/**
* Path param: Identifier
*/
zone_id: string;

/**
* Query param: The type of device.
*/
deviceType: 'DESKTOP' | 'MOBILE';

/**
* Query param: A comma-separated list of metrics to include in the results.
*/
metrics: string;

/**
* Query param: A test region.
*/
region:
| 'asia-east1'
| 'asia-northeast1'
| 'asia-northeast2'
| 'asia-south1'
| 'asia-southeast1'
| 'australia-southeast1'
| 'europe-north1'
| 'europe-southwest1'
| 'europe-west1'
| 'europe-west2'
| 'europe-west3'
| 'europe-west4'
| 'europe-west8'
| 'europe-west9'
| 'me-west1'
| 'southamerica-east1'
| 'us-central1'
| 'us-east1'
| 'us-east4'
| 'us-south1'
| 'us-west1';

/**
* Query param:
*/
start: string;

/**
* Query param: The timezone of the start and end timestamps.
*/
tz: string;

/**
* Query param:
*/
end?: string;
}

export namespace Pages {
export import PageListResponse = PagesAPI.PageListResponse;
export import PageListResponsesSinglePage = PagesAPI.PageListResponsesSinglePage;
export import PageListParams = PagesAPI.PageListParams;
export import PageTrendParams = PagesAPI.PageTrendParams;
export import Tests = TestsAPI.Tests;
export import Test = TestsAPI.Test;
export import TestListResponse = TestsAPI.TestListResponse;
export import TestDeleteResponse = TestsAPI.TestDeleteResponse;
export import TestCreateParams = TestsAPI.TestCreateParams;
export import TestListParams = TestsAPI.TestListParams;
export import TestDeleteParams = TestsAPI.TestDeleteParams;
export import TestGetParams = TestsAPI.TestGetParams;
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import * as Core from 'cloudflare/core';
import { APIResource } from 'cloudflare/resource';
import * as TestsAPI from 'cloudflare/resources/speed/tests';
import * as TestsAPI from 'cloudflare/resources/speed/pages/tests';
import * as Shared from 'cloudflare/resources/shared';
import * as SpeedAPI from 'cloudflare/resources/speed/speed';

Expand Down
Loading

0 comments on commit 9c2b961

Please sign in to comment.