Skip to content

Commit f0b8d92

Browse files
committed
Make JSON protocols Sendable
1 parent 29ea986 commit f0b8d92

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

Diff for: Sources/WalletOrders/OrderJSON.swift

+7-7
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ public enum OrderJSON {
33
/// A protocol that defines the structure of a `order.json` file.
44
///
55
/// > Tip: See the [`Order`](https://developer.apple.com/documentation/walletorders/order) object to understand the keys.
6-
public protocol Properties: Codable {
6+
public protocol Properties: Codable, Sendable {
77
/// The date and time when the customer created the order, in RFC 3339 format.
88
var createdAt: String { get }
99

@@ -48,7 +48,7 @@ extension OrderJSON {
4848
/// A protocol that represents the merchant associated with the order.
4949
///
5050
/// > Tip: See the [`Order.Merchant`](https://developer.apple.com/documentation/walletorders/merchant) object to understand the keys.
51-
public protocol Merchant: Codable {
51+
public protocol Merchant: Codable, Sendable {
5252
/// The localized display name of the merchant.
5353
var displayName: String { get }
5454

@@ -64,7 +64,7 @@ extension OrderJSON {
6464
/// A protocol that represents the details of a barcode for an order.
6565
///
6666
/// > Tip: See the [`Order.Barcode`](https://developer.apple.com/documentation/walletorders/barcode) object to understand the keys.
67-
public protocol Barcode: Codable {
67+
public protocol Barcode: Codable, Sendable {
6868
/// The format of the barcode.
6969
var format: BarcodeFormat { get }
7070

@@ -80,24 +80,24 @@ extension OrderJSON {
8080

8181
extension OrderJSON {
8282
/// The type of order this bundle represents.
83-
public enum OrderType: String, Codable {
83+
public enum OrderType: String, Codable, Sendable {
8484
case ecommerce
8585
}
8686

8787
/// A high-level status of the order, used for display purposes.
88-
public enum OrderStatus: String, Codable {
88+
public enum OrderStatus: String, Codable, Sendable {
8989
case completed
9090
case cancelled
9191
case open
9292
}
9393

9494
/// The version of the schema used for the order.
95-
public enum SchemaVersion: Int, Codable {
95+
public enum SchemaVersion: Int, Codable, Sendable {
9696
case v1 = 1
9797
}
9898

9999
/// The format of the barcode.
100-
public enum BarcodeFormat: String, Codable {
100+
public enum BarcodeFormat: String, Codable, Sendable {
101101
case pdf417
102102
case qr
103103
case aztec

Diff for: Sources/WalletPasses/PassJSON.swift

+9-9
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ public enum PassJSON {
33
/// A protocol that defines the structure of a `pass.json` file.
44
///
55
/// > Tip: See the [`Pass`](https://developer.apple.com/documentation/walletpasses/pass) object to understand the keys.
6-
public protocol Properties: Codable {
6+
public protocol Properties: Codable, Sendable {
77
/// A short description that iOS accessibility technologies use for a pass.
88
var description: String { get }
99

@@ -34,7 +34,7 @@ extension PassJSON {
3434
/// A protocol that represents the information to display in a field on a pass.
3535
///
3636
/// > Tip: See the [`PassFieldContent`](https://developer.apple.com/documentation/walletpasses/passfieldcontent) object to understand the keys.
37-
public protocol PassFieldContent: Codable {
37+
public protocol PassFieldContent: Codable, Sendable {
3838
/// A unique key that identifies a field in the pass; for example, `departure-gate`.
3939
var key: String { get }
4040

@@ -49,7 +49,7 @@ extension PassJSON {
4949
/// A protocol that represents the groups of fields that display the information for a boarding pass.
5050
///
5151
/// > Tip: See the [`Pass.BoardingPass`](https://developer.apple.com/documentation/walletpasses/pass/boardingpass) object to understand the keys.
52-
public protocol BoardingPass: Codable {
52+
public protocol BoardingPass: Codable, Sendable {
5353
/// The type of transit for a boarding pass.
5454
///
5555
/// This key is invalid for other types of passes.
@@ -64,7 +64,7 @@ extension PassJSON {
6464
/// A protocol that represents a barcode on a pass.
6565
///
6666
/// > Tip: See the [`Pass.Barcodes`](https://developer.apple.com/documentation/walletpasses/pass/barcodes) object to understand the keys.
67-
public protocol Barcodes: Codable {
67+
public protocol Barcodes: Codable, Sendable {
6868
/// The format of the barcode.
6969
///
7070
/// The barcode format `PKBarcodeFormatCode128` isn’t supported for watchOS.
@@ -83,7 +83,7 @@ extension PassJSON {
8383
/// A protocol that represents a location that the system uses to show a relevant pass.
8484
///
8585
/// > Tip: See the [`Pass.Locations`](https://developer.apple.com/documentation/walletpasses/pass/locations) object to understand the keys.
86-
public protocol Locations: Codable {
86+
public protocol Locations: Codable, Sendable {
8787
/// The latitude, in degrees, of the location.
8888
var latitude: Double { get }
8989

@@ -96,7 +96,7 @@ extension PassJSON {
9696
/// An object that represents the near-field communication (NFC) payload the device passes to an Apple Pay terminal.
9797
///
9898
/// > Tip: See the [`Pass.NFC`](https://developer.apple.com/documentation/walletpasses/pass/nfc) object to understand the keys.
99-
public protocol NFC: Codable {
99+
public protocol NFC: Codable, Sendable {
100100
/// The payload the device transmits to the Apple Pay terminal.
101101
///
102102
/// The size must be no more than 64 bytes.
@@ -112,13 +112,13 @@ extension PassJSON {
112112

113113
extension PassJSON {
114114
/// The version of the file format.
115-
public enum FormatVersion: Int, Codable {
115+
public enum FormatVersion: Int, Codable, Sendable {
116116
/// The value must be `1`.
117117
case v1 = 1
118118
}
119119

120120
/// The type of transit for a boarding pass.
121-
public enum TransitType: String, Codable {
121+
public enum TransitType: String, Codable, Sendable {
122122
case air = "PKTransitTypeAir"
123123
case boat = "PKTransitTypeBoat"
124124
case bus = "PKTransitTypeBus"
@@ -127,7 +127,7 @@ extension PassJSON {
127127
}
128128

129129
/// The format of the barcode.
130-
public enum BarcodeFormat: String, Codable {
130+
public enum BarcodeFormat: String, Codable, Sendable {
131131
case pdf417 = "PKBarcodeFormatPDF417"
132132
case qr = "PKBarcodeFormatQR"
133133
case aztec = "PKBarcodeFormatAztec"

0 commit comments

Comments
 (0)