Skip to content

Commit d41a7cf

Browse files
committed
codegen
1 parent 450e224 commit d41a7cf

File tree

5 files changed

+84
-79
lines changed

5 files changed

+84
-79
lines changed

alibabacloud-gateway-spi/java/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
<dependency>
5555
<groupId>com.aliyun</groupId>
5656
<artifactId>credentials-java</artifactId>
57-
<version>0.3.6</version>
57+
<version>1.0.2</version>
5858
</dependency>
5959
</dependencies>
6060
<build>

alibabacloud-gateway-spi/swift/AlibabacloudGatewaySPI.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Pod::Spec.new do |spec|
1717
spec.watchos.deployment_target = '6.0'
1818
spec.tvos.deployment_target = '13.0'
1919

20-
spec.dependency 'Tea', '~> 1.0.0'
20+
spec.dependency 'Tea', '~> 1.0.3'
2121
spec.dependency 'AlibabaCloudCredentials', '~> 1.0.1'
2222

2323
spec.swift_version='5.6'
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
github aliyun/tea-swift ~> 1.0.0
1+
github aliyun/tea-swift ~> 1.0.3
22
github aliyun/credentials-swift ~> 1.0.1

alibabacloud-gateway-spi/swift/Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ let package = Package(
1515
],
1616
dependencies: [
1717
// Dependencies declare other packages that this package depends on.
18-
.package(url: "https://github.com/aliyun/tea-swift.git", from: "1.0.0"),
18+
.package(url: "https://github.com/aliyun/tea-swift.git", from: "1.0.3"),
1919
.package(url: "https://github.com/aliyun/credentials-swift.git", from: "1.0.1"),
2020
],
2121
targets: [

alibabacloud-gateway-spi/swift/Sources/AlibabacloudGatewaySPI/Models.swift

Lines changed: 80 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -127,63 +127,64 @@ public class InterceptorContext : Tea.TeaModel {
127127
return map
128128
}
129129

130-
public override func fromMap(_ dict: [String: Any]) -> Void {
131-
if dict.keys.contains("headers") && dict["headers"] != nil {
132-
self.headers = dict["headers"] as! [String: String]
130+
public override func fromMap(_ dict: [String: Any?]?) -> Void {
131+
guard let dict else { return }
132+
if let value = dict["headers"] as? [String: String] {
133+
self.headers = value
133134
}
134-
if dict.keys.contains("query") && dict["query"] != nil {
135-
self.query = dict["query"] as! [String: String]
135+
if let value = dict["query"] as? [String: String] {
136+
self.query = value
136137
}
137-
if dict.keys.contains("body") && dict["body"] != nil {
138-
self.body = dict["body"] as! Any
138+
if let value = dict["body"] as? Any {
139+
self.body = value
139140
}
140-
if dict.keys.contains("stream") && dict["stream"] != nil {
141-
self.stream = dict["stream"] as! InputStream
141+
if let value = dict["stream"] as? InputStream {
142+
self.stream = value
142143
}
143-
if dict.keys.contains("hostMap") && dict["hostMap"] != nil {
144-
self.hostMap = dict["hostMap"] as! [String: String]
144+
if let value = dict["hostMap"] as? [String: String] {
145+
self.hostMap = value
145146
}
146-
if dict.keys.contains("pathname") && dict["pathname"] != nil {
147-
self.pathname = dict["pathname"] as! String
147+
if let value = dict["pathname"] as? String {
148+
self.pathname = value
148149
}
149-
if dict.keys.contains("productId") && dict["productId"] != nil {
150-
self.productId = dict["productId"] as! String
150+
if let value = dict["productId"] as? String {
151+
self.productId = value
151152
}
152-
if dict.keys.contains("action") && dict["action"] != nil {
153-
self.action = dict["action"] as! String
153+
if let value = dict["action"] as? String {
154+
self.action = value
154155
}
155-
if dict.keys.contains("version") && dict["version"] != nil {
156-
self.version = dict["version"] as! String
156+
if let value = dict["version"] as? String {
157+
self.version = value
157158
}
158-
if dict.keys.contains("protocol") && dict["protocol"] != nil {
159-
self.protocol_ = dict["protocol"] as! String
159+
if let value = dict["protocol"] as? String {
160+
self.protocol_ = value
160161
}
161-
if dict.keys.contains("method") && dict["method"] != nil {
162-
self.method = dict["method"] as! String
162+
if let value = dict["method"] as? String {
163+
self.method = value
163164
}
164-
if dict.keys.contains("authType") && dict["authType"] != nil {
165-
self.authType = dict["authType"] as! String
165+
if let value = dict["authType"] as? String {
166+
self.authType = value
166167
}
167-
if dict.keys.contains("bodyType") && dict["bodyType"] != nil {
168-
self.bodyType = dict["bodyType"] as! String
168+
if let value = dict["bodyType"] as? String {
169+
self.bodyType = value
169170
}
170-
if dict.keys.contains("reqBodyType") && dict["reqBodyType"] != nil {
171-
self.reqBodyType = dict["reqBodyType"] as! String
171+
if let value = dict["reqBodyType"] as? String {
172+
self.reqBodyType = value
172173
}
173-
if dict.keys.contains("style") && dict["style"] != nil {
174-
self.style = dict["style"] as! String
174+
if let value = dict["style"] as? String {
175+
self.style = value
175176
}
176-
if dict.keys.contains("credential") && dict["credential"] != nil {
177-
self.credential = dict["credential"] as! AlibabaCloudCredentials.Client
177+
if let value = dict["credential"] as? AlibabaCloudCredentials.Client {
178+
self.credential = value
178179
}
179-
if dict.keys.contains("signatureVersion") && dict["signatureVersion"] != nil {
180-
self.signatureVersion = dict["signatureVersion"] as! String
180+
if let value = dict["signatureVersion"] as? String {
181+
self.signatureVersion = value
181182
}
182-
if dict.keys.contains("signatureAlgorithm") && dict["signatureAlgorithm"] != nil {
183-
self.signatureAlgorithm = dict["signatureAlgorithm"] as! String
183+
if let value = dict["signatureAlgorithm"] as? String {
184+
self.signatureAlgorithm = value
184185
}
185-
if dict.keys.contains("userAgent") && dict["userAgent"] != nil {
186-
self.userAgent = dict["userAgent"] as! String
186+
if let value = dict["userAgent"] as? String {
187+
self.userAgent = value
187188
}
188189
}
189190
}
@@ -241,27 +242,28 @@ public class InterceptorContext : Tea.TeaModel {
241242
return map
242243
}
243244

244-
public override func fromMap(_ dict: [String: Any]) -> Void {
245-
if dict.keys.contains("regionId") && dict["regionId"] != nil {
246-
self.regionId = dict["regionId"] as! String
245+
public override func fromMap(_ dict: [String: Any?]?) -> Void {
246+
guard let dict else { return }
247+
if let value = dict["regionId"] as? String {
248+
self.regionId = value
247249
}
248-
if dict.keys.contains("endpoint") && dict["endpoint"] != nil {
249-
self.endpoint = dict["endpoint"] as! String
250+
if let value = dict["endpoint"] as? String {
251+
self.endpoint = value
250252
}
251-
if dict.keys.contains("endpointRule") && dict["endpointRule"] != nil {
252-
self.endpointRule = dict["endpointRule"] as! String
253+
if let value = dict["endpointRule"] as? String {
254+
self.endpointRule = value
253255
}
254-
if dict.keys.contains("endpointMap") && dict["endpointMap"] != nil {
255-
self.endpointMap = dict["endpointMap"] as! [String: String]
256+
if let value = dict["endpointMap"] as? [String: String] {
257+
self.endpointMap = value
256258
}
257-
if dict.keys.contains("endpointType") && dict["endpointType"] != nil {
258-
self.endpointType = dict["endpointType"] as! String
259+
if let value = dict["endpointType"] as? String {
260+
self.endpointType = value
259261
}
260-
if dict.keys.contains("network") && dict["network"] != nil {
261-
self.network = dict["network"] as! String
262+
if let value = dict["network"] as? String {
263+
self.network = value
262264
}
263-
if dict.keys.contains("suffix") && dict["suffix"] != nil {
264-
self.suffix = dict["suffix"] as! String
265+
if let value = dict["suffix"] as? String {
266+
self.suffix = value
265267
}
266268
}
267269
}
@@ -303,18 +305,19 @@ public class InterceptorContext : Tea.TeaModel {
303305
return map
304306
}
305307

306-
public override func fromMap(_ dict: [String: Any]) -> Void {
307-
if dict.keys.contains("statusCode") && dict["statusCode"] != nil {
308-
self.statusCode = dict["statusCode"] as! Int
308+
public override func fromMap(_ dict: [String: Any?]?) -> Void {
309+
guard let dict else { return }
310+
if let value = dict["statusCode"] as? Int {
311+
self.statusCode = value
309312
}
310-
if dict.keys.contains("headers") && dict["headers"] != nil {
311-
self.headers = dict["headers"] as! [String: String]
313+
if let value = dict["headers"] as? [String: String] {
314+
self.headers = value
312315
}
313-
if dict.keys.contains("body") && dict["body"] != nil {
314-
self.body = dict["body"] as! InputStream
316+
if let value = dict["body"] as? InputStream {
317+
self.body = value
315318
}
316-
if dict.keys.contains("deserializedBody") && dict["deserializedBody"] != nil {
317-
self.deserializedBody = dict["deserializedBody"] as! Any
319+
if let value = dict["deserializedBody"] as? Any {
320+
self.deserializedBody = value
318321
}
319322
}
320323
}
@@ -356,20 +359,21 @@ public class InterceptorContext : Tea.TeaModel {
356359
return map
357360
}
358361

359-
public override func fromMap(_ dict: [String: Any]) -> Void {
360-
if dict.keys.contains("request") && dict["request"] != nil {
362+
public override func fromMap(_ dict: [String: Any?]?) -> Void {
363+
guard let dict else { return }
364+
if let value = dict["request"] as? [String: Any?] {
361365
var model = InterceptorContext.Request()
362-
model.fromMap(dict["request"] as! [String: Any])
366+
model.fromMap(value)
363367
self.request = model
364368
}
365-
if dict.keys.contains("configuration") && dict["configuration"] != nil {
369+
if let value = dict["configuration"] as? [String: Any?] {
366370
var model = InterceptorContext.Configuration()
367-
model.fromMap(dict["configuration"] as! [String: Any])
371+
model.fromMap(value)
368372
self.configuration = model
369373
}
370-
if dict.keys.contains("response") && dict["response"] != nil {
374+
if let value = dict["response"] as? [String: Any?] {
371375
var model = InterceptorContext.Response()
372-
model.fromMap(dict["response"] as! [String: Any])
376+
model.fromMap(value)
373377
self.response = model
374378
}
375379
}
@@ -405,12 +409,13 @@ public class AttributeMap : Tea.TeaModel {
405409
return map
406410
}
407411

408-
public override func fromMap(_ dict: [String: Any]) -> Void {
409-
if dict.keys.contains("attributes") && dict["attributes"] != nil {
410-
self.attributes = dict["attributes"] as! [String: Any]
412+
public override func fromMap(_ dict: [String: Any?]?) -> Void {
413+
guard let dict else { return }
414+
if let value = dict["attributes"] as? [String: Any] {
415+
self.attributes = value
411416
}
412-
if dict.keys.contains("key") && dict["key"] != nil {
413-
self.key = dict["key"] as! [String: String]
417+
if let value = dict["key"] as? [String: String] {
418+
self.key = value
414419
}
415420
}
416421
}

0 commit comments

Comments
 (0)