Skip to content

Commit

Permalink
Merge branch '360-fetch-api-specs-from-repo' into 'master'
Browse files Browse the repository at this point in the history
Resolve "Fetch API specs from repo"

Closes #360

See merge request pace/mobile/ios/pace-cloud-sdk!412
  • Loading branch information
telip007 committed May 22, 2024
2 parents 1095d4f + 58c0f4f commit 1ea3774
Show file tree
Hide file tree
Showing 114 changed files with 1,165 additions and 39,039 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"originHash" : "e0713bdbaed12173aa79fd8b5a53a02b221bf41ba76d358427b2b685b30cc4f9",
"originHash" : "da68c000b21e6de9cfbaf22201af9660e783191ac5de2b84d7c74dea2a63667e",
"pins" : [
{
"identity" : "appauth-ios",
Expand Down Expand Up @@ -69,17 +69,16 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-syntax.git",
"state" : {
"revision" : "6ad4ea24b01559dde0773e3d091f1b9e36175036",
"version" : "509.0.2"
"revision" : "08a2f0a9a30e0f705f79c9cfaca1f68b71bdc775",
"version" : "510.0.0"
}
},
{
"identity" : "swiftlint",
"kind" : "remoteSourceControl",
"location" : "https://github.com/realm/SwiftLint.git",
"state" : {
"revision" : "f17a4f9dfb6a6afb0408426354e4180daaf49cee",
"version" : "0.54.0"
"revision" : "108b1fca7a9445c12a92a83fdd9945ae03309f5d"
}
},
{
Expand Down Expand Up @@ -119,5 +118,5 @@
}
}
],
"version" : 2
"version" : 3
}
734 changes: 187 additions & 547 deletions PACECloudSDK.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/realm/SwiftLint.git",
"state" : {
"branch" : "main",
"revision" : "108b1fca7a9445c12a92a83fdd9945ae03309f5d"
}
},
Expand Down Expand Up @@ -110,5 +109,5 @@
}
}
],
"version" : 2
"version" : 3
}
6 changes: 3 additions & 3 deletions PACECloudSDK/API/Fueling/Generated/FuelingAPI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ public struct FuelingAPI {
locale: Locale(identifier: "de_DE"),
calendar: Calendar(identifier: .gregorian))

public static let version = "2022-1"
public static let version = "2024-2"

public enum Discount {}
public enum Fueling {}
public enum Notification {}

public enum FuelingAPIServer {
/** Production server (stable release 2022-1) **/
public static let main = "https://api.pace.cloud/fueling/2022-1"
/** Production server (stable release 2024-2) **/
public static let main = "https://api.pace.cloud/fueling/2024-2"
}
}

2 changes: 1 addition & 1 deletion PACECloudSDK/API/Fueling/Generated/FuelingAPIRequest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class FuelingAPIRequest<ResponseType: APIResponseValue> {
public let encodeBody: ((RequestEncoder) throws -> Data)?
private(set) var headerParameters: [String: String]
public var customHeaders: [String: String] = [:]
public var version: String = "2022-1"
public var version: String = "2024-2"
public var contentType: String = "application/json"

public var headers: [String: String] {
Expand Down
2 changes: 2 additions & 0 deletions PACECloudSDK/API/Fueling/Generated/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,11 @@ To add support for a specific asynchronous library, just add an extension on `Fu
- **PCFuelingPaymentMethod**
- **PCFuelingPaymentMethodKind**
- **PCFuelingProcessPaymentResponse**
- **PCFuelingProduct**
- **PCFuelingPump**
- **PCFuelingPumpResponse**
- **PCFuelingTransaction**
- **PCFuelingTransactionMetadata**
- **PCFuelingTransactionRequest**

## Requests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2186,6 +2186,23 @@ Example:
/** The provided priceIncludingVAT does not match the actual price */
case status409(Status409)

/** Precondition failed
```
{
"errors": [
{
"id": "buck3h44qtf5j268141g",
"title": "Pump already unlocked/in-use on site by someone else",
"detail": "",
"status": "412",
"code": "FUELING_PUMP_BUSY_ON_SITE"
}
]
}
```
*/
case status412(PCFuelingErrors)

/** The specified content type header is invalid */
case status415(Status415)

Expand Down Expand Up @@ -2214,6 +2231,7 @@ Example:
case .status404(let response): return response
case .status406(let response): return response
case .status409(let response): return response
case .status412(let response): return response
case .status415(let response): return response
case .status422(let response): return response
case .status500(let response): return response
Expand All @@ -2232,6 +2250,7 @@ Example:
case .status404: return 404
case .status406: return 406
case .status409: return 409
case .status412: return 412
case .status415: return 415
case .status422: return 422
case .status500: return 500
Expand All @@ -2249,6 +2268,7 @@ Example:
case .status404: return false
case .status406: return false
case .status409: return false
case .status412: return false
case .status415: return false
case .status422: return false
case .status500: return false
Expand All @@ -2266,6 +2286,7 @@ Example:
case 404: self = try .status404(decoder.decode(Status404.self, from: data))
case 406: self = try .status406(decoder.decode(Status406.self, from: data))
case 409: self = try .status409(decoder.decode(Status409.self, from: data))
case 412: self = try .status412(decoder.decode(PCFuelingErrors.self, from: data))
case 415: self = try .status415(decoder.decode(Status415.self, from: data))
case 422: self = try .status422(decoder.decode(Status422.self, from: data))
case 500: self = try .status500(decoder.decode(Status500.self, from: data))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,19 @@ public class PCFuelingApproachingResponse: APIModel {

public var transactions: [PCFuelingTransaction]?

public var unsupportedPaymentMethodKinds: [PCFuelingPaymentMethodKind]?

public var unsupportedPaymentMethods: [PCFuelingPaymentMethod]?

public init(id: ID? = nil, type: PCFuelingType? = nil, gasStation: PCFuelingGasStation? = nil, gasStationNote: PCFuelingGasStationNote? = nil, paymentMethods: [PCFuelingPaymentMethod]? = nil, supportedPaymentMethodKinds: [PCFuelingPaymentMethodKind]? = nil, transactions: [PCFuelingTransaction]? = nil, unsupportedPaymentMethods: [PCFuelingPaymentMethod]? = nil) {
public init(id: ID? = nil, type: PCFuelingType? = nil, gasStation: PCFuelingGasStation? = nil, gasStationNote: PCFuelingGasStationNote? = nil, paymentMethods: [PCFuelingPaymentMethod]? = nil, supportedPaymentMethodKinds: [PCFuelingPaymentMethodKind]? = nil, transactions: [PCFuelingTransaction]? = nil, unsupportedPaymentMethodKinds: [PCFuelingPaymentMethodKind]? = nil, unsupportedPaymentMethods: [PCFuelingPaymentMethod]? = nil) {
self.id = id
self.type = type
self.gasStation = gasStation
self.gasStationNote = gasStationNote
self.paymentMethods = paymentMethods
self.supportedPaymentMethodKinds = supportedPaymentMethodKinds
self.transactions = transactions
self.unsupportedPaymentMethodKinds = unsupportedPaymentMethodKinds
self.unsupportedPaymentMethods = unsupportedPaymentMethods
}

Expand All @@ -49,6 +52,7 @@ public class PCFuelingApproachingResponse: APIModel {
paymentMethods = try container.decodeIfPresent("paymentMethods")
supportedPaymentMethodKinds = try container.decodeIfPresent("supportedPaymentMethodKinds")
transactions = try container.decodeIfPresent("transactions")
unsupportedPaymentMethodKinds = try container.decodeIfPresent("unsupportedPaymentMethodKinds")
unsupportedPaymentMethods = try container.decodeIfPresent("unsupportedPaymentMethods")
}

Expand All @@ -62,6 +66,7 @@ public class PCFuelingApproachingResponse: APIModel {
try container.encodeIfPresent(paymentMethods, forKey: "paymentMethods")
try container.encodeIfPresent(supportedPaymentMethodKinds, forKey: "supportedPaymentMethodKinds")
try container.encodeIfPresent(transactions, forKey: "transactions")
try container.encodeIfPresent(unsupportedPaymentMethodKinds, forKey: "unsupportedPaymentMethodKinds")
try container.encodeIfPresent(unsupportedPaymentMethods, forKey: "unsupportedPaymentMethods")
}

Expand All @@ -74,6 +79,7 @@ public class PCFuelingApproachingResponse: APIModel {
guard self.paymentMethods == object.paymentMethods else { return false }
guard self.supportedPaymentMethodKinds == object.supportedPaymentMethodKinds else { return false }
guard self.transactions == object.transactions else { return false }
guard self.unsupportedPaymentMethodKinds == object.unsupportedPaymentMethodKinds else { return false }
guard self.unsupportedPaymentMethods == object.unsupportedPaymentMethods else { return false }
return true
}
Expand Down
6 changes: 6 additions & 0 deletions PACECloudSDK/API/Generated/Models/PCFuelingFuelPrice.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,15 @@ public class PCFuelingFuelPrice: APIModel {
case ron95e5 = "ron95e5"
case ron100 = "ron100"
case dieselGtl = "dieselGtl"
case dieselB0 = "dieselB0"
case dieselB7 = "dieselB7"
case dieselB15 = "dieselB15"
case dieselB20 = "dieselB20"
case dieselBMix = "dieselBMix"
case dieselPremium = "dieselPremium"
case dieselHvo = "dieselHvo"
case dieselRed = "dieselRed"
case dieselSynthetic = "dieselSynthetic"
case lpg = "lpg"
case cng = "cng"
case lng = "lng"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,15 @@ public class PCFuelingFuelPriceResponse: APIModel {
case ron95e5 = "ron95e5"
case ron100 = "ron100"
case dieselGtl = "dieselGtl"
case dieselB0 = "dieselB0"
case dieselB7 = "dieselB7"
case dieselB15 = "dieselB15"
case dieselB20 = "dieselB20"
case dieselBMix = "dieselBMix"
case dieselPremium = "dieselPremium"
case dieselHvo = "dieselHvo"
case dieselRed = "dieselRed"
case dieselSynthetic = "dieselSynthetic"
case lpg = "lpg"
case cng = "cng"
case lng = "lng"
Expand Down
51 changes: 9 additions & 42 deletions PACECloudSDK/API/Generated/Models/PCFuelingPaymentMethodKind.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,69 +45,40 @@ This field is optional and if not present should be assumed to indicate `implici
/** data privacy information */
public class DataPrivacy: APIModel {

/** Localized hint that data privacy terms apply. The hint comes formatted in multiple ways, which are all equally valid if given. Additional formats might be added in the future. */
public var hint: Hint?

/** Localized data privacy terms. The terms come formatted in multiple ways, which are all equally valid if given. Additional formats might be added in the future. */
public var terms: Terms?

/** Localized hint that data privacy terms apply. The hint comes formatted in multiple ways, which are all equally valid if given. Additional formats might be added in the future. */
public class Hint: APIModel {

/** Hint formatted as markdown. Contains only links to the reference <code>terms</code>. Does not contain other links. Other than that, only contains markdown syntax for <a href="https://daringfireball.net/projects/markdown/syntax#p">Paragraphs and Line Breaks</a> and <a href="https://daringfireball.net/projects/markdown/syntax#em">Emphasis</a>. */
public var markdown: String?

public init(markdown: String? = nil) {
self.markdown = markdown
}

public required init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: StringCodingKey.self)

markdown = try container.decodeIfPresent("markdown")
}

public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: StringCodingKey.self)

try container.encodeIfPresent(markdown, forKey: "markdown")
}

public func isEqual(to object: Any?) -> Bool {
guard let object = object as? Hint else { return false }
guard self.markdown == object.markdown else { return false }
return true
}

public static func == (lhs: Hint, rhs: Hint) -> Bool {
return lhs.isEqual(to: rhs)
}
}

/** Localized data privacy terms. The terms come formatted in multiple ways, which are all equally valid if given. Additional formats might be added in the future. */
public class Terms: APIModel {

/** Terms formatted as markdown. Does not contain external resources like images. */
public var html: String?

/** Terms formatted as markdown. Does not contain external resources like images. */
public var markdown: String?

public init(markdown: String? = nil) {
public init(html: String? = nil, markdown: String? = nil) {
self.html = html
self.markdown = markdown
}

public required init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: StringCodingKey.self)

html = try container.decodeIfPresent("html")
markdown = try container.decodeIfPresent("markdown")
}

public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: StringCodingKey.self)

try container.encodeIfPresent(html, forKey: "html")
try container.encodeIfPresent(markdown, forKey: "markdown")
}

public func isEqual(to object: Any?) -> Bool {
guard let object = object as? Terms else { return false }
guard self.html == object.html else { return false }
guard self.markdown == object.markdown else { return false }
return true
}
Expand All @@ -117,28 +88,24 @@ This field is optional and if not present should be assumed to indicate `implici
}
}

public init(hint: Hint? = nil, terms: Terms? = nil) {
self.hint = hint
public init(terms: Terms? = nil) {
self.terms = terms
}

public required init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: StringCodingKey.self)

hint = try container.decodeIfPresent("hint")
terms = try container.decodeIfPresent("terms")
}

public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: StringCodingKey.self)

try container.encodeIfPresent(hint, forKey: "hint")
try container.encodeIfPresent(terms, forKey: "terms")
}

public func isEqual(to object: Any?) -> Bool {
guard let object = object as? DataPrivacy else { return false }
guard self.hint == object.hint else { return false }
guard self.terms == object.terms else { return false }
return true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ public class PCFuelingProcessPaymentResponse: APIModel {
/** Amount that was discounted. Only if any discounts were applied earlier. */
public var discountAmount: Decimal?

/** Driver/vehicle identification */
public var driverVehicleID: String?

public var gasStationId: ID?

/** Mileage in meters */
Expand Down Expand Up @@ -77,12 +80,13 @@ public class PCFuelingProcessPaymentResponse: APIModel {
}
}

public init(id: ID? = nil, type: PCFuelingType? = nil, vat: VAT? = nil, currency: String? = nil, discountAmount: Decimal? = nil, gasStationId: ID? = nil, mileage: Int? = nil, paymentToken: String? = nil, priceIncludingVAT: Decimal? = nil, priceWithoutVAT: Decimal? = nil, pumpId: ID? = nil, vin: String? = nil) {
public init(id: ID? = nil, type: PCFuelingType? = nil, vat: VAT? = nil, currency: String? = nil, discountAmount: Decimal? = nil, driverVehicleID: String? = nil, gasStationId: ID? = nil, mileage: Int? = nil, paymentToken: String? = nil, priceIncludingVAT: Decimal? = nil, priceWithoutVAT: Decimal? = nil, pumpId: ID? = nil, vin: String? = nil) {
self.id = id
self.type = type
self.vat = vat
self.currency = currency
self.discountAmount = discountAmount
self.driverVehicleID = driverVehicleID
self.gasStationId = gasStationId
self.mileage = mileage
self.paymentToken = paymentToken
Expand All @@ -100,6 +104,7 @@ public class PCFuelingProcessPaymentResponse: APIModel {
vat = try container.decodeIfPresent("VAT")
currency = try container.decodeIfPresent("currency")
discountAmount = try container.decodeLosslessDecimal("discountAmount")
driverVehicleID = try container.decodeIfPresent("driverVehicleID")
gasStationId = try container.decodeIfPresent("gasStationId")
mileage = try container.decodeIfPresent("mileage")
paymentToken = try container.decodeIfPresent("paymentToken")
Expand All @@ -117,6 +122,7 @@ public class PCFuelingProcessPaymentResponse: APIModel {
try container.encodeIfPresent(vat, forKey: "VAT")
try container.encodeIfPresent(currency, forKey: "currency")
try container.encodeIfPresent(discountAmount, forKey: "discountAmount")
try container.encodeIfPresent(driverVehicleID, forKey: "driverVehicleID")
try container.encodeIfPresent(gasStationId, forKey: "gasStationId")
try container.encodeIfPresent(mileage, forKey: "mileage")
try container.encodeIfPresent(paymentToken, forKey: "paymentToken")
Expand All @@ -133,6 +139,7 @@ public class PCFuelingProcessPaymentResponse: APIModel {
guard self.vat == object.vat else { return false }
guard self.currency == object.currency else { return false }
guard self.discountAmount == object.discountAmount else { return false }
guard self.driverVehicleID == object.driverVehicleID else { return false }
guard self.gasStationId == object.gasStationId else { return false }
guard self.mileage == object.mileage else { return false }
guard self.paymentToken == object.paymentToken else { return false }
Expand Down
Loading

0 comments on commit 1ea3774

Please sign in to comment.