From ed8f1baccd8fb64decc7551a2a5ced53a86add91 Mon Sep 17 00:00:00 2001 From: yndu13 Date: Sun, 7 Jul 2024 19:49:51 +0800 Subject: [PATCH] feat: support extends query parameters --- csharp/core/Client.cs | 82 +++++++++++++++++-- csharp/core/Properties/AssemblyInfo.cs | 4 +- csharp/core/client.csproj | 2 +- golang/client/client.go | 34 +++++++- golang/go.mod | 2 +- java/pom.xml | 2 +- .../java/com/aliyun/teaopenapi/Client.java | 38 ++++++++- main.tea | 33 +++++++- php/composer.json | 2 +- php/src/OpenApiClient.php | 48 +++++++---- python/alibabacloud_tea_openapi/client.py | 48 ++++++++++- python/setup.py | 4 +- swift/AlibabacloudOpenApi.podspec | 4 +- swift/Cartfile | 4 +- swift/Package.swift | 4 +- .../Sources/AlibabacloudOpenApi/Client.swift | 24 +++++- ts/package.json | 2 +- ts/src/client.ts | 38 ++++++++- 18 files changed, 325 insertions(+), 50 deletions(-) diff --git a/csharp/core/Client.cs b/csharp/core/Client.cs index f2bea37..7d5bf73 100644 --- a/csharp/core/Client.cs +++ b/csharp/core/Client.cs @@ -195,6 +195,7 @@ public Dictionary DoRPCRequest(string action, string version, st } } Dictionary extendsHeaders = new Dictionary(){}; + Dictionary extendsQueries = new Dictionary(){}; if (!AlibabaCloud.TeaUtil.Common.IsUnset(runtime.ExtendsParameters)) { AlibabaCloud.TeaUtil.Models.ExtendsParameters extendsParameters = runtime.ExtendsParameters; @@ -202,6 +203,10 @@ public Dictionary DoRPCRequest(string action, string version, st { extendsHeaders = extendsParameters.Headers; } + if (!AlibabaCloud.TeaUtil.Common.IsUnset(extendsParameters.Queries)) + { + extendsQueries = extendsParameters.Queries; + } } request_.Query = TeaConverter.merge ( @@ -214,6 +219,7 @@ public Dictionary DoRPCRequest(string action, string version, st {"SignatureNonce", AlibabaCloud.TeaUtil.Common.GetNonce()}, }, globalQueries, + extendsQueries, request.Query ); Dictionary headers = GetRpcHeaders(); @@ -460,6 +466,7 @@ public async Task> DoRPCRequestAsync(string action, s } } Dictionary extendsHeaders = new Dictionary(){}; + Dictionary extendsQueries = new Dictionary(){}; if (!AlibabaCloud.TeaUtil.Common.IsUnset(runtime.ExtendsParameters)) { AlibabaCloud.TeaUtil.Models.ExtendsParameters extendsParameters = runtime.ExtendsParameters; @@ -467,6 +474,10 @@ public async Task> DoRPCRequestAsync(string action, s { extendsHeaders = extendsParameters.Headers; } + if (!AlibabaCloud.TeaUtil.Common.IsUnset(extendsParameters.Queries)) + { + extendsQueries = extendsParameters.Queries; + } } request_.Query = TeaConverter.merge ( @@ -479,6 +490,7 @@ public async Task> DoRPCRequestAsync(string action, s {"SignatureNonce", AlibabaCloud.TeaUtil.Common.GetNonce()}, }, globalQueries, + extendsQueries, request.Query ); Dictionary headers = GetRpcHeaders(); @@ -726,6 +738,7 @@ public Dictionary DoROARequest(string action, string version, st } } Dictionary extendsHeaders = new Dictionary(){}; + Dictionary extendsQueries = new Dictionary(){}; if (!AlibabaCloud.TeaUtil.Common.IsUnset(runtime.ExtendsParameters)) { AlibabaCloud.TeaUtil.Models.ExtendsParameters extendsParameters = runtime.ExtendsParameters; @@ -733,6 +746,10 @@ public Dictionary DoROARequest(string action, string version, st { extendsHeaders = extendsParameters.Headers; } + if (!AlibabaCloud.TeaUtil.Common.IsUnset(extendsParameters.Queries)) + { + extendsQueries = extendsParameters.Queries; + } } request_.Headers = TeaConverter.merge ( @@ -757,7 +774,11 @@ public Dictionary DoROARequest(string action, string version, st request_.Body = TeaCore.BytesReadable(AlibabaCloud.TeaUtil.Common.ToJSONString(request.Body)); request_.Headers["content-type"] = "application/json; charset=utf-8"; } - request_.Query = globalQueries; + request_.Query = TeaConverter.merge + ( + globalQueries, + extendsQueries + ); if (!AlibabaCloud.TeaUtil.Common.IsUnset(request.Query)) { request_.Query = TeaConverter.merge @@ -968,6 +989,7 @@ public async Task> DoROARequestAsync(string action, s } } Dictionary extendsHeaders = new Dictionary(){}; + Dictionary extendsQueries = new Dictionary(){}; if (!AlibabaCloud.TeaUtil.Common.IsUnset(runtime.ExtendsParameters)) { AlibabaCloud.TeaUtil.Models.ExtendsParameters extendsParameters = runtime.ExtendsParameters; @@ -975,6 +997,10 @@ public async Task> DoROARequestAsync(string action, s { extendsHeaders = extendsParameters.Headers; } + if (!AlibabaCloud.TeaUtil.Common.IsUnset(extendsParameters.Queries)) + { + extendsQueries = extendsParameters.Queries; + } } request_.Headers = TeaConverter.merge ( @@ -999,7 +1025,11 @@ public async Task> DoROARequestAsync(string action, s request_.Body = TeaCore.BytesReadable(AlibabaCloud.TeaUtil.Common.ToJSONString(request.Body)); request_.Headers["content-type"] = "application/json; charset=utf-8"; } - request_.Query = globalQueries; + request_.Query = TeaConverter.merge + ( + globalQueries, + extendsQueries + ); if (!AlibabaCloud.TeaUtil.Common.IsUnset(request.Query)) { request_.Query = TeaConverter.merge @@ -1210,6 +1240,7 @@ public Dictionary DoROARequestWithForm(string action, string ver } } Dictionary extendsHeaders = new Dictionary(){}; + Dictionary extendsQueries = new Dictionary(){}; if (!AlibabaCloud.TeaUtil.Common.IsUnset(runtime.ExtendsParameters)) { AlibabaCloud.TeaUtil.Models.ExtendsParameters extendsParameters = runtime.ExtendsParameters; @@ -1217,6 +1248,10 @@ public Dictionary DoROARequestWithForm(string action, string ver { extendsHeaders = extendsParameters.Headers; } + if (!AlibabaCloud.TeaUtil.Common.IsUnset(extendsParameters.Queries)) + { + extendsQueries = extendsParameters.Queries; + } } request_.Headers = TeaConverter.merge ( @@ -1242,7 +1277,11 @@ public Dictionary DoROARequestWithForm(string action, string ver request_.Body = TeaCore.BytesReadable(AlibabaCloud.OpenApiUtil.Client.ToForm(m)); request_.Headers["content-type"] = "application/x-www-form-urlencoded"; } - request_.Query = globalQueries; + request_.Query = TeaConverter.merge + ( + globalQueries, + extendsQueries + ); if (!AlibabaCloud.TeaUtil.Common.IsUnset(request.Query)) { request_.Query = TeaConverter.merge @@ -1451,6 +1490,7 @@ public async Task> DoROARequestWithFormAsync(string a } } Dictionary extendsHeaders = new Dictionary(){}; + Dictionary extendsQueries = new Dictionary(){}; if (!AlibabaCloud.TeaUtil.Common.IsUnset(runtime.ExtendsParameters)) { AlibabaCloud.TeaUtil.Models.ExtendsParameters extendsParameters = runtime.ExtendsParameters; @@ -1458,6 +1498,10 @@ public async Task> DoROARequestWithFormAsync(string a { extendsHeaders = extendsParameters.Headers; } + if (!AlibabaCloud.TeaUtil.Common.IsUnset(extendsParameters.Queries)) + { + extendsQueries = extendsParameters.Queries; + } } request_.Headers = TeaConverter.merge ( @@ -1483,7 +1527,11 @@ public async Task> DoROARequestWithFormAsync(string a request_.Body = TeaCore.BytesReadable(AlibabaCloud.OpenApiUtil.Client.ToForm(m)); request_.Headers["content-type"] = "application/x-www-form-urlencoded"; } - request_.Query = globalQueries; + request_.Query = TeaConverter.merge + ( + globalQueries, + extendsQueries + ); if (!AlibabaCloud.TeaUtil.Common.IsUnset(request.Query)) { request_.Query = TeaConverter.merge @@ -1692,6 +1740,7 @@ public Dictionary DoRequest(Params params_, OpenApiRequest reque } } Dictionary extendsHeaders = new Dictionary(){}; + Dictionary extendsQueries = new Dictionary(){}; if (!AlibabaCloud.TeaUtil.Common.IsUnset(runtime.ExtendsParameters)) { AlibabaCloud.TeaUtil.Models.ExtendsParameters extendsParameters = runtime.ExtendsParameters; @@ -1699,10 +1748,15 @@ public Dictionary DoRequest(Params params_, OpenApiRequest reque { extendsHeaders = extendsParameters.Headers; } + if (!AlibabaCloud.TeaUtil.Common.IsUnset(extendsParameters.Queries)) + { + extendsQueries = extendsParameters.Queries; + } } request_.Query = TeaConverter.merge ( globalQueries, + extendsQueries, request.Query ); // endpoint is setted in product client @@ -1982,6 +2036,7 @@ public async Task> DoRequestAsync(Params params_, Ope } } Dictionary extendsHeaders = new Dictionary(){}; + Dictionary extendsQueries = new Dictionary(){}; if (!AlibabaCloud.TeaUtil.Common.IsUnset(runtime.ExtendsParameters)) { AlibabaCloud.TeaUtil.Models.ExtendsParameters extendsParameters = runtime.ExtendsParameters; @@ -1989,10 +2044,15 @@ public async Task> DoRequestAsync(Params params_, Ope { extendsHeaders = extendsParameters.Headers; } + if (!AlibabaCloud.TeaUtil.Common.IsUnset(extendsParameters.Queries)) + { + extendsQueries = extendsParameters.Queries; + } } request_.Query = TeaConverter.merge ( globalQueries, + extendsQueries, request.Query ); // endpoint is setted in product client @@ -2272,6 +2332,7 @@ public Dictionary Execute(Params params_, OpenApiRequest request } } Dictionary extendsHeaders = new Dictionary(){}; + Dictionary extendsQueries = new Dictionary(){}; if (!AlibabaCloud.TeaUtil.Common.IsUnset(runtime.ExtendsParameters)) { AlibabaCloud.TeaUtil.Models.ExtendsParameters extendsParameters = runtime.ExtendsParameters; @@ -2279,6 +2340,10 @@ public Dictionary Execute(Params params_, OpenApiRequest request { extendsHeaders = extendsParameters.Headers; } + if (!AlibabaCloud.TeaUtil.Common.IsUnset(extendsParameters.Queries)) + { + extendsQueries = extendsParameters.Queries; + } } AlibabaCloud.GatewaySpi.Models.InterceptorContext.InterceptorContextRequest requestContext = new AlibabaCloud.GatewaySpi.Models.InterceptorContext.InterceptorContextRequest { @@ -2292,6 +2357,7 @@ public Dictionary Execute(Params params_, OpenApiRequest request Query = TeaConverter.merge ( globalQueries, + extendsQueries, request.Query ), Body = request.Body, @@ -2412,7 +2478,7 @@ public async Task> ExecuteAsync(Params params_, OpenA {"period", AlibabaCloud.TeaUtil.Common.DefaultNumber(runtime.BackoffPeriod, 1)}, }}, {"ignoreSSL", runtime.IgnoreSSL}, - {"disableHttp2", DefaultAny(_disableHttp2, false)}, + {"disableHttp2", DefaultAny(_disableHttp2.Value, false)}, }; TeaRequest _lastRequest = null; @@ -2450,6 +2516,7 @@ public async Task> ExecuteAsync(Params params_, OpenA } } Dictionary extendsHeaders = new Dictionary(){}; + Dictionary extendsQueries = new Dictionary(){}; if (!AlibabaCloud.TeaUtil.Common.IsUnset(runtime.ExtendsParameters)) { AlibabaCloud.TeaUtil.Models.ExtendsParameters extendsParameters = runtime.ExtendsParameters; @@ -2457,6 +2524,10 @@ public async Task> ExecuteAsync(Params params_, OpenA { extendsHeaders = extendsParameters.Headers; } + if (!AlibabaCloud.TeaUtil.Common.IsUnset(extendsParameters.Queries)) + { + extendsQueries = extendsParameters.Queries; + } } AlibabaCloud.GatewaySpi.Models.InterceptorContext.InterceptorContextRequest requestContext = new AlibabaCloud.GatewaySpi.Models.InterceptorContext.InterceptorContextRequest { @@ -2470,6 +2541,7 @@ public async Task> ExecuteAsync(Params params_, OpenA Query = TeaConverter.merge ( globalQueries, + extendsQueries, request.Query ), Body = request.Body, diff --git a/csharp/core/Properties/AssemblyInfo.cs b/csharp/core/Properties/AssemblyInfo.cs index 9da4c9b..8f2a9a7 100644 --- a/csharp/core/Properties/AssemblyInfo.cs +++ b/csharp/core/Properties/AssemblyInfo.cs @@ -29,5 +29,5 @@ // Build Number // Revision // -[assembly : AssemblyVersion("0.1.9.0")] -[assembly : AssemblyFileVersion("0.1.9.0")] +[assembly : AssemblyVersion("0.1.10.0")] +[assembly : AssemblyFileVersion("0.1.10.0")] diff --git a/csharp/core/client.csproj b/csharp/core/client.csproj index 3fcdb6a..8cc37d7 100644 --- a/csharp/core/client.csproj +++ b/csharp/core/client.csproj @@ -40,7 +40,7 @@ all runtime; build; native; contentfiles; analyzers - + diff --git a/golang/client/client.go b/golang/client/client.go index 43bcb50..d21b1d1 100644 --- a/golang/client/client.go +++ b/golang/client/client.go @@ -674,12 +674,17 @@ func (client *Client) DoRPCRequest(action *string, version *string, protocol *st } extendsHeaders := make(map[string]*string) + extendsQueries := make(map[string]*string) if !tea.BoolValue(util.IsUnset(runtime.ExtendsParameters)) { extendsParameters := runtime.ExtendsParameters if !tea.BoolValue(util.IsUnset(extendsParameters.Headers)) { extendsHeaders = extendsParameters.Headers } + if !tea.BoolValue(util.IsUnset(extendsParameters.Queries)) { + extendsQueries = extendsParameters.Queries + } + } request_.Query = tea.Merge(map[string]*string{ @@ -689,6 +694,7 @@ func (client *Client) DoRPCRequest(action *string, version *string, protocol *st "Timestamp": openapiutil.GetTimestamp(), "SignatureNonce": util.GetNonce(), }, globalQueries, + extendsQueries, request.Query) headers, _err := client.GetRpcHeaders() if _err != nil { @@ -974,12 +980,17 @@ func (client *Client) DoROARequest(action *string, version *string, protocol *st } extendsHeaders := make(map[string]*string) + extendsQueries := make(map[string]*string) if !tea.BoolValue(util.IsUnset(runtime.ExtendsParameters)) { extendsParameters := runtime.ExtendsParameters if !tea.BoolValue(util.IsUnset(extendsParameters.Headers)) { extendsHeaders = extendsParameters.Headers } + if !tea.BoolValue(util.IsUnset(extendsParameters.Queries)) { + extendsQueries = extendsParameters.Queries + } + } request_.Headers = tea.Merge(map[string]*string{ @@ -1000,7 +1011,8 @@ func (client *Client) DoROARequest(action *string, version *string, protocol *st request_.Headers["content-type"] = tea.String("application/json; charset=utf-8") } - request_.Query = globalQueries + request_.Query = tea.Merge(globalQueries, + extendsQueries) if !tea.BoolValue(util.IsUnset(request.Query)) { request_.Query = tea.Merge(request_.Query, request.Query) @@ -1251,12 +1263,17 @@ func (client *Client) DoROARequestWithForm(action *string, version *string, prot } extendsHeaders := make(map[string]*string) + extendsQueries := make(map[string]*string) if !tea.BoolValue(util.IsUnset(runtime.ExtendsParameters)) { extendsParameters := runtime.ExtendsParameters if !tea.BoolValue(util.IsUnset(extendsParameters.Headers)) { extendsHeaders = extendsParameters.Headers } + if !tea.BoolValue(util.IsUnset(extendsParameters.Queries)) { + extendsQueries = extendsParameters.Queries + } + } request_.Headers = tea.Merge(map[string]*string{ @@ -1282,7 +1299,8 @@ func (client *Client) DoROARequestWithForm(action *string, version *string, prot request_.Headers["content-type"] = tea.String("application/x-www-form-urlencoded") } - request_.Query = globalQueries + request_.Query = tea.Merge(globalQueries, + extendsQueries) if !tea.BoolValue(util.IsUnset(request.Query)) { request_.Query = tea.Merge(request_.Query, request.Query) @@ -1533,15 +1551,21 @@ func (client *Client) DoRequest(params *Params, request *OpenApiRequest, runtime } extendsHeaders := make(map[string]*string) + extendsQueries := make(map[string]*string) if !tea.BoolValue(util.IsUnset(runtime.ExtendsParameters)) { extendsParameters := runtime.ExtendsParameters if !tea.BoolValue(util.IsUnset(extendsParameters.Headers)) { extendsHeaders = extendsParameters.Headers } + if !tea.BoolValue(util.IsUnset(extendsParameters.Queries)) { + extendsQueries = extendsParameters.Queries + } + } request_.Query = tea.Merge(globalQueries, + extendsQueries, request.Query) // endpoint is setted in product client request_.Headers = tea.Merge(map[string]*string{ @@ -1863,12 +1887,17 @@ func (client *Client) Execute(params *Params, request *OpenApiRequest, runtime * } extendsHeaders := make(map[string]*string) + extendsQueries := make(map[string]*string) if !tea.BoolValue(util.IsUnset(runtime.ExtendsParameters)) { extendsParameters := runtime.ExtendsParameters if !tea.BoolValue(util.IsUnset(extendsParameters.Headers)) { extendsHeaders = extendsParameters.Headers } + if !tea.BoolValue(util.IsUnset(extendsParameters.Queries)) { + extendsQueries = extendsParameters.Queries + } + } requestContext := &spi.InterceptorContextRequest{ @@ -1877,6 +1906,7 @@ func (client *Client) Execute(params *Params, request *OpenApiRequest, runtime * request.Headers, headers), Query: tea.Merge(globalQueries, + extendsQueries, request.Query), Body: request.Body, Stream: request.Stream, diff --git a/golang/go.mod b/golang/go.mod index e6b1c93..fdcfaef 100644 --- a/golang/go.mod +++ b/golang/go.mod @@ -6,7 +6,7 @@ require ( github.com/alibabacloud-go/alibabacloud-gateway-spi v0.0.4 github.com/alibabacloud-go/openapi-util v0.1.0 github.com/alibabacloud-go/tea v1.2.1 - github.com/alibabacloud-go/tea-utils/v2 v2.0.5 + github.com/alibabacloud-go/tea-utils/v2 v2.0.6 github.com/alibabacloud-go/tea-xml v1.1.3 github.com/aliyun/credentials-go v1.3.1 github.com/clbanning/mxj/v2 v2.5.5 // indirect diff --git a/java/pom.xml b/java/pom.xml index e8d9d77..6f7c301 100644 --- a/java/pom.xml +++ b/java/pom.xml @@ -51,7 +51,7 @@ com.aliyun tea-util - 0.2.22 + 0.2.23 com.aliyun diff --git a/java/src/main/java/com/aliyun/teaopenapi/Client.java b/java/src/main/java/com/aliyun/teaopenapi/Client.java index 5c10f72..a320d6c 100644 --- a/java/src/main/java/com/aliyun/teaopenapi/Client.java +++ b/java/src/main/java/com/aliyun/teaopenapi/Client.java @@ -173,12 +173,17 @@ public Client(com.aliyun.teaopenapi.models.Config config) throws Exception { } java.util.Map extendsHeaders = new java.util.HashMap<>(); + java.util.Map extendsQueries = new java.util.HashMap<>(); if (!com.aliyun.teautil.Common.isUnset(runtime.extendsParameters)) { com.aliyun.teautil.models.ExtendsParameters extendsParameters = runtime.extendsParameters; if (!com.aliyun.teautil.Common.isUnset(extendsParameters.headers)) { extendsHeaders = extendsParameters.headers; } + if (!com.aliyun.teautil.Common.isUnset(extendsParameters.queries)) { + extendsQueries = extendsParameters.queries; + } + } request_.query = TeaConverter.merge(String.class, @@ -190,6 +195,7 @@ public Client(com.aliyun.teaopenapi.models.Config config) throws Exception { new TeaPair("SignatureNonce", com.aliyun.teautil.Common.getNonce()) ), globalQueries, + extendsQueries, request.query ); java.util.Map headers = this.getRpcHeaders(); @@ -399,12 +405,17 @@ public Client(com.aliyun.teaopenapi.models.Config config) throws Exception { } java.util.Map extendsHeaders = new java.util.HashMap<>(); + java.util.Map extendsQueries = new java.util.HashMap<>(); if (!com.aliyun.teautil.Common.isUnset(runtime.extendsParameters)) { com.aliyun.teautil.models.ExtendsParameters extendsParameters = runtime.extendsParameters; if (!com.aliyun.teautil.Common.isUnset(extendsParameters.headers)) { extendsHeaders = extendsParameters.headers; } + if (!com.aliyun.teautil.Common.isUnset(extendsParameters.queries)) { + extendsQueries = extendsParameters.queries; + } + } request_.headers = TeaConverter.merge(String.class, @@ -428,7 +439,10 @@ public Client(com.aliyun.teaopenapi.models.Config config) throws Exception { request_.headers.put("content-type", "application/json; charset=utf-8"); } - request_.query = globalQueries; + request_.query = TeaConverter.merge(String.class, + globalQueries, + extendsQueries + ); if (!com.aliyun.teautil.Common.isUnset(request.query)) { request_.query = TeaConverter.merge(String.class, request_.query, @@ -606,12 +620,17 @@ public Client(com.aliyun.teaopenapi.models.Config config) throws Exception { } java.util.Map extendsHeaders = new java.util.HashMap<>(); + java.util.Map extendsQueries = new java.util.HashMap<>(); if (!com.aliyun.teautil.Common.isUnset(runtime.extendsParameters)) { com.aliyun.teautil.models.ExtendsParameters extendsParameters = runtime.extendsParameters; if (!com.aliyun.teautil.Common.isUnset(extendsParameters.headers)) { extendsHeaders = extendsParameters.headers; } + if (!com.aliyun.teautil.Common.isUnset(extendsParameters.queries)) { + extendsQueries = extendsParameters.queries; + } + } request_.headers = TeaConverter.merge(String.class, @@ -636,7 +655,10 @@ public Client(com.aliyun.teaopenapi.models.Config config) throws Exception { request_.headers.put("content-type", "application/x-www-form-urlencoded"); } - request_.query = globalQueries; + request_.query = TeaConverter.merge(String.class, + globalQueries, + extendsQueries + ); if (!com.aliyun.teautil.Common.isUnset(request.query)) { request_.query = TeaConverter.merge(String.class, request_.query, @@ -812,16 +834,22 @@ public Client(com.aliyun.teaopenapi.models.Config config) throws Exception { } java.util.Map extendsHeaders = new java.util.HashMap<>(); + java.util.Map extendsQueries = new java.util.HashMap<>(); if (!com.aliyun.teautil.Common.isUnset(runtime.extendsParameters)) { com.aliyun.teautil.models.ExtendsParameters extendsParameters = runtime.extendsParameters; if (!com.aliyun.teautil.Common.isUnset(extendsParameters.headers)) { extendsHeaders = extendsParameters.headers; } + if (!com.aliyun.teautil.Common.isUnset(extendsParameters.queries)) { + extendsQueries = extendsParameters.queries; + } + } request_.query = TeaConverter.merge(String.class, globalQueries, + extendsQueries, request.query ); // endpoint is setted in product client @@ -1058,12 +1086,17 @@ public Client(com.aliyun.teaopenapi.models.Config config) throws Exception { } java.util.Map extendsHeaders = new java.util.HashMap<>(); + java.util.Map extendsQueries = new java.util.HashMap<>(); if (!com.aliyun.teautil.Common.isUnset(runtime.extendsParameters)) { com.aliyun.teautil.models.ExtendsParameters extendsParameters = runtime.extendsParameters; if (!com.aliyun.teautil.Common.isUnset(extendsParameters.headers)) { extendsHeaders = extendsParameters.headers; } + if (!com.aliyun.teautil.Common.isUnset(extendsParameters.queries)) { + extendsQueries = extendsParameters.queries; + } + } com.aliyun.gateway.spi.models.InterceptorContext.InterceptorContextRequest requestContext = com.aliyun.gateway.spi.models.InterceptorContext.InterceptorContextRequest.build(TeaConverter.buildMap( @@ -1075,6 +1108,7 @@ public Client(com.aliyun.teaopenapi.models.Config config) throws Exception { )), new TeaPair("query", TeaConverter.merge(String.class, globalQueries, + extendsQueries, request.query )), new TeaPair("body", request.body), diff --git a/main.tea b/main.tea index 5998a46..6770d55 100644 --- a/main.tea +++ b/main.tea @@ -175,11 +175,15 @@ api doRPCRequest(action: string, version: string, protocol: string, method: stri } } var extendsHeaders : map[string]string = {}; + var extendsQueries : map[string]string = {}; if (!Util.isUnset(runtime.extendsParameters)) { var extendsParameters = runtime.extendsParameters; if (!Util.isUnset(extendsParameters.headers)) { extendsHeaders = extendsParameters.headers; } + if (!Util.isUnset(extendsParameters.queries)) { + extendsQueries = extendsParameters.queries; + } } __request.query = { Action = action, @@ -188,6 +192,7 @@ api doRPCRequest(action: string, version: string, protocol: string, method: stri Timestamp = OpenApiUtil.getTimestamp(), SignatureNonce = Util.getNonce(), ...globalQueries, + ...extendsQueries, ...request.query }; @@ -357,11 +362,15 @@ api doROARequest(action: string, version: string, protocol: string, method: stri } } var extendsHeaders : map[string]string = {}; + var extendsQueries : map[string]string = {}; if (!Util.isUnset(runtime.extendsParameters)) { var extendsParameters = runtime.extendsParameters; if (!Util.isUnset(extendsParameters.headers)) { extendsHeaders = extendsParameters.headers; } + if (!Util.isUnset(extendsParameters.queries)) { + extendsQueries = extendsParameters.queries; + } } __request.headers = { date = Util.getDateUTCString(), @@ -383,7 +392,10 @@ api doROARequest(action: string, version: string, protocol: string, method: stri __request.headers.content-type = 'application/json; charset=utf-8'; } - __request.query = globalQueries; + __request.query = { + ...globalQueries, + ...extendsQueries, + }; if (!Util.isUnset(request.query)) { __request.query = { ...__request.query, @@ -526,11 +538,15 @@ api doROARequestWithForm(action: string, version: string, protocol: string, meth } } var extendsHeaders : map[string]string = {}; + var extendsQueries : map[string]string = {}; if (!Util.isUnset(runtime.extendsParameters)) { var extendsParameters = runtime.extendsParameters; if (!Util.isUnset(extendsParameters.headers)) { extendsHeaders = extendsParameters.headers; } + if (!Util.isUnset(extendsParameters.queries)) { + extendsQueries = extendsParameters.queries; + } } __request.headers = { date = Util.getDateUTCString(), @@ -554,7 +570,10 @@ api doROARequestWithForm(action: string, version: string, protocol: string, meth } - __request.query = globalQueries; + __request.query = { + ...globalQueries, + ...extendsQueries, + }; if (!Util.isUnset(request.query)) { __request.query = { ...__request.query, @@ -723,14 +742,19 @@ api doRequest(params: Params, request: OpenApiRequest, runtime: Util.RuntimeOpti } } var extendsHeaders : map[string]string = {}; + var extendsQueries : map[string]string = {}; if (!Util.isUnset(runtime.extendsParameters)) { var extendsParameters = runtime.extendsParameters; if (!Util.isUnset(extendsParameters.headers)) { extendsHeaders = extendsParameters.headers; } + if (!Util.isUnset(extendsParameters.queries)) { + extendsQueries = extendsParameters.queries; + } } __request.query = { ...globalQueries, + ...extendsQueries, ...request.query, }; @@ -928,11 +952,15 @@ api execute(params: Params, request: OpenApiRequest, runtime: Util.RuntimeOption } } var extendsHeaders : map[string]string = {}; + var extendsQueries : map[string]string = {}; if (!Util.isUnset(runtime.extendsParameters)) { var extendsParameters = runtime.extendsParameters; if (!Util.isUnset(extendsParameters.headers)) { extendsHeaders = extendsParameters.headers; } + if (!Util.isUnset(extendsParameters.queries)) { + extendsQueries = extendsParameters.queries; + } } var requestContext = new SPI.InterceptorContext.request{ headers = { @@ -943,6 +971,7 @@ api execute(params: Params, request: OpenApiRequest, runtime: Util.RuntimeOption }, query = { ...globalQueries, + ...extendsQueries, ...request.query, }, body = request.body, diff --git a/php/composer.json b/php/composer.json index ffb73f7..11e4da1 100644 --- a/php/composer.json +++ b/php/composer.json @@ -11,7 +11,7 @@ ], "require": { "php": ">5.5", - "alibabacloud/tea-utils": "^0.2.20", + "alibabacloud/tea-utils": "^0.2.21", "alibabacloud/credentials": "^1.1", "alibabacloud/openapi-util": "^0.1.10|^0.2.1", "alibabacloud/gateway-spi": "^1", diff --git a/php/src/OpenApiClient.php b/php/src/OpenApiClient.php index c332ed8..f428e55 100644 --- a/php/src/OpenApiClient.php +++ b/php/src/OpenApiClient.php @@ -218,11 +218,15 @@ public function doRPCRequest($action, $version, $protocol, $method, $authType, $ } } $extendsHeaders = []; + $extendsQueries = []; if (!Utils::isUnset($runtime->extendsParameters)) { $extendsParameters = $runtime->extendsParameters; if (!Utils::isUnset($extendsParameters->headers)) { $extendsHeaders = $extendsParameters->headers; } + if (!Utils::isUnset($extendsParameters->queries)) { + $extendsQueries = $extendsParameters->queries; + } } $_request->query = Tea::merge([ "Action" => $action, @@ -230,7 +234,7 @@ public function doRPCRequest($action, $version, $protocol, $method, $authType, $ "Version" => $version, "Timestamp" => OpenApiUtilClient::getTimestamp(), "SignatureNonce" => Utils::getNonce() - ], $globalQueries, $request->query); + ], $globalQueries, $extendsQueries, $request->query); $headers = $this->getRpcHeaders(); if (Utils::isUnset($headers)) { // endpoint is setted in product client @@ -383,13 +387,13 @@ public function doROARequest($action, $version, $protocol, $method, $authType, $ "socks5NetWork" => Utils::defaultString($runtime->socks5NetWork, $this->_socks5NetWork), "maxIdleConns" => Utils::defaultNumber($runtime->maxIdleConns, $this->_maxIdleConns), "retry" => [ - "retryable" => $runtime->autoretry, - "maxAttempts" => Utils::defaultNumber($runtime->maxAttempts, 3) - ], + "retryable" => $runtime->autoretry, + "maxAttempts" => Utils::defaultNumber($runtime->maxAttempts, 3) + ], "backoff" => [ - "policy" => Utils::defaultString($runtime->backoffPolicy, "no"), - "period" => Utils::defaultNumber($runtime->backoffPeriod, 1) - ], + "policy" => Utils::defaultString($runtime->backoffPolicy, "no"), + "period" => Utils::defaultNumber($runtime->backoffPeriod, 1) + ], "ignoreSSL" => $runtime->ignoreSSL ]; $_lastRequest = null; @@ -421,11 +425,15 @@ public function doROARequest($action, $version, $protocol, $method, $authType, $ } } $extendsHeaders = []; + $extendsQueries = []; if (!Utils::isUnset($runtime->extendsParameters)) { $extendsParameters = $runtime->extendsParameters; if (!Utils::isUnset($extendsParameters->headers)) { $extendsHeaders = $extendsParameters->headers; } + if (!Utils::isUnset($extendsParameters->queries)) { + $extendsQueries = $extendsParameters->queries; + } } $_request->headers = Tea::merge([ "date" => Utils::getDateUTCString(), @@ -442,7 +450,7 @@ public function doROARequest($action, $version, $protocol, $method, $authType, $ $_request->body = Utils::toJSONString($request->body); $_request->headers["content-type"] = "application/json; charset=utf-8"; } - $_request->query = $globalQueries; + $_request->query = Tea::merge($globalQueries, $extendsQueries); if (!Utils::isUnset($request->query)) { $_request->query = Tea::merge($_request->query, $request->query); } @@ -579,9 +587,9 @@ public function doROARequestWithForm($action, $version, $protocol, $method, $aut "maxAttempts" => Utils::defaultNumber($runtime->maxAttempts, 3) ], "backoff" => [ - "policy" => Utils::defaultString($runtime->backoffPolicy, "no"), - "period" => Utils::defaultNumber($runtime->backoffPeriod, 1) - ], + "policy" => Utils::defaultString($runtime->backoffPolicy, "no"), + "period" => Utils::defaultNumber($runtime->backoffPeriod, 1) + ], "ignoreSSL" => $runtime->ignoreSSL ]; $_lastRequest = null; @@ -613,11 +621,15 @@ public function doROARequestWithForm($action, $version, $protocol, $method, $aut } } $extendsHeaders = []; + $extendsQueries = []; if (!Utils::isUnset($runtime->extendsParameters)) { $extendsParameters = $runtime->extendsParameters; if (!Utils::isUnset($extendsParameters->headers)) { $extendsHeaders = $extendsParameters->headers; } + if (!Utils::isUnset($extendsParameters->queries)) { + $extendsQueries = $extendsParameters->queries; + } } $_request->headers = Tea::merge([ "date" => Utils::getDateUTCString(), @@ -635,7 +647,7 @@ public function doROARequestWithForm($action, $version, $protocol, $method, $aut $_request->body = OpenApiUtilClient::toForm($m); $_request->headers["content-type"] = "application/x-www-form-urlencoded"; } - $_request->query = $globalQueries; + $_request->query = Tea::merge($globalQueries, $extendsQueries); if (!Utils::isUnset($request->query)) { $_request->query = Tea::merge($_request->query, $request->query); } @@ -799,13 +811,17 @@ public function doRequest($params, $request, $runtime) } } $extendsHeaders = []; + $extendsQueries = []; if (!Utils::isUnset($runtime->extendsParameters)) { $extendsParameters = $runtime->extendsParameters; if (!Utils::isUnset($extendsParameters->headers)) { $extendsHeaders = $extendsParameters->headers; } + if (!Utils::isUnset($extendsParameters->queries)) { + $extendsQueries = $extendsParameters->queries; + } } - $_request->query = Tea::merge($globalQueries, $request->query); + $_request->query = Tea::merge($globalQueries, $extendsQueries, $request->query); // endpoint is setted in product client $_request->headers = Tea::merge([ "host" => $this->_endpoint, @@ -1010,15 +1026,19 @@ public function execute($params, $request, $runtime) } } $extendsHeaders = []; + $extendsQueries = []; if (!Utils::isUnset($runtime->extendsParameters)) { $extendsParameters = $runtime->extendsParameters; if (!Utils::isUnset($extendsParameters->headers)) { $extendsHeaders = $extendsParameters->headers; } + if (!Utils::isUnset($extendsParameters->queries)) { + $extendsQueries = $extendsParameters->queries; + } } $requestContext = new \Darabonba\GatewaySpi\Models\InterceptorContext\request([ "headers" => Tea::merge($globalHeaders, $extendsHeaders, $request->headers, $headers), - "query" => Tea::merge($globalQueries, $request->query), + "query" => Tea::merge($globalQueries, $extendsQueries, $request->query), "body" => $request->body, "stream" => $request->stream, "hostMap" => $request->hostMap, diff --git a/python/alibabacloud_tea_openapi/client.py b/python/alibabacloud_tea_openapi/client.py index 7cc9008..5818091 100644 --- a/python/alibabacloud_tea_openapi/client.py +++ b/python/alibabacloud_tea_openapi/client.py @@ -182,10 +182,13 @@ def do_rpcrequest( if not UtilClient.is_unset(global_params.headers): global_headers = global_params.headers extends_headers = {} + extends_queries = {} if not UtilClient.is_unset(runtime.extends_parameters): extends_parameters = runtime.extends_parameters if not UtilClient.is_unset(extends_parameters.headers): extends_headers = extends_parameters.headers + if not UtilClient.is_unset(extends_parameters.queries): + extends_queries = extends_parameters.queries _request.query = TeaCore.merge({ 'Action': action, 'Format': 'json', @@ -193,6 +196,7 @@ def do_rpcrequest( 'Timestamp': OpenApiUtilClient.get_timestamp(), 'SignatureNonce': UtilClient.get_nonce() }, global_queries, + extends_queries, request.query) headers = self.get_rpc_headers() if UtilClient.is_unset(headers): @@ -373,10 +377,13 @@ async def do_rpcrequest_async( if not UtilClient.is_unset(global_params.headers): global_headers = global_params.headers extends_headers = {} + extends_queries = {} if not UtilClient.is_unset(runtime.extends_parameters): extends_parameters = runtime.extends_parameters if not UtilClient.is_unset(extends_parameters.headers): extends_headers = extends_parameters.headers + if not UtilClient.is_unset(extends_parameters.queries): + extends_queries = extends_parameters.queries _request.query = TeaCore.merge({ 'Action': action, 'Format': 'json', @@ -384,6 +391,7 @@ async def do_rpcrequest_async( 'Timestamp': OpenApiUtilClient.get_timestamp(), 'SignatureNonce': UtilClient.get_nonce() }, global_queries, + extends_queries, request.query) headers = self.get_rpc_headers() if UtilClient.is_unset(headers): @@ -566,10 +574,13 @@ def do_roarequest( if not UtilClient.is_unset(global_params.headers): global_headers = global_params.headers extends_headers = {} + extends_queries = {} if not UtilClient.is_unset(runtime.extends_parameters): extends_parameters = runtime.extends_parameters if not UtilClient.is_unset(extends_parameters.headers): extends_headers = extends_parameters.headers + if not UtilClient.is_unset(extends_parameters.queries): + extends_queries = extends_parameters.queries _request.headers = TeaCore.merge({ 'date': UtilClient.get_date_utcstring(), 'host': self._endpoint, @@ -586,7 +597,8 @@ def do_roarequest( if not UtilClient.is_unset(request.body): _request.body = UtilClient.to_jsonstring(request.body) _request.headers['content-type'] = 'application/json; charset=utf-8' - _request.query = global_queries + _request.query = TeaCore.merge(global_queries, + extends_queries) if not UtilClient.is_unset(request.query): _request.query = TeaCore.merge(_request.query, request.query) @@ -746,10 +758,13 @@ async def do_roarequest_async( if not UtilClient.is_unset(global_params.headers): global_headers = global_params.headers extends_headers = {} + extends_queries = {} if not UtilClient.is_unset(runtime.extends_parameters): extends_parameters = runtime.extends_parameters if not UtilClient.is_unset(extends_parameters.headers): extends_headers = extends_parameters.headers + if not UtilClient.is_unset(extends_parameters.queries): + extends_queries = extends_parameters.queries _request.headers = TeaCore.merge({ 'date': UtilClient.get_date_utcstring(), 'host': self._endpoint, @@ -766,7 +781,8 @@ async def do_roarequest_async( if not UtilClient.is_unset(request.body): _request.body = UtilClient.to_jsonstring(request.body) _request.headers['content-type'] = 'application/json; charset=utf-8' - _request.query = global_queries + _request.query = TeaCore.merge(global_queries, + extends_queries) if not UtilClient.is_unset(request.query): _request.query = TeaCore.merge(_request.query, request.query) @@ -926,10 +942,13 @@ def do_roarequest_with_form( if not UtilClient.is_unset(global_params.headers): global_headers = global_params.headers extends_headers = {} + extends_queries = {} if not UtilClient.is_unset(runtime.extends_parameters): extends_parameters = runtime.extends_parameters if not UtilClient.is_unset(extends_parameters.headers): extends_headers = extends_parameters.headers + if not UtilClient.is_unset(extends_parameters.queries): + extends_queries = extends_parameters.queries _request.headers = TeaCore.merge({ 'date': UtilClient.get_date_utcstring(), 'host': self._endpoint, @@ -947,7 +966,8 @@ def do_roarequest_with_form( m = UtilClient.assert_as_map(request.body) _request.body = OpenApiUtilClient.to_form(m) _request.headers['content-type'] = 'application/x-www-form-urlencoded' - _request.query = global_queries + _request.query = TeaCore.merge(global_queries, + extends_queries) if not UtilClient.is_unset(request.query): _request.query = TeaCore.merge(_request.query, request.query) @@ -1105,10 +1125,13 @@ async def do_roarequest_with_form_async( if not UtilClient.is_unset(global_params.headers): global_headers = global_params.headers extends_headers = {} + extends_queries = {} if not UtilClient.is_unset(runtime.extends_parameters): extends_parameters = runtime.extends_parameters if not UtilClient.is_unset(extends_parameters.headers): extends_headers = extends_parameters.headers + if not UtilClient.is_unset(extends_parameters.queries): + extends_queries = extends_parameters.queries _request.headers = TeaCore.merge({ 'date': UtilClient.get_date_utcstring(), 'host': self._endpoint, @@ -1126,7 +1149,8 @@ async def do_roarequest_with_form_async( m = UtilClient.assert_as_map(request.body) _request.body = OpenApiUtilClient.to_form(m) _request.headers['content-type'] = 'application/x-www-form-urlencoded' - _request.query = global_queries + _request.query = TeaCore.merge(global_queries, + extends_queries) if not UtilClient.is_unset(request.query): _request.query = TeaCore.merge(_request.query, request.query) @@ -1278,11 +1302,15 @@ def do_request( if not UtilClient.is_unset(global_params.headers): global_headers = global_params.headers extends_headers = {} + extends_queries = {} if not UtilClient.is_unset(runtime.extends_parameters): extends_parameters = runtime.extends_parameters if not UtilClient.is_unset(extends_parameters.headers): extends_headers = extends_parameters.headers + if not UtilClient.is_unset(extends_parameters.queries): + extends_queries = extends_parameters.queries _request.query = TeaCore.merge(global_queries, + extends_queries, request.query) # endpoint is setted in product client _request.headers = TeaCore.merge({ @@ -1480,11 +1508,15 @@ async def do_request_async( if not UtilClient.is_unset(global_params.headers): global_headers = global_params.headers extends_headers = {} + extends_queries = {} if not UtilClient.is_unset(runtime.extends_parameters): extends_parameters = runtime.extends_parameters if not UtilClient.is_unset(extends_parameters.headers): extends_headers = extends_parameters.headers + if not UtilClient.is_unset(extends_parameters.queries): + extends_queries = extends_parameters.queries _request.query = TeaCore.merge(global_queries, + extends_queries, request.query) # endpoint is setted in product client _request.headers = TeaCore.merge({ @@ -1682,16 +1714,20 @@ def execute( if not UtilClient.is_unset(global_params.headers): global_headers = global_params.headers extends_headers = {} + extends_queries = {} if not UtilClient.is_unset(runtime.extends_parameters): extends_parameters = runtime.extends_parameters if not UtilClient.is_unset(extends_parameters.headers): extends_headers = extends_parameters.headers + if not UtilClient.is_unset(extends_parameters.queries): + extends_queries = extends_parameters.queries request_context = spi_models.InterceptorContextRequest( headers=TeaCore.merge(global_headers, extends_headers, request.headers, headers), query=TeaCore.merge(global_queries, + extends_queries, request.query), body=request.body, stream=request.stream, @@ -1825,16 +1861,20 @@ async def execute_async( if not UtilClient.is_unset(global_params.headers): global_headers = global_params.headers extends_headers = {} + extends_queries = {} if not UtilClient.is_unset(runtime.extends_parameters): extends_parameters = runtime.extends_parameters if not UtilClient.is_unset(extends_parameters.headers): extends_headers = extends_parameters.headers + if not UtilClient.is_unset(extends_parameters.queries): + extends_queries = extends_parameters.queries request_context = spi_models.InterceptorContextRequest( headers=TeaCore.merge(global_headers, extends_headers, request.headers, headers), query=TeaCore.merge(global_queries, + extends_queries, request.query), body=request.body, stream=request.stream, diff --git a/python/setup.py b/python/setup.py index 4acbbbd..0866d92 100644 --- a/python/setup.py +++ b/python/setup.py @@ -24,7 +24,7 @@ """ setup module for alibabacloud_tea_openapi. -Created on 21/06/2024 +Created on 07/07/2024 @author: Alibaba Cloud SDK """ @@ -37,7 +37,7 @@ URL = "https://github.com/aliyun/darabonba-openapi" VERSION = __import__(PACKAGE).__version__ REQUIRES = [ - "alibabacloud_tea_util>=0.3.12, <1.0.0", + "alibabacloud_tea_util>=0.3.13, <1.0.0", "alibabacloud_credentials>=0.3.1, <1.0.0", "alibabacloud_openapi_util>=0.2.1, <1.0.0", "alibabacloud_gateway_spi>=0.0.1, <1.0.0", diff --git a/swift/AlibabacloudOpenApi.podspec b/swift/AlibabacloudOpenApi.podspec index da7e6d0..f673e4f 100644 --- a/swift/AlibabacloudOpenApi.podspec +++ b/swift/AlibabacloudOpenApi.podspec @@ -17,8 +17,8 @@ Pod::Spec.new do |spec| spec.watchos.deployment_target = '6.0' spec.tvos.deployment_target = '13.0' - spec.dependency 'Tea', '~> 1.0.1' - spec.dependency 'TeaUtils', '~> 1.0.5' + spec.dependency 'Tea', '~> 1.0.2' + spec.dependency 'TeaUtils', '~> 1.0.6' spec.dependency 'AlibabaCloudCredentials', '~> 1.0.1' spec.dependency 'AlibabaCloudOpenApiUtil', '~> 1.0.1' diff --git a/swift/Cartfile b/swift/Cartfile index cb4cc6e..55c8db2 100644 --- a/swift/Cartfile +++ b/swift/Cartfile @@ -1,4 +1,4 @@ -github aliyun/tea-swift ~> 1.0.1 -github alibabacloud-sdk-swift/tea-utils ~> 1.0.5 +github aliyun/tea-swift ~> 1.0.2 +github alibabacloud-sdk-swift/tea-utils ~> 1.0.6 github aliyun/credentials-swift ~> 1.0.1 github alibabacloud-sdk-swift/openapi-util ~> 1.0.1 diff --git a/swift/Package.swift b/swift/Package.swift index bfedc4e..8c39316 100644 --- a/swift/Package.swift +++ b/swift/Package.swift @@ -15,8 +15,8 @@ let package = Package( ], dependencies: [ // Dependencies declare other packages that this package depends on. - .package(url: "https://github.com/aliyun/tea-swift.git", from: "1.0.1"), - .package(url: "https://github.com/alibabacloud-sdk-swift/tea-utils", from: "1.0.5"), + .package(url: "https://github.com/aliyun/tea-swift.git", from: "1.0.2"), + .package(url: "https://github.com/alibabacloud-sdk-swift/tea-utils", from: "1.0.6"), .package(url: "https://github.com/aliyun/credentials-swift", from: "1.0.1"), .package(url: "https://github.com/alibabacloud-sdk-swift/openapi-util", from: "1.0.1"), ], diff --git a/swift/Sources/AlibabacloudOpenApi/Client.swift b/swift/Sources/AlibabacloudOpenApi/Client.swift index 0d43b7c..2216468 100644 --- a/swift/Sources/AlibabacloudOpenApi/Client.swift +++ b/swift/Sources/AlibabacloudOpenApi/Client.swift @@ -176,11 +176,15 @@ open class Client { } } var extendsHeaders: [String: String] = [:] + var extendsQueries: [String: String] = [:] if (!TeaUtils.Client.isUnset(runtime.extendsParameters)) { var extendsParameters: TeaUtils.ExtendsParameters = runtime.extendsParameters! if (!TeaUtils.Client.isUnset(extendsParameters.headers)) { extendsHeaders = extendsParameters.headers ?? [:] } + if (!TeaUtils.Client.isUnset(extendsParameters.queries)) { + extendsQueries = extendsParameters.queries ?? [:] + } } _request.query = Tea.TeaConverter.merge([ "Action": action as! String, @@ -188,7 +192,7 @@ open class Client { "Version": version as! String, "Timestamp": AlibabaCloudOpenApiUtil.Client.getTimestamp(), "SignatureNonce": TeaUtils.Client.getNonce() - ], globalQueries, request.query ?? [:]) + ], globalQueries, extendsQueries, request.query ?? [:]) var headers: [String: String] = try getRpcHeaders() if (TeaUtils.Client.isUnset(headers)) { _request.headers = Tea.TeaConverter.merge([ @@ -367,11 +371,15 @@ open class Client { } } var extendsHeaders: [String: String] = [:] + var extendsQueries: [String: String] = [:] if (!TeaUtils.Client.isUnset(runtime.extendsParameters)) { var extendsParameters: TeaUtils.ExtendsParameters = runtime.extendsParameters! if (!TeaUtils.Client.isUnset(extendsParameters.headers)) { extendsHeaders = extendsParameters.headers ?? [:] } + if (!TeaUtils.Client.isUnset(extendsParameters.queries)) { + extendsQueries = extendsParameters.queries ?? [:] + } } _request.headers = Tea.TeaConverter.merge([ "date": TeaUtils.Client.getDateUTCString(), @@ -388,7 +396,7 @@ open class Client { _request.body = Tea.TeaCore.toReadable(TeaUtils.Client.toJSONString(request.body)) _request.headers["content-type"] = "application/json; charset=utf-8"; } - _request.query = globalQueries as! [String: String] + _request.query = Tea.TeaConverter.merge([:], globalQueries, extendsQueries) if (!TeaUtils.Client.isUnset(request.query)) { _request.query = Tea.TeaConverter.merge([:], _request.query, request.query ?? [:]) } @@ -547,11 +555,15 @@ open class Client { } } var extendsHeaders: [String: String] = [:] + var extendsQueries: [String: String] = [:] if (!TeaUtils.Client.isUnset(runtime.extendsParameters)) { var extendsParameters: TeaUtils.ExtendsParameters = runtime.extendsParameters! if (!TeaUtils.Client.isUnset(extendsParameters.headers)) { extendsHeaders = extendsParameters.headers ?? [:] } + if (!TeaUtils.Client.isUnset(extendsParameters.queries)) { + extendsQueries = extendsParameters.queries ?? [:] + } } _request.headers = Tea.TeaConverter.merge([ "date": TeaUtils.Client.getDateUTCString(), @@ -569,7 +581,7 @@ open class Client { _request.body = Tea.TeaCore.toReadable(AlibabaCloudOpenApiUtil.Client.toForm(m)) _request.headers["content-type"] = "application/x-www-form-urlencoded"; } - _request.query = globalQueries as! [String: String] + _request.query = Tea.TeaConverter.merge([:], globalQueries, extendsQueries) if (!TeaUtils.Client.isUnset(request.query)) { _request.query = Tea.TeaConverter.merge([:], _request.query, request.query ?? [:]) } @@ -727,13 +739,17 @@ open class Client { } } var extendsHeaders: [String: String] = [:] + var extendsQueries: [String: String] = [:] if (!TeaUtils.Client.isUnset(runtime.extendsParameters)) { var extendsParameters: TeaUtils.ExtendsParameters = runtime.extendsParameters! if (!TeaUtils.Client.isUnset(extendsParameters.headers)) { extendsHeaders = extendsParameters.headers ?? [:] } + if (!TeaUtils.Client.isUnset(extendsParameters.queries)) { + extendsQueries = extendsParameters.queries ?? [:] + } } - _request.query = Tea.TeaConverter.merge([:], globalQueries, request.query ?? [:]) + _request.query = Tea.TeaConverter.merge([:], globalQueries, extendsQueries, request.query ?? [:]) _request.headers = Tea.TeaConverter.merge([ "host": self._endpoint ?? "", "x-acs-version": params.version ?? "", diff --git a/ts/package.json b/ts/package.json index 8cac542..94b1d8a 100644 --- a/ts/package.json +++ b/ts/package.json @@ -22,7 +22,7 @@ }, "dependencies": { "@alicloud/tea-typescript": "^1.7.1", - "@alicloud/tea-util": "^1.4.8", + "@alicloud/tea-util": "^1.4.9", "@alicloud/credentials": "^2", "@alicloud/openapi-util": "^0.3.2", "@alicloud/gateway-spi": "^0.0.8", diff --git a/ts/src/client.ts b/ts/src/client.ts index 63ddf90..0974644 100644 --- a/ts/src/client.ts +++ b/ts/src/client.ts @@ -381,12 +381,17 @@ export default class Client { } let extendsHeaders : {[key: string ]: string} = { }; + let extendsQueries : {[key: string ]: string} = { }; if (!Util.isUnset(runtime.extendsParameters)) { let extendsParameters = runtime.extendsParameters; if (!Util.isUnset(extendsParameters.headers)) { extendsHeaders = extendsParameters.headers; } + if (!Util.isUnset(extendsParameters.queries)) { + extendsQueries = extendsParameters.queries; + } + } request_.query = { @@ -396,6 +401,7 @@ export default class Client { Timestamp: OpenApiUtil.getTimestamp(), SignatureNonce: Util.getNonce(), ...globalQueries, + ...extendsQueries, ...request.query, }; let headers = this.getRpcHeaders(); @@ -600,12 +606,17 @@ export default class Client { } let extendsHeaders : {[key: string ]: string} = { }; + let extendsQueries : {[key: string ]: string} = { }; if (!Util.isUnset(runtime.extendsParameters)) { let extendsParameters = runtime.extendsParameters; if (!Util.isUnset(extendsParameters.headers)) { extendsHeaders = extendsParameters.headers; } + if (!Util.isUnset(extendsParameters.queries)) { + extendsQueries = extendsParameters.queries; + } + } request_.headers = { @@ -627,7 +638,10 @@ export default class Client { request_.headers["content-type"] = "application/json; charset=utf-8"; } - request_.query = globalQueries; + request_.query = { + ...globalQueries, + ...extendsQueries, + }; if (!Util.isUnset(request.query)) { request_.query = { ...request_.query, @@ -804,12 +818,17 @@ export default class Client { } let extendsHeaders : {[key: string ]: string} = { }; + let extendsQueries : {[key: string ]: string} = { }; if (!Util.isUnset(runtime.extendsParameters)) { let extendsParameters = runtime.extendsParameters; if (!Util.isUnset(extendsParameters.headers)) { extendsHeaders = extendsParameters.headers; } + if (!Util.isUnset(extendsParameters.queries)) { + extendsQueries = extendsParameters.queries; + } + } request_.headers = { @@ -832,7 +851,10 @@ export default class Client { request_.headers["content-type"] = "application/x-www-form-urlencoded"; } - request_.query = globalQueries; + request_.query = { + ...globalQueries, + ...extendsQueries, + }; if (!Util.isUnset(request.query)) { request_.query = { ...request_.query, @@ -1006,16 +1028,22 @@ export default class Client { } let extendsHeaders : {[key: string ]: string} = { }; + let extendsQueries : {[key: string ]: string} = { }; if (!Util.isUnset(runtime.extendsParameters)) { let extendsParameters = runtime.extendsParameters; if (!Util.isUnset(extendsParameters.headers)) { extendsHeaders = extendsParameters.headers; } + if (!Util.isUnset(extendsParameters.queries)) { + extendsQueries = extendsParameters.queries; + } + } request_.query = { ...globalQueries, + ...extendsQueries, ...request.query, }; // endpoint is setted in product client @@ -1248,12 +1276,17 @@ export default class Client { } let extendsHeaders : {[key: string ]: string} = { }; + let extendsQueries : {[key: string ]: string} = { }; if (!Util.isUnset(runtime.extendsParameters)) { let extendsParameters = runtime.extendsParameters; if (!Util.isUnset(extendsParameters.headers)) { extendsHeaders = extendsParameters.headers; } + if (!Util.isUnset(extendsParameters.queries)) { + extendsQueries = extendsParameters.queries; + } + } let requestContext = new $SPI.InterceptorContextRequest({ @@ -1265,6 +1298,7 @@ export default class Client { }, query: { ...globalQueries, + ...extendsQueries, ...request.query, }, body: request.body,