Skip to content

Commit

Permalink
Merge pull request #64 from shimastripe/feature/sendable
Browse files Browse the repository at this point in the history
Conform data models to Sendable
  • Loading branch information
alexanderjordanbaker committed Jul 29, 2024
2 parents 7a2f5aa + a0a43ec commit b631d37
Show file tree
Hide file tree
Showing 55 changed files with 58 additions and 58 deletions.
2 changes: 1 addition & 1 deletion Sources/AppStoreServerLibrary/Models/AccountTenure.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
///The age of the customer’s account.
///
///[accountTenure](https://developer.apple.com/documentation/appstoreserverapi/accounttenure)
public enum AccountTenure: Int32, Decodable, Encodable, Hashable {
public enum AccountTenure: Int32, Decodable, Encodable, Hashable, Sendable {
case undeclared = 0
case zeroToThreeDays = 1
case threeDaysToTenDays = 2
Expand Down
2 changes: 1 addition & 1 deletion Sources/AppStoreServerLibrary/Models/AppTransaction.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Foundation
///Information that represents the customer’s purchase of the app, cryptographically signed by the App Store.
///
///[AppTransaction](https://developer.apple.com/documentation/storekit/apptransaction)
public struct AppTransaction: DecodedSignedData, Decodable, Encodable, Hashable {
public struct AppTransaction: DecodedSignedData, Decodable, Encodable, Hashable, Sendable {

public init(receiptType: Environment? = nil, appAppleId: Int64? = nil, bundleId: String? = nil, applicationVersion: String? = nil, versionExternalIdentifier: Int64? = nil, receiptCreationDate: Date? = nil, originalPurchaseDate: Date? = nil, originalApplicationVersion: String? = nil, deviceVerification: String? = nil, deviceVerificationNonce: UUID? = nil, preorderDate: Date? = nil) {
self.receiptType = receiptType
Expand Down
2 changes: 1 addition & 1 deletion Sources/AppStoreServerLibrary/Models/AutoRenewStatus.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
///The renewal status for an auto-renewable subscription.
///
///[autoRenewStatus](https://developer.apple.com/documentation/appstoreserverapi/autorenewstatus)
public enum AutoRenewStatus: Int32, Decodable, Encodable, Hashable {
public enum AutoRenewStatus: Int32, Decodable, Encodable, Hashable, Sendable {
case off = 0
case on = 1
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
///A response that contains the contents of the test notification sent by the App Store server and the result from your server.
///
///[CheckTestNotificationResponse](https://developer.apple.com/documentation/appstoreserverapi/checktestnotificationresponse)
public struct CheckTestNotificationResponse: Decodable, Encodable, Hashable {
public struct CheckTestNotificationResponse: Decodable, Encodable, Hashable, Sendable {

public init(signedPayload: String? = nil, sendAttempts: [SendAttemptItem]? = nil) {
self.signedPayload = signedPayload
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Foundation
///The request body containing consumption information.
///
///[ConsumptionRequest](https://developer.apple.com/documentation/appstoreserverapi/consumptionrequest)
public struct ConsumptionRequest: Decodable, Encodable, Hashable {
public struct ConsumptionRequest: Decodable, Encodable, Hashable, Sendable {

public init(customerConsented: Bool? = nil, consumptionStatus: ConsumptionStatus? = nil, platform: Platform? = nil, sampleContentProvided: Bool? = nil, deliveryStatus: DeliveryStatus? = nil, appAccountToken: UUID? = nil, accountTenure: AccountTenure? = nil, playTime: PlayTime? = nil, lifetimeDollarsRefunded: LifetimeDollarsRefunded? = nil, lifetimeDollarsPurchased: LifetimeDollarsPurchased? = nil, userStatus: UserStatus? = nil, refundPreference: RefundPreference? = nil) {
self.customerConsented = customerConsented
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
///The customer-provided reason for a refund request.
///
///[consumptionRequestReason](https://developer.apple.com/documentation/appstoreservernotifications/consumptionrequestreason)
public enum ConsumptionRequestReason: String, Decodable, Encodable, Hashable {
public enum ConsumptionRequestReason: String, Decodable, Encodable, Hashable, Sendable {
case unintendedPurchase = "UNINTENDED_PURCHASE"
case fulfillmentIssue = "FULFILLMENT_ISSUE"
case unsatisfiedWithPurchase = "UNSATISFIED_WITH_PURCHASE"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
///A value that indicates the extent to which the customer consumed the in-app purchase.
///
///[consumptionStatus](https://developer.apple.com/documentation/appstoreserverapi/consumptionstatus)
public enum ConsumptionStatus: Int32, Decodable, Encodable, Hashable {
public enum ConsumptionStatus: Int32, Decodable, Encodable, Hashable, Sendable {
case undeclared = 0
case notConsumed = 1
case partiallyConsumed = 2
Expand Down
2 changes: 1 addition & 1 deletion Sources/AppStoreServerLibrary/Models/Data.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
///The app metadata and the signed renewal and transaction information.
///
///[data](https://developer.apple.com/documentation/appstoreservernotifications/data)
public struct Data: Decodable, Encodable, Hashable {
public struct Data: Decodable, Encodable, Hashable, Sendable {

public init(environment: Environment? = nil, appAppleId: Int64? = nil, bundleId: String? = nil, bundleVersion: String? = nil, signedTransactionInfo: String? = nil, signedRenewalInfo: String? = nil, status: Status? = nil, consumptionRequestReason: ConsumptionRequestReason? = nil) {
self.environment = environment
Expand Down
2 changes: 1 addition & 1 deletion Sources/AppStoreServerLibrary/Models/DeliveryStatus.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
///A value that indicates whether the app successfully delivered an in-app purchase that works properly.
///
///[deliveryStatus](https://developer.apple.com/documentation/appstoreserverapi/deliverystatus)
public enum DeliveryStatus: Int32, Decodable, Encodable, Hashable {
public enum DeliveryStatus: Int32, Decodable, Encodable, Hashable, Sendable {
case deliveredAndWorkingProperly = 0
case didNotDeliverDueToQualityIssue = 1
case deliveredWrongItem = 2
Expand Down
2 changes: 1 addition & 1 deletion Sources/AppStoreServerLibrary/Models/Environment.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
///The server environment, either sandbox or production.
///
///[environment](https://developer.apple.com/documentation/appstoreserverapi/environment)
public enum Environment: String, Decodable, Encodable, Hashable {
public enum Environment: String, Decodable, Encodable, Hashable, Sendable {
case sandbox = "Sandbox"
case production = "Production"
case xcode = "Xcode"
Expand Down
2 changes: 1 addition & 1 deletion Sources/AppStoreServerLibrary/Models/ErrorPayload.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) 2023 Apple Inc. Licensed under MIT License.


public struct ErrorPayload: Decodable, Encodable, Hashable {
public struct ErrorPayload: Decodable, Encodable, Hashable, Sendable {
public var errorCode: Int64?
public var errorMessage: String?
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
///The reason an auto-renewable subscription expired.
///
///[expirationIntent](https://developer.apple.com/documentation/appstoreserverapi/expirationintent)
public enum ExpirationIntent: Int32, Decodable, Encodable, Hashable {
public enum ExpirationIntent: Int32, Decodable, Encodable, Hashable, Sendable {
case customerCancelled = 1
case billingError = 2
case customerDidNotConsentToPriceIncrease = 3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
///The code that represents the reason for the subscription-renewal-date extension.
///
///[extendReasonCode](https://developer.apple.com/documentation/appstoreserverapi/extendreasoncode)
public enum ExtendReasonCode: Int32, Decodable, Encodable, Hashable {
public enum ExtendReasonCode: Int32, Decodable, Encodable, Hashable, Sendable {
case undeclared = 0
case customerSatisfaction = 1
case other = 2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
///The request body that contains subscription-renewal-extension data for an individual subscription.
///
///[ExtendRenewalDateRequest](https://developer.apple.com/documentation/appstoreserverapi/extendrenewaldaterequest)
public struct ExtendRenewalDateRequest: Decodable, Encodable, Hashable {
public struct ExtendRenewalDateRequest: Decodable, Encodable, Hashable, Sendable {

public init(extendByDays: Int32? = nil, extendReasonCode: ExtendReasonCode? = nil, requestIdentifier: String? = nil) {
self.extendByDays = extendByDays
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Foundation
///A response that indicates whether an individual renewal-date extension succeeded, and related details.
///
///[ExtendRenewalDateResponse](https://developer.apple.com/documentation/appstoreserverapi/extendrenewaldateresponse)
public struct ExtendRenewalDateResponse: Decodable, Encodable, Hashable {
public struct ExtendRenewalDateResponse: Decodable, Encodable, Hashable, Sendable {

public init(originalTransactionId: String? = nil, webOrderLineItemId: String? = nil, success: Bool? = nil, effectiveDate: Date? = nil) {
self.originalTransactionId = originalTransactionId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
///The payload data that contains an external purchase token.
///
///[externalPurchaseToken](https://developer.apple.com/documentation/appstoreservernotifications/externalpurchasetoken)
public struct ExternalPurchaseToken: Decodable, Encodable, Hashable {
public struct ExternalPurchaseToken: Decodable, Encodable, Hashable, Sendable {

public init(externalPurchaseId: String? = nil, tokenCreationDate: Int64? = nil, appAppleId: Int64? = nil, bundleId: String? = nil) {
self.externalPurchaseId = externalPurchaseId
Expand Down
2 changes: 1 addition & 1 deletion Sources/AppStoreServerLibrary/Models/HistoryResponse.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
///A response that contains the customer’s transaction history for an app.
///
///[HistoryResponse](https://developer.apple.com/documentation/appstoreserverapi/historyresponse)
public struct HistoryResponse: Decodable, Encodable, Hashable {
public struct HistoryResponse: Decodable, Encodable, Hashable, Sendable {

public init(revision: String? = nil, hasMore: Bool? = nil, bundleId: String? = nil, appAppleId: Int64? = nil, environment: Environment? = nil, signedTransactions: [String]? = nil) {
self.revision = revision
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
///The relationship of the user with the family-shared purchase to which they have access.
///
///[inAppOwnershipType](https://developer.apple.com/documentation/appstoreserverapi/inappownershiptype)
public enum InAppOwnershipType: String, Decodable, Encodable, Hashable {
public enum InAppOwnershipType: String, Decodable, Encodable, Hashable, Sendable {
case familyShared = "FAMILY_SHARED"
case purchased = "PURCHASED"
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Foundation
///A decoded payload containing subscription renewal information for an auto-renewable subscription.
///
///[JWSRenewalInfoDecodedPayload](https://developer.apple.com/documentation/appstoreserverapi/jwsrenewalinfodecodedpayload)
public struct JWSRenewalInfoDecodedPayload: DecodedSignedData, Decodable, Encodable, Hashable {
public struct JWSRenewalInfoDecodedPayload: DecodedSignedData, Decodable, Encodable, Hashable, Sendable {

public init(expirationIntent: ExpirationIntent? = nil, originalTransactionId: String? = nil, autoRenewProductId: String? = nil, productId: String? = nil, autoRenewStatus: AutoRenewStatus? = nil, isInBillingRetryPeriod: Bool? = nil, priceIncreaseStatus: PriceIncreaseStatus? = nil, gracePeriodExpiresDate: Date? = nil, offerType: OfferType? = nil, offerIdentifier: String? = nil, signedDate: Date? = nil, environment: Environment? = nil, recentSubscriptionStartDate: Date? = nil, renewalDate: Date? = nil, currency: String? = nil, renewalPrice: Int64? = nil, offerDiscountType: OfferDiscountType? = nil, eligibleWinBackOfferIds: [String]? = nil) {
self.expirationIntent = expirationIntent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Foundation
///A decoded payload containing transaction information.
///
///[JWSTransactionDecodedPayload](https://developer.apple.com/documentation/appstoreserverapi/jwstransactiondecodedpayload)
public struct JWSTransactionDecodedPayload: DecodedSignedData, Decodable, Encodable, Hashable {
public struct JWSTransactionDecodedPayload: DecodedSignedData, Decodable, Encodable, Hashable, Sendable {

public init(originalTransactionId: String? = nil, transactionId: String? = nil, webOrderLineItemId: String? = nil, bundleId: String? = nil, productId: String? = nil, subscriptionGroupIdentifier: String? = nil, purchaseDate: Date? = nil, originalPurchaseDate: Date? = nil, expiresDate: Date? = nil, quantity: Int32? = nil, type: ProductType? = nil, appAccountToken: UUID? = nil, inAppOwnershipType: InAppOwnershipType? = nil, signedDate: Date? = nil, revocationReason: RevocationReason? = nil, revocationDate: Date? = nil, isUpgraded: Bool? = nil, offerType: OfferType? = nil, offerIdentifier: String? = nil, environment: Environment? = nil, storefront: String? = nil, storefrontId: String? = nil, transactionReason: TransactionReason? = nil, currency: String? = nil, price: Int64? = nil, offerDiscountType: OfferDiscountType? = nil) {
self.originalTransactionId = originalTransactionId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
///The most recent App Store-signed transaction information and App Store-signed renewal information for an auto-renewable subscription.
///
///[lastTransactionsItem](https://developer.apple.com/documentation/appstoreserverapi/lasttransactionsitem)
public struct LastTransactionsItem: Decodable, Encodable, Hashable {
public struct LastTransactionsItem: Decodable, Encodable, Hashable, Sendable {

public init(status: Status? = nil, originalTransactionId: String? = nil, signedTransactionInfo: String? = nil, signedRenewalInfo: String? = nil) {
self.status = status
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
///A value that indicates the total amount, in USD, of in-app purchases the customer has made in your app, across all platforms.
///
///[lifetimeDollarsPurchased](https://developer.apple.com/documentation/appstoreserverapi/lifetimedollarspurchased)
public enum LifetimeDollarsPurchased: Int32, Decodable, Encodable, Hashable {
public enum LifetimeDollarsPurchased: Int32, Decodable, Encodable, Hashable, Sendable {
case undeclared = 0
case zeroDollars = 1
case oneCentToFortyNineDollarsAndNinetyNineCents = 2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
///A value that indicates the dollar amount of refunds the customer has received in your app, since purchasing the app, across all platforms.
///
///[lifetimeDollarsRefunded](https://developer.apple.com/documentation/appstoreserverapi/lifetimedollarsrefunded)
public enum LifetimeDollarsRefunded: Int32, Decodable, Encodable, Hashable {
public enum LifetimeDollarsRefunded: Int32, Decodable, Encodable, Hashable, Sendable {
case undeclared = 0
case zeroDollars = 1
case oneCentToFortyNineDollarsAndNinetyNineCents = 2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
///The request body that contains subscription-renewal-extension data to apply for all eligible active subscribers.
///
///[MassExtendRenewalDateRequest](https://developer.apple.com/documentation/appstoreserverapi/massextendrenewaldaterequest)
public struct MassExtendRenewalDateRequest: Decodable, Encodable, Hashable {
public struct MassExtendRenewalDateRequest: Decodable, Encodable, Hashable, Sendable {

public init(extendByDays: Int32? = nil, extendReasonCode: ExtendReasonCode? = nil, requestIdentifier: String? = nil, storefrontCountryCodes: [String]? = nil, productId: String? = nil) {
self.extendByDays = extendByDays
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
///A response that indicates the server successfully received the subscription-renewal-date extension request.
///
///[MassExtendRenewalDateResponse](https://developer.apple.com/documentation/appstoreserverapi/massextendrenewaldateresponse)
public struct MassExtendRenewalDateResponse: Decodable, Encodable, Hashable {
public struct MassExtendRenewalDateResponse: Decodable, Encodable, Hashable, Sendable {

public init(requestIdentifier: String? = nil) {
self.requestIdentifier = requestIdentifier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Foundation
///A response that indicates the current status of a request to extend the subscription renewal date to all eligible subscribers.
///
///[MassExtendRenewalDateStatusResponse](https://developer.apple.com/documentation/appstoreserverapi/massextendrenewaldatestatusresponse)
public struct MassExtendRenewalDateStatusResponse: Decodable, Encodable, Hashable {
public struct MassExtendRenewalDateStatusResponse: Decodable, Encodable, Hashable, Sendable {

public init(requestIdentifier: String? = nil, complete: Bool? = nil, completeDate: Date? = nil, succeededCount: Int64? = nil, failedCount: Int64? = nil) {
self.requestIdentifier = requestIdentifier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Foundation
///The request body for notification history.
///
///[NotificationHistoryRequest](https://developer.apple.com/documentation/appstoreserverapi/notificationhistoryrequest)
public struct NotificationHistoryRequest: Decodable, Encodable, Hashable {
public struct NotificationHistoryRequest: Decodable, Encodable, Hashable, Sendable {

public init(startDate: Date? = nil, endDate: Date? = nil, notificationType: NotificationTypeV2? = nil, notificationSubtype: Subtype? = nil, transactionId: String? = nil, onlyFailures: Bool? = nil) {
self.startDate = startDate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
///A response that contains the App Store Server Notifications history for your app.
///
///[NotificationHistoryResponse](https://developer.apple.com/documentation/appstoreserverapi/notificationhistoryresponse)
public struct NotificationHistoryResponse: Decodable, Encodable, Hashable {
public struct NotificationHistoryResponse: Decodable, Encodable, Hashable, Sendable {

public init(paginationToken: String? = nil, hasMore: Bool? = nil, notificationHistory: [NotificationHistoryResponseItem]? = nil) {
self.paginationToken = paginationToken
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
///The App Store server notification history record, including the signed notification payload and the result of the server’s first send attempt.
///
///[notificationHistoryResponseItem](https://developer.apple.com/documentation/appstoreserverapi/notificationhistoryresponseitem)
public struct NotificationHistoryResponseItem: Decodable, Encodable, Hashable {
public struct NotificationHistoryResponseItem: Decodable, Encodable, Hashable, Sendable {

public init(signedPayload: String? = nil, sendAttempts: [SendAttemptItem]? = nil) {
self.signedPayload = signedPayload
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
///The type that describes the in-app purchase or external purchase event for which the App Store sends the version 2 notification.
///
///[notificationType](https://developer.apple.com/documentation/appstoreservernotifications/notificationtype)
public enum NotificationTypeV2: String, Decodable, Encodable, Hashable {
public enum NotificationTypeV2: String, Decodable, Encodable, Hashable, Sendable {
case subscribed = "SUBSCRIBED"
case didChangeRenewalPref = "DID_CHANGE_RENEWAL_PREF"
case didChangeRenewalStatus = "DID_CHANGE_RENEWAL_STATUS"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
///The payment mode you configure for an introductory offer, promotional offer, or offer code on an auto-renewable subscription.
///
///[offerDiscountType](https://developer.apple.com/documentation/appstoreserverapi/offerdiscounttype)
public enum OfferDiscountType: String, Decodable, Encodable, Hashable {
public enum OfferDiscountType: String, Decodable, Encodable, Hashable, Sendable {
case freeTrial = "FREE_TRIAL"
case payAsYouGo = "PAY_AS_YOU_GO"
case payUpFront = "PAY_UP_FRONT"
Expand Down
2 changes: 1 addition & 1 deletion Sources/AppStoreServerLibrary/Models/OfferType.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
///The type of subscription offer.
///
///[offerType](https://developer.apple.com/documentation/appstoreserverapi/offertype)
public enum OfferType: Int32, Decodable, Encodable, Hashable {
public enum OfferType: Int32, Decodable, Encodable, Hashable, Sendable {
case introductoryOffer = 1
case promotionalOffer = 2
case subscriptionOfferCode = 3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
///A response that includes the order lookup status and an array of signed transactions for the in-app purchases in the order.
///
///[OrderLookupResponse](https://developer.apple.com/documentation/appstoreserverapi/orderlookupresponse)
public struct OrderLookupResponse: Decodable, Encodable, Hashable {
public struct OrderLookupResponse: Decodable, Encodable, Hashable, Sendable {

public init(status: OrderLookupStatus? = nil, signedTransactions: [String]? = nil) {
self.status = status
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
///A value that indicates whether the order ID in the request is valid for your app.
///
///[OrderLookupStatus](https://developer.apple.com/documentation/appstoreserverapi/orderlookupstatus)
public enum OrderLookupStatus: Int32, Decodable, Encodable, Hashable {
public enum OrderLookupStatus: Int32, Decodable, Encodable, Hashable, Sendable {
case valid = 0
case invalid = 1
}
2 changes: 1 addition & 1 deletion Sources/AppStoreServerLibrary/Models/Platform.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
///The platform on which the customer consumed the in-app purchase.
///
///[platform](https://developer.apple.com/documentation/appstoreserverapi/platform)
public enum Platform: Int32, Decodable, Encodable, Hashable {
public enum Platform: Int32, Decodable, Encodable, Hashable, Sendable {
case undeclared = 0
case apple = 1
case nonApple = 2
Expand Down
Loading

0 comments on commit b631d37

Please sign in to comment.