-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(api): update via SDK Studio (#429)
- Loading branch information
1 parent
3e39431
commit 9c2b961
Showing
12 changed files
with
367 additions
and
356 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.