-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bedfb7a
commit c246212
Showing
24 changed files
with
969 additions
and
314 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--swiftversion 6.0 | ||
--disable preferKeyPath | ||
--ifdef no-indent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
Sources/OversizeAppStoreServices/Models/CustomerReviewResponseV1.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// | ||
// Copyright © 2024 Alexander Romanov | ||
// CustomerReviewResponseV1.swift, created on 22.11.2024 | ||
// | ||
|
||
import AppStoreAPI | ||
import AppStoreConnect | ||
import Foundation | ||
|
||
public struct CustomerReviewResponseV1: Sendable, Identifiable { | ||
public enum State: String, CaseIterable, Codable, Sendable { | ||
case published = "PUBLISHED" | ||
case pendingPublish = "PENDING_PUBLISH" | ||
} | ||
|
||
public let id: String | ||
public let responseBody: String | ||
public let lastModifiedDate: Date | ||
public let state: State | ||
|
||
init?(schema: AppStoreAPI.CustomerReviewResponseV1) { | ||
guard let attributes = schema.attributes, | ||
let responseBody = attributes.responseBody, | ||
let lastModifiedDate = attributes.lastModifiedDate, | ||
let stateRawValue = attributes.state?.rawValue, | ||
let state: State = .init(rawValue: stateRawValue) | ||
else { return nil } | ||
id = schema.id | ||
self.responseBody = responseBody | ||
self.lastModifiedDate = lastModifiedDate | ||
self.state = state | ||
} | ||
} |
Oops, something went wrong.