cloudflare/cloudflare-typescript

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
v4.2.0

Branches

Tags

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

Clone

HTTPS

Download ZIP

src/resources/argo/smart-routing.ts

68lines · modecode

1// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
3import { APIResource } from '../../resource';
4import * as Core from '../../core';
5
6export class SmartRouting extends APIResource {
7 /**
8 * Updates enablement of Argo Smart Routing.
9 */
10 edit(
11 params: SmartRoutingEditParams,
12 options?: Core.RequestOptions,
13 ): Core.APIPromise<SmartRoutingEditResponse> {
14 const { zone_id, ...body } = params;
15 return (
16 this._client.patch(`/zones/${zone_id}/argo/smart_routing`, { body, ...options }) as Core.APIPromise<{
17 result: SmartRoutingEditResponse;
18 }>
19 )._thenUnwrap((obj) => obj.result);
20 }
21
22 /**
23 * Get Argo Smart Routing setting
24 */
25 get(
26 params: SmartRoutingGetParams,
27 options?: Core.RequestOptions,
28 ): Core.APIPromise<SmartRoutingGetResponse> {
29 const { zone_id } = params;
30 return (
31 this._client.get(`/zones/${zone_id}/argo/smart_routing`, options) as Core.APIPromise<{
32 result: SmartRoutingGetResponse;
33 }>
34 )._thenUnwrap((obj) => obj.result);
35 }
36}
37
38export type SmartRoutingEditResponse = unknown | string | null;
39
40export type SmartRoutingGetResponse = unknown | string | null;
41
42export interface SmartRoutingEditParams {
43 /**
44 * Path param: Identifier
45 */
46 zone_id: string;
47
48 /**
49 * Body param: Enables Argo Smart Routing.
50 */
51 value: 'on' | 'off';
52}
53
54export interface SmartRoutingGetParams {
55 /**
56 * Identifier
57 */
58 zone_id: string;
59}
60
61export declare namespace SmartRouting {
62 export {
63 type SmartRoutingEditResponse as SmartRoutingEditResponse,
64 type SmartRoutingGetResponse as SmartRoutingGetResponse,
65 type SmartRoutingEditParams as SmartRoutingEditParams,
66 type SmartRoutingGetParams as SmartRoutingGetParams,
67 };
68}
69