|
| 1 | +// This file is auto-generated, don't edit it |
| 2 | +/** |
| 3 | + * |
| 4 | + */ |
| 5 | +import Util, * as $Util from '@alicloud/tea-util'; |
| 6 | +import OpenApi, * as $OpenApi from '@alicloud/openapi-client'; |
| 7 | +import EndpointUtil from '@alicloud/endpoint-util'; |
| 8 | +import * as $tea from '@alicloud/tea-typescript'; |
| 9 | + |
| 10 | +export class DefaultDegradeRuleRequest extends $tea.Model { |
| 11 | + request?: string; |
| 12 | + response?: string; |
| 13 | + RT?: number; |
| 14 | + responseSize?: number; |
| 15 | + static names(): { [key: string]: string } { |
| 16 | + return { |
| 17 | + request: 'Request', |
| 18 | + response: 'Response', |
| 19 | + RT: 'RT', |
| 20 | + responseSize: 'ResponseSize', |
| 21 | + }; |
| 22 | + } |
| 23 | + |
| 24 | + static types(): { [key: string]: any } { |
| 25 | + return { |
| 26 | + request: 'string', |
| 27 | + response: 'string', |
| 28 | + RT: 'number', |
| 29 | + responseSize: 'number', |
| 30 | + }; |
| 31 | + } |
| 32 | + |
| 33 | + constructor(map?: { [key: string]: any }) { |
| 34 | + super(map); |
| 35 | + } |
| 36 | +} |
| 37 | + |
| 38 | +export class DefaultDegradeRuleResponseBody extends $tea.Model { |
| 39 | + requestId?: string; |
| 40 | + size?: string; |
| 41 | + value?: string; |
| 42 | + static names(): { [key: string]: string } { |
| 43 | + return { |
| 44 | + requestId: 'RequestId', |
| 45 | + size: 'Size', |
| 46 | + value: 'Value', |
| 47 | + }; |
| 48 | + } |
| 49 | + |
| 50 | + static types(): { [key: string]: any } { |
| 51 | + return { |
| 52 | + requestId: 'string', |
| 53 | + size: 'string', |
| 54 | + value: 'string', |
| 55 | + }; |
| 56 | + } |
| 57 | + |
| 58 | + constructor(map?: { [key: string]: any }) { |
| 59 | + super(map); |
| 60 | + } |
| 61 | +} |
| 62 | + |
| 63 | +export class DefaultDegradeRuleResponse extends $tea.Model { |
| 64 | + headers: { [key: string]: string }; |
| 65 | + body: DefaultDegradeRuleResponseBody; |
| 66 | + static names(): { [key: string]: string } { |
| 67 | + return { |
| 68 | + headers: 'headers', |
| 69 | + body: 'body', |
| 70 | + }; |
| 71 | + } |
| 72 | + |
| 73 | + static types(): { [key: string]: any } { |
| 74 | + return { |
| 75 | + headers: { 'type': 'map', 'keyType': 'string', 'valueType': 'string' }, |
| 76 | + body: DefaultDegradeRuleResponseBody, |
| 77 | + }; |
| 78 | + } |
| 79 | + |
| 80 | + constructor(map?: { [key: string]: any }) { |
| 81 | + super(map); |
| 82 | + } |
| 83 | +} |
| 84 | + |
| 85 | +export class DefaultDegradeRuleTestRequest extends $tea.Model { |
| 86 | + request?: string; |
| 87 | + response?: string; |
| 88 | + RT?: number; |
| 89 | + responseSize?: number; |
| 90 | + static names(): { [key: string]: string } { |
| 91 | + return { |
| 92 | + request: 'Request', |
| 93 | + response: 'Response', |
| 94 | + RT: 'RT', |
| 95 | + responseSize: 'ResponseSize', |
| 96 | + }; |
| 97 | + } |
| 98 | + |
| 99 | + static types(): { [key: string]: any } { |
| 100 | + return { |
| 101 | + request: 'string', |
| 102 | + response: 'string', |
| 103 | + RT: 'number', |
| 104 | + responseSize: 'number', |
| 105 | + }; |
| 106 | + } |
| 107 | + |
| 108 | + constructor(map?: { [key: string]: any }) { |
| 109 | + super(map); |
| 110 | + } |
| 111 | +} |
| 112 | + |
| 113 | +export class DefaultDegradeRuleTestResponseBody extends $tea.Model { |
| 114 | + requestId?: string; |
| 115 | + size?: string; |
| 116 | + value?: string; |
| 117 | + static names(): { [key: string]: string } { |
| 118 | + return { |
| 119 | + requestId: 'RequestId', |
| 120 | + size: 'Size', |
| 121 | + value: 'Value', |
| 122 | + }; |
| 123 | + } |
| 124 | + |
| 125 | + static types(): { [key: string]: any } { |
| 126 | + return { |
| 127 | + requestId: 'string', |
| 128 | + size: 'string', |
| 129 | + value: 'string', |
| 130 | + }; |
| 131 | + } |
| 132 | + |
| 133 | + constructor(map?: { [key: string]: any }) { |
| 134 | + super(map); |
| 135 | + } |
| 136 | +} |
| 137 | + |
| 138 | +export class DefaultDegradeRuleTestResponse extends $tea.Model { |
| 139 | + headers: { [key: string]: string }; |
| 140 | + body: DefaultDegradeRuleTestResponseBody; |
| 141 | + static names(): { [key: string]: string } { |
| 142 | + return { |
| 143 | + headers: 'headers', |
| 144 | + body: 'body', |
| 145 | + }; |
| 146 | + } |
| 147 | + |
| 148 | + static types(): { [key: string]: any } { |
| 149 | + return { |
| 150 | + headers: { 'type': 'map', 'keyType': 'string', 'valueType': 'string' }, |
| 151 | + body: DefaultDegradeRuleTestResponseBody, |
| 152 | + }; |
| 153 | + } |
| 154 | + |
| 155 | + constructor(map?: { [key: string]: any }) { |
| 156 | + super(map); |
| 157 | + } |
| 158 | +} |
| 159 | + |
| 160 | + |
| 161 | +export default class Client extends OpenApi { |
| 162 | + |
| 163 | + constructor(config: $OpenApi.Config) { |
| 164 | + super(config); |
| 165 | + this._endpointRule = "regional"; |
| 166 | + this._endpointMap = { |
| 167 | + 'ap-northeast-2-pop': "ft.aliyuncs.com", |
| 168 | + 'ap-south-1': "ft.aliyuncs.com", |
| 169 | + 'ap-southeast-1': "ft.aliyuncs.com", |
| 170 | + 'ap-southeast-2': "ft.aliyuncs.com", |
| 171 | + 'ap-southeast-3': "ft.aliyuncs.com", |
| 172 | + 'ap-southeast-5': "ft.aliyuncs.com", |
| 173 | + 'cn-beijing': "ft.aliyuncs.com", |
| 174 | + 'cn-beijing-finance-1': "ft.aliyuncs.com", |
| 175 | + 'cn-beijing-finance-pop': "ft.aliyuncs.com", |
| 176 | + 'cn-beijing-gov-1': "ft.aliyuncs.com", |
| 177 | + 'cn-beijing-nu16-b01': "ft.aliyuncs.com", |
| 178 | + 'cn-chengdu': "ft.aliyuncs.com", |
| 179 | + 'cn-edge-1': "ft.aliyuncs.com", |
| 180 | + 'cn-fujian': "ft.aliyuncs.com", |
| 181 | + 'cn-haidian-cm12-c01': "ft.aliyuncs.com", |
| 182 | + 'cn-hangzhou-bj-b01': "ft.aliyuncs.com", |
| 183 | + 'cn-hangzhou-finance': "ft.aliyuncs.com", |
| 184 | + 'cn-hangzhou-internal-prod-1': "ft.aliyuncs.com", |
| 185 | + 'cn-hangzhou-internal-test-1': "ft.aliyuncs.com", |
| 186 | + 'cn-hangzhou-internal-test-2': "ft.aliyuncs.com", |
| 187 | + 'cn-hangzhou-internal-test-3': "ft.aliyuncs.com", |
| 188 | + 'cn-hangzhou-test-306': "ft.aliyuncs.com", |
| 189 | + 'cn-hongkong-finance-pop': "ft.aliyuncs.com", |
| 190 | + 'cn-huhehaote': "ft.aliyuncs.com", |
| 191 | + 'cn-huhehaote-nebula-1': "ft.aliyuncs.com", |
| 192 | + 'cn-qingdao': "ft.aliyuncs.com", |
| 193 | + 'cn-qingdao-nebula': "ft.aliyuncs.com", |
| 194 | + 'cn-shanghai-et15-b01': "ft.aliyuncs.com", |
| 195 | + 'cn-shanghai-et2-b01': "ft.aliyuncs.com", |
| 196 | + 'cn-shanghai-finance-1': "ft.aliyuncs.com", |
| 197 | + 'cn-shanghai-inner': "ft.aliyuncs.com", |
| 198 | + 'cn-shanghai-internal-test-1': "ft.aliyuncs.com", |
| 199 | + 'cn-shenzhen-finance-1': "ft.aliyuncs.com", |
| 200 | + 'cn-shenzhen-inner': "ft.aliyuncs.com", |
| 201 | + 'cn-shenzhen-st4-d01': "ft.aliyuncs.com", |
| 202 | + 'cn-shenzhen-su18-b01': "ft.aliyuncs.com", |
| 203 | + 'cn-wuhan': "ft.aliyuncs.com", |
| 204 | + 'cn-wulanchabu': "ft.aliyuncs.com", |
| 205 | + 'cn-yushanfang': "ft.aliyuncs.com", |
| 206 | + 'cn-zhangbei': "ft.aliyuncs.com", |
| 207 | + 'cn-zhangbei-na61-b01': "ft.aliyuncs.com", |
| 208 | + 'cn-zhangjiakou-na62-a01': "ft.aliyuncs.com", |
| 209 | + 'cn-zhengzhou-nebula-1': "ft.aliyuncs.com", |
| 210 | + 'eu-central-1': "ft.aliyuncs.com", |
| 211 | + 'eu-west-1': "ft.aliyuncs.com", |
| 212 | + 'eu-west-1-oxs': "ft.aliyuncs.com", |
| 213 | + 'me-east-1': "ft.aliyuncs.com", |
| 214 | + 'rus-west-1-pop': "ft.aliyuncs.com", |
| 215 | + 'us-west-1': "ft.aliyuncs.com", |
| 216 | + }; |
| 217 | + this.checkConfig(config); |
| 218 | + this._endpoint = this.getEndpoint("ft", this._regionId, this._endpointRule, this._network, this._suffix, this._endpointMap, this._endpoint); |
| 219 | + } |
| 220 | + |
| 221 | + |
| 222 | + getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: {[key: string ]: string}, endpoint: string): string { |
| 223 | + if (!Util.empty(endpoint)) { |
| 224 | + return endpoint; |
| 225 | + } |
| 226 | + |
| 227 | + if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) { |
| 228 | + return endpointMap[regionId]; |
| 229 | + } |
| 230 | + |
| 231 | + return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix); |
| 232 | + } |
| 233 | + |
| 234 | + async defaultDegradeRuleWithOptions(request: DefaultDegradeRuleRequest, runtime: $Util.RuntimeOptions): Promise<DefaultDegradeRuleResponse> { |
| 235 | + Util.validateModel(request); |
| 236 | + let req = new $OpenApi.OpenApiRequest({ |
| 237 | + body: Util.toMap(request), |
| 238 | + }); |
| 239 | + return $tea.cast<DefaultDegradeRuleResponse>(await this.doRPCRequest("DefaultDegradeRule", "2020-02-02", "HTTPS", "POST", "AK", "json", req, runtime), new DefaultDegradeRuleResponse({})); |
| 240 | + } |
| 241 | + |
| 242 | + async defaultDegradeRule(request: DefaultDegradeRuleRequest): Promise<DefaultDegradeRuleResponse> { |
| 243 | + let runtime = new $Util.RuntimeOptions({ }); |
| 244 | + return await this.defaultDegradeRuleWithOptions(request, runtime); |
| 245 | + } |
| 246 | + |
| 247 | + async defaultDegradeRuleTestWithOptions(request: DefaultDegradeRuleTestRequest, runtime: $Util.RuntimeOptions): Promise<DefaultDegradeRuleTestResponse> { |
| 248 | + Util.validateModel(request); |
| 249 | + let req = new $OpenApi.OpenApiRequest({ |
| 250 | + body: Util.toMap(request), |
| 251 | + }); |
| 252 | + return $tea.cast<DefaultDegradeRuleTestResponse>(await this.doRPCRequest("DefaultDegradeRuleTest", "2020-02-02", "HTTPS", "POST", "AK", "json", req, runtime), new DefaultDegradeRuleTestResponse({})); |
| 253 | + } |
| 254 | + |
| 255 | + async defaultDegradeRuleTest(request: DefaultDegradeRuleTestRequest): Promise<DefaultDegradeRuleTestResponse> { |
| 256 | + let runtime = new $Util.RuntimeOptions({ }); |
| 257 | + return await this.defaultDegradeRuleTestWithOptions(request, runtime); |
| 258 | + } |
| 259 | + |
| 260 | +} |
0 commit comments