cloudflare/cloudflare-typescript

Public

mirrored from https://github.com/cloudflare/cloudflare-typescriptAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
v6.0.0-beta.2

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

src/resources/ai-gateway/dynamic-routing.ts

2430lines · modecode

1// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
3import { APIResource } from '../../resource';
4import { isRequestOptions } from '../../core';
5import * as Core from '../../core';
6
7export class DynamicRouting extends APIResource {
8 /**
9 * Create a new AI Gateway Dynamic Route.
10 *
11 * @example
12 * ```ts
13 * const dynamicRouting =
14 * await client.aiGateway.dynamicRouting.create('54442216', {
15 * account_id: '0d37909e38d3e99c29fa2cd343ac421a',
16 * elements: [
17 * {
18 * id: 'id',
19 * outputs: { next: { elementId: 'elementId' } },
20 * type: 'start',
21 * },
22 * ],
23 * name: 'name',
24 * });
25 * ```
26 */
27 create(
28 gatewayId: string,
29 params: DynamicRoutingCreateParams,
30 options?: Core.RequestOptions,
31 ): Core.APIPromise<DynamicRoutingCreateResponse> {
32 const { account_id = this._client.accountId, ...body } = params;
33 return (
34 this._client.post(`/accounts/${account_id}/ai-gateway/gateways/${gatewayId}/routes`, {
35 body,
36 ...options,
37 }) as Core.APIPromise<{ result: DynamicRoutingCreateResponse }>
38 )._thenUnwrap((obj) => obj.result);
39 }
40
41 /**
42 * Update an AI Gateway Dynamic Route.
43 *
44 * @example
45 * ```ts
46 * const dynamicRouting =
47 * await client.aiGateway.dynamicRouting.update(
48 * '54442216',
49 * '54442216',
50 * {
51 * account_id: '0d37909e38d3e99c29fa2cd343ac421a',
52 * name: 'Route Name',
53 * },
54 * );
55 * ```
56 */
57 update(
58 gatewayId: string,
59 id: string,
60 params: DynamicRoutingUpdateParams,
61 options?: Core.RequestOptions,
62 ): Core.APIPromise<DynamicRoutingUpdateResponse> {
63 const { account_id = this._client.accountId, ...body } = params;
64 return this._client.patch(`/accounts/${account_id}/ai-gateway/gateways/${gatewayId}/routes/${id}`, {
65 body,
66 ...options,
67 });
68 }
69
70 /**
71 * List all AI Gateway Dynamic Routes.
72 *
73 * @example
74 * ```ts
75 * const dynamicRoutings =
76 * await client.aiGateway.dynamicRouting.list('54442216', {
77 * account_id: '0d37909e38d3e99c29fa2cd343ac421a',
78 * });
79 * ```
80 */
81 list(
82 gatewayId: string,
83 params?: DynamicRoutingListParams,
84 options?: Core.RequestOptions,
85 ): Core.APIPromise<DynamicRoutingListResponse>;
86 list(gatewayId: string, options?: Core.RequestOptions): Core.APIPromise<DynamicRoutingListResponse>;
87 list(
88 gatewayId: string,
89 params: DynamicRoutingListParams | Core.RequestOptions = {},
90 options?: Core.RequestOptions,
91 ): Core.APIPromise<DynamicRoutingListResponse> {
92 if (isRequestOptions(params)) {
93 return this.list(gatewayId, {}, params);
94 }
95 const { account_id = this._client.accountId } = params;
96 return this._client.get(`/accounts/${account_id}/ai-gateway/gateways/${gatewayId}/routes`, options);
97 }
98
99 /**
100 * Delete an AI Gateway Dynamic Route.
101 *
102 * @example
103 * ```ts
104 * const dynamicRouting =
105 * await client.aiGateway.dynamicRouting.delete(
106 * '54442216',
107 * '54442216',
108 * { account_id: '0d37909e38d3e99c29fa2cd343ac421a' },
109 * );
110 * ```
111 */
112 delete(
113 gatewayId: string,
114 id: string,
115 params?: DynamicRoutingDeleteParams,
116 options?: Core.RequestOptions,
117 ): Core.APIPromise<DynamicRoutingDeleteResponse>;
118 delete(
119 gatewayId: string,
120 id: string,
121 options?: Core.RequestOptions,
122 ): Core.APIPromise<DynamicRoutingDeleteResponse>;
123 delete(
124 gatewayId: string,
125 id: string,
126 params: DynamicRoutingDeleteParams | Core.RequestOptions = {},
127 options?: Core.RequestOptions,
128 ): Core.APIPromise<DynamicRoutingDeleteResponse> {
129 if (isRequestOptions(params)) {
130 return this.delete(gatewayId, id, {}, params);
131 }
132 const { account_id = this._client.accountId } = params;
133 return (
134 this._client.delete(
135 `/accounts/${account_id}/ai-gateway/gateways/${gatewayId}/routes/${id}`,
136 options,
137 ) as Core.APIPromise<{ result: DynamicRoutingDeleteResponse }>
138 )._thenUnwrap((obj) => obj.result);
139 }
140
141 /**
142 * Create a new AI Gateway Dynamic Route Deployment.
143 *
144 * @example
145 * ```ts
146 * const response =
147 * await client.aiGateway.dynamicRouting.createDeployment(
148 * '54442216',
149 * '54442216',
150 * {
151 * account_id: '0d37909e38d3e99c29fa2cd343ac421a',
152 * version_id: '54442216',
153 * },
154 * );
155 * ```
156 */
157 createDeployment(
158 gatewayId: string,
159 id: string,
160 params: DynamicRoutingCreateDeploymentParams,
161 options?: Core.RequestOptions,
162 ): Core.APIPromise<DynamicRoutingCreateDeploymentResponse> {
163 const { account_id = this._client.accountId, ...body } = params;
164 return (
165 this._client.post(`/accounts/${account_id}/ai-gateway/gateways/${gatewayId}/routes/${id}/deployments`, {
166 body,
167 ...options,
168 }) as Core.APIPromise<{ result: DynamicRoutingCreateDeploymentResponse }>
169 )._thenUnwrap((obj) => obj.result);
170 }
171
172 /**
173 * Create a new AI Gateway Dynamic Route Version.
174 *
175 * @example
176 * ```ts
177 * const response =
178 * await client.aiGateway.dynamicRouting.createVersion(
179 * '54442216',
180 * '54442216',
181 * {
182 * account_id: '0d37909e38d3e99c29fa2cd343ac421a',
183 * elements: [
184 * {
185 * id: 'id',
186 * outputs: { next: { elementId: 'elementId' } },
187 * type: 'start',
188 * },
189 * ],
190 * },
191 * );
192 * ```
193 */
194 createVersion(
195 gatewayId: string,
196 id: string,
197 params: DynamicRoutingCreateVersionParams,
198 options?: Core.RequestOptions,
199 ): Core.APIPromise<DynamicRoutingCreateVersionResponse> {
200 const { account_id = this._client.accountId, ...body } = params;
201 return (
202 this._client.post(`/accounts/${account_id}/ai-gateway/gateways/${gatewayId}/routes/${id}/versions`, {
203 body,
204 ...options,
205 }) as Core.APIPromise<{ result: DynamicRoutingCreateVersionResponse }>
206 )._thenUnwrap((obj) => obj.result);
207 }
208
209 /**
210 * Get an AI Gateway Dynamic Route.
211 *
212 * @example
213 * ```ts
214 * const dynamicRouting =
215 * await client.aiGateway.dynamicRouting.get(
216 * '54442216',
217 * '54442216',
218 * { account_id: '0d37909e38d3e99c29fa2cd343ac421a' },
219 * );
220 * ```
221 */
222 get(
223 gatewayId: string,
224 id: string,
225 params?: DynamicRoutingGetParams,
226 options?: Core.RequestOptions,
227 ): Core.APIPromise<DynamicRoutingGetResponse>;
228 get(
229 gatewayId: string,
230 id: string,
231 options?: Core.RequestOptions,
232 ): Core.APIPromise<DynamicRoutingGetResponse>;
233 get(
234 gatewayId: string,
235 id: string,
236 params: DynamicRoutingGetParams | Core.RequestOptions = {},
237 options?: Core.RequestOptions,
238 ): Core.APIPromise<DynamicRoutingGetResponse> {
239 if (isRequestOptions(params)) {
240 return this.get(gatewayId, id, {}, params);
241 }
242 const { account_id = this._client.accountId } = params;
243 return (
244 this._client.get(
245 `/accounts/${account_id}/ai-gateway/gateways/${gatewayId}/routes/${id}`,
246 options,
247 ) as Core.APIPromise<{ result: DynamicRoutingGetResponse }>
248 )._thenUnwrap((obj) => obj.result);
249 }
250
251 /**
252 * Get an AI Gateway Dynamic Route Version.
253 *
254 * @example
255 * ```ts
256 * const response =
257 * await client.aiGateway.dynamicRouting.getVersion(
258 * '54442216',
259 * '54442216',
260 * '54442216',
261 * { account_id: '0d37909e38d3e99c29fa2cd343ac421a' },
262 * );
263 * ```
264 */
265 getVersion(
266 gatewayId: string,
267 id: string,
268 versionId: string,
269 params?: DynamicRoutingGetVersionParams,
270 options?: Core.RequestOptions,
271 ): Core.APIPromise<DynamicRoutingGetVersionResponse>;
272 getVersion(
273 gatewayId: string,
274 id: string,
275 versionId: string,
276 options?: Core.RequestOptions,
277 ): Core.APIPromise<DynamicRoutingGetVersionResponse>;
278 getVersion(
279 gatewayId: string,
280 id: string,
281 versionId: string,
282 params: DynamicRoutingGetVersionParams | Core.RequestOptions = {},
283 options?: Core.RequestOptions,
284 ): Core.APIPromise<DynamicRoutingGetVersionResponse> {
285 if (isRequestOptions(params)) {
286 return this.getVersion(gatewayId, id, versionId, {}, params);
287 }
288 const { account_id = this._client.accountId } = params;
289 return (
290 this._client.get(
291 `/accounts/${account_id}/ai-gateway/gateways/${gatewayId}/routes/${id}/versions/${versionId}`,
292 options,
293 ) as Core.APIPromise<{ result: DynamicRoutingGetVersionResponse }>
294 )._thenUnwrap((obj) => obj.result);
295 }
296
297 /**
298 * List all AI Gateway Dynamic Route Deployments.
299 *
300 * @example
301 * ```ts
302 * const response =
303 * await client.aiGateway.dynamicRouting.listDeployments(
304 * '54442216',
305 * '54442216',
306 * { account_id: '0d37909e38d3e99c29fa2cd343ac421a' },
307 * );
308 * ```
309 */
310 listDeployments(
311 gatewayId: string,
312 id: string,
313 params?: DynamicRoutingListDeploymentsParams,
314 options?: Core.RequestOptions,
315 ): Core.APIPromise<DynamicRoutingListDeploymentsResponse>;
316 listDeployments(
317 gatewayId: string,
318 id: string,
319 options?: Core.RequestOptions,
320 ): Core.APIPromise<DynamicRoutingListDeploymentsResponse>;
321 listDeployments(
322 gatewayId: string,
323 id: string,
324 params: DynamicRoutingListDeploymentsParams | Core.RequestOptions = {},
325 options?: Core.RequestOptions,
326 ): Core.APIPromise<DynamicRoutingListDeploymentsResponse> {
327 if (isRequestOptions(params)) {
328 return this.listDeployments(gatewayId, id, {}, params);
329 }
330 const { account_id = this._client.accountId } = params;
331 return this._client.get(
332 `/accounts/${account_id}/ai-gateway/gateways/${gatewayId}/routes/${id}/deployments`,
333 options,
334 );
335 }
336
337 /**
338 * List all AI Gateway Dynamic Route Versions.
339 *
340 * @example
341 * ```ts
342 * const response =
343 * await client.aiGateway.dynamicRouting.listVersions(
344 * '54442216',
345 * '54442216',
346 * { account_id: '0d37909e38d3e99c29fa2cd343ac421a' },
347 * );
348 * ```
349 */
350 listVersions(
351 gatewayId: string,
352 id: string,
353 params?: DynamicRoutingListVersionsParams,
354 options?: Core.RequestOptions,
355 ): Core.APIPromise<DynamicRoutingListVersionsResponse>;
356 listVersions(
357 gatewayId: string,
358 id: string,
359 options?: Core.RequestOptions,
360 ): Core.APIPromise<DynamicRoutingListVersionsResponse>;
361 listVersions(
362 gatewayId: string,
363 id: string,
364 params: DynamicRoutingListVersionsParams | Core.RequestOptions = {},
365 options?: Core.RequestOptions,
366 ): Core.APIPromise<DynamicRoutingListVersionsResponse> {
367 if (isRequestOptions(params)) {
368 return this.listVersions(gatewayId, id, {}, params);
369 }
370 const { account_id = this._client.accountId } = params;
371 return this._client.get(
372 `/accounts/${account_id}/ai-gateway/gateways/${gatewayId}/routes/${id}/versions`,
373 options,
374 );
375 }
376}
377
378export interface DynamicRoutingCreateResponse {
379 id: string;
380
381 created_at: string;
382
383 deployment: DynamicRoutingCreateResponse.Deployment;
384
385 elements: Array<
386 | DynamicRoutingCreateResponse.UnionMember0
387 | DynamicRoutingCreateResponse.UnionMember1
388 | DynamicRoutingCreateResponse.UnionMember2
389 | DynamicRoutingCreateResponse.UnionMember3
390 | DynamicRoutingCreateResponse.UnionMember4
391 | DynamicRoutingCreateResponse.UnionMember5
392 >;
393
394 gateway_id: string;
395
396 modified_at: string;
397
398 name: string;
399
400 version: DynamicRoutingCreateResponse.Version;
401}
402
403export namespace DynamicRoutingCreateResponse {
404 export interface Deployment {
405 created_at: string;
406
407 deployment_id: string;
408
409 version_id: string;
410 }
411
412 export interface UnionMember0 {
413 id: string;
414
415 outputs: UnionMember0.Outputs;
416
417 type: 'start';
418 }
419
420 export namespace UnionMember0 {
421 export interface Outputs {
422 next: Outputs.Next;
423 }
424
425 export namespace Outputs {
426 export interface Next {
427 elementId: string;
428 }
429 }
430 }
431
432 export interface UnionMember1 {
433 id: string;
434
435 outputs: UnionMember1.Outputs;
436
437 properties: UnionMember1.Properties;
438
439 type: 'conditional';
440 }
441
442 export namespace UnionMember1 {
443 export interface Outputs {
444 false: Outputs.False;
445
446 true: Outputs.True;
447 }
448
449 export namespace Outputs {
450 export interface False {
451 elementId: string;
452 }
453
454 export interface True {
455 elementId: string;
456 }
457 }
458
459 export interface Properties {
460 conditions?: unknown;
461 }
462 }
463
464 export interface UnionMember2 {
465 id: string;
466
467 outputs: { [key: string]: UnionMember2.Outputs };
468
469 type: 'percentage';
470 }
471
472 export namespace UnionMember2 {
473 export interface Outputs {
474 elementId: string;
475 }
476 }
477
478 export interface UnionMember3 {
479 id: string;
480
481 outputs: UnionMember3.Outputs;
482
483 properties: UnionMember3.Properties;
484
485 type: 'rate';
486 }
487
488 export namespace UnionMember3 {
489 export interface Outputs {
490 fallback: Outputs.Fallback;
491
492 success: Outputs.Success;
493 }
494
495 export namespace Outputs {
496 export interface Fallback {
497 elementId: string;
498 }
499
500 export interface Success {
501 elementId: string;
502 }
503 }
504
505 export interface Properties {
506 key: string;
507
508 limit: number;
509
510 limitType: 'count' | 'cost';
511
512 window: number;
513 }
514 }
515
516 export interface UnionMember4 {
517 id: string;
518
519 outputs: UnionMember4.Outputs;
520
521 properties: UnionMember4.Properties;
522
523 type: 'model';
524 }
525
526 export namespace UnionMember4 {
527 export interface Outputs {
528 fallback: Outputs.Fallback;
529
530 success: Outputs.Success;
531 }
532
533 export namespace Outputs {
534 export interface Fallback {
535 elementId: string;
536 }
537
538 export interface Success {
539 elementId: string;
540 }
541 }
542
543 export interface Properties {
544 model: string;
545
546 provider: string;
547
548 retries: number;
549
550 timeout: number;
551 }
552 }
553
554 export interface UnionMember5 {
555 id: string;
556
557 outputs: { [key: string]: UnionMember5.Outputs };
558
559 type: 'end';
560 }
561
562 export namespace UnionMember5 {
563 export interface Outputs {
564 elementId: string;
565 }
566 }
567
568 export interface Version {
569 active: 'true' | 'false';
570
571 created_at: string;
572
573 data: string;
574
575 version_id: string;
576 }
577}
578
579export interface DynamicRoutingUpdateResponse {
580 route: DynamicRoutingUpdateResponse.Route;
581
582 success: boolean;
583}
584
585export namespace DynamicRoutingUpdateResponse {
586 export interface Route {
587 id: string;
588
589 account_tag: string;
590
591 created_at: string;
592
593 deployment: Route.Deployment;
594
595 elements: Array<
596 | Route.UnionMember0
597 | Route.UnionMember1
598 | Route.UnionMember2
599 | Route.UnionMember3
600 | Route.UnionMember4
601 | Route.UnionMember5
602 >;
603
604 gateway_id: string;
605
606 modified_at: string;
607
608 name: string;
609
610 version: Route.Version;
611 }
612
613 export namespace Route {
614 export interface Deployment {
615 created_at: string;
616
617 deployment_id: string;
618
619 version_id: string;
620 }
621
622 export interface UnionMember0 {
623 id: string;
624
625 outputs: UnionMember0.Outputs;
626
627 type: 'start';
628 }
629
630 export namespace UnionMember0 {
631 export interface Outputs {
632 next: Outputs.Next;
633 }
634
635 export namespace Outputs {
636 export interface Next {
637 elementId: string;
638 }
639 }
640 }
641
642 export interface UnionMember1 {
643 id: string;
644
645 outputs: UnionMember1.Outputs;
646
647 properties: UnionMember1.Properties;
648
649 type: 'conditional';
650 }
651
652 export namespace UnionMember1 {
653 export interface Outputs {
654 false: Outputs.False;
655
656 true: Outputs.True;
657 }
658
659 export namespace Outputs {
660 export interface False {
661 elementId: string;
662 }
663
664 export interface True {
665 elementId: string;
666 }
667 }
668
669 export interface Properties {
670 conditions?: unknown;
671 }
672 }
673
674 export interface UnionMember2 {
675 id: string;
676
677 outputs: { [key: string]: UnionMember2.Outputs };
678
679 type: 'percentage';
680 }
681
682 export namespace UnionMember2 {
683 export interface Outputs {
684 elementId: string;
685 }
686 }
687
688 export interface UnionMember3 {
689 id: string;
690
691 outputs: UnionMember3.Outputs;
692
693 properties: UnionMember3.Properties;
694
695 type: 'rate';
696 }
697
698 export namespace UnionMember3 {
699 export interface Outputs {
700 fallback: Outputs.Fallback;
701
702 success: Outputs.Success;
703 }
704
705 export namespace Outputs {
706 export interface Fallback {
707 elementId: string;
708 }
709
710 export interface Success {
711 elementId: string;
712 }
713 }
714
715 export interface Properties {
716 key: string;
717
718 limit: number;
719
720 limitType: 'count' | 'cost';
721
722 window: number;
723 }
724 }
725
726 export interface UnionMember4 {
727 id: string;
728
729 outputs: UnionMember4.Outputs;
730
731 properties: UnionMember4.Properties;
732
733 type: 'model';
734 }
735
736 export namespace UnionMember4 {
737 export interface Outputs {
738 fallback: Outputs.Fallback;
739
740 success: Outputs.Success;
741 }
742
743 export namespace Outputs {
744 export interface Fallback {
745 elementId: string;
746 }
747
748 export interface Success {
749 elementId: string;
750 }
751 }
752
753 export interface Properties {
754 model: string;
755
756 provider: string;
757
758 retries: number;
759
760 timeout: number;
761 }
762 }
763
764 export interface UnionMember5 {
765 id: string;
766
767 outputs: { [key: string]: UnionMember5.Outputs };
768
769 type: 'end';
770 }
771
772 export namespace UnionMember5 {
773 export interface Outputs {
774 elementId: string;
775 }
776 }
777
778 export interface Version {
779 active: 'true' | 'false';
780
781 created_at: string;
782
783 data: string;
784
785 version_id: string;
786 }
787 }
788}
789
790export interface DynamicRoutingListResponse {
791 data: DynamicRoutingListResponse.Data;
792
793 success: boolean;
794}
795
796export namespace DynamicRoutingListResponse {
797 export interface Data {
798 order_by: string;
799
800 order_by_direction: string;
801
802 page: number;
803
804 per_page: number;
805
806 routes: Array<Data.Route>;
807 }
808
809 export namespace Data {
810 export interface Route {
811 id: string;
812
813 account_tag: string;
814
815 created_at: string;
816
817 deployment: Route.Deployment;
818
819 elements: Array<
820 | Route.UnionMember0
821 | Route.UnionMember1
822 | Route.UnionMember2
823 | Route.UnionMember3
824 | Route.UnionMember4
825 | Route.UnionMember5
826 >;
827
828 gateway_id: string;
829
830 modified_at: string;
831
832 name: string;
833
834 version: Route.Version;
835 }
836
837 export namespace Route {
838 export interface Deployment {
839 created_at: string;
840
841 deployment_id: string;
842
843 version_id: string;
844 }
845
846 export interface UnionMember0 {
847 id: string;
848
849 outputs: UnionMember0.Outputs;
850
851 type: 'start';
852 }
853
854 export namespace UnionMember0 {
855 export interface Outputs {
856 next: Outputs.Next;
857 }
858
859 export namespace Outputs {
860 export interface Next {
861 elementId: string;
862 }
863 }
864 }
865
866 export interface UnionMember1 {
867 id: string;
868
869 outputs: UnionMember1.Outputs;
870
871 properties: UnionMember1.Properties;
872
873 type: 'conditional';
874 }
875
876 export namespace UnionMember1 {
877 export interface Outputs {
878 false: Outputs.False;
879
880 true: Outputs.True;
881 }
882
883 export namespace Outputs {
884 export interface False {
885 elementId: string;
886 }
887
888 export interface True {
889 elementId: string;
890 }
891 }
892
893 export interface Properties {
894 conditions?: unknown;
895 }
896 }
897
898 export interface UnionMember2 {
899 id: string;
900
901 outputs: { [key: string]: UnionMember2.Outputs };
902
903 type: 'percentage';
904 }
905
906 export namespace UnionMember2 {
907 export interface Outputs {
908 elementId: string;
909 }
910 }
911
912 export interface UnionMember3 {
913 id: string;
914
915 outputs: UnionMember3.Outputs;
916
917 properties: UnionMember3.Properties;
918
919 type: 'rate';
920 }
921
922 export namespace UnionMember3 {
923 export interface Outputs {
924 fallback: Outputs.Fallback;
925
926 success: Outputs.Success;
927 }
928
929 export namespace Outputs {
930 export interface Fallback {
931 elementId: string;
932 }
933
934 export interface Success {
935 elementId: string;
936 }
937 }
938
939 export interface Properties {
940 key: string;
941
942 limit: number;
943
944 limitType: 'count' | 'cost';
945
946 window: number;
947 }
948 }
949
950 export interface UnionMember4 {
951 id: string;
952
953 outputs: UnionMember4.Outputs;
954
955 properties: UnionMember4.Properties;
956
957 type: 'model';
958 }
959
960 export namespace UnionMember4 {
961 export interface Outputs {
962 fallback: Outputs.Fallback;
963
964 success: Outputs.Success;
965 }
966
967 export namespace Outputs {
968 export interface Fallback {
969 elementId: string;
970 }
971
972 export interface Success {
973 elementId: string;
974 }
975 }
976
977 export interface Properties {
978 model: string;
979
980 provider: string;
981
982 retries: number;
983
984 timeout: number;
985 }
986 }
987
988 export interface UnionMember5 {
989 id: string;
990
991 outputs: { [key: string]: UnionMember5.Outputs };
992
993 type: 'end';
994 }
995
996 export namespace UnionMember5 {
997 export interface Outputs {
998 elementId: string;
999 }
1000 }
1001
1002 export interface Version {
1003 active: 'true' | 'false';
1004
1005 created_at: string;
1006
1007 data: string;
1008
1009 version_id: string;
1010 }
1011 }
1012 }
1013}
1014
1015export interface DynamicRoutingDeleteResponse {
1016 id: string;
1017
1018 created_at: string;
1019
1020 elements: Array<
1021 | DynamicRoutingDeleteResponse.UnionMember0
1022 | DynamicRoutingDeleteResponse.UnionMember1
1023 | DynamicRoutingDeleteResponse.UnionMember2
1024 | DynamicRoutingDeleteResponse.UnionMember3
1025 | DynamicRoutingDeleteResponse.UnionMember4
1026 | DynamicRoutingDeleteResponse.UnionMember5
1027 >;
1028
1029 gateway_id: string;
1030
1031 modified_at: string;
1032
1033 name: string;
1034}
1035
1036export namespace DynamicRoutingDeleteResponse {
1037 export interface UnionMember0 {
1038 id: string;
1039
1040 outputs: UnionMember0.Outputs;
1041
1042 type: 'start';
1043 }
1044
1045 export namespace UnionMember0 {
1046 export interface Outputs {
1047 next: Outputs.Next;
1048 }
1049
1050 export namespace Outputs {
1051 export interface Next {
1052 elementId: string;
1053 }
1054 }
1055 }
1056
1057 export interface UnionMember1 {
1058 id: string;
1059
1060 outputs: UnionMember1.Outputs;
1061
1062 properties: UnionMember1.Properties;
1063
1064 type: 'conditional';
1065 }
1066
1067 export namespace UnionMember1 {
1068 export interface Outputs {
1069 false: Outputs.False;
1070
1071 true: Outputs.True;
1072 }
1073
1074 export namespace Outputs {
1075 export interface False {
1076 elementId: string;
1077 }
1078
1079 export interface True {
1080 elementId: string;
1081 }
1082 }
1083
1084 export interface Properties {
1085 conditions?: unknown;
1086 }
1087 }
1088
1089 export interface UnionMember2 {
1090 id: string;
1091
1092 outputs: { [key: string]: UnionMember2.Outputs };
1093
1094 type: 'percentage';
1095 }
1096
1097 export namespace UnionMember2 {
1098 export interface Outputs {
1099 elementId: string;
1100 }
1101 }
1102
1103 export interface UnionMember3 {
1104 id: string;
1105
1106 outputs: UnionMember3.Outputs;
1107
1108 properties: UnionMember3.Properties;
1109
1110 type: 'rate';
1111 }
1112
1113 export namespace UnionMember3 {
1114 export interface Outputs {
1115 fallback: Outputs.Fallback;
1116
1117 success: Outputs.Success;
1118 }
1119
1120 export namespace Outputs {
1121 export interface Fallback {
1122 elementId: string;
1123 }
1124
1125 export interface Success {
1126 elementId: string;
1127 }
1128 }
1129
1130 export interface Properties {
1131 key: string;
1132
1133 limit: number;
1134
1135 limitType: 'count' | 'cost';
1136
1137 window: number;
1138 }
1139 }
1140
1141 export interface UnionMember4 {
1142 id: string;
1143
1144 outputs: UnionMember4.Outputs;
1145
1146 properties: UnionMember4.Properties;
1147
1148 type: 'model';
1149 }
1150
1151 export namespace UnionMember4 {
1152 export interface Outputs {
1153 fallback: Outputs.Fallback;
1154
1155 success: Outputs.Success;
1156 }
1157
1158 export namespace Outputs {
1159 export interface Fallback {
1160 elementId: string;
1161 }
1162
1163 export interface Success {
1164 elementId: string;
1165 }
1166 }
1167
1168 export interface Properties {
1169 model: string;
1170
1171 provider: string;
1172
1173 retries: number;
1174
1175 timeout: number;
1176 }
1177 }
1178
1179 export interface UnionMember5 {
1180 id: string;
1181
1182 outputs: { [key: string]: UnionMember5.Outputs };
1183
1184 type: 'end';
1185 }
1186
1187 export namespace UnionMember5 {
1188 export interface Outputs {
1189 elementId: string;
1190 }
1191 }
1192}
1193
1194export interface DynamicRoutingCreateDeploymentResponse {
1195 id: string;
1196
1197 created_at: string;
1198
1199 elements: Array<
1200 | DynamicRoutingCreateDeploymentResponse.UnionMember0
1201 | DynamicRoutingCreateDeploymentResponse.UnionMember1
1202 | DynamicRoutingCreateDeploymentResponse.UnionMember2
1203 | DynamicRoutingCreateDeploymentResponse.UnionMember3
1204 | DynamicRoutingCreateDeploymentResponse.UnionMember4
1205 | DynamicRoutingCreateDeploymentResponse.UnionMember5
1206 >;
1207
1208 gateway_id: string;
1209
1210 modified_at: string;
1211
1212 name: string;
1213}
1214
1215export namespace DynamicRoutingCreateDeploymentResponse {
1216 export interface UnionMember0 {
1217 id: string;
1218
1219 outputs: UnionMember0.Outputs;
1220
1221 type: 'start';
1222 }
1223
1224 export namespace UnionMember0 {
1225 export interface Outputs {
1226 next: Outputs.Next;
1227 }
1228
1229 export namespace Outputs {
1230 export interface Next {
1231 elementId: string;
1232 }
1233 }
1234 }
1235
1236 export interface UnionMember1 {
1237 id: string;
1238
1239 outputs: UnionMember1.Outputs;
1240
1241 properties: UnionMember1.Properties;
1242
1243 type: 'conditional';
1244 }
1245
1246 export namespace UnionMember1 {
1247 export interface Outputs {
1248 false: Outputs.False;
1249
1250 true: Outputs.True;
1251 }
1252
1253 export namespace Outputs {
1254 export interface False {
1255 elementId: string;
1256 }
1257
1258 export interface True {
1259 elementId: string;
1260 }
1261 }
1262
1263 export interface Properties {
1264 conditions?: unknown;
1265 }
1266 }
1267
1268 export interface UnionMember2 {
1269 id: string;
1270
1271 outputs: { [key: string]: UnionMember2.Outputs };
1272
1273 type: 'percentage';
1274 }
1275
1276 export namespace UnionMember2 {
1277 export interface Outputs {
1278 elementId: string;
1279 }
1280 }
1281
1282 export interface UnionMember3 {
1283 id: string;
1284
1285 outputs: UnionMember3.Outputs;
1286
1287 properties: UnionMember3.Properties;
1288
1289 type: 'rate';
1290 }
1291
1292 export namespace UnionMember3 {
1293 export interface Outputs {
1294 fallback: Outputs.Fallback;
1295
1296 success: Outputs.Success;
1297 }
1298
1299 export namespace Outputs {
1300 export interface Fallback {
1301 elementId: string;
1302 }
1303
1304 export interface Success {
1305 elementId: string;
1306 }
1307 }
1308
1309 export interface Properties {
1310 key: string;
1311
1312 limit: number;
1313
1314 limitType: 'count' | 'cost';
1315
1316 window: number;
1317 }
1318 }
1319
1320 export interface UnionMember4 {
1321 id: string;
1322
1323 outputs: UnionMember4.Outputs;
1324
1325 properties: UnionMember4.Properties;
1326
1327 type: 'model';
1328 }
1329
1330 export namespace UnionMember4 {
1331 export interface Outputs {
1332 fallback: Outputs.Fallback;
1333
1334 success: Outputs.Success;
1335 }
1336
1337 export namespace Outputs {
1338 export interface Fallback {
1339 elementId: string;
1340 }
1341
1342 export interface Success {
1343 elementId: string;
1344 }
1345 }
1346
1347 export interface Properties {
1348 model: string;
1349
1350 provider: string;
1351
1352 retries: number;
1353
1354 timeout: number;
1355 }
1356 }
1357
1358 export interface UnionMember5 {
1359 id: string;
1360
1361 outputs: { [key: string]: UnionMember5.Outputs };
1362
1363 type: 'end';
1364 }
1365
1366 export namespace UnionMember5 {
1367 export interface Outputs {
1368 elementId: string;
1369 }
1370 }
1371}
1372
1373export interface DynamicRoutingCreateVersionResponse {
1374 id: string;
1375
1376 created_at: string;
1377
1378 elements: Array<
1379 | DynamicRoutingCreateVersionResponse.UnionMember0
1380 | DynamicRoutingCreateVersionResponse.UnionMember1
1381 | DynamicRoutingCreateVersionResponse.UnionMember2
1382 | DynamicRoutingCreateVersionResponse.UnionMember3
1383 | DynamicRoutingCreateVersionResponse.UnionMember4
1384 | DynamicRoutingCreateVersionResponse.UnionMember5
1385 >;
1386
1387 gateway_id: string;
1388
1389 modified_at: string;
1390
1391 name: string;
1392}
1393
1394export namespace DynamicRoutingCreateVersionResponse {
1395 export interface UnionMember0 {
1396 id: string;
1397
1398 outputs: UnionMember0.Outputs;
1399
1400 type: 'start';
1401 }
1402
1403 export namespace UnionMember0 {
1404 export interface Outputs {
1405 next: Outputs.Next;
1406 }
1407
1408 export namespace Outputs {
1409 export interface Next {
1410 elementId: string;
1411 }
1412 }
1413 }
1414
1415 export interface UnionMember1 {
1416 id: string;
1417
1418 outputs: UnionMember1.Outputs;
1419
1420 properties: UnionMember1.Properties;
1421
1422 type: 'conditional';
1423 }
1424
1425 export namespace UnionMember1 {
1426 export interface Outputs {
1427 false: Outputs.False;
1428
1429 true: Outputs.True;
1430 }
1431
1432 export namespace Outputs {
1433 export interface False {
1434 elementId: string;
1435 }
1436
1437 export interface True {
1438 elementId: string;
1439 }
1440 }
1441
1442 export interface Properties {
1443 conditions?: unknown;
1444 }
1445 }
1446
1447 export interface UnionMember2 {
1448 id: string;
1449
1450 outputs: { [key: string]: UnionMember2.Outputs };
1451
1452 type: 'percentage';
1453 }
1454
1455 export namespace UnionMember2 {
1456 export interface Outputs {
1457 elementId: string;
1458 }
1459 }
1460
1461 export interface UnionMember3 {
1462 id: string;
1463
1464 outputs: UnionMember3.Outputs;
1465
1466 properties: UnionMember3.Properties;
1467
1468 type: 'rate';
1469 }
1470
1471 export namespace UnionMember3 {
1472 export interface Outputs {
1473 fallback: Outputs.Fallback;
1474
1475 success: Outputs.Success;
1476 }
1477
1478 export namespace Outputs {
1479 export interface Fallback {
1480 elementId: string;
1481 }
1482
1483 export interface Success {
1484 elementId: string;
1485 }
1486 }
1487
1488 export interface Properties {
1489 key: string;
1490
1491 limit: number;
1492
1493 limitType: 'count' | 'cost';
1494
1495 window: number;
1496 }
1497 }
1498
1499 export interface UnionMember4 {
1500 id: string;
1501
1502 outputs: UnionMember4.Outputs;
1503
1504 properties: UnionMember4.Properties;
1505
1506 type: 'model';
1507 }
1508
1509 export namespace UnionMember4 {
1510 export interface Outputs {
1511 fallback: Outputs.Fallback;
1512
1513 success: Outputs.Success;
1514 }
1515
1516 export namespace Outputs {
1517 export interface Fallback {
1518 elementId: string;
1519 }
1520
1521 export interface Success {
1522 elementId: string;
1523 }
1524 }
1525
1526 export interface Properties {
1527 model: string;
1528
1529 provider: string;
1530
1531 retries: number;
1532
1533 timeout: number;
1534 }
1535 }
1536
1537 export interface UnionMember5 {
1538 id: string;
1539
1540 outputs: { [key: string]: UnionMember5.Outputs };
1541
1542 type: 'end';
1543 }
1544
1545 export namespace UnionMember5 {
1546 export interface Outputs {
1547 elementId: string;
1548 }
1549 }
1550}
1551
1552export interface DynamicRoutingGetResponse {
1553 id: string;
1554
1555 created_at: string;
1556
1557 deployment: DynamicRoutingGetResponse.Deployment;
1558
1559 elements: Array<
1560 | DynamicRoutingGetResponse.UnionMember0
1561 | DynamicRoutingGetResponse.UnionMember1
1562 | DynamicRoutingGetResponse.UnionMember2
1563 | DynamicRoutingGetResponse.UnionMember3
1564 | DynamicRoutingGetResponse.UnionMember4
1565 | DynamicRoutingGetResponse.UnionMember5
1566 >;
1567
1568 gateway_id: string;
1569
1570 modified_at: string;
1571
1572 name: string;
1573
1574 version: DynamicRoutingGetResponse.Version;
1575}
1576
1577export namespace DynamicRoutingGetResponse {
1578 export interface Deployment {
1579 created_at: string;
1580
1581 deployment_id: string;
1582
1583 version_id: string;
1584 }
1585
1586 export interface UnionMember0 {
1587 id: string;
1588
1589 outputs: UnionMember0.Outputs;
1590
1591 type: 'start';
1592 }
1593
1594 export namespace UnionMember0 {
1595 export interface Outputs {
1596 next: Outputs.Next;
1597 }
1598
1599 export namespace Outputs {
1600 export interface Next {
1601 elementId: string;
1602 }
1603 }
1604 }
1605
1606 export interface UnionMember1 {
1607 id: string;
1608
1609 outputs: UnionMember1.Outputs;
1610
1611 properties: UnionMember1.Properties;
1612
1613 type: 'conditional';
1614 }
1615
1616 export namespace UnionMember1 {
1617 export interface Outputs {
1618 false: Outputs.False;
1619
1620 true: Outputs.True;
1621 }
1622
1623 export namespace Outputs {
1624 export interface False {
1625 elementId: string;
1626 }
1627
1628 export interface True {
1629 elementId: string;
1630 }
1631 }
1632
1633 export interface Properties {
1634 conditions?: unknown;
1635 }
1636 }
1637
1638 export interface UnionMember2 {
1639 id: string;
1640
1641 outputs: { [key: string]: UnionMember2.Outputs };
1642
1643 type: 'percentage';
1644 }
1645
1646 export namespace UnionMember2 {
1647 export interface Outputs {
1648 elementId: string;
1649 }
1650 }
1651
1652 export interface UnionMember3 {
1653 id: string;
1654
1655 outputs: UnionMember3.Outputs;
1656
1657 properties: UnionMember3.Properties;
1658
1659 type: 'rate';
1660 }
1661
1662 export namespace UnionMember3 {
1663 export interface Outputs {
1664 fallback: Outputs.Fallback;
1665
1666 success: Outputs.Success;
1667 }
1668
1669 export namespace Outputs {
1670 export interface Fallback {
1671 elementId: string;
1672 }
1673
1674 export interface Success {
1675 elementId: string;
1676 }
1677 }
1678
1679 export interface Properties {
1680 key: string;
1681
1682 limit: number;
1683
1684 limitType: 'count' | 'cost';
1685
1686 window: number;
1687 }
1688 }
1689
1690 export interface UnionMember4 {
1691 id: string;
1692
1693 outputs: UnionMember4.Outputs;
1694
1695 properties: UnionMember4.Properties;
1696
1697 type: 'model';
1698 }
1699
1700 export namespace UnionMember4 {
1701 export interface Outputs {
1702 fallback: Outputs.Fallback;
1703
1704 success: Outputs.Success;
1705 }
1706
1707 export namespace Outputs {
1708 export interface Fallback {
1709 elementId: string;
1710 }
1711
1712 export interface Success {
1713 elementId: string;
1714 }
1715 }
1716
1717 export interface Properties {
1718 model: string;
1719
1720 provider: string;
1721
1722 retries: number;
1723
1724 timeout: number;
1725 }
1726 }
1727
1728 export interface UnionMember5 {
1729 id: string;
1730
1731 outputs: { [key: string]: UnionMember5.Outputs };
1732
1733 type: 'end';
1734 }
1735
1736 export namespace UnionMember5 {
1737 export interface Outputs {
1738 elementId: string;
1739 }
1740 }
1741
1742 export interface Version {
1743 active: 'true' | 'false';
1744
1745 created_at: string;
1746
1747 data: string;
1748
1749 version_id: string;
1750 }
1751}
1752
1753export interface DynamicRoutingGetVersionResponse {
1754 id: string;
1755
1756 active: 'true' | 'false';
1757
1758 created_at: string;
1759
1760 data: string;
1761
1762 elements: Array<
1763 | DynamicRoutingGetVersionResponse.UnionMember0
1764 | DynamicRoutingGetVersionResponse.UnionMember1
1765 | DynamicRoutingGetVersionResponse.UnionMember2
1766 | DynamicRoutingGetVersionResponse.UnionMember3
1767 | DynamicRoutingGetVersionResponse.UnionMember4
1768 | DynamicRoutingGetVersionResponse.UnionMember5
1769 >;
1770
1771 gateway_id: string;
1772
1773 modified_at: string;
1774
1775 name: string;
1776
1777 version_id: string;
1778}
1779
1780export namespace DynamicRoutingGetVersionResponse {
1781 export interface UnionMember0 {
1782 id: string;
1783
1784 outputs: UnionMember0.Outputs;
1785
1786 type: 'start';
1787 }
1788
1789 export namespace UnionMember0 {
1790 export interface Outputs {
1791 next: Outputs.Next;
1792 }
1793
1794 export namespace Outputs {
1795 export interface Next {
1796 elementId: string;
1797 }
1798 }
1799 }
1800
1801 export interface UnionMember1 {
1802 id: string;
1803
1804 outputs: UnionMember1.Outputs;
1805
1806 properties: UnionMember1.Properties;
1807
1808 type: 'conditional';
1809 }
1810
1811 export namespace UnionMember1 {
1812 export interface Outputs {
1813 false: Outputs.False;
1814
1815 true: Outputs.True;
1816 }
1817
1818 export namespace Outputs {
1819 export interface False {
1820 elementId: string;
1821 }
1822
1823 export interface True {
1824 elementId: string;
1825 }
1826 }
1827
1828 export interface Properties {
1829 conditions?: unknown;
1830 }
1831 }
1832
1833 export interface UnionMember2 {
1834 id: string;
1835
1836 outputs: { [key: string]: UnionMember2.Outputs };
1837
1838 type: 'percentage';
1839 }
1840
1841 export namespace UnionMember2 {
1842 export interface Outputs {
1843 elementId: string;
1844 }
1845 }
1846
1847 export interface UnionMember3 {
1848 id: string;
1849
1850 outputs: UnionMember3.Outputs;
1851
1852 properties: UnionMember3.Properties;
1853
1854 type: 'rate';
1855 }
1856
1857 export namespace UnionMember3 {
1858 export interface Outputs {
1859 fallback: Outputs.Fallback;
1860
1861 success: Outputs.Success;
1862 }
1863
1864 export namespace Outputs {
1865 export interface Fallback {
1866 elementId: string;
1867 }
1868
1869 export interface Success {
1870 elementId: string;
1871 }
1872 }
1873
1874 export interface Properties {
1875 key: string;
1876
1877 limit: number;
1878
1879 limitType: 'count' | 'cost';
1880
1881 window: number;
1882 }
1883 }
1884
1885 export interface UnionMember4 {
1886 id: string;
1887
1888 outputs: UnionMember4.Outputs;
1889
1890 properties: UnionMember4.Properties;
1891
1892 type: 'model';
1893 }
1894
1895 export namespace UnionMember4 {
1896 export interface Outputs {
1897 fallback: Outputs.Fallback;
1898
1899 success: Outputs.Success;
1900 }
1901
1902 export namespace Outputs {
1903 export interface Fallback {
1904 elementId: string;
1905 }
1906
1907 export interface Success {
1908 elementId: string;
1909 }
1910 }
1911
1912 export interface Properties {
1913 model: string;
1914
1915 provider: string;
1916
1917 retries: number;
1918
1919 timeout: number;
1920 }
1921 }
1922
1923 export interface UnionMember5 {
1924 id: string;
1925
1926 outputs: { [key: string]: UnionMember5.Outputs };
1927
1928 type: 'end';
1929 }
1930
1931 export namespace UnionMember5 {
1932 export interface Outputs {
1933 elementId: string;
1934 }
1935 }
1936}
1937
1938export interface DynamicRoutingListDeploymentsResponse {
1939 data: DynamicRoutingListDeploymentsResponse.Data;
1940
1941 success: boolean;
1942}
1943
1944export namespace DynamicRoutingListDeploymentsResponse {
1945 export interface Data {
1946 deployments: Array<Data.Deployment>;
1947
1948 order_by: string;
1949
1950 order_by_direction: string;
1951
1952 page: number;
1953
1954 per_page: number;
1955 }
1956
1957 export namespace Data {
1958 export interface Deployment {
1959 created_at: string;
1960
1961 deployment_id: string;
1962
1963 version_id: string;
1964 }
1965 }
1966}
1967
1968export interface DynamicRoutingListVersionsResponse {
1969 data: DynamicRoutingListVersionsResponse.Data;
1970
1971 success: boolean;
1972}
1973
1974export namespace DynamicRoutingListVersionsResponse {
1975 export interface Data {
1976 order_by: string;
1977
1978 order_by_direction: string;
1979
1980 page: number;
1981
1982 per_page: number;
1983
1984 versions: Array<Data.Version>;
1985 }
1986
1987 export namespace Data {
1988 export interface Version {
1989 active: 'true' | 'false';
1990
1991 created_at: string;
1992
1993 data: string;
1994
1995 version_id: string;
1996 }
1997 }
1998}
1999
2000export interface DynamicRoutingCreateParams {
2001 /**
2002 * Path param
2003 */
2004 account_id?: string;
2005
2006 /**
2007 * Body param
2008 */
2009 elements: Array<
2010 | DynamicRoutingCreateParams.UnionMember0
2011 | DynamicRoutingCreateParams.UnionMember1
2012 | DynamicRoutingCreateParams.UnionMember2
2013 | DynamicRoutingCreateParams.UnionMember3
2014 | DynamicRoutingCreateParams.UnionMember4
2015 | DynamicRoutingCreateParams.UnionMember5
2016 >;
2017
2018 /**
2019 * Body param
2020 */
2021 name: string;
2022}
2023
2024export namespace DynamicRoutingCreateParams {
2025 export interface UnionMember0 {
2026 id: string;
2027
2028 outputs: UnionMember0.Outputs;
2029
2030 type: 'start';
2031 }
2032
2033 export namespace UnionMember0 {
2034 export interface Outputs {
2035 next: Outputs.Next;
2036 }
2037
2038 export namespace Outputs {
2039 export interface Next {
2040 elementId: string;
2041 }
2042 }
2043 }
2044
2045 export interface UnionMember1 {
2046 id: string;
2047
2048 outputs: UnionMember1.Outputs;
2049
2050 properties: UnionMember1.Properties;
2051
2052 type: 'conditional';
2053 }
2054
2055 export namespace UnionMember1 {
2056 export interface Outputs {
2057 false: Outputs.False;
2058
2059 true: Outputs.True;
2060 }
2061
2062 export namespace Outputs {
2063 export interface False {
2064 elementId: string;
2065 }
2066
2067 export interface True {
2068 elementId: string;
2069 }
2070 }
2071
2072 export interface Properties {
2073 conditions?: unknown;
2074 }
2075 }
2076
2077 export interface UnionMember2 {
2078 id: string;
2079
2080 outputs: { [key: string]: UnionMember2.Outputs };
2081
2082 type: 'percentage';
2083 }
2084
2085 export namespace UnionMember2 {
2086 export interface Outputs {
2087 elementId: string;
2088 }
2089 }
2090
2091 export interface UnionMember3 {
2092 id: string;
2093
2094 outputs: UnionMember3.Outputs;
2095
2096 properties: UnionMember3.Properties;
2097
2098 type: 'rate';
2099 }
2100
2101 export namespace UnionMember3 {
2102 export interface Outputs {
2103 fallback: Outputs.Fallback;
2104
2105 success: Outputs.Success;
2106 }
2107
2108 export namespace Outputs {
2109 export interface Fallback {
2110 elementId: string;
2111 }
2112
2113 export interface Success {
2114 elementId: string;
2115 }
2116 }
2117
2118 export interface Properties {
2119 key: string;
2120
2121 limit: number;
2122
2123 limitType: 'count' | 'cost';
2124
2125 window: number;
2126 }
2127 }
2128
2129 export interface UnionMember4 {
2130 id: string;
2131
2132 outputs: UnionMember4.Outputs;
2133
2134 properties: UnionMember4.Properties;
2135
2136 type: 'model';
2137 }
2138
2139 export namespace UnionMember4 {
2140 export interface Outputs {
2141 fallback: Outputs.Fallback;
2142
2143 success: Outputs.Success;
2144 }
2145
2146 export namespace Outputs {
2147 export interface Fallback {
2148 elementId: string;
2149 }
2150
2151 export interface Success {
2152 elementId: string;
2153 }
2154 }
2155
2156 export interface Properties {
2157 model: string;
2158
2159 provider: string;
2160
2161 retries: number;
2162
2163 timeout: number;
2164 }
2165 }
2166
2167 export interface UnionMember5 {
2168 id: string;
2169
2170 outputs: { [key: string]: UnionMember5.Outputs };
2171
2172 type: 'end';
2173 }
2174
2175 export namespace UnionMember5 {
2176 export interface Outputs {
2177 elementId: string;
2178 }
2179 }
2180}
2181
2182export interface DynamicRoutingUpdateParams {
2183 /**
2184 * Path param
2185 */
2186 account_id?: string;
2187
2188 /**
2189 * Body param
2190 */
2191 name: string;
2192}
2193
2194export interface DynamicRoutingListParams {
2195 account_id?: string;
2196}
2197
2198export interface DynamicRoutingDeleteParams {
2199 account_id?: string;
2200}
2201
2202export interface DynamicRoutingCreateDeploymentParams {
2203 /**
2204 * Path param
2205 */
2206 account_id?: string;
2207
2208 /**
2209 * Body param
2210 */
2211 version_id: string;
2212}
2213
2214export interface DynamicRoutingCreateVersionParams {
2215 /**
2216 * Path param
2217 */
2218 account_id?: string;
2219
2220 /**
2221 * Body param
2222 */
2223 elements: Array<
2224 | DynamicRoutingCreateVersionParams.UnionMember0
2225 | DynamicRoutingCreateVersionParams.UnionMember1
2226 | DynamicRoutingCreateVersionParams.UnionMember2
2227 | DynamicRoutingCreateVersionParams.UnionMember3
2228 | DynamicRoutingCreateVersionParams.UnionMember4
2229 | DynamicRoutingCreateVersionParams.UnionMember5
2230 >;
2231}
2232
2233export namespace DynamicRoutingCreateVersionParams {
2234 export interface UnionMember0 {
2235 id: string;
2236
2237 outputs: UnionMember0.Outputs;
2238
2239 type: 'start';
2240 }
2241
2242 export namespace UnionMember0 {
2243 export interface Outputs {
2244 next: Outputs.Next;
2245 }
2246
2247 export namespace Outputs {
2248 export interface Next {
2249 elementId: string;
2250 }
2251 }
2252 }
2253
2254 export interface UnionMember1 {
2255 id: string;
2256
2257 outputs: UnionMember1.Outputs;
2258
2259 properties: UnionMember1.Properties;
2260
2261 type: 'conditional';
2262 }
2263
2264 export namespace UnionMember1 {
2265 export interface Outputs {
2266 false: Outputs.False;
2267
2268 true: Outputs.True;
2269 }
2270
2271 export namespace Outputs {
2272 export interface False {
2273 elementId: string;
2274 }
2275
2276 export interface True {
2277 elementId: string;
2278 }
2279 }
2280
2281 export interface Properties {
2282 conditions?: unknown;
2283 }
2284 }
2285
2286 export interface UnionMember2 {
2287 id: string;
2288
2289 outputs: { [key: string]: UnionMember2.Outputs };
2290
2291 type: 'percentage';
2292 }
2293
2294 export namespace UnionMember2 {
2295 export interface Outputs {
2296 elementId: string;
2297 }
2298 }
2299
2300 export interface UnionMember3 {
2301 id: string;
2302
2303 outputs: UnionMember3.Outputs;
2304
2305 properties: UnionMember3.Properties;
2306
2307 type: 'rate';
2308 }
2309
2310 export namespace UnionMember3 {
2311 export interface Outputs {
2312 fallback: Outputs.Fallback;
2313
2314 success: Outputs.Success;
2315 }
2316
2317 export namespace Outputs {
2318 export interface Fallback {
2319 elementId: string;
2320 }
2321
2322 export interface Success {
2323 elementId: string;
2324 }
2325 }
2326
2327 export interface Properties {
2328 key: string;
2329
2330 limit: number;
2331
2332 limitType: 'count' | 'cost';
2333
2334 window: number;
2335 }
2336 }
2337
2338 export interface UnionMember4 {
2339 id: string;
2340
2341 outputs: UnionMember4.Outputs;
2342
2343 properties: UnionMember4.Properties;
2344
2345 type: 'model';
2346 }
2347
2348 export namespace UnionMember4 {
2349 export interface Outputs {
2350 fallback: Outputs.Fallback;
2351
2352 success: Outputs.Success;
2353 }
2354
2355 export namespace Outputs {
2356 export interface Fallback {
2357 elementId: string;
2358 }
2359
2360 export interface Success {
2361 elementId: string;
2362 }
2363 }
2364
2365 export interface Properties {
2366 model: string;
2367
2368 provider: string;
2369
2370 retries: number;
2371
2372 timeout: number;
2373 }
2374 }
2375
2376 export interface UnionMember5 {
2377 id: string;
2378
2379 outputs: { [key: string]: UnionMember5.Outputs };
2380
2381 type: 'end';
2382 }
2383
2384 export namespace UnionMember5 {
2385 export interface Outputs {
2386 elementId: string;
2387 }
2388 }
2389}
2390
2391export interface DynamicRoutingGetParams {
2392 account_id?: string;
2393}
2394
2395export interface DynamicRoutingGetVersionParams {
2396 account_id?: string;
2397}
2398
2399export interface DynamicRoutingListDeploymentsParams {
2400 account_id?: string;
2401}
2402
2403export interface DynamicRoutingListVersionsParams {
2404 account_id?: string;
2405}
2406
2407export declare namespace DynamicRouting {
2408 export {
2409 type DynamicRoutingCreateResponse as DynamicRoutingCreateResponse,
2410 type DynamicRoutingUpdateResponse as DynamicRoutingUpdateResponse,
2411 type DynamicRoutingListResponse as DynamicRoutingListResponse,
2412 type DynamicRoutingDeleteResponse as DynamicRoutingDeleteResponse,
2413 type DynamicRoutingCreateDeploymentResponse as DynamicRoutingCreateDeploymentResponse,
2414 type DynamicRoutingCreateVersionResponse as DynamicRoutingCreateVersionResponse,
2415 type DynamicRoutingGetResponse as DynamicRoutingGetResponse,
2416 type DynamicRoutingGetVersionResponse as DynamicRoutingGetVersionResponse,
2417 type DynamicRoutingListDeploymentsResponse as DynamicRoutingListDeploymentsResponse,
2418 type DynamicRoutingListVersionsResponse as DynamicRoutingListVersionsResponse,
2419 type DynamicRoutingCreateParams as DynamicRoutingCreateParams,
2420 type DynamicRoutingUpdateParams as DynamicRoutingUpdateParams,
2421 type DynamicRoutingListParams as DynamicRoutingListParams,
2422 type DynamicRoutingDeleteParams as DynamicRoutingDeleteParams,
2423 type DynamicRoutingCreateDeploymentParams as DynamicRoutingCreateDeploymentParams,
2424 type DynamicRoutingCreateVersionParams as DynamicRoutingCreateVersionParams,
2425 type DynamicRoutingGetParams as DynamicRoutingGetParams,
2426 type DynamicRoutingGetVersionParams as DynamicRoutingGetVersionParams,
2427 type DynamicRoutingListDeploymentsParams as DynamicRoutingListDeploymentsParams,
2428 type DynamicRoutingListVersionsParams as DynamicRoutingListVersionsParams,
2429 };
2430}
2431