Skip to content

Commit 47408ee

Browse files
authored
Add conformances removed from latest releases of aws-sdk-swift. (#16)
Add conformances removed from latest releases of aws-sdk-swift.
1 parent a526058 commit 47408ee

5 files changed

+231
-9
lines changed

.swiftformat

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Swift version
2+
--swiftversion 5.8
3+
4+
# file options
5+
--exclude .build
6+
7+
# rules
8+
9+
# format options
10+
--ifdef no-indent
11+
--nospaceoperators ...,..<
12+
--self insert
13+
--allman false
14+
15+
#--maxwidth 150
16+
--wraparguments after-first
17+
--wrapparameters after-first
18+
--wrapcollections after-first
19+
--closingparen same-line

Package.resolved

+17-8
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@
55
"kind" : "remoteSourceControl",
66
"location" : "https://github.com/awslabs/aws-crt-swift",
77
"state" : {
8-
"revision" : "459da1e556d2486b354dad4ef5fd4c266bd3285c",
9-
"version" : "0.29.0"
8+
"revision" : "b6380f683b31072d77b601c88674461c11bcad5a",
9+
"version" : "0.30.0"
1010
}
1111
},
1212
{
1313
"identity" : "aws-sdk-swift",
1414
"kind" : "remoteSourceControl",
1515
"location" : "https://github.com/awslabs/aws-sdk-swift.git",
1616
"state" : {
17-
"revision" : "454ad2b1de7b5f27fe74b88d4030c55a230c8e62",
18-
"version" : "0.40.0"
17+
"revision" : "22ac271a961d9c8cec2308bf853f773c04146260",
18+
"version" : "0.44.0"
1919
}
2020
},
2121
{
@@ -32,8 +32,8 @@
3232
"kind" : "remoteSourceControl",
3333
"location" : "https://github.com/smithy-lang/smithy-swift",
3434
"state" : {
35-
"revision" : "e42afe5f27ff916fb0803b1b37563d8c6d14abcf",
36-
"version" : "0.45.0"
35+
"revision" : "c9caeb7c2df39ac0d4d4c6182c40426b7ec4485a",
36+
"version" : "0.49.0"
3737
}
3838
},
3939
{
@@ -50,8 +50,17 @@
5050
"kind" : "remoteSourceControl",
5151
"location" : "https://github.com/apple/swift-metrics.git",
5252
"state" : {
53-
"revision" : "971ba26378ab69c43737ee7ba967a896cb74c0d1",
54-
"version" : "2.4.1"
53+
"revision" : "ce594e71e92a1610015017f83f402894df540e51",
54+
"version" : "2.4.4"
55+
}
56+
},
57+
{
58+
"identity" : "swiftformat",
59+
"kind" : "remoteSourceControl",
60+
"location" : "https://github.com/nicklockwood/SwiftFormat",
61+
"state" : {
62+
"revision" : "4bf475154c1c98dcdf751037f930f8e5c72597a4",
63+
"version" : "0.53.10"
5564
}
5665
}
5766
],

Package.swift

+2-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ let package = Package(
3737
.package(url: "https://github.com/awslabs/aws-sdk-swift.git", from: "0.40.0"),
3838
.package(url: "https://github.com/apple/swift-log.git", from: "1.0.0"),
3939
.package(url: "https://github.com/apple/swift-metrics.git", "1.0.0"..<"3.0.0"),
40-
.package(url: "https://github.com/JohnSundell/CollectionConcurrencyKit", from :"0.2.0")
40+
.package(url: "https://github.com/JohnSundell/CollectionConcurrencyKit", from :"0.2.0"),
41+
.package(url: "https://github.com/nicklockwood/SwiftFormat", from: "0.53.9"),
4142
],
4243
targets: [
4344
.target(

Sources/DynamoDBTables/AWSDynamoDBCompositePrimaryKeyTable+updateItems.swift

+10
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,16 @@ public extension AWSDynamoDBCompositePrimaryKeyTable {
446446
}
447447
}
448448

449+
extension DynamoDBClientTypes.BatchStatementError: Equatable {
450+
public static func == (lhs: DynamoDBClientTypes.BatchStatementError, rhs: DynamoDBClientTypes.BatchStatementError) -> Bool {
451+
guard lhs.code == rhs.code && lhs.item == rhs.item && lhs.message == rhs.message else {
452+
return false
453+
}
454+
455+
return true
456+
}
457+
}
458+
449459
extension DynamoDBClientTypes.BatchStatementError: Hashable {
450460

451461
public func hash(into hasher: inout Hasher) {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,183 @@
1+
// Code generated by smithy-swift-codegen. DO NOT EDIT!
2+
// swiftlint:disable identifier_name cyclomatic_complexity function_body_length
3+
4+
import AWSClientRuntime
5+
import ClientRuntime
6+
import AWSDynamoDB
7+
8+
public struct Key: CodingKey {
9+
public let stringValue: String
10+
public init(stringValue: String) {
11+
self.stringValue = stringValue
12+
self.intValue = nil
13+
}
14+
15+
public init(_ stringValue: String) {
16+
self.stringValue = stringValue
17+
self.intValue = nil
18+
}
19+
20+
public let intValue: Int?
21+
public init?(intValue: Int) {
22+
return nil
23+
}
24+
}
25+
26+
extension DynamoDBClientTypes.AttributeValue: Swift.Codable {
27+
enum CodingKeys: Swift.String, Swift.CodingKey {
28+
case b = "B"
29+
case bool = "BOOL"
30+
case bs = "BS"
31+
case l = "L"
32+
case m = "M"
33+
case n = "N"
34+
case ns = "NS"
35+
case null = "NULL"
36+
case s = "S"
37+
case ss = "SS"
38+
case sdkUnknown
39+
}
40+
41+
public func encode(to encoder: Swift.Encoder) throws {
42+
var container = encoder.container(keyedBy: CodingKeys.self)
43+
switch self {
44+
case let .b(b):
45+
try container.encode(b.base64EncodedString(), forKey: .b)
46+
case let .bool(bool):
47+
try container.encode(bool, forKey: .bool)
48+
case let .bs(bs):
49+
var bsContainer = container.nestedUnkeyedContainer(forKey: .bs)
50+
for binaryattributevalue0 in bs {
51+
try bsContainer.encode(binaryattributevalue0.base64EncodedString())
52+
}
53+
case let .l(l):
54+
var lContainer = container.nestedUnkeyedContainer(forKey: .l)
55+
for attributevalue0 in l {
56+
try lContainer.encode(attributevalue0)
57+
}
58+
case let .m(m):
59+
var mContainer = container.nestedContainer(keyedBy: Key.self, forKey: .m)
60+
for (dictKey0, mapAttributeValue0) in m {
61+
try mContainer.encode(mapAttributeValue0, forKey: Key(stringValue: dictKey0))
62+
}
63+
case let .n(n):
64+
try container.encode(n, forKey: .n)
65+
case let .ns(ns):
66+
var nsContainer = container.nestedUnkeyedContainer(forKey: .ns)
67+
for numberattributevalue0 in ns {
68+
try nsContainer.encode(numberattributevalue0)
69+
}
70+
case let .null(null):
71+
try container.encode(null, forKey: .null)
72+
case let .s(s):
73+
try container.encode(s, forKey: .s)
74+
case let .ss(ss):
75+
var ssContainer = container.nestedUnkeyedContainer(forKey: .ss)
76+
for stringattributevalue0 in ss {
77+
try ssContainer.encode(stringattributevalue0)
78+
}
79+
case let .sdkUnknown(sdkUnknown):
80+
try container.encode(sdkUnknown, forKey: .sdkUnknown)
81+
}
82+
}
83+
84+
public init(from decoder: Swift.Decoder) throws {
85+
let values = try decoder.container(keyedBy: CodingKeys.self)
86+
let sDecoded = try values.decodeIfPresent(Swift.String.self, forKey: .s)
87+
if let s = sDecoded {
88+
self = .s(s)
89+
return
90+
}
91+
let nDecoded = try values.decodeIfPresent(Swift.String.self, forKey: .n)
92+
if let n = nDecoded {
93+
self = .n(n)
94+
return
95+
}
96+
let bDecoded = try values.decodeIfPresent(ClientRuntime.Data.self, forKey: .b)
97+
if let b = bDecoded {
98+
self = .b(b)
99+
return
100+
}
101+
let ssContainer = try values.decodeIfPresent([Swift.String?].self, forKey: .ss)
102+
var ssDecoded0:[Swift.String]? = nil
103+
if let ssContainer = ssContainer {
104+
ssDecoded0 = [Swift.String]()
105+
for string0 in ssContainer {
106+
if let string0 = string0 {
107+
ssDecoded0?.append(string0)
108+
}
109+
}
110+
}
111+
if let ss = ssDecoded0 {
112+
self = .ss(ss)
113+
return
114+
}
115+
let nsContainer = try values.decodeIfPresent([Swift.String?].self, forKey: .ns)
116+
var nsDecoded0:[Swift.String]? = nil
117+
if let nsContainer = nsContainer {
118+
nsDecoded0 = [Swift.String]()
119+
for string0 in nsContainer {
120+
if let string0 = string0 {
121+
nsDecoded0?.append(string0)
122+
}
123+
}
124+
}
125+
if let ns = nsDecoded0 {
126+
self = .ns(ns)
127+
return
128+
}
129+
let bsContainer = try values.decodeIfPresent([ClientRuntime.Data?].self, forKey: .bs)
130+
var bsDecoded0:[ClientRuntime.Data]? = nil
131+
if let bsContainer = bsContainer {
132+
bsDecoded0 = [ClientRuntime.Data]()
133+
for blob0 in bsContainer {
134+
if let blob0 = blob0 {
135+
bsDecoded0?.append(blob0)
136+
}
137+
}
138+
}
139+
if let bs = bsDecoded0 {
140+
self = .bs(bs)
141+
return
142+
}
143+
let mContainer = try values.decodeIfPresent([Swift.String: DynamoDBClientTypes.AttributeValue?].self, forKey: .m)
144+
var mDecoded0: [Swift.String:DynamoDBClientTypes.AttributeValue]? = nil
145+
if let mContainer = mContainer {
146+
mDecoded0 = [Swift.String:DynamoDBClientTypes.AttributeValue]()
147+
for (key0, attributevalue0) in mContainer {
148+
if let attributevalue0 = attributevalue0 {
149+
mDecoded0?[key0] = attributevalue0
150+
}
151+
}
152+
}
153+
if let m = mDecoded0 {
154+
self = .m(m)
155+
return
156+
}
157+
let lContainer = try values.decodeIfPresent([DynamoDBClientTypes.AttributeValue?].self, forKey: .l)
158+
var lDecoded0:[DynamoDBClientTypes.AttributeValue]? = nil
159+
if let lContainer = lContainer {
160+
lDecoded0 = [DynamoDBClientTypes.AttributeValue]()
161+
for union0 in lContainer {
162+
if let union0 = union0 {
163+
lDecoded0?.append(union0)
164+
}
165+
}
166+
}
167+
if let l = lDecoded0 {
168+
self = .l(l)
169+
return
170+
}
171+
let nullDecoded = try values.decodeIfPresent(Swift.Bool.self, forKey: .null)
172+
if let null = nullDecoded {
173+
self = .null(null)
174+
return
175+
}
176+
let boolDecoded = try values.decodeIfPresent(Swift.Bool.self, forKey: .bool)
177+
if let bool = boolDecoded {
178+
self = .bool(bool)
179+
return
180+
}
181+
self = .sdkUnknown("")
182+
}
183+
}

0 commit comments

Comments
 (0)