Skip to content

Commit 95865d6

Browse files
committed
Add POS prefix to catalog response structs/enum.
1 parent 3e7625e commit 95865d6

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

Modules/Sources/Networking/Remote/POSCatalogSyncRemote.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,14 @@ public class POSCatalogSyncRemote: Remote {
6666
/// - Returns: Catalog job response with job ID.
6767
///
6868
// periphery:ignore - TODO - remove this periphery ignore comment when this endpoint is integrated with catalog sync
69-
public func generateCatalog(for siteID: Int64, forceGenerate: Bool = false) async throws -> CatalogGenerationResponse {
69+
public func generateCatalog(for siteID: Int64, forceGenerate: Bool = false) async throws -> POSCatalogGenerationResponse {
7070
let path = "catalog"
7171
let parameters: [String: Any] = [
7272
ParameterKey.fullSyncFields: POSProduct.requestFields
7373
]
7474

7575
let request = JetpackRequest(wooApiVersion: .mark3, method: .post, siteID: siteID, path: path, parameters: parameters, availableAsRESTRequest: true)
76-
let mapper = SingleItemMapper<CatalogGenerationResponse>(siteID: siteID)
76+
let mapper = SingleItemMapper<POSCatalogGenerationResponse>(siteID: siteID)
7777
return try await enqueue(request, mapper: mapper)
7878
}
7979

@@ -85,11 +85,11 @@ public class POSCatalogSyncRemote: Remote {
8585
/// - Returns: Catalog status response.
8686
///
8787
// periphery:ignore - TODO - remove this periphery ignore comment when this endpoint is integrated with catalog sync
88-
public func checkCatalogStatus(for siteID: Int64, jobID: String) async throws -> CatalogStatusResponse {
88+
public func checkCatalogStatus(for siteID: Int64, jobID: String) async throws -> POSCatalogStatusResponse {
8989
let path = "catalog/status/\(jobID)"
9090

9191
let request = JetpackRequest(wooApiVersion: .mark3, method: .get, siteID: siteID, path: path, availableAsRESTRequest: true)
92-
let mapper = SingleItemMapper<CatalogStatusResponse>(siteID: siteID)
92+
let mapper = SingleItemMapper<POSCatalogStatusResponse>(siteID: siteID)
9393
return try await enqueue(request, mapper: mapper)
9494
}
9595
}
@@ -114,7 +114,7 @@ private extension POSCatalogSyncRemote {
114114

115115
/// Response from catalog generation request.
116116
// periphery:ignore - TODO - remove this periphery ignore comment when the corresponding endpoint is integrated with catalog sync
117-
public struct CatalogGenerationResponse: Decodable {
117+
public struct POSCatalogGenerationResponse: Decodable {
118118
/// Unique identifier for tracking the catalog generation job.
119119
public let jobID: String
120120

@@ -125,9 +125,9 @@ public struct CatalogGenerationResponse: Decodable {
125125

126126
/// Response from catalog status check.
127127
// periphery:ignore - TODO - remove this periphery ignore comment when the corresponding endpoint is integrated with catalog sync
128-
public struct CatalogStatusResponse: Decodable {
128+
public struct POSCatalogStatusResponse: Decodable {
129129
/// Current status of the catalog generation job.
130-
public let status: CatalogStatus
130+
public let status: POSCatalogStatus
131131
/// Download URL for the completed catalog (available when status is complete).
132132
public let downloadURL: String?
133133
/// Progress percentage of the catalog generation (0.0 to 100.0).
@@ -141,7 +141,7 @@ public struct CatalogStatusResponse: Decodable {
141141
}
142142

143143
/// Catalog generation status.
144-
public enum CatalogStatus: String, Decodable {
144+
public enum POSCatalogStatus: String, Decodable {
145145
case pending
146146
case processing
147147
case complete

0 commit comments

Comments
 (0)