22
33import { APIResource } from '../../../resource' ;
44import * as Core from '../../../core' ;
5- import { SinglePage } from '../../../pagination' ;
5+ import { V4PagePaginationArray , type V4PagePaginationArrayParams } from '../../../pagination' ;
66
77export class DEXTests extends APIResource {
88 /**
@@ -13,7 +13,10 @@ export class DEXTests extends APIResource {
1313 * const dexTest =
1414 * await client.zeroTrust.devices.dexTests.create({
1515 * account_id: '01a7362d577a6c3019a474fd6f485823',
16- * data: {},
16+ * data: {
17+ * host: 'https://dash.cloudflare.com',
18+ * kind: 'http',
19+ * },
1720 * enabled: true,
1821 * interval: '30m',
1922 * name: 'HTTP dash health check',
@@ -40,7 +43,10 @@ export class DEXTests extends APIResource {
4043 * 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
4144 * {
4245 * account_id: '01a7362d577a6c3019a474fd6f485823',
43- * data: {},
46+ * data: {
47+ * host: 'https://dash.cloudflare.com',
48+ * kind: 'http',
49+ * },
4450 * enabled: true,
4551 * interval: '30m',
4652 * name: 'HTTP dash health check',
@@ -78,12 +84,12 @@ export class DEXTests extends APIResource {
7884 list (
7985 params : DEXTestListParams ,
8086 options ?: Core . RequestOptions ,
81- ) : Core . PagePromise < DEXTestListResponsesSinglePage , DEXTestListResponse > {
82- const { account_id } = params ;
87+ ) : Core . PagePromise < DEXTestListResponsesV4PagePaginationArray , DEXTestListResponse > {
88+ const { account_id, ... query } = params ;
8389 return this . _client . getAPIList (
8490 `/accounts/${ account_id } /dex/devices/dex_tests` ,
85- DEXTestListResponsesSinglePage ,
86- options ,
91+ DEXTestListResponsesV4PagePaginationArray ,
92+ { query , ... options } ,
8793 ) ;
8894 }
8995
@@ -140,7 +146,7 @@ export class DEXTests extends APIResource {
140146 }
141147}
142148
143- export class DEXTestListResponsesSinglePage extends SinglePage < DEXTestListResponse > { }
149+ export class DEXTestListResponsesV4PagePaginationArray extends V4PagePaginationArray < DEXTestListResponse > { }
144150
145151/**
146152 * The configuration object which contains the details for the WARP client to
@@ -271,24 +277,24 @@ export namespace DEXTestCreateResponse {
271277 /**
272278 * The desired endpoint to test.
273279 */
274- host ? : string ;
280+ host : string ;
275281
276282 /**
277283 * The type of test.
278284 */
279- kind ?: string ;
285+ kind : 'http' | 'traceroute' ;
280286
281287 /**
282288 * The HTTP request method type.
283289 */
284- method ?: string ;
290+ method ?: 'GET' ;
285291 }
286292
287293 export interface TargetPolicy {
288294 /**
289- * The id of the DEX rule
295+ * API Resource UUID tag.
290296 */
291- id ? : string ;
297+ id : string ;
292298
293299 /**
294300 * Whether the DEX rule is the account default
@@ -351,24 +357,24 @@ export namespace DEXTestUpdateResponse {
351357 /**
352358 * The desired endpoint to test.
353359 */
354- host ? : string ;
360+ host : string ;
355361
356362 /**
357363 * The type of test.
358364 */
359- kind ?: string ;
365+ kind : 'http' | 'traceroute' ;
360366
361367 /**
362368 * The HTTP request method type.
363369 */
364- method ?: string ;
370+ method ?: 'GET' ;
365371 }
366372
367373 export interface TargetPolicy {
368374 /**
369- * The id of the DEX rule
375+ * API Resource UUID tag.
370376 */
371- id ? : string ;
377+ id : string ;
372378
373379 /**
374380 * Whether the DEX rule is the account default
@@ -431,24 +437,24 @@ export namespace DEXTestListResponse {
431437 /**
432438 * The desired endpoint to test.
433439 */
434- host ? : string ;
440+ host : string ;
435441
436442 /**
437443 * The type of test.
438444 */
439- kind ?: string ;
445+ kind : 'http' | 'traceroute' ;
440446
441447 /**
442448 * The HTTP request method type.
443449 */
444- method ?: string ;
450+ method ?: 'GET' ;
445451 }
446452
447453 export interface TargetPolicy {
448454 /**
449- * The id of the DEX rule
455+ * API Resource UUID tag.
450456 */
451- id ? : string ;
457+ id : string ;
452458
453459 /**
454460 * Whether the DEX rule is the account default
@@ -516,24 +522,24 @@ export namespace DEXTestDeleteResponse {
516522 /**
517523 * The desired endpoint to test.
518524 */
519- host ? : string ;
525+ host : string ;
520526
521527 /**
522528 * The type of test.
523529 */
524- kind ?: string ;
530+ kind : 'http' | 'traceroute' ;
525531
526532 /**
527533 * The HTTP request method type.
528534 */
529- method ?: string ;
535+ method ?: 'GET' ;
530536 }
531537
532538 export interface TargetPolicy {
533539 /**
534- * The id of the DEX rule
540+ * API Resource UUID tag.
535541 */
536- id ? : string ;
542+ id : string ;
537543
538544 /**
539545 * Whether the DEX rule is the account default
@@ -597,24 +603,24 @@ export namespace DEXTestGetResponse {
597603 /**
598604 * The desired endpoint to test.
599605 */
600- host ? : string ;
606+ host : string ;
601607
602608 /**
603609 * The type of test.
604610 */
605- kind ?: string ;
611+ kind : 'http' | 'traceroute' ;
606612
607613 /**
608614 * The HTTP request method type.
609615 */
610- method ?: string ;
616+ method ?: 'GET' ;
611617 }
612618
613619 export interface TargetPolicy {
614620 /**
615- * The id of the DEX rule
621+ * API Resource UUID tag.
616622 */
617- id ? : string ;
623+ id : string ;
618624
619625 /**
620626 * Whether the DEX rule is the account default
@@ -680,24 +686,24 @@ export namespace DEXTestCreateParams {
680686 /**
681687 * The desired endpoint to test.
682688 */
683- host ? : string ;
689+ host : string ;
684690
685691 /**
686692 * The type of test.
687693 */
688- kind ?: string ;
694+ kind : 'http' | 'traceroute' ;
689695
690696 /**
691697 * The HTTP request method type.
692698 */
693- method ?: string ;
699+ method ?: 'GET' ;
694700 }
695701
696702 export interface TargetPolicy {
697703 /**
698- * The id of the DEX rule
704+ * API Resource UUID tag.
699705 */
700- id ? : string ;
706+ id : string ;
701707
702708 /**
703709 * Whether the DEX rule is the account default
@@ -763,24 +769,24 @@ export namespace DEXTestUpdateParams {
763769 /**
764770 * The desired endpoint to test.
765771 */
766- host ? : string ;
772+ host : string ;
767773
768774 /**
769775 * The type of test.
770776 */
771- kind ?: string ;
777+ kind : 'http' | 'traceroute' ;
772778
773779 /**
774780 * The HTTP request method type.
775781 */
776- method ?: string ;
782+ method ?: 'GET' ;
777783 }
778784
779785 export interface TargetPolicy {
780786 /**
781- * The id of the DEX rule
787+ * API Resource UUID tag.
782788 */
783- id ? : string ;
789+ id : string ;
784790
785791 /**
786792 * Whether the DEX rule is the account default
@@ -794,8 +800,21 @@ export namespace DEXTestUpdateParams {
794800 }
795801}
796802
797- export interface DEXTestListParams {
803+ export interface DEXTestListParams extends V4PagePaginationArrayParams {
804+ /**
805+ * Path param
806+ */
798807 account_id : string ;
808+
809+ /**
810+ * Query param: Filter by test type
811+ */
812+ kind ?: 'http' | 'traceroute' ;
813+
814+ /**
815+ * Query param: Filter by test name
816+ */
817+ testName ?: string ;
799818}
800819
801820export interface DEXTestDeleteParams {
@@ -806,7 +825,7 @@ export interface DEXTestGetParams {
806825 account_id : string ;
807826}
808827
809- DEXTests . DEXTestListResponsesSinglePage = DEXTestListResponsesSinglePage ;
828+ DEXTests . DEXTestListResponsesV4PagePaginationArray = DEXTestListResponsesV4PagePaginationArray ;
810829
811830export declare namespace DEXTests {
812831 export {
@@ -817,7 +836,7 @@ export declare namespace DEXTests {
817836 type DEXTestListResponse as DEXTestListResponse ,
818837 type DEXTestDeleteResponse as DEXTestDeleteResponse ,
819838 type DEXTestGetResponse as DEXTestGetResponse ,
820- DEXTestListResponsesSinglePage as DEXTestListResponsesSinglePage ,
839+ DEXTestListResponsesV4PagePaginationArray as DEXTestListResponsesV4PagePaginationArray ,
821840 type DEXTestCreateParams as DEXTestCreateParams ,
822841 type DEXTestUpdateParams as DEXTestUpdateParams ,
823842 type DEXTestListParams as DEXTestListParams ,
0 commit comments