From 4382f027d7ad5b6e9cf771c82a7218dd7ef2bc5e Mon Sep 17 00:00:00 2001 From: pokepay-ci Date: Sat, 22 Aug 2026 04:05:29 +0000 Subject: [PATCH] Generate ios-sdk by pokepay-server generate-mobile-sdk-pr.yml --- Sources/Pokepay/BankAPI.swift | 5 ++ .../BankAPI/Account/CreateAccount.swift | 11 ++- .../Account/CreateAccountCpmToken.swift | 82 +++++++++---------- .../Pokepay/BankAPI/Account/GetAccount.swift | 19 +++-- .../BankAPI/Account/GetAccountBalances.swift | 52 ++++++++++++ .../Account/GetAccountCouponDetail.swift | 13 ++- .../BankAPI/Account/GetAccountCoupons.swift | 14 +++- .../Account/GetAccountTransactions.swift | 19 +++-- .../BankAPI/Account/GetAccountTransfers.swift | 22 +++-- .../Account/PatchAccountCouponDetail.swift | 25 +++--- .../BankAPI/Account/SendToAccount.swift | 50 +++++++++++ .../BankAPI/Account/UpdateAccount.swift | 34 ++++++++ .../BankPayTopUp.swift} | 34 ++++---- .../Pokepay/BankAPI/Bank/CreateBankPay.swift | 42 ++++++++++ .../Pokepay/BankAPI/Bank/DeleteBankPay.swift | 32 ++++++++ Sources/Pokepay/BankAPI/Bill/CreateBill.swift | 47 ++++++++++- Sources/Pokepay/BankAPI/Bill/DeleteBill.swift | 17 ++-- Sources/Pokepay/BankAPI/Bill/GetBill.swift | 25 ++++-- .../BankAPI/Bill/GetBillTransactions.swift | 46 +++++++++++ Sources/Pokepay/BankAPI/Bill/UpdateBill.swift | 28 +++++-- .../GetAccountCampaignPointAmounts.swift | 30 +++++++ .../BankAPI/Cashtray/CreateCashtray.swift | 23 ++++-- .../BankAPI/Cashtray/DeleteCashtray.swift | 17 ++-- .../BankAPI/Cashtray/GetCashtray.swift | 19 +++-- .../Cashtray/GetCashtrayAttempts.swift | 17 ++-- .../BankAPI/Cashtray/UpdateCashtray.swift | 25 ++++-- .../Pokepay/BankAPI/Check/CreateCheck.swift | 59 +++++++++++-- .../Pokepay/BankAPI/Check/DeleteCheck.swift | 17 ++-- Sources/Pokepay/BankAPI/Check/GetCheck.swift | 17 ++-- .../Pokepay/BankAPI/Check/UpdateCheck.swift | 32 ++++++-- .../BankAPI/Coupon/GetCouponDetail.swift | 28 +++++++ .../Coupon/GetPrivateMoneyCoupons.swift | 46 +++++++++++ Sources/Pokepay/BankAPI/Cpm/GetCpmToken.swift | 28 +++++++ .../CreditWithCreditCardMembership.swift | 52 ++++++++++++ .../GetVeritransMdkTokenApiKey.swift | 32 ++++++++ .../CreditCard/TopupWithCreditCard.swift | 54 ++++++++++++ .../Merchants/GetMerchantTransaction.swift | 28 +++++++ .../PrivateMoney/GetPrivateMoney.swift | 12 +-- .../GetPrivateMoneyCommercialAct.swift | 28 +++++++ .../GetPrivateMoneyPaymentAct.swift | 28 +++++++ .../GetPrivateMoneyPrivacyPolicy.swift | 28 +++++++ .../PrivateMoney/GetPrivateMoneyTerms.swift | 28 +++++++ .../PrivateMoney/SearchPrivateMoneys.swift | 19 +++-- .../Pokepay/BankAPI/Shop/GetListOfShops.swift | 8 +- .../BankAPI/Terminal/GetTerminal.swift | 13 ++- .../BankAPI/Terminal/GetTerminalById.swift | 28 +++++++ .../BankAPI/Terminal/UpdateTerminal.swift | 37 ++++++--- .../Transaction/CreateBillTransaction.swift | 58 ------------- .../CreateCashtrayTransaction.swift | 58 ------------- .../Transaction/CreateCpmTransaction.swift | 56 ------------- .../CreateTransactionWithBill.swift | 37 +++++---- .../CreateTransactionWithCashtray.swift | 29 ++++--- .../CreateTransactionWithCheck.swift | 23 ++++-- .../CreateTransactionWithCpm.swift | 30 ++++--- .../BankAPI/Transaction/GetTransaction.swift | 19 +++-- .../Transaction/RefundTransaction.swift | 34 ++++++++ Sources/Pokepay/BankAPI/User/DeleteUser.swift | 28 +++++++ Sources/Pokepay/BankAPI/User/GetUser.swift | 28 +++++++ .../BankAPI/User/GetUserAccounts.swift | 19 +++-- .../BankAPI/User/GetUserSettingUrl.swift | 14 ++-- .../BankAPI/User/GetUserTransactions.swift | 19 +++-- .../BankAPI/User/GetUserWithAuthFactors.swift | 16 ++-- Sources/Pokepay/BankAPI/User/UpdateUser.swift | 15 ++-- Sources/Pokepay/Responses/Account.swift | 15 ++-- .../Pokepay/Responses/AccountBalance.swift | 3 +- .../AccountCampaignPointAmounts.swift | 1 + Sources/Pokepay/Responses/AccountDetail.swift | 28 +++++++ .../Pokepay/Responses/BankPaySession.swift | 12 +++ Sources/Pokepay/Responses/Bill.swift | 21 +++-- .../BillWithAdditionalPrivateMoneys.swift | 30 +++++++ Sources/Pokepay/Responses/Cashtray.swift | 19 ++--- .../Pokepay/Responses/CashtrayAttempt.swift | 17 ++-- .../Pokepay/Responses/CashtrayAttempts.swift | 3 +- .../CashtrayWithAttemptAndTransaction.swift | 28 +++++++ Sources/Pokepay/Responses/Check.swift | 21 ++--- Sources/Pokepay/Responses/Coupon.swift | 49 +++++------ Sources/Pokepay/Responses/CouponDetail.swift | 57 ++++++------- Sources/Pokepay/Responses/CouponInfo.swift | 44 ++++++++++ Sources/Pokepay/Responses/CpmToken.swift | 24 ++++++ .../Responses/FallbackPrivateMoney.swift | 12 +++ .../Responses/IdentificationMatch.swift | 9 +- .../Responses/IdentificationResult.swift | 7 +- .../IndividualNumberIdentificationError.swift | 16 ++++ .../Responses/OauthFullAccessUrl.swift | 10 +++ Sources/Pokepay/Responses/Organization.swift | 6 ++ .../Responses/PaginatedAccountBalances.swift | 13 +-- .../Responses/PaginatedAccountCoupons.swift | 18 ++++ .../PaginatedAccountTransactions.swift | 18 ++++ .../Responses/PaginatedAccountTransfers.swift | 18 ++++ .../Responses/PaginatedBillTransactions.swift | 18 ++++ .../PaginatedPrivateMoneyCoupons.swift | 18 ++++ .../Responses/PaginatedPrivateMoneys.swift | 13 +-- .../Responses/PaginatedUserAccounts.swift | 18 ++++ .../Responses/PaginatedUserTransactions.swift | 18 ++++ Sources/Pokepay/Responses/PrivateMoney.swift | 39 +++++---- .../Responses/PrivateMoneyDetail.swift | 62 ++++++++++++++ .../Responses/PrivateMoneyImages.swift | 14 ++++ .../Responses/PrivateMoneyLegalText.swift | 10 +++ .../Responses/PrivateMoneySounds.swift | 10 +++ .../Responses/PrivateMoneyTopupMethod.swift | 16 ++++ Sources/Pokepay/Responses/Terminal.swift | 11 +-- Sources/Pokepay/Responses/User.swift | 5 +- Sources/Pokepay/Responses/UserBank.swift | 26 ++++++ .../Pokepay/Responses/UserTransaction.swift | 31 +++---- .../UserTransactionWithCustomerBalance.swift | 36 ++++++++ ...actionWithFallbackAndCustomerBalance.swift | 40 +++++++++ ...ctionWithTransfersAndCustomerBalance.swift | 38 +++++++++ Sources/Pokepay/Responses/UserTransfer.swift | 30 +++++++ .../Responses/UserWithAuthFactors.swift | 11 ++- .../Pokepay/Responses/UserWithDetails.swift | 20 +++++ .../Responses/VeritransMdkTokenApiKey.swift | 10 +++ 111 files changed, 2230 insertions(+), 616 deletions(-) create mode 100644 Sources/Pokepay/BankAPI/Account/GetAccountBalances.swift create mode 100644 Sources/Pokepay/BankAPI/Account/SendToAccount.swift create mode 100644 Sources/Pokepay/BankAPI/Account/UpdateAccount.swift rename Sources/Pokepay/BankAPI/{Transaction/CreateCheckTransaction.swift => Bank/BankPayTopUp.swift} (52%) create mode 100644 Sources/Pokepay/BankAPI/Bank/CreateBankPay.swift create mode 100644 Sources/Pokepay/BankAPI/Bank/DeleteBankPay.swift create mode 100644 Sources/Pokepay/BankAPI/Bill/GetBillTransactions.swift create mode 100644 Sources/Pokepay/BankAPI/Campaign/GetAccountCampaignPointAmounts.swift create mode 100644 Sources/Pokepay/BankAPI/Coupon/GetCouponDetail.swift create mode 100644 Sources/Pokepay/BankAPI/Coupon/GetPrivateMoneyCoupons.swift create mode 100644 Sources/Pokepay/BankAPI/Cpm/GetCpmToken.swift create mode 100644 Sources/Pokepay/BankAPI/CreditCard/CreditWithCreditCardMembership.swift create mode 100644 Sources/Pokepay/BankAPI/CreditCard/GetVeritransMdkTokenApiKey.swift create mode 100644 Sources/Pokepay/BankAPI/CreditCard/TopupWithCreditCard.swift create mode 100644 Sources/Pokepay/BankAPI/Merchants/GetMerchantTransaction.swift create mode 100644 Sources/Pokepay/BankAPI/PrivateMoney/GetPrivateMoneyCommercialAct.swift create mode 100644 Sources/Pokepay/BankAPI/PrivateMoney/GetPrivateMoneyPaymentAct.swift create mode 100644 Sources/Pokepay/BankAPI/PrivateMoney/GetPrivateMoneyPrivacyPolicy.swift create mode 100644 Sources/Pokepay/BankAPI/PrivateMoney/GetPrivateMoneyTerms.swift create mode 100644 Sources/Pokepay/BankAPI/Terminal/GetTerminalById.swift delete mode 100644 Sources/Pokepay/BankAPI/Transaction/CreateBillTransaction.swift delete mode 100644 Sources/Pokepay/BankAPI/Transaction/CreateCashtrayTransaction.swift delete mode 100644 Sources/Pokepay/BankAPI/Transaction/CreateCpmTransaction.swift create mode 100644 Sources/Pokepay/BankAPI/Transaction/RefundTransaction.swift create mode 100644 Sources/Pokepay/BankAPI/User/DeleteUser.swift create mode 100644 Sources/Pokepay/BankAPI/User/GetUser.swift create mode 100644 Sources/Pokepay/Responses/AccountDetail.swift create mode 100644 Sources/Pokepay/Responses/BankPaySession.swift create mode 100644 Sources/Pokepay/Responses/BillWithAdditionalPrivateMoneys.swift create mode 100644 Sources/Pokepay/Responses/CashtrayWithAttemptAndTransaction.swift create mode 100644 Sources/Pokepay/Responses/CouponInfo.swift create mode 100644 Sources/Pokepay/Responses/CpmToken.swift create mode 100644 Sources/Pokepay/Responses/FallbackPrivateMoney.swift create mode 100644 Sources/Pokepay/Responses/IndividualNumberIdentificationError.swift create mode 100644 Sources/Pokepay/Responses/OauthFullAccessUrl.swift create mode 100644 Sources/Pokepay/Responses/PaginatedAccountCoupons.swift create mode 100644 Sources/Pokepay/Responses/PaginatedAccountTransactions.swift create mode 100644 Sources/Pokepay/Responses/PaginatedAccountTransfers.swift create mode 100644 Sources/Pokepay/Responses/PaginatedBillTransactions.swift create mode 100644 Sources/Pokepay/Responses/PaginatedPrivateMoneyCoupons.swift create mode 100644 Sources/Pokepay/Responses/PaginatedUserAccounts.swift create mode 100644 Sources/Pokepay/Responses/PaginatedUserTransactions.swift create mode 100644 Sources/Pokepay/Responses/PrivateMoneyDetail.swift create mode 100644 Sources/Pokepay/Responses/PrivateMoneyImages.swift create mode 100644 Sources/Pokepay/Responses/PrivateMoneyLegalText.swift create mode 100644 Sources/Pokepay/Responses/PrivateMoneySounds.swift create mode 100644 Sources/Pokepay/Responses/PrivateMoneyTopupMethod.swift create mode 100644 Sources/Pokepay/Responses/UserBank.swift create mode 100644 Sources/Pokepay/Responses/UserTransactionWithCustomerBalance.swift create mode 100644 Sources/Pokepay/Responses/UserTransactionWithFallbackAndCustomerBalance.swift create mode 100644 Sources/Pokepay/Responses/UserTransactionWithTransfersAndCustomerBalance.swift create mode 100644 Sources/Pokepay/Responses/UserTransfer.swift create mode 100644 Sources/Pokepay/Responses/UserWithDetails.swift create mode 100644 Sources/Pokepay/Responses/VeritransMdkTokenApiKey.swift diff --git a/Sources/Pokepay/BankAPI.swift b/Sources/Pokepay/BankAPI.swift index efd74b0..c0b4217 100644 --- a/Sources/Pokepay/BankAPI.swift +++ b/Sources/Pokepay/BankAPI.swift @@ -2,13 +2,18 @@ public struct BankAPI { public struct Account {} + public struct Bank {} public struct Bill {} + public struct Campaign {} public struct Cashtray {} public struct Check {} + public struct Coupon {} + public struct Cpm {} public struct CpmToken {} public struct CreditCard {} public struct Cvs {} public struct Jihanpi {} + public struct Merchants {} public struct PrivateMoney {} public struct Shop {} public struct Terminal {} diff --git a/Sources/Pokepay/BankAPI/Account/CreateAccount.swift b/Sources/Pokepay/BankAPI/Account/CreateAccount.swift index ebaaa3b..62bc21c 100644 --- a/Sources/Pokepay/BankAPI/Account/CreateAccount.swift +++ b/Sources/Pokepay/BankAPI/Account/CreateAccount.swift @@ -1,12 +1,13 @@ +// DO NOT EDIT: File is generated by code generator. import APIKit public extension BankAPI.Account { - struct Create: BankRequest { + struct CreateAccount: BankRequest { public let name: String? public let privateMoneyId: String public let externalId: String? - public typealias Response = Account + public typealias Response = AccountDetail public init(name: String? = nil, privateMoneyId: String, externalId: String? = nil) { self.name = name @@ -24,15 +25,17 @@ public extension BankAPI.Account { public var parameters: Any? { var dict: [String: Any] = [:] + if name != nil { dict["name"] = name } - + dict["private_money_id"] = privateMoneyId - + if externalId != nil { dict["external_id"] = externalId } + return dict } } diff --git a/Sources/Pokepay/BankAPI/Account/CreateAccountCpmToken.swift b/Sources/Pokepay/BankAPI/Account/CreateAccountCpmToken.swift index 3efcf89..bff5ce5 100644 --- a/Sources/Pokepay/BankAPI/Account/CreateAccountCpmToken.swift +++ b/Sources/Pokepay/BankAPI/Account/CreateAccountCpmToken.swift @@ -1,33 +1,28 @@ +// DO NOT EDIT: File is generated by code generator. import APIKit public extension BankAPI.Account { struct CreateAccountCpmToken: BankRequest { - - public enum Scope: Int { - case PAYMENT = 1 - case TOPUP = 2 - case BOTH = 3 - } - - public let accountId: String - public let scopes: Int + public let scopes: [String]? public let expiresIn: Int? - public let metadata: [String:String]? + public let metadata: String? + public let keepAlive: Bool? + public let isShortToken: Bool? + public let strategy: String? + public let couponId: String? + public let accountId: String - public typealias Response = AccountCpmToken + public typealias Response = CpmToken - public init(accountId: String, scopes: Scope = .PAYMENT, expiresIn: Int? = nil, metadata: [String:String]? = nil) { - self.accountId = accountId - self.scopes = scopes.rawValue - self.expiresIn = expiresIn - self.metadata = metadata - } - - public init(accountId:String, scopes:Int,expiresIn: Int? = nil,metadata: [String:String]? = nil){ - self.accountId = accountId + public init(scopes: [String]? = nil, expiresIn: Int? = nil, metadata: String? = nil, keepAlive: Bool? = nil, isShortToken: Bool? = nil, strategy: String? = nil, couponId: String? = nil, accountId: String) { self.scopes = scopes self.expiresIn = expiresIn self.metadata = metadata + self.keepAlive = keepAlive + self.isShortToken = isShortToken + self.strategy = strategy + self.couponId = couponId + self.accountId = accountId } public var method: HTTPMethod { @@ -40,37 +35,36 @@ public extension BankAPI.Account { public var parameters: Any? { var dict: [String: Any] = [:] - var scopesArr: [String] = [] - if (scopes & Scope.PAYMENT.rawValue) != 0 { - scopesArr.append("payment") - } - if (scopes & Scope.TOPUP.rawValue) != 0 { - scopesArr.append("topup") + + if scopes != nil { + dict["scopes"] = scopes } - dict["scopes"] = scopesArr + if expiresIn != nil { dict["expires_in"] = expiresIn } + if metadata != nil { - - dict["metadata"] = self.toJsonString(metadata:metadata!) + dict["metadata"] = metadata } - return dict - } - - private func toJsonString(metadata:[String:String]) -> String{ - var jsonString = "{" - for (key, value) in metadata { - jsonString.append("\"") - jsonString.append(key) - jsonString.append("\":\"") - jsonString.append(value) - jsonString.append("\"") - jsonString.append(",") + + if keepAlive != nil { + dict["keep_alive"] = keepAlive + } + + if isShortToken != nil { + dict["is_short_token"] = isShortToken } - jsonString.removeLast() - jsonString.append("}") - return jsonString + + if strategy != nil { + dict["strategy"] = strategy + } + + if couponId != nil { + dict["coupon_id"] = couponId + } + + return dict } } } diff --git a/Sources/Pokepay/BankAPI/Account/GetAccount.swift b/Sources/Pokepay/BankAPI/Account/GetAccount.swift index 0eb7c47..18647fe 100644 --- a/Sources/Pokepay/BankAPI/Account/GetAccount.swift +++ b/Sources/Pokepay/BankAPI/Account/GetAccount.swift @@ -1,13 +1,14 @@ +// DO NOT EDIT: File is generated by code generator. import APIKit public extension BankAPI.Account { - struct Get: BankRequest { - public let id: String + struct GetAccount: BankRequest { + public let accountId: String - public typealias Response = Account + public typealias Response = AccountDetail - public init(id: String) { - self.id = id + public init(accountId: String) { + self.accountId = accountId } public var method: HTTPMethod { @@ -15,7 +16,13 @@ public extension BankAPI.Account { } public var path: String { - return "/accounts/\(id)" + return "/accounts/\(accountId)" + } + + public var parameters: Any? { + var dict: [String: Any] = [:] + + return dict } } } diff --git a/Sources/Pokepay/BankAPI/Account/GetAccountBalances.swift b/Sources/Pokepay/BankAPI/Account/GetAccountBalances.swift new file mode 100644 index 0000000..b130540 --- /dev/null +++ b/Sources/Pokepay/BankAPI/Account/GetAccountBalances.swift @@ -0,0 +1,52 @@ +// DO NOT EDIT: File is generated by code generator. +import APIKit + +public extension BankAPI.Account { + struct GetAccountBalances: BankRequest { + public let accountId: String + public let before: String? + public let after: String? + public let perPage: Int? + public let expired: String? + + public typealias Response = PaginatedAccountBalances + + public init(accountId: String, before: String? = nil, after: String? = nil, perPage: Int? = nil, expired: String? = nil) { + self.accountId = accountId + self.before = before + self.after = after + self.perPage = perPage + self.expired = expired + } + + public var method: HTTPMethod { + return .get + } + + public var path: String { + return "/accounts/\(accountId)/balances" + } + + public var parameters: Any? { + var dict: [String: Any] = [:] + + if before != nil { + dict["before"] = before + } + + if after != nil { + dict["after"] = after + } + + if perPage != nil { + dict["per_page"] = perPage + } + + if expired != nil { + dict["expired"] = expired + } + + return dict + } + } +} diff --git a/Sources/Pokepay/BankAPI/Account/GetAccountCouponDetail.swift b/Sources/Pokepay/BankAPI/Account/GetAccountCouponDetail.swift index 8bf76c3..ed2f92a 100644 --- a/Sources/Pokepay/BankAPI/Account/GetAccountCouponDetail.swift +++ b/Sources/Pokepay/BankAPI/Account/GetAccountCouponDetail.swift @@ -1,13 +1,14 @@ +// DO NOT EDIT: File is generated by code generator. import APIKit public extension BankAPI.Account { - struct GetCouponDetail:BankRequest { + struct GetAccountCouponDetail: BankRequest { public let accountId: String - public let couponId:String + public let couponId: String public typealias Response = CouponDetail - public init(accountId: String, couponId:String) { + public init(accountId: String, couponId: String) { self.accountId = accountId self.couponId = couponId } @@ -19,5 +20,11 @@ public extension BankAPI.Account { public var path: String { return "/accounts/\(accountId)/coupons/\(couponId)" } + + public var parameters: Any? { + var dict: [String: Any] = [:] + + return dict + } } } diff --git a/Sources/Pokepay/BankAPI/Account/GetAccountCoupons.swift b/Sources/Pokepay/BankAPI/Account/GetAccountCoupons.swift index 1d92fe4..5915441 100644 --- a/Sources/Pokepay/BankAPI/Account/GetAccountCoupons.swift +++ b/Sources/Pokepay/BankAPI/Account/GetAccountCoupons.swift @@ -1,16 +1,17 @@ +// DO NOT EDIT: File is generated by code generator. import APIKit public extension BankAPI.Account { struct GetAccountCoupons: BankRequest { public let accountId: String - public let isAvailable:Bool? + public let isAvailable: String? public let before: String? public let after: String? - public let perPage: Int32? + public let perPage: Int? - public typealias Response = PaginatedCoupons + public typealias Response = PaginatedAccountCoupons - public init(accountId: String,isAvailable:Bool? = nil , before: String? = nil, after: String? = nil, perPage: Int32? = nil) { + public init(accountId: String, isAvailable: String? = nil, before: String? = nil, after: String? = nil, perPage: Int? = nil) { self.accountId = accountId self.isAvailable = isAvailable self.before = before @@ -28,18 +29,23 @@ public extension BankAPI.Account { public var parameters: Any? { var dict: [String: Any] = [:] + if isAvailable != nil { dict["is_available"] = isAvailable } + if before != nil { dict["before"] = before } + if after != nil { dict["after"] = after } + if perPage != nil { dict["per_page"] = perPage } + return dict } } diff --git a/Sources/Pokepay/BankAPI/Account/GetAccountTransactions.swift b/Sources/Pokepay/BankAPI/Account/GetAccountTransactions.swift index fe8bd0b..db377a7 100644 --- a/Sources/Pokepay/BankAPI/Account/GetAccountTransactions.swift +++ b/Sources/Pokepay/BankAPI/Account/GetAccountTransactions.swift @@ -1,16 +1,17 @@ +// DO NOT EDIT: File is generated by code generator. import APIKit public extension BankAPI.Account { - struct GetTransactions: BankRequest { - public let id: String + struct GetAccountTransactions: BankRequest { + public let accountId: String public let before: String? public let after: String? - public let perPage: Int32? + public let perPage: Int? - public typealias Response = PaginatedTransactions + public typealias Response = PaginatedAccountTransactions - public init(id: String, before: String? = nil, after: String? = nil, perPage: Int32? = nil) { - self.id = id + public init(accountId: String, before: String? = nil, after: String? = nil, perPage: Int? = nil) { + self.accountId = accountId self.before = before self.after = after self.perPage = perPage @@ -21,20 +22,24 @@ public extension BankAPI.Account { } public var path: String { - return "/accounts/\(id)/transactions" + return "/accounts/\(accountId)/transactions" } public var parameters: Any? { var dict: [String: Any] = [:] + if before != nil { dict["before"] = before } + if after != nil { dict["after"] = after } + if perPage != nil { dict["per_page"] = perPage } + return dict } } diff --git a/Sources/Pokepay/BankAPI/Account/GetAccountTransfers.swift b/Sources/Pokepay/BankAPI/Account/GetAccountTransfers.swift index 36700cf..827ce9b 100644 --- a/Sources/Pokepay/BankAPI/Account/GetAccountTransfers.swift +++ b/Sources/Pokepay/BankAPI/Account/GetAccountTransfers.swift @@ -1,16 +1,17 @@ +// DO NOT EDIT: File is generated by code generator. import APIKit public extension BankAPI.Account { - struct GetTransfers: BankRequest { - public let id: String + struct GetAccountTransfers: BankRequest { + public let accountId: String public let before: String? public let after: String? - public let perPage: Int32? + public let perPage: Int? - public typealias Response = PaginatedTransfers + public typealias Response = PaginatedAccountTransfers - public init(id: String, before: String? = nil, after: String? = nil, perPage: Int32? = nil) { - self.id = id + public init(accountId: String, before: String? = nil, after: String? = nil, perPage: Int? = nil) { + self.accountId = accountId self.before = before self.after = after self.perPage = perPage @@ -21,22 +22,25 @@ public extension BankAPI.Account { } public var path: String { - return "/accounts/\(id)/transfers" + return "/accounts/\(accountId)/transfers" } - + public var parameters: Any? { var dict: [String: Any] = [:] + if before != nil { dict["before"] = before } + if after != nil { dict["after"] = after } + if perPage != nil { dict["per_page"] = perPage } + return dict } } } - diff --git a/Sources/Pokepay/BankAPI/Account/PatchAccountCouponDetail.swift b/Sources/Pokepay/BankAPI/Account/PatchAccountCouponDetail.swift index 5470eff..3453d4d 100644 --- a/Sources/Pokepay/BankAPI/Account/PatchAccountCouponDetail.swift +++ b/Sources/Pokepay/BankAPI/Account/PatchAccountCouponDetail.swift @@ -1,19 +1,20 @@ +// DO NOT EDIT: File is generated by code generator. import APIKit public extension BankAPI.Account { - struct PatchCouponDetail:BankRequest { - public let accountId: String - public let couponId:String - public let isReceived: Bool + struct PatchAccountCouponDetail: BankRequest { + public let isReceived: Bool? public let code: String? + public let accountId: String + public let couponId: String public typealias Response = CouponDetail - public init(accountId: String, couponId:String, isReceived: Bool = true, code: String? = nil) { - self.accountId = accountId - self.couponId = couponId + public init(isReceived: Bool? = nil, code: String? = nil, accountId: String, couponId: String) { self.isReceived = isReceived self.code = code + self.accountId = accountId + self.couponId = couponId } public var method: HTTPMethod { @@ -23,15 +24,19 @@ public extension BankAPI.Account { public var path: String { return "/accounts/\(accountId)/coupons/\(couponId)" } - + public var parameters: Any? { var dict: [String: Any] = [:] - dict["is_received"] = isReceived + + if isReceived != nil { + dict["is_received"] = isReceived + } + if code != nil { dict["code"] = code } + return dict } } } - diff --git a/Sources/Pokepay/BankAPI/Account/SendToAccount.swift b/Sources/Pokepay/BankAPI/Account/SendToAccount.swift new file mode 100644 index 0000000..3899a7b --- /dev/null +++ b/Sources/Pokepay/BankAPI/Account/SendToAccount.swift @@ -0,0 +1,50 @@ +// DO NOT EDIT: File is generated by code generator. +import APIKit + +public extension BankAPI.Account { + struct SendToAccount: BankRequest { + public let receiverTerminalId: String? + public let senderAccountId: String? + public let amount: Double + public let description: String? + public let accountId: String + + public typealias Response = UserTransaction + + public init(receiverTerminalId: String? = nil, senderAccountId: String? = nil, amount: Double, description: String? = nil, accountId: String) { + self.receiverTerminalId = receiverTerminalId + self.senderAccountId = senderAccountId + self.amount = amount + self.description = description + self.accountId = accountId + } + + public var method: HTTPMethod { + return .post + } + + public var path: String { + return "/accounts/\(accountId)/transactions" + } + + public var parameters: Any? { + var dict: [String: Any] = [:] + + if receiverTerminalId != nil { + dict["receiver_terminal_id"] = receiverTerminalId + } + + if senderAccountId != nil { + dict["sender_account_id"] = senderAccountId + } + + dict["amount"] = amount + + if description != nil { + dict["description"] = description + } + + return dict + } + } +} diff --git a/Sources/Pokepay/BankAPI/Account/UpdateAccount.swift b/Sources/Pokepay/BankAPI/Account/UpdateAccount.swift new file mode 100644 index 0000000..05e2724 --- /dev/null +++ b/Sources/Pokepay/BankAPI/Account/UpdateAccount.swift @@ -0,0 +1,34 @@ +// DO NOT EDIT: File is generated by code generator. +import APIKit + +public extension BankAPI.Account { + struct UpdateAccount: BankRequest { + public let name: String? + public let accountId: String + + public typealias Response = AccountDetail + + public init(name: String? = nil, accountId: String) { + self.name = name + self.accountId = accountId + } + + public var method: HTTPMethod { + return .patch + } + + public var path: String { + return "/accounts/\(accountId)" + } + + public var parameters: Any? { + var dict: [String: Any] = [:] + + if name != nil { + dict["name"] = name + } + + return dict + } + } +} diff --git a/Sources/Pokepay/BankAPI/Transaction/CreateCheckTransaction.swift b/Sources/Pokepay/BankAPI/Bank/BankPayTopUp.swift similarity index 52% rename from Sources/Pokepay/BankAPI/Transaction/CreateCheckTransaction.swift rename to Sources/Pokepay/BankAPI/Bank/BankPayTopUp.swift index 22ac25a..2866194 100644 --- a/Sources/Pokepay/BankAPI/Transaction/CreateCheckTransaction.swift +++ b/Sources/Pokepay/BankAPI/Bank/BankPayTopUp.swift @@ -1,20 +1,24 @@ // DO NOT EDIT: File is generated by code generator. import APIKit -public extension BankAPI.Transaction { - struct CreateCheckTransaction: BankRequest { +public extension BankAPI.Bank { + struct BankPayTopUp: BankRequest { + public let accountId: String + public let bankId: String + public let amount: Int public let requestId: String? - public let checkId: String - public let accountId: String? public let topupQuotaId: Int? + public let userId: String - public typealias Response = UserTransactionWithFallback + public typealias Response = UserTransaction - public init(requestId: String? = nil, checkId: String, accountId: String? = nil, topupQuotaId: Int? = nil) { - self.requestId = requestId - self.checkId = checkId + public init(accountId: String, bankId: String, amount: Int, requestId: String? = nil, topupQuotaId: Int? = nil, userId: String) { self.accountId = accountId + self.bankId = bankId + self.amount = amount + self.requestId = requestId self.topupQuotaId = topupQuotaId + self.userId = userId } public var method: HTTPMethod { @@ -22,20 +26,20 @@ public extension BankAPI.Transaction { } public var path: String { - return "/transactions/check" + return "/users/\(userId)/banks/topup" } public var parameters: Any? { var dict: [String: Any] = [:] - if requestId != nil { - dict["request_id"] = requestId - } + dict["account_id"] = accountId + + dict["bank_id"] = bankId - dict["check_id"] = checkId + dict["amount"] = amount - if accountId != nil { - dict["account_id"] = accountId + if requestId != nil { + dict["request_id"] = requestId } if topupQuotaId != nil { diff --git a/Sources/Pokepay/BankAPI/Bank/CreateBankPay.swift b/Sources/Pokepay/BankAPI/Bank/CreateBankPay.swift new file mode 100644 index 0000000..4c6e093 --- /dev/null +++ b/Sources/Pokepay/BankAPI/Bank/CreateBankPay.swift @@ -0,0 +1,42 @@ +// DO NOT EDIT: File is generated by code generator. +import APIKit + +public extension BankAPI.Bank { + struct CreateBankPay: BankRequest { + public let privateMoneyId: String + public let callbackUrl: String + public let kana: String? + public let userId: String + + public typealias Response = BankPaySession + + public init(privateMoneyId: String, callbackUrl: String, kana: String? = nil, userId: String) { + self.privateMoneyId = privateMoneyId + self.callbackUrl = callbackUrl + self.kana = kana + self.userId = userId + } + + public var method: HTTPMethod { + return .post + } + + public var path: String { + return "/users/\(userId)/banks" + } + + public var parameters: Any? { + var dict: [String: Any] = [:] + + dict["private_money_id"] = privateMoneyId + + dict["callback_url"] = callbackUrl + + if kana != nil { + dict["kana"] = kana + } + + return dict + } + } +} diff --git a/Sources/Pokepay/BankAPI/Bank/DeleteBankPay.swift b/Sources/Pokepay/BankAPI/Bank/DeleteBankPay.swift new file mode 100644 index 0000000..dc0750a --- /dev/null +++ b/Sources/Pokepay/BankAPI/Bank/DeleteBankPay.swift @@ -0,0 +1,32 @@ +// DO NOT EDIT: File is generated by code generator. +import APIKit + +public extension BankAPI.Bank { + struct DeleteBankPay: BankRequest { + public let bankId: String + public let userId: String + + public typealias Response = NoContent + + public init(bankId: String, userId: String) { + self.bankId = bankId + self.userId = userId + } + + public var method: HTTPMethod { + return .delete + } + + public var path: String { + return "/users/\(userId)/banks" + } + + public var parameters: Any? { + var dict: [String: Any] = [:] + + dict["bank_id"] = bankId + + return dict + } + } +} diff --git a/Sources/Pokepay/BankAPI/Bill/CreateBill.swift b/Sources/Pokepay/BankAPI/Bill/CreateBill.swift index c4fef2c..026d137 100644 --- a/Sources/Pokepay/BankAPI/Bill/CreateBill.swift +++ b/Sources/Pokepay/BankAPI/Bill/CreateBill.swift @@ -1,19 +1,30 @@ +// DO NOT EDIT: File is generated by code generator. import APIKit public extension BankAPI.Bill { - struct Create: BankRequest { + struct CreateBill: BankRequest { public let amount: Double? public let accountId: String? + public let additionalAccountIds: [String]? public let description: String? + public let isOnetime: Bool? + public let minAmount: Double? + public let maxAmount: Double? public let products: [Product]? + public let metadata: String? public typealias Response = Bill - public init(amount: Double? = nil, accountId: String? = nil, description: String? = nil, products: [Product]? = nil) { + public init(amount: Double? = nil, accountId: String? = nil, additionalAccountIds: [String]? = nil, description: String? = nil, isOnetime: Bool? = nil, minAmount: Double? = nil, maxAmount: Double? = nil, products: [Product]? = nil, metadata: String? = nil) { self.amount = amount self.accountId = accountId + self.additionalAccountIds = additionalAccountIds self.description = description + self.isOnetime = isOnetime + self.minAmount = minAmount + self.maxAmount = maxAmount self.products = products + self.metadata = metadata } public var method: HTTPMethod { @@ -25,16 +36,44 @@ public extension BankAPI.Bill { } public var parameters: Any? { - var dict: [String: Any] = ["amount": amount as Any] + var dict: [String: Any] = [:] + + if amount != nil { + dict["amount"] = amount + } + if accountId != nil { dict["account_id"] = accountId } + + if additionalAccountIds != nil { + dict["additional_account_ids"] = additionalAccountIds + } + if description != nil { dict["description"] = description } + + if isOnetime != nil { + dict["is_onetime"] = isOnetime + } + + if minAmount != nil { + dict["min_amount"] = minAmount + } + + if maxAmount != nil { + dict["max_amount"] = maxAmount + } + if products != nil { - dict["products"] = products!.map { $0.dictionary } + dict["products"] = products + } + + if metadata != nil { + dict["metadata"] = metadata } + return dict } } diff --git a/Sources/Pokepay/BankAPI/Bill/DeleteBill.swift b/Sources/Pokepay/BankAPI/Bill/DeleteBill.swift index b14bba4..84acdc6 100644 --- a/Sources/Pokepay/BankAPI/Bill/DeleteBill.swift +++ b/Sources/Pokepay/BankAPI/Bill/DeleteBill.swift @@ -1,13 +1,14 @@ +// DO NOT EDIT: File is generated by code generator. import APIKit public extension BankAPI.Bill { - struct Delete: BankRequest { - public let id: String + struct DeleteBill: BankRequest { + public let billId: String public typealias Response = NoContent - public init(id: String) { - self.id = id + public init(billId: String) { + self.billId = billId } public var method: HTTPMethod { @@ -15,7 +16,13 @@ public extension BankAPI.Bill { } public var path: String { - return "/bills/\(id)" + return "/bills/\(billId)" + } + + public var parameters: Any? { + var dict: [String: Any] = [:] + + return dict } } } diff --git a/Sources/Pokepay/BankAPI/Bill/GetBill.swift b/Sources/Pokepay/BankAPI/Bill/GetBill.swift index 0280072..e42d505 100644 --- a/Sources/Pokepay/BankAPI/Bill/GetBill.swift +++ b/Sources/Pokepay/BankAPI/Bill/GetBill.swift @@ -1,13 +1,16 @@ +// DO NOT EDIT: File is generated by code generator. import APIKit public extension BankAPI.Bill { - struct Get: BankRequest { - public let id: String + struct GetBill: BankRequest { + public let billId: String + public let privateMoneyId: String? - public typealias Response = Bill + public typealias Response = BillWithAdditionalPrivateMoneys - public init(id: String) { - self.id = id + public init(billId: String, privateMoneyId: String? = nil) { + self.billId = billId + self.privateMoneyId = privateMoneyId } public var method: HTTPMethod { @@ -15,7 +18,17 @@ public extension BankAPI.Bill { } public var path: String { - return "/bills/\(id)" + return "/bills/\(billId)" + } + + public var parameters: Any? { + var dict: [String: Any] = [:] + + if privateMoneyId != nil { + dict["private_money_id"] = privateMoneyId + } + + return dict } } } diff --git a/Sources/Pokepay/BankAPI/Bill/GetBillTransactions.swift b/Sources/Pokepay/BankAPI/Bill/GetBillTransactions.swift new file mode 100644 index 0000000..14e0bf5 --- /dev/null +++ b/Sources/Pokepay/BankAPI/Bill/GetBillTransactions.swift @@ -0,0 +1,46 @@ +// DO NOT EDIT: File is generated by code generator. +import APIKit + +public extension BankAPI.Bill { + struct GetBillTransactions: BankRequest { + public let billId: String + public let before: String? + public let after: String? + public let perPage: Int? + + public typealias Response = PaginatedBillTransactions + + public init(billId: String, before: String? = nil, after: String? = nil, perPage: Int? = nil) { + self.billId = billId + self.before = before + self.after = after + self.perPage = perPage + } + + public var method: HTTPMethod { + return .get + } + + public var path: String { + return "/bills/\(billId)/transactions" + } + + public var parameters: Any? { + var dict: [String: Any] = [:] + + if before != nil { + dict["before"] = before + } + + if after != nil { + dict["after"] = after + } + + if perPage != nil { + dict["per_page"] = perPage + } + + return dict + } + } +} diff --git a/Sources/Pokepay/BankAPI/Bill/UpdateBill.swift b/Sources/Pokepay/BankAPI/Bill/UpdateBill.swift index 27713e3..ba62d1a 100644 --- a/Sources/Pokepay/BankAPI/Bill/UpdateBill.swift +++ b/Sources/Pokepay/BankAPI/Bill/UpdateBill.swift @@ -1,17 +1,20 @@ +// DO NOT EDIT: File is generated by code generator. import APIKit public extension BankAPI.Bill { - struct Update: BankRequest { - public let id: String - public let amount: Double? + struct UpdateBill: BankRequest { + public let amount: Int? public let description: String? + public let products: [Product]? + public let billId: String public typealias Response = Bill - public init(id: String, amount: Double? = nil, description: String? = nil) { - self.id = id + public init(amount: Int? = nil, description: String? = nil, products: [Product]? = nil, billId: String) { self.amount = amount self.description = description + self.products = products + self.billId = billId } public var method: HTTPMethod { @@ -19,15 +22,24 @@ public extension BankAPI.Bill { } public var path: String { - return "/bills/\(id)" + return "/bills/\(billId)" } public var parameters: Any? { - // 'amount' will be sent anyway even when it's nil (unsetting it) - var dict: [String: Any] = ["amount": amount as Any] + var dict: [String: Any] = [:] + + if amount != nil { + dict["amount"] = amount + } + if description != nil { dict["description"] = description } + + if products != nil { + dict["products"] = products + } + return dict } } diff --git a/Sources/Pokepay/BankAPI/Campaign/GetAccountCampaignPointAmounts.swift b/Sources/Pokepay/BankAPI/Campaign/GetAccountCampaignPointAmounts.swift new file mode 100644 index 0000000..7130c3a --- /dev/null +++ b/Sources/Pokepay/BankAPI/Campaign/GetAccountCampaignPointAmounts.swift @@ -0,0 +1,30 @@ +// DO NOT EDIT: File is generated by code generator. +import APIKit + +public extension BankAPI.Campaign { + struct GetAccountCampaignPointAmounts: BankRequest { + public let accountId: String + public let campaignId: String + + public typealias Response = AccountCampaignPointAmounts + + public init(accountId: String, campaignId: String) { + self.accountId = accountId + self.campaignId = campaignId + } + + public var method: HTTPMethod { + return .get + } + + public var path: String { + return "/accounts/\(accountId)/campaigns/\(campaignId)/point-amounts" + } + + public var parameters: Any? { + var dict: [String: Any] = [:] + + return dict + } + } +} diff --git a/Sources/Pokepay/BankAPI/Cashtray/CreateCashtray.swift b/Sources/Pokepay/BankAPI/Cashtray/CreateCashtray.swift index cf691bc..899da1b 100644 --- a/Sources/Pokepay/BankAPI/Cashtray/CreateCashtray.swift +++ b/Sources/Pokepay/BankAPI/Cashtray/CreateCashtray.swift @@ -1,19 +1,22 @@ +// DO NOT EDIT: File is generated by code generator. import APIKit public extension BankAPI.Cashtray { - struct Create: BankRequest { + struct CreateCashtray: BankRequest { public let amount: Double public let description: String? - public let expiresIn: Int32? + public let expiresIn: Int? public let products: [Product]? + public let metadata: String? public typealias Response = Cashtray - public init(amount: Double, description: String? = nil, expiresIn: Int32? = nil, products: [Product]? = nil) { + public init(amount: Double, description: String? = nil, expiresIn: Int? = nil, products: [Product]? = nil, metadata: String? = nil) { self.amount = amount self.description = description self.expiresIn = expiresIn self.products = products + self.metadata = metadata } public var method: HTTPMethod { @@ -25,16 +28,26 @@ public extension BankAPI.Cashtray { } public var parameters: Any? { - var dict: [String: Any] = ["amount": amount as Any] + var dict: [String: Any] = [:] + + dict["amount"] = amount + if description != nil { dict["description"] = description } + if expiresIn != nil { dict["expires_in"] = expiresIn } + if products != nil { - dict["products"] = products!.map { $0.dictionary } + dict["products"] = products } + + if metadata != nil { + dict["metadata"] = metadata + } + return dict } } diff --git a/Sources/Pokepay/BankAPI/Cashtray/DeleteCashtray.swift b/Sources/Pokepay/BankAPI/Cashtray/DeleteCashtray.swift index 1ec01d9..0179626 100644 --- a/Sources/Pokepay/BankAPI/Cashtray/DeleteCashtray.swift +++ b/Sources/Pokepay/BankAPI/Cashtray/DeleteCashtray.swift @@ -1,13 +1,14 @@ +// DO NOT EDIT: File is generated by code generator. import APIKit public extension BankAPI.Cashtray { - struct Delete: BankRequest { - public let id: String + struct DeleteCashtray: BankRequest { + public let cashtrayId: String public typealias Response = NoContent - public init(id: String) { - self.id = id + public init(cashtrayId: String) { + self.cashtrayId = cashtrayId } public var method: HTTPMethod { @@ -15,7 +16,13 @@ public extension BankAPI.Cashtray { } public var path: String { - return "/cashtrays/\(id)" + return "/cashtrays/\(cashtrayId)" + } + + public var parameters: Any? { + var dict: [String: Any] = [:] + + return dict } } } diff --git a/Sources/Pokepay/BankAPI/Cashtray/GetCashtray.swift b/Sources/Pokepay/BankAPI/Cashtray/GetCashtray.swift index 7e9fe71..e141001 100644 --- a/Sources/Pokepay/BankAPI/Cashtray/GetCashtray.swift +++ b/Sources/Pokepay/BankAPI/Cashtray/GetCashtray.swift @@ -1,13 +1,14 @@ +// DO NOT EDIT: File is generated by code generator. import APIKit public extension BankAPI.Cashtray { - struct Get: BankRequest { - public let id: String + struct GetCashtray: BankRequest { + public let cashtrayId: String - public typealias Response = Cashtray + public typealias Response = CashtrayWithAttemptAndTransaction - public init(id: String) { - self.id = id + public init(cashtrayId: String) { + self.cashtrayId = cashtrayId } public var method: HTTPMethod { @@ -15,7 +16,13 @@ public extension BankAPI.Cashtray { } public var path: String { - return "/cashtrays/\(id)" + return "/cashtrays/\(cashtrayId)" + } + + public var parameters: Any? { + var dict: [String: Any] = [:] + + return dict } } } diff --git a/Sources/Pokepay/BankAPI/Cashtray/GetCashtrayAttempts.swift b/Sources/Pokepay/BankAPI/Cashtray/GetCashtrayAttempts.swift index ee41e66..60a0147 100644 --- a/Sources/Pokepay/BankAPI/Cashtray/GetCashtrayAttempts.swift +++ b/Sources/Pokepay/BankAPI/Cashtray/GetCashtrayAttempts.swift @@ -1,13 +1,14 @@ +// DO NOT EDIT: File is generated by code generator. import APIKit public extension BankAPI.Cashtray { - struct GetAttempts: BankRequest { - public let id: String + struct GetCashtrayAttempts: BankRequest { + public let cashtrayId: String public typealias Response = CashtrayAttempts - public init(id: String) { - self.id = id + public init(cashtrayId: String) { + self.cashtrayId = cashtrayId } public var method: HTTPMethod { @@ -15,7 +16,13 @@ public extension BankAPI.Cashtray { } public var path: String { - return "/cashtrays/\(id)/attempts" + return "/cashtrays/\(cashtrayId)/attempts" + } + + public var parameters: Any? { + var dict: [String: Any] = [:] + + return dict } } } diff --git a/Sources/Pokepay/BankAPI/Cashtray/UpdateCashtray.swift b/Sources/Pokepay/BankAPI/Cashtray/UpdateCashtray.swift index 8f8b6a8..657d652 100644 --- a/Sources/Pokepay/BankAPI/Cashtray/UpdateCashtray.swift +++ b/Sources/Pokepay/BankAPI/Cashtray/UpdateCashtray.swift @@ -1,19 +1,22 @@ +// DO NOT EDIT: File is generated by code generator. import APIKit public extension BankAPI.Cashtray { - struct Update: BankRequest { - public let id: String - public let amount: Double? + struct UpdateCashtray: BankRequest { + public let amount: Int? public let description: String? - public let expiresIn: Int32? + public let expiresIn: Int? + public let products: [Product]? + public let cashtrayId: String public typealias Response = Cashtray - public init(id: String, amount: Double? = nil, description: String? = nil, expiresIn: Int32? = nil) { - self.id = id + public init(amount: Int? = nil, description: String? = nil, expiresIn: Int? = nil, products: [Product]? = nil, cashtrayId: String) { self.amount = amount self.description = description self.expiresIn = expiresIn + self.products = products + self.cashtrayId = cashtrayId } public var method: HTTPMethod { @@ -21,20 +24,28 @@ public extension BankAPI.Cashtray { } public var path: String { - return "/cashtrays/\(id)" + return "/cashtrays/\(cashtrayId)" } public var parameters: Any? { var dict: [String: Any] = [:] + if amount != nil { dict["amount"] = amount } + if description != nil { dict["description"] = description } + if expiresIn != nil { dict["expires_in"] = expiresIn } + + if products != nil { + dict["products"] = products + } + return dict } } diff --git a/Sources/Pokepay/BankAPI/Check/CreateCheck.swift b/Sources/Pokepay/BankAPI/Check/CreateCheck.swift index cd22044..13edc17 100644 --- a/Sources/Pokepay/BankAPI/Check/CreateCheck.swift +++ b/Sources/Pokepay/BankAPI/Check/CreateCheck.swift @@ -1,20 +1,34 @@ -import Foundation +// DO NOT EDIT: File is generated by code generator. import APIKit public extension BankAPI.Check { - struct Create: BankRequest { + struct CreateCheck: BankRequest { public let amount: Double? + public let moneyAmount: Double? + public let pointAmount: Double? public let accountId: String? public let description: String? - public let expiresAt: Date? + public let isOnetime: Bool? + public let usageLimit: Int? + public let expiresAt: String? + public let pointExpiresAt: String? + public let pointExpiresInDays: Int? + public let metadata: String? public typealias Response = Check - public init(amount: Double? = nil, accountId: String? = nil, description: String? = nil, expiresAt: Date? = nil) { + public init(amount: Double? = nil, moneyAmount: Double? = nil, pointAmount: Double? = nil, accountId: String? = nil, description: String? = nil, isOnetime: Bool? = nil, usageLimit: Int? = nil, expiresAt: String? = nil, pointExpiresAt: String? = nil, pointExpiresInDays: Int? = nil, metadata: String? = nil) { self.amount = amount + self.moneyAmount = moneyAmount + self.pointAmount = pointAmount self.accountId = accountId self.description = description + self.isOnetime = isOnetime + self.usageLimit = usageLimit self.expiresAt = expiresAt + self.pointExpiresAt = pointExpiresAt + self.pointExpiresInDays = pointExpiresInDays + self.metadata = metadata } public var method: HTTPMethod { @@ -27,18 +41,51 @@ public extension BankAPI.Check { public var parameters: Any? { var dict: [String: Any] = [:] + if amount != nil { dict["amount"] = amount } + + if moneyAmount != nil { + dict["money_amount"] = moneyAmount + } + + if pointAmount != nil { + dict["point_amount"] = pointAmount + } + if accountId != nil { dict["account_id"] = accountId } + if description != nil { dict["description"] = description } - if let p = expiresAt { - dict["expires_at"] = BankAPIDateFormatter.string(date: p) + + if isOnetime != nil { + dict["is_onetime"] = isOnetime + } + + if usageLimit != nil { + dict["usage_limit"] = usageLimit } + + if expiresAt != nil { + dict["expires_at"] = expiresAt + } + + if pointExpiresAt != nil { + dict["point_expires_at"] = pointExpiresAt + } + + if pointExpiresInDays != nil { + dict["point_expires_in_days"] = pointExpiresInDays + } + + if metadata != nil { + dict["metadata"] = metadata + } + return dict } } diff --git a/Sources/Pokepay/BankAPI/Check/DeleteCheck.swift b/Sources/Pokepay/BankAPI/Check/DeleteCheck.swift index 9bc7044..3ce3a24 100644 --- a/Sources/Pokepay/BankAPI/Check/DeleteCheck.swift +++ b/Sources/Pokepay/BankAPI/Check/DeleteCheck.swift @@ -1,13 +1,14 @@ +// DO NOT EDIT: File is generated by code generator. import APIKit public extension BankAPI.Check { - struct Delete: BankRequest { - public let id: String + struct DeleteCheck: BankRequest { + public let checkId: String public typealias Response = NoContent - public init(id: String) { - self.id = id + public init(checkId: String) { + self.checkId = checkId } public var method: HTTPMethod { @@ -15,7 +16,13 @@ public extension BankAPI.Check { } public var path: String { - return "/checks/\(id)" + return "/checks/\(checkId)" + } + + public var parameters: Any? { + var dict: [String: Any] = [:] + + return dict } } } diff --git a/Sources/Pokepay/BankAPI/Check/GetCheck.swift b/Sources/Pokepay/BankAPI/Check/GetCheck.swift index 5f2c240..603f974 100644 --- a/Sources/Pokepay/BankAPI/Check/GetCheck.swift +++ b/Sources/Pokepay/BankAPI/Check/GetCheck.swift @@ -1,13 +1,14 @@ +// DO NOT EDIT: File is generated by code generator. import APIKit public extension BankAPI.Check { - struct Get: BankRequest { - public let id: String + struct GetCheck: BankRequest { + public let checkId: String public typealias Response = Check - public init(id: String) { - self.id = id + public init(checkId: String) { + self.checkId = checkId } public var method: HTTPMethod { @@ -15,7 +16,13 @@ public extension BankAPI.Check { } public var path: String { - return "/checks/\(id)" + return "/checks/\(checkId)" + } + + public var parameters: Any? { + var dict: [String: Any] = [:] + + return dict } } } diff --git a/Sources/Pokepay/BankAPI/Check/UpdateCheck.swift b/Sources/Pokepay/BankAPI/Check/UpdateCheck.swift index af004a8..e16f2ee 100644 --- a/Sources/Pokepay/BankAPI/Check/UpdateCheck.swift +++ b/Sources/Pokepay/BankAPI/Check/UpdateCheck.swift @@ -1,17 +1,24 @@ +// DO NOT EDIT: File is generated by code generator. import APIKit public extension BankAPI.Check { - struct Update: BankRequest { - public let id: String + struct UpdateCheck: BankRequest { public let amount: Double? public let description: String? + public let expiresAt: String? + public let pointExpiresAt: String? + public let pointExpiresInDays: Int? + public let checkId: String public typealias Response = Check - public init(id: String, amount: Double? = nil, description: String? = nil) { - self.id = id + public init(amount: Double? = nil, description: String? = nil, expiresAt: String? = nil, pointExpiresAt: String? = nil, pointExpiresInDays: Int? = nil, checkId: String) { self.amount = amount self.description = description + self.expiresAt = expiresAt + self.pointExpiresAt = pointExpiresAt + self.pointExpiresInDays = pointExpiresInDays + self.checkId = checkId } public var method: HTTPMethod { @@ -19,17 +26,32 @@ public extension BankAPI.Check { } public var path: String { - return "/checks/\(id)" + return "/checks/\(checkId)" } public var parameters: Any? { var dict: [String: Any] = [:] + if amount != nil { dict["amount"] = amount } + if description != nil { dict["description"] = description } + + if expiresAt != nil { + dict["expires_at"] = expiresAt + } + + if pointExpiresAt != nil { + dict["point_expires_at"] = pointExpiresAt + } + + if pointExpiresInDays != nil { + dict["point_expires_in_days"] = pointExpiresInDays + } + return dict } } diff --git a/Sources/Pokepay/BankAPI/Coupon/GetCouponDetail.swift b/Sources/Pokepay/BankAPI/Coupon/GetCouponDetail.swift new file mode 100644 index 0000000..e9a2a5e --- /dev/null +++ b/Sources/Pokepay/BankAPI/Coupon/GetCouponDetail.swift @@ -0,0 +1,28 @@ +// DO NOT EDIT: File is generated by code generator. +import APIKit + +public extension BankAPI.Coupon { + struct GetCouponDetail: BankRequest { + public let couponId: String + + public typealias Response = CouponInfo + + public init(couponId: String) { + self.couponId = couponId + } + + public var method: HTTPMethod { + return .get + } + + public var path: String { + return "/coupons/\(couponId)" + } + + public var parameters: Any? { + var dict: [String: Any] = [:] + + return dict + } + } +} diff --git a/Sources/Pokepay/BankAPI/Coupon/GetPrivateMoneyCoupons.swift b/Sources/Pokepay/BankAPI/Coupon/GetPrivateMoneyCoupons.swift new file mode 100644 index 0000000..2428a3b --- /dev/null +++ b/Sources/Pokepay/BankAPI/Coupon/GetPrivateMoneyCoupons.swift @@ -0,0 +1,46 @@ +// DO NOT EDIT: File is generated by code generator. +import APIKit + +public extension BankAPI.Coupon { + struct GetPrivateMoneyCoupons: BankRequest { + public let privateMoneyId: String + public let before: String? + public let after: String? + public let perPage: Int? + + public typealias Response = PaginatedPrivateMoneyCoupons + + public init(privateMoneyId: String, before: String? = nil, after: String? = nil, perPage: Int? = nil) { + self.privateMoneyId = privateMoneyId + self.before = before + self.after = after + self.perPage = perPage + } + + public var method: HTTPMethod { + return .get + } + + public var path: String { + return "/private-moneys/\(privateMoneyId)/coupons" + } + + public var parameters: Any? { + var dict: [String: Any] = [:] + + if before != nil { + dict["before"] = before + } + + if after != nil { + dict["after"] = after + } + + if perPage != nil { + dict["per_page"] = perPage + } + + return dict + } + } +} diff --git a/Sources/Pokepay/BankAPI/Cpm/GetCpmToken.swift b/Sources/Pokepay/BankAPI/Cpm/GetCpmToken.swift new file mode 100644 index 0000000..b27eaa2 --- /dev/null +++ b/Sources/Pokepay/BankAPI/Cpm/GetCpmToken.swift @@ -0,0 +1,28 @@ +// DO NOT EDIT: File is generated by code generator. +import APIKit + +public extension BankAPI.Cpm { + struct GetCpmToken: BankRequest { + public let cpmToken: String + + public typealias Response = CpmToken + + public init(cpmToken: String) { + self.cpmToken = cpmToken + } + + public var method: HTTPMethod { + return .get + } + + public var path: String { + return "/cpm/\(cpmToken)" + } + + public var parameters: Any? { + var dict: [String: Any] = [:] + + return dict + } + } +} diff --git a/Sources/Pokepay/BankAPI/CreditCard/CreditWithCreditCardMembership.swift b/Sources/Pokepay/BankAPI/CreditCard/CreditWithCreditCardMembership.swift new file mode 100644 index 0000000..7340972 --- /dev/null +++ b/Sources/Pokepay/BankAPI/CreditCard/CreditWithCreditCardMembership.swift @@ -0,0 +1,52 @@ +// DO NOT EDIT: File is generated by code generator. +import APIKit + +public extension BankAPI.CreditCard { + struct CreditWithCreditCardMembership: BankRequest { + public let userId: String + public let cardRegisteredAt: String? + public let cardUuid: String? + public let organizationCode: String? + + public typealias Response = String + + public init(userId: String, cardRegisteredAt: String? = nil, cardUuid: String? = nil, organizationCode: String? = nil) { + self.userId = userId + self.cardRegisteredAt = cardRegisteredAt + self.cardUuid = cardUuid + self.organizationCode = organizationCode + } + + public var method: HTTPMethod { + return .post + } + + public var path: String { + return "/veritrans/card-authorize/credit-with-membership" + } + + public var parameters: Any? { + var dict: [String: Any] = [:] + + dict["user_id"] = userId + + if cardRegisteredAt != nil { + dict["card_registered_at"] = cardRegisteredAt + } + + if cardUuid != nil { + dict["card_uuid"] = cardUuid + } + + if organizationCode != nil { + dict["organization_code"] = organizationCode + } + + return dict + } + + public var responseContentType: String { + return "text/html" + } + } +} diff --git a/Sources/Pokepay/BankAPI/CreditCard/GetVeritransMdkTokenApiKey.swift b/Sources/Pokepay/BankAPI/CreditCard/GetVeritransMdkTokenApiKey.swift new file mode 100644 index 0000000..6a5becb --- /dev/null +++ b/Sources/Pokepay/BankAPI/CreditCard/GetVeritransMdkTokenApiKey.swift @@ -0,0 +1,32 @@ +// DO NOT EDIT: File is generated by code generator. +import APIKit + +public extension BankAPI.CreditCard { + struct GetVeritransMdkTokenApiKey: BankRequest { + public let organizationCode: String? + + public typealias Response = VeritransMdkTokenApiKey + + public init(organizationCode: String? = nil) { + self.organizationCode = organizationCode + } + + public var method: HTTPMethod { + return .get + } + + public var path: String { + return "/veritrans/mdk-token-api-key" + } + + public var parameters: Any? { + var dict: [String: Any] = [:] + + if organizationCode != nil { + dict["organization_code"] = organizationCode + } + + return dict + } + } +} diff --git a/Sources/Pokepay/BankAPI/CreditCard/TopupWithCreditCard.swift b/Sources/Pokepay/BankAPI/CreditCard/TopupWithCreditCard.swift new file mode 100644 index 0000000..9ac3da5 --- /dev/null +++ b/Sources/Pokepay/BankAPI/CreditCard/TopupWithCreditCard.swift @@ -0,0 +1,54 @@ +// DO NOT EDIT: File is generated by code generator. +import APIKit + +public extension BankAPI.CreditCard { + struct TopupWithCreditCard: BankRequest { + public let accountId: String + public let amount: Int + public let cardRegisteredAt: String? + public let cardUuid: String? + public let organizationCode: String? + public let userId: String + + public typealias Response = UserTransaction + + public init(accountId: String, amount: Int, cardRegisteredAt: String? = nil, cardUuid: String? = nil, organizationCode: String? = nil, userId: String) { + self.accountId = accountId + self.amount = amount + self.cardRegisteredAt = cardRegisteredAt + self.cardUuid = cardUuid + self.organizationCode = organizationCode + self.userId = userId + } + + public var method: HTTPMethod { + return .post + } + + public var path: String { + return "/users/\(userId)/cards/topup" + } + + public var parameters: Any? { + var dict: [String: Any] = [:] + + dict["account_id"] = accountId + + dict["amount"] = amount + + if cardRegisteredAt != nil { + dict["card_registered_at"] = cardRegisteredAt + } + + if cardUuid != nil { + dict["card_uuid"] = cardUuid + } + + if organizationCode != nil { + dict["organization_code"] = organizationCode + } + + return dict + } + } +} diff --git a/Sources/Pokepay/BankAPI/Merchants/GetMerchantTransaction.swift b/Sources/Pokepay/BankAPI/Merchants/GetMerchantTransaction.swift new file mode 100644 index 0000000..11650f3 --- /dev/null +++ b/Sources/Pokepay/BankAPI/Merchants/GetMerchantTransaction.swift @@ -0,0 +1,28 @@ +// DO NOT EDIT: File is generated by code generator. +import APIKit + +public extension BankAPI.Merchants { + struct GetMerchantTransaction: BankRequest { + public let transactionId: String + + public typealias Response = UserTransactionWithCustomerBalance + + public init(transactionId: String) { + self.transactionId = transactionId + } + + public var method: HTTPMethod { + return .get + } + + public var path: String { + return "/merchant/transactions/\(transactionId)" + } + + public var parameters: Any? { + var dict: [String: Any] = [:] + + return dict + } + } +} diff --git a/Sources/Pokepay/BankAPI/PrivateMoney/GetPrivateMoney.swift b/Sources/Pokepay/BankAPI/PrivateMoney/GetPrivateMoney.swift index f6f9b1d..1d7c7c4 100644 --- a/Sources/Pokepay/BankAPI/PrivateMoney/GetPrivateMoney.swift +++ b/Sources/Pokepay/BankAPI/PrivateMoney/GetPrivateMoney.swift @@ -1,11 +1,11 @@ +// DO NOT EDIT: File is generated by code generator. import APIKit public extension BankAPI.PrivateMoney { - struct GetPrivateMoney: BankRequest { - public let privateMoneyId:String + public let privateMoneyId: String - public typealias Response = PrivateMoney + public typealias Response = PrivateMoneyDetail public init(privateMoneyId: String) { self.privateMoneyId = privateMoneyId @@ -20,9 +20,9 @@ public extension BankAPI.PrivateMoney { } public var parameters: Any? { - return [:] - } + var dict: [String: Any] = [:] + return dict + } } - } diff --git a/Sources/Pokepay/BankAPI/PrivateMoney/GetPrivateMoneyCommercialAct.swift b/Sources/Pokepay/BankAPI/PrivateMoney/GetPrivateMoneyCommercialAct.swift new file mode 100644 index 0000000..aca3781 --- /dev/null +++ b/Sources/Pokepay/BankAPI/PrivateMoney/GetPrivateMoneyCommercialAct.swift @@ -0,0 +1,28 @@ +// DO NOT EDIT: File is generated by code generator. +import APIKit + +public extension BankAPI.PrivateMoney { + struct GetPrivateMoneyCommercialAct: BankRequest { + public let privateMoneyId: String + + public typealias Response = PrivateMoneyLegalText + + public init(privateMoneyId: String) { + self.privateMoneyId = privateMoneyId + } + + public var method: HTTPMethod { + return .get + } + + public var path: String { + return "/private-moneys/\(privateMoneyId)/commercial-act" + } + + public var parameters: Any? { + var dict: [String: Any] = [:] + + return dict + } + } +} diff --git a/Sources/Pokepay/BankAPI/PrivateMoney/GetPrivateMoneyPaymentAct.swift b/Sources/Pokepay/BankAPI/PrivateMoney/GetPrivateMoneyPaymentAct.swift new file mode 100644 index 0000000..b4b6b90 --- /dev/null +++ b/Sources/Pokepay/BankAPI/PrivateMoney/GetPrivateMoneyPaymentAct.swift @@ -0,0 +1,28 @@ +// DO NOT EDIT: File is generated by code generator. +import APIKit + +public extension BankAPI.PrivateMoney { + struct GetPrivateMoneyPaymentAct: BankRequest { + public let privateMoneyId: String + + public typealias Response = PrivateMoneyLegalText + + public init(privateMoneyId: String) { + self.privateMoneyId = privateMoneyId + } + + public var method: HTTPMethod { + return .get + } + + public var path: String { + return "/private-moneys/\(privateMoneyId)/payment-act" + } + + public var parameters: Any? { + var dict: [String: Any] = [:] + + return dict + } + } +} diff --git a/Sources/Pokepay/BankAPI/PrivateMoney/GetPrivateMoneyPrivacyPolicy.swift b/Sources/Pokepay/BankAPI/PrivateMoney/GetPrivateMoneyPrivacyPolicy.swift new file mode 100644 index 0000000..3a2085c --- /dev/null +++ b/Sources/Pokepay/BankAPI/PrivateMoney/GetPrivateMoneyPrivacyPolicy.swift @@ -0,0 +1,28 @@ +// DO NOT EDIT: File is generated by code generator. +import APIKit + +public extension BankAPI.PrivateMoney { + struct GetPrivateMoneyPrivacyPolicy: BankRequest { + public let privateMoneyId: String + + public typealias Response = PrivateMoneyLegalText + + public init(privateMoneyId: String) { + self.privateMoneyId = privateMoneyId + } + + public var method: HTTPMethod { + return .get + } + + public var path: String { + return "/private-moneys/\(privateMoneyId)/privacy-policy" + } + + public var parameters: Any? { + var dict: [String: Any] = [:] + + return dict + } + } +} diff --git a/Sources/Pokepay/BankAPI/PrivateMoney/GetPrivateMoneyTerms.swift b/Sources/Pokepay/BankAPI/PrivateMoney/GetPrivateMoneyTerms.swift new file mode 100644 index 0000000..44eba8f --- /dev/null +++ b/Sources/Pokepay/BankAPI/PrivateMoney/GetPrivateMoneyTerms.swift @@ -0,0 +1,28 @@ +// DO NOT EDIT: File is generated by code generator. +import APIKit + +public extension BankAPI.PrivateMoney { + struct GetPrivateMoneyTerms: BankRequest { + public let privateMoneyId: String + + public typealias Response = PrivateMoneyLegalText + + public init(privateMoneyId: String) { + self.privateMoneyId = privateMoneyId + } + + public var method: HTTPMethod { + return .get + } + + public var path: String { + return "/private-moneys/\(privateMoneyId)/terms" + } + + public var parameters: Any? { + var dict: [String: Any] = [:] + + return dict + } + } +} diff --git a/Sources/Pokepay/BankAPI/PrivateMoney/SearchPrivateMoneys.swift b/Sources/Pokepay/BankAPI/PrivateMoney/SearchPrivateMoneys.swift index 5f0a4c4..eb8ee92 100644 --- a/Sources/Pokepay/BankAPI/PrivateMoney/SearchPrivateMoneys.swift +++ b/Sources/Pokepay/BankAPI/PrivateMoney/SearchPrivateMoneys.swift @@ -1,16 +1,17 @@ +// DO NOT EDIT: File is generated by code generator. import APIKit public extension BankAPI.PrivateMoney { - struct Search: BankRequest { + struct SearchPrivateMoneys: BankRequest { public let name: String? - public let includeExclusive: Bool + public let includeExclusive: Bool? public let before: String? public let after: String? - public let perPage: Int32? + public let perPage: Int? public typealias Response = PaginatedPrivateMoneys - public init(name: String? = nil, includeExclusive: Bool = false, before: String? = nil, after: String? = nil, perPage: Int32? = nil) { + public init(name: String? = nil, includeExclusive: Bool? = nil, before: String? = nil, after: String? = nil, perPage: Int? = nil) { self.name = name self.includeExclusive = includeExclusive self.before = before @@ -28,19 +29,27 @@ public extension BankAPI.PrivateMoney { public var parameters: Any? { var dict: [String: Any] = [:] + if name != nil { dict["name"] = name } - dict["include_exclusive"] = includeExclusive + + if includeExclusive != nil { + dict["include_exclusive"] = includeExclusive + } + if before != nil { dict["before"] = before } + if after != nil { dict["after"] = after } + if perPage != nil { dict["per_page"] = perPage } + return dict } } diff --git a/Sources/Pokepay/BankAPI/Shop/GetListOfShops.swift b/Sources/Pokepay/BankAPI/Shop/GetListOfShops.swift index 3083f1f..b48e4e9 100644 --- a/Sources/Pokepay/BankAPI/Shop/GetListOfShops.swift +++ b/Sources/Pokepay/BankAPI/Shop/GetListOfShops.swift @@ -4,6 +4,7 @@ import APIKit public extension BankAPI.Shop { struct GetListOfShops: BankRequest { public let privateMoneyId: String + public let name: String? public let userTagGroupItemId: String? public let userTagSubgroupId: String? public let before: String? @@ -12,8 +13,9 @@ public extension BankAPI.Shop { public typealias Response = PaginatedShops - public init(privateMoneyId: String, userTagGroupItemId: String? = nil, userTagSubgroupId: String? = nil, before: String? = nil, after: String? = nil, perPage: Int? = nil) { + public init(privateMoneyId: String, name: String? = nil, userTagGroupItemId: String? = nil, userTagSubgroupId: String? = nil, before: String? = nil, after: String? = nil, perPage: Int? = nil) { self.privateMoneyId = privateMoneyId + self.name = name self.userTagGroupItemId = userTagGroupItemId self.userTagSubgroupId = userTagSubgroupId self.before = before @@ -34,6 +36,10 @@ public extension BankAPI.Shop { dict["private_money_id"] = privateMoneyId + if name != nil { + dict["name"] = name + } + if userTagGroupItemId != nil { dict["user_tag_group_item_id"] = userTagGroupItemId } diff --git a/Sources/Pokepay/BankAPI/Terminal/GetTerminal.swift b/Sources/Pokepay/BankAPI/Terminal/GetTerminal.swift index 9bc0e3b..9df85f7 100644 --- a/Sources/Pokepay/BankAPI/Terminal/GetTerminal.swift +++ b/Sources/Pokepay/BankAPI/Terminal/GetTerminal.swift @@ -1,10 +1,13 @@ +// DO NOT EDIT: File is generated by code generator. import APIKit public extension BankAPI.Terminal { - struct Get: BankRequest { + struct GetTerminal: BankRequest { + public typealias Response = Terminal - public init() {} + public init() { + } public var method: HTTPMethod { return .get @@ -13,5 +16,11 @@ public extension BankAPI.Terminal { public var path: String { return "/terminal" } + + public var parameters: Any? { + var dict: [String: Any] = [:] + + return dict + } } } diff --git a/Sources/Pokepay/BankAPI/Terminal/GetTerminalById.swift b/Sources/Pokepay/BankAPI/Terminal/GetTerminalById.swift new file mode 100644 index 0000000..6f41827 --- /dev/null +++ b/Sources/Pokepay/BankAPI/Terminal/GetTerminalById.swift @@ -0,0 +1,28 @@ +// DO NOT EDIT: File is generated by code generator. +import APIKit + +public extension BankAPI.Terminal { + struct GetTerminalById: BankRequest { + public let terminalId: String + + public typealias Response = Terminal + + public init(terminalId: String) { + self.terminalId = terminalId + } + + public var method: HTTPMethod { + return .get + } + + public var path: String { + return "/terminals/\(terminalId)" + } + + public var parameters: Any? { + var dict: [String: Any] = [:] + + return dict + } + } +} diff --git a/Sources/Pokepay/BankAPI/Terminal/UpdateTerminal.swift b/Sources/Pokepay/BankAPI/Terminal/UpdateTerminal.swift index 1c19555..7ea278b 100644 --- a/Sources/Pokepay/BankAPI/Terminal/UpdateTerminal.swift +++ b/Sources/Pokepay/BankAPI/Terminal/UpdateTerminal.swift @@ -1,16 +1,19 @@ +// DO NOT EDIT: File is generated by code generator. import APIKit public extension BankAPI.Terminal { - struct Update: BankRequest { - let accountId: String - let name: String - let pushToken: String? + struct UpdateTerminal: BankRequest { + public let name: String? + public let accountId: String? + public let pushService: String? + public let pushToken: String? public typealias Response = Terminal - public init(name: String, accountId: String, pushToken: String? = nil) { + public init(name: String? = nil, accountId: String? = nil, pushService: String? = nil, pushToken: String? = nil) { self.name = name self.accountId = accountId + self.pushService = pushService self.pushToken = pushToken } @@ -23,11 +26,25 @@ public extension BankAPI.Terminal { } public var parameters: Any? { - return [ - "account_id": accountId, - "name": name, - "push_token": pushToken - ] + var dict: [String: Any] = [:] + + if name != nil { + dict["name"] = name + } + + if accountId != nil { + dict["account_id"] = accountId + } + + if pushService != nil { + dict["push_service"] = pushService + } + + if pushToken != nil { + dict["push_token"] = pushToken + } + + return dict } } } diff --git a/Sources/Pokepay/BankAPI/Transaction/CreateBillTransaction.swift b/Sources/Pokepay/BankAPI/Transaction/CreateBillTransaction.swift deleted file mode 100644 index 76b09bb..0000000 --- a/Sources/Pokepay/BankAPI/Transaction/CreateBillTransaction.swift +++ /dev/null @@ -1,58 +0,0 @@ -// DO NOT EDIT: File is generated by code generator. -import APIKit - -public extension BankAPI.Transaction { - struct CreateBillTransaction: BankRequest { - public let requestId: String - public let billId: String - public let accountId: String? - public let amount: Double? - public let couponId: String? - public let strategy: String? - - public typealias Response = UserTransactionWithFallback - - public init(requestId: String, billId: String, accountId: String? = nil, amount: Double? = nil, couponId: String? = nil, strategy: String? = nil) { - self.requestId = requestId - self.billId = billId - self.accountId = accountId - self.amount = amount - self.couponId = couponId - self.strategy = strategy - } - - public var method: HTTPMethod { - return .post - } - - public var path: String { - return "/transactions/bill" - } - - public var parameters: Any? { - var dict: [String: Any] = [:] - - dict["request_id"] = requestId - - dict["bill_id"] = billId - - if accountId != nil { - dict["account_id"] = accountId - } - - if amount != nil { - dict["amount"] = amount - } - - if couponId != nil { - dict["coupon_id"] = couponId - } - - if strategy != nil { - dict["strategy"] = strategy - } - - return dict - } - } -} diff --git a/Sources/Pokepay/BankAPI/Transaction/CreateCashtrayTransaction.swift b/Sources/Pokepay/BankAPI/Transaction/CreateCashtrayTransaction.swift deleted file mode 100644 index 8cd8f20..0000000 --- a/Sources/Pokepay/BankAPI/Transaction/CreateCashtrayTransaction.swift +++ /dev/null @@ -1,58 +0,0 @@ -// DO NOT EDIT: File is generated by code generator. -import APIKit - -public extension BankAPI.Transaction { - struct CreateCashtrayTransaction: BankRequest { - public let requestId: String - public let cashtrayId: String - public let accountId: String? - public let couponId: String? - public let strategy: String? - public let topupQuotaId: Int? - - public typealias Response = UserTransactionWithFallback - - public init(requestId: String, cashtrayId: String, accountId: String? = nil, couponId: String? = nil, strategy: String? = nil, topupQuotaId: Int? = nil) { - self.requestId = requestId - self.cashtrayId = cashtrayId - self.accountId = accountId - self.couponId = couponId - self.strategy = strategy - self.topupQuotaId = topupQuotaId - } - - public var method: HTTPMethod { - return .post - } - - public var path: String { - return "/transactions/cashtray" - } - - public var parameters: Any? { - var dict: [String: Any] = [:] - - dict["request_id"] = requestId - - dict["cashtray_id"] = cashtrayId - - if accountId != nil { - dict["account_id"] = accountId - } - - if couponId != nil { - dict["coupon_id"] = couponId - } - - if strategy != nil { - dict["strategy"] = strategy - } - - if topupQuotaId != nil { - dict["topup_quota_id"] = topupQuotaId - } - - return dict - } - } -} diff --git a/Sources/Pokepay/BankAPI/Transaction/CreateCpmTransaction.swift b/Sources/Pokepay/BankAPI/Transaction/CreateCpmTransaction.swift deleted file mode 100644 index e808d3a..0000000 --- a/Sources/Pokepay/BankAPI/Transaction/CreateCpmTransaction.swift +++ /dev/null @@ -1,56 +0,0 @@ -// DO NOT EDIT: File is generated by code generator. -import APIKit - -public extension BankAPI.Transaction { - struct CreateCpmTransaction: BankRequest { - public let requestId: String - public let cpmToken: String - public let accountId: String? - public let amount: Double - public let products: [Product]? - public let topupQuotaId: Int? - - public typealias Response = UserTransactionWithFallback - - public init(requestId: String, cpmToken: String, accountId: String? = nil, amount: Double, products: [Product]? = nil, topupQuotaId: Int? = nil) { - self.requestId = requestId - self.cpmToken = cpmToken - self.accountId = accountId - self.amount = amount - self.products = products - self.topupQuotaId = topupQuotaId - } - - public var method: HTTPMethod { - return .post - } - - public var path: String { - return "/transactions/cpm" - } - - public var parameters: Any? { - var dict: [String: Any] = [:] - - dict["request_id"] = requestId - - dict["cpm_token"] = cpmToken - - if accountId != nil { - dict["account_id"] = accountId - } - - dict["amount"] = amount - - if products != nil { - dict["products"] = products - } - - if topupQuotaId != nil { - dict["topup_quota_id"] = topupQuotaId - } - - return dict - } - } -} diff --git a/Sources/Pokepay/BankAPI/Transaction/CreateTransactionWithBill.swift b/Sources/Pokepay/BankAPI/Transaction/CreateTransactionWithBill.swift index f65b44c..c410735 100644 --- a/Sources/Pokepay/BankAPI/Transaction/CreateTransactionWithBill.swift +++ b/Sources/Pokepay/BankAPI/Transaction/CreateTransactionWithBill.swift @@ -1,19 +1,18 @@ +// DO NOT EDIT: File is generated by code generator. import APIKit -import Foundation public extension BankAPI.Transaction { - struct CreateWithBill: BankRequest { + struct CreateTransactionWithBill: BankRequest { + public let requestId: String public let billId: String public let accountId: String? public let amount: Double? - public let couponId:String? - public let strategy: TransactionStrategy? - public let requestId: UUID? - - public typealias Response = UserTransaction - - public init(billId: String, accountId: String? = nil, amount: Double? = nil, couponId:String? = nil, strategy:TransactionStrategy? = .pointPreferred, - requestId: UUID? = nil) { + public let couponId: String? + public let strategy: String? + + public typealias Response = UserTransactionWithFallback + + public init(requestId: String, billId: String, accountId: String? = nil, amount: Double? = nil, couponId: String? = nil, strategy: String? = nil) { self.requestId = requestId self.billId = billId self.accountId = accountId @@ -27,26 +26,32 @@ public extension BankAPI.Transaction { } public var path: String { - return "/transactions" + return "/transactions/bill" } public var parameters: Any? { - var dict: [String: Any] = ["bill_id": billId] + var dict: [String: Any] = [:] + + dict["request_id"] = requestId + + dict["bill_id"] = billId + if accountId != nil { dict["account_id"] = accountId } + if amount != nil { dict["amount"] = amount } + if couponId != nil { dict["coupon_id"] = couponId } + if strategy != nil { - dict["strategy"] = strategy?.rawValue - } - if requestId != nil { - dict["request_id"] = requestId?.uuidString + dict["strategy"] = strategy } + return dict } } diff --git a/Sources/Pokepay/BankAPI/Transaction/CreateTransactionWithCashtray.swift b/Sources/Pokepay/BankAPI/Transaction/CreateTransactionWithCashtray.swift index e0b4348..58374e3 100644 --- a/Sources/Pokepay/BankAPI/Transaction/CreateTransactionWithCashtray.swift +++ b/Sources/Pokepay/BankAPI/Transaction/CreateTransactionWithCashtray.swift @@ -1,18 +1,18 @@ +// DO NOT EDIT: File is generated by code generator. import APIKit -import Foundation public extension BankAPI.Transaction { - struct CreateWithCashtray: BankRequest { + struct CreateTransactionWithCashtray: BankRequest { + public let requestId: String public let cashtrayId: String public let accountId: String? - public let couponId:String? - public let strategy:TransactionStrategy? - public let requestId: UUID? + public let couponId: String? + public let strategy: String? public let topupQuotaId: Int? - public typealias Response = UserTransaction + public typealias Response = UserTransactionWithFallback - public init(cashtrayId: String, accountId: String? = nil, couponId:String? = nil, strategy:TransactionStrategy? = .pointPreferred, requestId: UUID? = nil, topupQuotaId: Int? = nil) { + public init(requestId: String, cashtrayId: String, accountId: String? = nil, couponId: String? = nil, strategy: String? = nil, topupQuotaId: Int? = nil) { self.requestId = requestId self.cashtrayId = cashtrayId self.accountId = accountId @@ -26,27 +26,32 @@ public extension BankAPI.Transaction { } public var path: String { - return "/transactions" + return "/transactions/cashtray" } public var parameters: Any? { var dict: [String: Any] = [:] + + dict["request_id"] = requestId + dict["cashtray_id"] = cashtrayId + if accountId != nil { dict["account_id"] = accountId } + if couponId != nil { dict["coupon_id"] = couponId } + if strategy != nil { - dict["strategy"] = strategy?.rawValue - } - if requestId != nil { - dict["request_id"] = requestId?.uuidString + dict["strategy"] = strategy } + if topupQuotaId != nil { dict["topup_quota_id"] = topupQuotaId } + return dict } } diff --git a/Sources/Pokepay/BankAPI/Transaction/CreateTransactionWithCheck.swift b/Sources/Pokepay/BankAPI/Transaction/CreateTransactionWithCheck.swift index 98a23cb..b0a78ad 100644 --- a/Sources/Pokepay/BankAPI/Transaction/CreateTransactionWithCheck.swift +++ b/Sources/Pokepay/BankAPI/Transaction/CreateTransactionWithCheck.swift @@ -1,16 +1,16 @@ +// DO NOT EDIT: File is generated by code generator. import APIKit -import Foundation public extension BankAPI.Transaction { - struct CreateWithCheck: BankRequest { + struct CreateTransactionWithCheck: BankRequest { + public let requestId: String? public let checkId: String public let accountId: String? - public let requestId: UUID? public let topupQuotaId: Int? - public typealias Response = UserTransaction + public typealias Response = UserTransactionWithFallback - public init(checkId: String, accountId: String? = nil, requestId: UUID? = nil, topupQuotaId: Int? = nil) { + public init(requestId: String? = nil, checkId: String, accountId: String? = nil, topupQuotaId: Int? = nil) { self.requestId = requestId self.checkId = checkId self.accountId = accountId @@ -22,21 +22,26 @@ public extension BankAPI.Transaction { } public var path: String { - return "/transactions" + return "/transactions/check" } public var parameters: Any? { var dict: [String: Any] = [:] + + if requestId != nil { + dict["request_id"] = requestId + } + dict["check_id"] = checkId + if accountId != nil { dict["account_id"] = accountId } - if requestId != nil { - dict["request_id"] = requestId?.uuidString - } + if topupQuotaId != nil { dict["topup_quota_id"] = topupQuotaId } + return dict } } diff --git a/Sources/Pokepay/BankAPI/Transaction/CreateTransactionWithCpm.swift b/Sources/Pokepay/BankAPI/Transaction/CreateTransactionWithCpm.swift index a4bd81f..3b049da 100644 --- a/Sources/Pokepay/BankAPI/Transaction/CreateTransactionWithCpm.swift +++ b/Sources/Pokepay/BankAPI/Transaction/CreateTransactionWithCpm.swift @@ -1,18 +1,18 @@ +// DO NOT EDIT: File is generated by code generator. import APIKit -import Foundation public extension BankAPI.Transaction { - struct CreateWithCpm: BankRequest { + struct CreateTransactionWithCpm: BankRequest { + public let requestId: String public let cpmToken: String public let accountId: String? public let amount: Double public let products: [Product]? - public let requestId: UUID? public let topupQuotaId: Int? - public typealias Response = UserTransaction + public typealias Response = UserTransactionWithFallbackAndCustomerBalance - public init(cpmToken: String, accountId: String? = nil, amount: Double, products: [Product]? = nil, requestId: UUID? = nil, topupQuotaId: Int? = nil) { + public init(requestId: String, cpmToken: String, accountId: String? = nil, amount: Double, products: [Product]? = nil, topupQuotaId: Int? = nil) { self.requestId = requestId self.cpmToken = cpmToken self.accountId = accountId @@ -26,26 +26,30 @@ public extension BankAPI.Transaction { } public var path: String { - return "/transactions" + return "/transactions/cpm" } public var parameters: Any? { - var dict: [String: Any] = ["cpm_token": cpmToken] + var dict: [String: Any] = [:] + + dict["request_id"] = requestId + + dict["cpm_token"] = cpmToken + if accountId != nil { dict["account_id"] = accountId } - + dict["amount"] = amount - + if products != nil { - dict["products"] = products!.map { $0.dictionary } - } - if requestId != nil { - dict["request_id"] = requestId?.uuidString + dict["products"] = products } + if topupQuotaId != nil { dict["topup_quota_id"] = topupQuotaId } + return dict } } diff --git a/Sources/Pokepay/BankAPI/Transaction/GetTransaction.swift b/Sources/Pokepay/BankAPI/Transaction/GetTransaction.swift index 9c76482..fa5e2f0 100644 --- a/Sources/Pokepay/BankAPI/Transaction/GetTransaction.swift +++ b/Sources/Pokepay/BankAPI/Transaction/GetTransaction.swift @@ -1,13 +1,14 @@ +// DO NOT EDIT: File is generated by code generator. import APIKit public extension BankAPI.Transaction { - struct Get: BankRequest { - public let id: String + struct GetTransaction: BankRequest { + public let transactionId: String - public typealias Response = UserTransaction + public typealias Response = UserTransactionWithTransfers - public init(id: String) { - self.id = id + public init(transactionId: String) { + self.transactionId = transactionId } public var method: HTTPMethod { @@ -15,7 +16,13 @@ public extension BankAPI.Transaction { } public var path: String { - return "/transactions/\(id)" + return "/transactions/\(transactionId)" + } + + public var parameters: Any? { + var dict: [String: Any] = [:] + + return dict } } } diff --git a/Sources/Pokepay/BankAPI/Transaction/RefundTransaction.swift b/Sources/Pokepay/BankAPI/Transaction/RefundTransaction.swift new file mode 100644 index 0000000..08fbdc1 --- /dev/null +++ b/Sources/Pokepay/BankAPI/Transaction/RefundTransaction.swift @@ -0,0 +1,34 @@ +// DO NOT EDIT: File is generated by code generator. +import APIKit + +public extension BankAPI.Transaction { + struct RefundTransaction: BankRequest { + public let amount: Double? + public let transactionId: String + + public typealias Response = UserTransaction + + public init(amount: Double? = nil, transactionId: String) { + self.amount = amount + self.transactionId = transactionId + } + + public var method: HTTPMethod { + return .post + } + + public var path: String { + return "/transactions/\(transactionId)/refund" + } + + public var parameters: Any? { + var dict: [String: Any] = [:] + + if amount != nil { + dict["amount"] = amount + } + + return dict + } + } +} diff --git a/Sources/Pokepay/BankAPI/User/DeleteUser.swift b/Sources/Pokepay/BankAPI/User/DeleteUser.swift new file mode 100644 index 0000000..9c431e4 --- /dev/null +++ b/Sources/Pokepay/BankAPI/User/DeleteUser.swift @@ -0,0 +1,28 @@ +// DO NOT EDIT: File is generated by code generator. +import APIKit + +public extension BankAPI.User { + struct DeleteUser: BankRequest { + public let userId: String + + public typealias Response = NoContent + + public init(userId: String) { + self.userId = userId + } + + public var method: HTTPMethod { + return .delete + } + + public var path: String { + return "/users/\(userId)" + } + + public var parameters: Any? { + var dict: [String: Any] = [:] + + return dict + } + } +} diff --git a/Sources/Pokepay/BankAPI/User/GetUser.swift b/Sources/Pokepay/BankAPI/User/GetUser.swift new file mode 100644 index 0000000..9a666b6 --- /dev/null +++ b/Sources/Pokepay/BankAPI/User/GetUser.swift @@ -0,0 +1,28 @@ +// DO NOT EDIT: File is generated by code generator. +import APIKit + +public extension BankAPI.User { + struct GetUser: BankRequest { + public let userId: String + + public typealias Response = UserWithDetails + + public init(userId: String) { + self.userId = userId + } + + public var method: HTTPMethod { + return .get + } + + public var path: String { + return "/users/\(userId)" + } + + public var parameters: Any? { + var dict: [String: Any] = [:] + + return dict + } + } +} diff --git a/Sources/Pokepay/BankAPI/User/GetUserAccounts.swift b/Sources/Pokepay/BankAPI/User/GetUserAccounts.swift index fb774d2..8787eb3 100644 --- a/Sources/Pokepay/BankAPI/User/GetUserAccounts.swift +++ b/Sources/Pokepay/BankAPI/User/GetUserAccounts.swift @@ -1,16 +1,17 @@ +// DO NOT EDIT: File is generated by code generator. import APIKit public extension BankAPI.User { - struct GetAccounts: BankRequest { - public let id: String + struct GetUserAccounts: BankRequest { + public let userId: String public let before: String? public let after: String? - public let perPage: Int32? + public let perPage: Int? - public typealias Response = PaginatedAccounts + public typealias Response = PaginatedUserAccounts - public init(id: String, before: String? = nil, after: String? = nil, perPage: Int32? = nil) { - self.id = id + public init(userId: String, before: String? = nil, after: String? = nil, perPage: Int? = nil) { + self.userId = userId self.before = before self.after = after self.perPage = perPage @@ -21,20 +22,24 @@ public extension BankAPI.User { } public var path: String { - return "/users/\(id)/accounts" + return "/users/\(userId)/accounts" } public var parameters: Any? { var dict: [String: Any] = [:] + if before != nil { dict["before"] = before } + if after != nil { dict["after"] = after } + if perPage != nil { dict["per_page"] = perPage } + return dict } } diff --git a/Sources/Pokepay/BankAPI/User/GetUserSettingUrl.swift b/Sources/Pokepay/BankAPI/User/GetUserSettingUrl.swift index 7a0aaf4..126dd81 100644 --- a/Sources/Pokepay/BankAPI/User/GetUserSettingUrl.swift +++ b/Sources/Pokepay/BankAPI/User/GetUserSettingUrl.swift @@ -1,14 +1,12 @@ - +// DO NOT EDIT: File is generated by code generator. import APIKit public extension BankAPI.User { struct GetUserSettingUrl: BankRequest { - public let accessCode: String - public typealias Response = UserSettingUrl + public typealias Response = OauthFullAccessUrl - public init(accessCode: String) { - self.accessCode = accessCode + public init() { } public var method: HTTPMethod { @@ -18,5 +16,11 @@ public extension BankAPI.User { public var path: String { return "/oauth/full-access" } + + public var parameters: Any? { + var dict: [String: Any] = [:] + + return dict + } } } diff --git a/Sources/Pokepay/BankAPI/User/GetUserTransactions.swift b/Sources/Pokepay/BankAPI/User/GetUserTransactions.swift index a3c62c8..5cb55c8 100644 --- a/Sources/Pokepay/BankAPI/User/GetUserTransactions.swift +++ b/Sources/Pokepay/BankAPI/User/GetUserTransactions.swift @@ -1,16 +1,17 @@ +// DO NOT EDIT: File is generated by code generator. import APIKit public extension BankAPI.User { - struct GetTransactions: BankRequest { - public let id: String + struct GetUserTransactions: BankRequest { + public let userId: String public let before: String? public let after: String? - public let perPage: Int32? + public let perPage: Int? - public typealias Response = PaginatedTransactions + public typealias Response = PaginatedUserTransactions - public init(id: String, before: String? = nil, after: String? = nil, perPage: Int32? = nil) { - self.id = id + public init(userId: String, before: String? = nil, after: String? = nil, perPage: Int? = nil) { + self.userId = userId self.before = before self.after = after self.perPage = perPage @@ -21,20 +22,24 @@ public extension BankAPI.User { } public var path: String { - return "/users/\(id)/transactions" + return "/users/\(userId)/transactions" } public var parameters: Any? { var dict: [String: Any] = [:] + if before != nil { dict["before"] = before } + if after != nil { dict["after"] = after } + if perPage != nil { dict["per_page"] = perPage } + return dict } } diff --git a/Sources/Pokepay/BankAPI/User/GetUserWithAuthFactors.swift b/Sources/Pokepay/BankAPI/User/GetUserWithAuthFactors.swift index 07db12f..a1f6cd9 100644 --- a/Sources/Pokepay/BankAPI/User/GetUserWithAuthFactors.swift +++ b/Sources/Pokepay/BankAPI/User/GetUserWithAuthFactors.swift @@ -1,22 +1,28 @@ +// DO NOT EDIT: File is generated by code generator. import APIKit public extension BankAPI.User { struct GetUserWithAuthFactors: BankRequest { public let userId: String - + public typealias Response = UserWithAuthFactors - + public init(userId: String) { self.userId = userId } - + public var method: HTTPMethod { return .get } - + public var path: String { return "/users/\(userId)/auth-factors" } - + + public var parameters: Any? { + var dict: [String: Any] = [:] + + return dict + } } } diff --git a/Sources/Pokepay/BankAPI/User/UpdateUser.swift b/Sources/Pokepay/BankAPI/User/UpdateUser.swift index 55e4822..cea3928 100644 --- a/Sources/Pokepay/BankAPI/User/UpdateUser.swift +++ b/Sources/Pokepay/BankAPI/User/UpdateUser.swift @@ -1,15 +1,16 @@ +// DO NOT EDIT: File is generated by code generator. import APIKit public extension BankAPI.User { - struct Update: BankRequest { - public let id: String + struct UpdateUser: BankRequest { public let name: String? + public let userId: String - public typealias Response = User + public typealias Response = UserWithDetails - public init(id: String, name: String? = nil) { - self.id = id + public init(name: String? = nil, userId: String) { self.name = name + self.userId = userId } public var method: HTTPMethod { @@ -17,14 +18,16 @@ public extension BankAPI.User { } public var path: String { - return "/users/\(id)" + return "/users/\(userId)" } public var parameters: Any? { var dict: [String: Any] = [:] + if name != nil { dict["name"] = name } + return dict } } diff --git a/Sources/Pokepay/Responses/Account.swift b/Sources/Pokepay/Responses/Account.swift index ba7915a..b522b58 100644 --- a/Sources/Pokepay/Responses/Account.swift +++ b/Sources/Pokepay/Responses/Account.swift @@ -1,3 +1,4 @@ +// DO NOT EDIT: File is generated by code generator. import Foundation public struct Account: Codable { @@ -6,20 +7,20 @@ public struct Account: Codable { public let balance: Double public let moneyBalance: Double public let pointBalance: Double + public let pointDebt: Double public let isSuspended: Bool + public let status: String public let privateMoney: PrivateMoney - public let nearestExpiresAt: Date? - public let pointDebt: Double private enum CodingKeys: String, CodingKey { - case id - case name - case balance + case id = "id" + case name = "name" + case balance = "balance" case moneyBalance = "money_balance" case pointBalance = "point_balance" + case pointDebt = "point_debt" case isSuspended = "is_suspended" + case status = "status" case privateMoney = "private_money" - case nearestExpiresAt = "nearest_expires_at" - case pointDebt = "point_debt" } } diff --git a/Sources/Pokepay/Responses/AccountBalance.swift b/Sources/Pokepay/Responses/AccountBalance.swift index 7137cdc..44e8262 100644 --- a/Sources/Pokepay/Responses/AccountBalance.swift +++ b/Sources/Pokepay/Responses/AccountBalance.swift @@ -1,7 +1,8 @@ +// DO NOT EDIT: File is generated by code generator. import Foundation public struct AccountBalance: Codable { - public let expiresAt: Date + public let expiresAt: String public let moneyAmount: Double public let pointAmount: Double diff --git a/Sources/Pokepay/Responses/AccountCampaignPointAmounts.swift b/Sources/Pokepay/Responses/AccountCampaignPointAmounts.swift index 38ca371..5a2201c 100644 --- a/Sources/Pokepay/Responses/AccountCampaignPointAmounts.swift +++ b/Sources/Pokepay/Responses/AccountCampaignPointAmounts.swift @@ -1,3 +1,4 @@ +// DO NOT EDIT: File is generated by code generator. import Foundation public struct AccountCampaignPointAmounts: Codable { diff --git a/Sources/Pokepay/Responses/AccountDetail.swift b/Sources/Pokepay/Responses/AccountDetail.swift new file mode 100644 index 0000000..eed0db9 --- /dev/null +++ b/Sources/Pokepay/Responses/AccountDetail.swift @@ -0,0 +1,28 @@ +// DO NOT EDIT: File is generated by code generator. +import Foundation + +public struct AccountDetail: Codable { + public let id: String + public let name: String + public let balance: Double + public let moneyBalance: Double + public let pointBalance: Double + public let pointDebt: Double + public let isSuspended: Bool + public let status: String + public let privateMoney: PrivateMoneyDetail + public let nearestExpiresAt: String? + + private enum CodingKeys: String, CodingKey { + case id = "id" + case name = "name" + case balance = "balance" + case moneyBalance = "money_balance" + case pointBalance = "point_balance" + case pointDebt = "point_debt" + case isSuspended = "is_suspended" + case status = "status" + case privateMoney = "private_money" + case nearestExpiresAt = "nearest_expires_at" + } +} diff --git a/Sources/Pokepay/Responses/BankPaySession.swift b/Sources/Pokepay/Responses/BankPaySession.swift new file mode 100644 index 0000000..f67dba2 --- /dev/null +++ b/Sources/Pokepay/Responses/BankPaySession.swift @@ -0,0 +1,12 @@ +// DO NOT EDIT: File is generated by code generator. +import Foundation + +public struct BankPaySession: Codable { + public let redirectUrl: String + public let paytreeCustomerNumber: String + + private enum CodingKeys: String, CodingKey { + case redirectUrl = "redirect_url" + case paytreeCustomerNumber = "paytree_customer_number" + } +} diff --git a/Sources/Pokepay/Responses/Bill.swift b/Sources/Pokepay/Responses/Bill.swift index 52224cb..60fd67e 100644 --- a/Sources/Pokepay/Responses/Bill.swift +++ b/Sources/Pokepay/Responses/Bill.swift @@ -1,3 +1,4 @@ +// DO NOT EDIT: File is generated by code generator. import Foundation public struct Bill: Codable { @@ -5,25 +6,23 @@ public struct Bill: Codable { public let amount: Double? public let description: String public let user: User - public let privateMoney: PrivateMoney public let isOnetime: Bool public let isDisabled: Bool + public let privateMoney: PrivateMoney public let token: String - public let minAmount: Double? public let maxAmount: Double? - public let additionalPrivateMoneys: [PrivateMoney]? + public let minAmount: Double? private enum CodingKeys: String, CodingKey { - case id - case amount - case description - case user - case privateMoney = "private_money" + case id = "id" + case amount = "amount" + case description = "description" + case user = "user" case isOnetime = "is_onetime" case isDisabled = "is_disabled" - case token - case minAmount = "min_amount" + case privateMoney = "private_money" + case token = "token" case maxAmount = "max_amount" - case additionalPrivateMoneys = "additional_private_moneys" + case minAmount = "min_amount" } } diff --git a/Sources/Pokepay/Responses/BillWithAdditionalPrivateMoneys.swift b/Sources/Pokepay/Responses/BillWithAdditionalPrivateMoneys.swift new file mode 100644 index 0000000..6f8e447 --- /dev/null +++ b/Sources/Pokepay/Responses/BillWithAdditionalPrivateMoneys.swift @@ -0,0 +1,30 @@ +// DO NOT EDIT: File is generated by code generator. +import Foundation + +public struct BillWithAdditionalPrivateMoneys: Codable { + public let id: String + public let amount: Double? + public let description: String + public let user: User + public let isOnetime: Bool + public let isDisabled: Bool + public let privateMoney: PrivateMoney + public let token: String + public let maxAmount: Double? + public let minAmount: Double? + public let additionalPrivateMoneys: [PrivateMoney] + + private enum CodingKeys: String, CodingKey { + case id = "id" + case amount = "amount" + case description = "description" + case user = "user" + case isOnetime = "is_onetime" + case isDisabled = "is_disabled" + case privateMoney = "private_money" + case token = "token" + case maxAmount = "max_amount" + case minAmount = "min_amount" + case additionalPrivateMoneys = "additional_private_moneys" + } +} diff --git a/Sources/Pokepay/Responses/Cashtray.swift b/Sources/Pokepay/Responses/Cashtray.swift index 51fb95e..1b608ff 100644 --- a/Sources/Pokepay/Responses/Cashtray.swift +++ b/Sources/Pokepay/Responses/Cashtray.swift @@ -1,3 +1,4 @@ +// DO NOT EDIT: File is generated by code generator. import Foundation public struct Cashtray: Codable { @@ -6,22 +7,18 @@ public struct Cashtray: Codable { public let description: String public let user: User public let privateMoney: PrivateMoney - public let expiresAt: Date - public let canceledAt: Date? + public let expiresAt: String + public let canceledAt: String? public let token: String - public let attempt: CashtrayAttempt? - public let transaction: UserTransaction? private enum CodingKeys: String, CodingKey { - case id - case amount - case description - case user + case id = "id" + case amount = "amount" + case description = "description" + case user = "user" case privateMoney = "private_money" case expiresAt = "expires_at" case canceledAt = "canceled_at" - case token - case attempt - case transaction + case token = "token" } } diff --git a/Sources/Pokepay/Responses/CashtrayAttempt.swift b/Sources/Pokepay/Responses/CashtrayAttempt.swift index 1de6e3f..088cdf0 100644 --- a/Sources/Pokepay/Responses/CashtrayAttempt.swift +++ b/Sources/Pokepay/Responses/CashtrayAttempt.swift @@ -1,21 +1,22 @@ +// DO NOT EDIT: File is generated by code generator. import Foundation public struct CashtrayAttempt: Codable { - public let user: User + public let user: User? public let account: Account? - public let statusCode: Int - public let errorType: String? - public let errorMessage: String? - public let createdAt: Date + public let statusCode: Double + public let errorType: String + public let errorMessage: String + public let createdAt: String public let strategy: String? private enum CodingKeys: String, CodingKey { - case user - case account + case user = "user" + case account = "account" case statusCode = "status_code" case errorType = "error_type" case errorMessage = "error_message" case createdAt = "created_at" - case strategy + case strategy = "strategy" } } diff --git a/Sources/Pokepay/Responses/CashtrayAttempts.swift b/Sources/Pokepay/Responses/CashtrayAttempts.swift index bb1edc3..0af0840 100644 --- a/Sources/Pokepay/Responses/CashtrayAttempts.swift +++ b/Sources/Pokepay/Responses/CashtrayAttempts.swift @@ -1,9 +1,10 @@ +// DO NOT EDIT: File is generated by code generator. import Foundation public struct CashtrayAttempts: Codable { public let rows: [CashtrayAttempt] private enum CodingKeys: String, CodingKey { - case rows + case rows = "rows" } } diff --git a/Sources/Pokepay/Responses/CashtrayWithAttemptAndTransaction.swift b/Sources/Pokepay/Responses/CashtrayWithAttemptAndTransaction.swift new file mode 100644 index 0000000..e34b869 --- /dev/null +++ b/Sources/Pokepay/Responses/CashtrayWithAttemptAndTransaction.swift @@ -0,0 +1,28 @@ +// DO NOT EDIT: File is generated by code generator. +import Foundation + +public struct CashtrayWithAttemptAndTransaction: Codable { + public let id: String + public let amount: Double + public let description: String + public let user: User + public let privateMoney: PrivateMoney + public let expiresAt: String + public let canceledAt: String? + public let token: String + public let attempt: CashtrayAttempt + public let transaction: UserTransaction + + private enum CodingKeys: String, CodingKey { + case id = "id" + case amount = "amount" + case description = "description" + case user = "user" + case privateMoney = "private_money" + case expiresAt = "expires_at" + case canceledAt = "canceled_at" + case token = "token" + case attempt = "attempt" + case transaction = "transaction" + } +} diff --git a/Sources/Pokepay/Responses/Check.swift b/Sources/Pokepay/Responses/Check.swift index 3a14839..ee216da 100644 --- a/Sources/Pokepay/Responses/Check.swift +++ b/Sources/Pokepay/Responses/Check.swift @@ -1,3 +1,4 @@ +// DO NOT EDIT: File is generated by code generator. import Foundation public struct Check: Codable { @@ -7,27 +8,27 @@ public struct Check: Codable { public let pointAmount: Double public let description: String public let user: User - public let privateMoney: PrivateMoney public let isOnetime: Bool public let isDisabled: Bool - public let expiresAt: Date + public let expiresAt: String + public let pointExpiresAt: String? + public let pointExpiresInDays: Int? + public let privateMoney: PrivateMoney public let token: String - public let pointExpiresAt: Date? - public let pointExpiresInDays: Int32? private enum CodingKeys: String, CodingKey { - case id - case amount + case id = "id" + case amount = "amount" case moneyAmount = "money_amount" case pointAmount = "point_amount" - case description - case user - case privateMoney = "private_money" + case description = "description" + case user = "user" case isOnetime = "is_onetime" case isDisabled = "is_disabled" case expiresAt = "expires_at" - case token case pointExpiresAt = "point_expires_at" case pointExpiresInDays = "point_expires_in_days" + case privateMoney = "private_money" + case token = "token" } } diff --git a/Sources/Pokepay/Responses/Coupon.swift b/Sources/Pokepay/Responses/Coupon.swift index 3c07fb3..e41b88a 100644 --- a/Sources/Pokepay/Responses/Coupon.swift +++ b/Sources/Pokepay/Responses/Coupon.swift @@ -1,32 +1,33 @@ +// DO NOT EDIT: File is generated by code generator. import Foundation -public struct Coupon :Codable{ - public let id:String - public let name:String - public let description:String - public let discountAmount:Int - public let discountPercentage:Int? - public let startAt:Date - public let endAt:Date - public let displayStartAt:Date - public let displayEndAt:Date - public let usageLimit:Int - public let minAmount:Int? - public let isShopSpecified:Bool - public let isDisabled:Bool - public let isHidden:Bool - public let couponImage:String? - +public struct Coupon: Codable { + public let id: String + public let name: String + public let description: String + public let discountAmount: Double? + public let discountPercentage: Double? + public let startsAt: String + public let endsAt: String + public let displayStartsAt: String + public let displayEndsAt: String + public let usageLimit: Double? + public let minAmount: Double? + public let isShopSpecified: Bool + public let isDisabled: Bool + public let isHidden: Bool + public let couponImage: String? + private enum CodingKeys: String, CodingKey { - case id - case name - case description + case id = "id" + case name = "name" + case description = "description" case discountAmount = "discount_amount" case discountPercentage = "discount_percentage" - case startAt = "starts_at" - case endAt = "ends_at" - case displayStartAt = "display_starts_at" - case displayEndAt = "display_ends_at" + case startsAt = "starts_at" + case endsAt = "ends_at" + case displayStartsAt = "display_starts_at" + case displayEndsAt = "display_ends_at" case usageLimit = "usage_limit" case minAmount = "min_amount" case isShopSpecified = "is_shop_specified" diff --git a/Sources/Pokepay/Responses/CouponDetail.swift b/Sources/Pokepay/Responses/CouponDetail.swift index 02bcf7b..d763ee0 100644 --- a/Sources/Pokepay/Responses/CouponDetail.swift +++ b/Sources/Pokepay/Responses/CouponDetail.swift @@ -1,35 +1,36 @@ +// DO NOT EDIT: File is generated by code generator. import Foundation -public struct CouponDetail:Codable{ - public let id:String - public let name:String - public let description:String - public let discountAmount:Int? - public let discountPercentage:Int? - public let startAt:Date - public let endAt:Date - public let displayStartAt:Date - public let displayEndAt:Date - public let usageLimit:Int? - public let minAmount:Int? - public let isShopSpecified:Bool - public let isDisabled:Bool - public let isHidden:Bool - public let couponImage:String? - public let receivedAt:String? - public let usageCount:Int - public let availableShops:[User] - - private enum CodingKeys: String, CodingKey{ - case id - case name - case description +public struct CouponDetail: Codable { + public let id: String + public let name: String + public let description: String + public let discountAmount: Double? + public let discountPercentage: Double? + public let startsAt: String + public let endsAt: String + public let displayStartsAt: String + public let displayEndsAt: String + public let usageLimit: Double? + public let minAmount: Double? + public let isShopSpecified: Bool + public let isDisabled: Bool + public let isHidden: Bool + public let couponImage: String? + public let receivedAt: String? + public let usageCount: Double + public let availableShops: [User] + + private enum CodingKeys: String, CodingKey { + case id = "id" + case name = "name" + case description = "description" case discountAmount = "discount_amount" case discountPercentage = "discount_percentage" - case startAt = "starts_at" - case endAt = "ends_at" - case displayStartAt = "display_starts_at" - case displayEndAt = "display_ends_at" + case startsAt = "starts_at" + case endsAt = "ends_at" + case displayStartsAt = "display_starts_at" + case displayEndsAt = "display_ends_at" case usageLimit = "usage_limit" case minAmount = "min_amount" case isShopSpecified = "is_shop_specified" diff --git a/Sources/Pokepay/Responses/CouponInfo.swift b/Sources/Pokepay/Responses/CouponInfo.swift new file mode 100644 index 0000000..df2fb6a --- /dev/null +++ b/Sources/Pokepay/Responses/CouponInfo.swift @@ -0,0 +1,44 @@ +// DO NOT EDIT: File is generated by code generator. +import Foundation + +public struct CouponInfo: Codable { + public let id: String + public let name: String + public let description: String + public let discountAmount: Double? + public let discountPercentage: Double? + public let startsAt: String + public let endsAt: String + public let displayStartsAt: String + public let displayEndsAt: String + public let usageLimit: Double? + public let minAmount: Double? + public let isShopSpecified: Bool + public let isPublic: Bool + public let isDisabled: Bool + public let isHidden: Bool + public let couponImage: String? + public let privateMoneyId: String + public let availableShops: [User] + + private enum CodingKeys: String, CodingKey { + case id = "id" + case name = "name" + case description = "description" + case discountAmount = "discount_amount" + case discountPercentage = "discount_percentage" + case startsAt = "starts_at" + case endsAt = "ends_at" + case displayStartsAt = "display_starts_at" + case displayEndsAt = "display_ends_at" + case usageLimit = "usage_limit" + case minAmount = "min_amount" + case isShopSpecified = "is_shop_specified" + case isPublic = "is_public" + case isDisabled = "is_disabled" + case isHidden = "is_hidden" + case couponImage = "coupon_image" + case privateMoneyId = "private_money_id" + case availableShops = "available_shops" + } +} diff --git a/Sources/Pokepay/Responses/CpmToken.swift b/Sources/Pokepay/Responses/CpmToken.swift new file mode 100644 index 0000000..a244f7f --- /dev/null +++ b/Sources/Pokepay/Responses/CpmToken.swift @@ -0,0 +1,24 @@ +// DO NOT EDIT: File is generated by code generator. +import Foundation + +public struct CpmToken: Codable { + public let cpmToken: String + public let account: Account + public let transaction: UserTransactionWithTransfers? + public let scopes: [String] + public let expiresAt: String + public let metadata: Object + public let strategy: String? + public let couponId: String? + + private enum CodingKeys: String, CodingKey { + case cpmToken = "cpm_token" + case account = "account" + case transaction = "transaction" + case scopes = "scopes" + case expiresAt = "expires_at" + case metadata = "metadata" + case strategy = "strategy" + case couponId = "coupon_id" + } +} diff --git a/Sources/Pokepay/Responses/FallbackPrivateMoney.swift b/Sources/Pokepay/Responses/FallbackPrivateMoney.swift new file mode 100644 index 0000000..f41c0ee --- /dev/null +++ b/Sources/Pokepay/Responses/FallbackPrivateMoney.swift @@ -0,0 +1,12 @@ +// DO NOT EDIT: File is generated by code generator. +import Foundation + +public struct FallbackPrivateMoney: Codable { + public let name: String + public let id: String + + private enum CodingKeys: String, CodingKey { + case name = "name" + case id = "id" + } +} diff --git a/Sources/Pokepay/Responses/IdentificationMatch.swift b/Sources/Pokepay/Responses/IdentificationMatch.swift index 3cdb12d..21f840a 100644 --- a/Sources/Pokepay/Responses/IdentificationMatch.swift +++ b/Sources/Pokepay/Responses/IdentificationMatch.swift @@ -1,3 +1,4 @@ +// DO NOT EDIT: File is generated by code generator. import Foundation public struct IdentificationMatch: Codable { @@ -7,9 +8,9 @@ public struct IdentificationMatch: Codable { public let dateOfBirth: Bool private enum CodingKeys: String, CodingKey { - case name - case gender - case address + case name = "name" + case gender = "gender" + case address = "address" case dateOfBirth = "date_of_birth" } -} \ No newline at end of file +} diff --git a/Sources/Pokepay/Responses/IdentificationResult.swift b/Sources/Pokepay/Responses/IdentificationResult.swift index 290310b..3abb48a 100644 --- a/Sources/Pokepay/Responses/IdentificationResult.swift +++ b/Sources/Pokepay/Responses/IdentificationResult.swift @@ -1,13 +1,16 @@ +// DO NOT EDIT: File is generated by code generator. import Foundation public struct IdentificationResult: Codable { public let isValid: Bool public let identifiedAt: String? public let match: IdentificationMatch + public let isResident: Bool private enum CodingKeys: String, CodingKey { case isValid = "is_valid" case identifiedAt = "identified_at" - case match + case match = "match" + case isResident = "is_resident" } -} \ No newline at end of file +} diff --git a/Sources/Pokepay/Responses/IndividualNumberIdentificationError.swift b/Sources/Pokepay/Responses/IndividualNumberIdentificationError.swift new file mode 100644 index 0000000..a9d93c0 --- /dev/null +++ b/Sources/Pokepay/Responses/IndividualNumberIdentificationError.swift @@ -0,0 +1,16 @@ +// DO NOT EDIT: File is generated by code generator. +import Foundation + +public struct IndividualNumberIdentificationError: Codable { + public let type: String + public let message: String + public let errorCode: Int + public let errorMessage: String + + private enum CodingKeys: String, CodingKey { + case type = "type" + case message = "message" + case errorCode = "error_code" + case errorMessage = "error_message" + } +} diff --git a/Sources/Pokepay/Responses/OauthFullAccessUrl.swift b/Sources/Pokepay/Responses/OauthFullAccessUrl.swift new file mode 100644 index 0000000..a4a2b6d --- /dev/null +++ b/Sources/Pokepay/Responses/OauthFullAccessUrl.swift @@ -0,0 +1,10 @@ +// DO NOT EDIT: File is generated by code generator. +import Foundation + +public struct OauthFullAccessUrl: Codable { + public let url: String + + private enum CodingKeys: String, CodingKey { + case url = "url" + } +} diff --git a/Sources/Pokepay/Responses/Organization.swift b/Sources/Pokepay/Responses/Organization.swift index 1158dc7..0b9984b 100644 --- a/Sources/Pokepay/Responses/Organization.swift +++ b/Sources/Pokepay/Responses/Organization.swift @@ -1,6 +1,12 @@ +// DO NOT EDIT: File is generated by code generator. import Foundation public struct Organization: Codable { public let code: String public let name: String + + private enum CodingKeys: String, CodingKey { + case code = "code" + case name = "name" + } } diff --git a/Sources/Pokepay/Responses/PaginatedAccountBalances.swift b/Sources/Pokepay/Responses/PaginatedAccountBalances.swift index a3443a2..9ce1b73 100644 --- a/Sources/Pokepay/Responses/PaginatedAccountBalances.swift +++ b/Sources/Pokepay/Responses/PaginatedAccountBalances.swift @@ -1,17 +1,18 @@ +// DO NOT EDIT: File is generated by code generator. import Foundation public struct PaginatedAccountBalances: Codable { - public let perPage: Int32 - public let count: Int32 + public let perPage: Int + public let count: Int public let next: String? public let prev: String? public let items: [AccountBalance] private enum CodingKeys: String, CodingKey { case perPage = "per_page" - case count - case next - case prev - case items + case count = "count" + case next = "next" + case prev = "prev" + case items = "items" } } diff --git a/Sources/Pokepay/Responses/PaginatedAccountCoupons.swift b/Sources/Pokepay/Responses/PaginatedAccountCoupons.swift new file mode 100644 index 0000000..8ec2b0f --- /dev/null +++ b/Sources/Pokepay/Responses/PaginatedAccountCoupons.swift @@ -0,0 +1,18 @@ +// DO NOT EDIT: File is generated by code generator. +import Foundation + +public struct PaginatedAccountCoupons: Codable { + public let perPage: Int + public let count: Int + public let next: String? + public let prev: String? + public let items: [Coupon] + + private enum CodingKeys: String, CodingKey { + case perPage = "per_page" + case count = "count" + case next = "next" + case prev = "prev" + case items = "items" + } +} diff --git a/Sources/Pokepay/Responses/PaginatedAccountTransactions.swift b/Sources/Pokepay/Responses/PaginatedAccountTransactions.swift new file mode 100644 index 0000000..981e2f7 --- /dev/null +++ b/Sources/Pokepay/Responses/PaginatedAccountTransactions.swift @@ -0,0 +1,18 @@ +// DO NOT EDIT: File is generated by code generator. +import Foundation + +public struct PaginatedAccountTransactions: Codable { + public let perPage: Int + public let count: Int + public let next: String? + public let prev: String? + public let items: [UserTransaction] + + private enum CodingKeys: String, CodingKey { + case perPage = "per_page" + case count = "count" + case next = "next" + case prev = "prev" + case items = "items" + } +} diff --git a/Sources/Pokepay/Responses/PaginatedAccountTransfers.swift b/Sources/Pokepay/Responses/PaginatedAccountTransfers.swift new file mode 100644 index 0000000..20225e6 --- /dev/null +++ b/Sources/Pokepay/Responses/PaginatedAccountTransfers.swift @@ -0,0 +1,18 @@ +// DO NOT EDIT: File is generated by code generator. +import Foundation + +public struct PaginatedAccountTransfers: Codable { + public let perPage: Int + public let count: Int + public let next: String? + public let prev: String? + public let items: [UserTransfer] + + private enum CodingKeys: String, CodingKey { + case perPage = "per_page" + case count = "count" + case next = "next" + case prev = "prev" + case items = "items" + } +} diff --git a/Sources/Pokepay/Responses/PaginatedBillTransactions.swift b/Sources/Pokepay/Responses/PaginatedBillTransactions.swift new file mode 100644 index 0000000..1107d78 --- /dev/null +++ b/Sources/Pokepay/Responses/PaginatedBillTransactions.swift @@ -0,0 +1,18 @@ +// DO NOT EDIT: File is generated by code generator. +import Foundation + +public struct PaginatedBillTransactions: Codable { + public let perPage: Int + public let count: Int + public let next: String? + public let prev: String? + public let items: [UserTransaction] + + private enum CodingKeys: String, CodingKey { + case perPage = "per_page" + case count = "count" + case next = "next" + case prev = "prev" + case items = "items" + } +} diff --git a/Sources/Pokepay/Responses/PaginatedPrivateMoneyCoupons.swift b/Sources/Pokepay/Responses/PaginatedPrivateMoneyCoupons.swift new file mode 100644 index 0000000..5acdb03 --- /dev/null +++ b/Sources/Pokepay/Responses/PaginatedPrivateMoneyCoupons.swift @@ -0,0 +1,18 @@ +// DO NOT EDIT: File is generated by code generator. +import Foundation + +public struct PaginatedPrivateMoneyCoupons: Codable { + public let perPage: Int + public let count: Int + public let next: String? + public let prev: String? + public let items: [Coupon] + + private enum CodingKeys: String, CodingKey { + case perPage = "per_page" + case count = "count" + case next = "next" + case prev = "prev" + case items = "items" + } +} diff --git a/Sources/Pokepay/Responses/PaginatedPrivateMoneys.swift b/Sources/Pokepay/Responses/PaginatedPrivateMoneys.swift index e375cb9..bfacbbc 100644 --- a/Sources/Pokepay/Responses/PaginatedPrivateMoneys.swift +++ b/Sources/Pokepay/Responses/PaginatedPrivateMoneys.swift @@ -1,17 +1,18 @@ +// DO NOT EDIT: File is generated by code generator. import Foundation public struct PaginatedPrivateMoneys: Codable { - public let perPage: Int32 - public let count: Int32 + public let perPage: Int + public let count: Int public let next: String? public let prev: String? public let items: [PrivateMoney] private enum CodingKeys: String, CodingKey { case perPage = "per_page" - case count - case next - case prev - case items + case count = "count" + case next = "next" + case prev = "prev" + case items = "items" } } diff --git a/Sources/Pokepay/Responses/PaginatedUserAccounts.swift b/Sources/Pokepay/Responses/PaginatedUserAccounts.swift new file mode 100644 index 0000000..e56e11d --- /dev/null +++ b/Sources/Pokepay/Responses/PaginatedUserAccounts.swift @@ -0,0 +1,18 @@ +// DO NOT EDIT: File is generated by code generator. +import Foundation + +public struct PaginatedUserAccounts: Codable { + public let perPage: Int + public let count: Int + public let next: String? + public let prev: String? + public let items: [Account] + + private enum CodingKeys: String, CodingKey { + case perPage = "per_page" + case count = "count" + case next = "next" + case prev = "prev" + case items = "items" + } +} diff --git a/Sources/Pokepay/Responses/PaginatedUserTransactions.swift b/Sources/Pokepay/Responses/PaginatedUserTransactions.swift new file mode 100644 index 0000000..5d36cc1 --- /dev/null +++ b/Sources/Pokepay/Responses/PaginatedUserTransactions.swift @@ -0,0 +1,18 @@ +// DO NOT EDIT: File is generated by code generator. +import Foundation + +public struct PaginatedUserTransactions: Codable { + public let perPage: Int + public let count: Int + public let next: String? + public let prev: String? + public let items: [UserTransaction] + + private enum CodingKeys: String, CodingKey { + case perPage = "per_page" + case count = "count" + case next = "next" + case prev = "prev" + case items = "items" + } +} diff --git a/Sources/Pokepay/Responses/PrivateMoney.swift b/Sources/Pokepay/Responses/PrivateMoney.swift index 5a8914d..8d95a71 100644 --- a/Sources/Pokepay/Responses/PrivateMoney.swift +++ b/Sources/Pokepay/Responses/PrivateMoney.swift @@ -1,3 +1,4 @@ +// DO NOT EDIT: File is generated by code generator. import Foundation public struct PrivateMoney: Codable { @@ -7,43 +8,51 @@ public struct PrivateMoney: Codable { public let unit: String public let description: String public let onelineMessage: String + public let displayMoneyAndPoint: String + public let customDomainName: String? + public let canUseC2cTransfer: Bool public let accountImage: String? - public let images: Images + public let images: PrivateMoneyImages + public let sounds: PrivateMoneySounds public let organization: Organization public let maxBalance: Double public let transferLimit: Double + public let moneyTopupTransferLimit: Double public let expirationType: String public let isExclusive: Bool public let termsUrl: String? public let privacyPolicyUrl: String? public let paymentActUrl: String? public let commercialActUrl: String? - public let canUseCreditCard: Bool? - public let canUseC2CTransfer: Bool - public let customDomainName: String? - public let topupMethods: [TopupMethod]? + public let isTopupQuotaAvailable: Bool + public let isItrustAuthenticationEnabled: Bool + public let canUseCreditCard: Bool private enum CodingKeys: String, CodingKey { - case id - case name - case type - case unit - case description + case id = "id" + case name = "name" + case type = "type" + case unit = "unit" + case description = "description" case onelineMessage = "oneline_message" + case displayMoneyAndPoint = "display_money_and_point" + case customDomainName = "custom_domain_name" + case canUseC2cTransfer = "can_use_c2c_transfer" case accountImage = "account_image" - case images - case organization + case images = "images" + case sounds = "sounds" + case organization = "organization" case maxBalance = "max_balance" case transferLimit = "transfer_limit" + case moneyTopupTransferLimit = "money_topup_transfer_limit" case expirationType = "expiration_type" case isExclusive = "is_exclusive" case termsUrl = "terms_url" case privacyPolicyUrl = "privacy_policy_url" case paymentActUrl = "payment_act_url" case commercialActUrl = "commercial_act_url" + case isTopupQuotaAvailable = "is_topup_quota_available" + case isItrustAuthenticationEnabled = "is_itrust_authentication_enabled" case canUseCreditCard = "can_use_credit_card" - case canUseC2CTransfer = "can_use_c2c_transfer" - case customDomainName = "custom_domain_name" - case topupMethods = "topup_methods" } } diff --git a/Sources/Pokepay/Responses/PrivateMoneyDetail.swift b/Sources/Pokepay/Responses/PrivateMoneyDetail.swift new file mode 100644 index 0000000..f8b2884 --- /dev/null +++ b/Sources/Pokepay/Responses/PrivateMoneyDetail.swift @@ -0,0 +1,62 @@ +// DO NOT EDIT: File is generated by code generator. +import Foundation + +public struct PrivateMoneyDetail: Codable { + public let id: String + public let name: String + public let type: String + public let unit: String + public let description: String + public let onelineMessage: String + public let displayMoneyAndPoint: String + public let customDomainName: String? + public let canUseC2cTransfer: Bool + public let accountImage: String? + public let images: PrivateMoneyImages + public let sounds: PrivateMoneySounds + public let organization: Organization + public let maxBalance: Double + public let transferLimit: Double + public let moneyTopupTransferLimit: Double + public let expirationType: String + public let isExclusive: Bool + public let termsUrl: String? + public let privacyPolicyUrl: String? + public let paymentActUrl: String? + public let commercialActUrl: String? + public let isTopupQuotaAvailable: Bool + public let isItrustAuthenticationEnabled: Bool + public let canUseCreditCard: Bool + public let topupMethods: [PrivateMoneyTopupMethod] + public let fallbackMoneys: [FallbackPrivateMoney] + + private enum CodingKeys: String, CodingKey { + case id = "id" + case name = "name" + case type = "type" + case unit = "unit" + case description = "description" + case onelineMessage = "oneline_message" + case displayMoneyAndPoint = "display_money_and_point" + case customDomainName = "custom_domain_name" + case canUseC2cTransfer = "can_use_c2c_transfer" + case accountImage = "account_image" + case images = "images" + case sounds = "sounds" + case organization = "organization" + case maxBalance = "max_balance" + case transferLimit = "transfer_limit" + case moneyTopupTransferLimit = "money_topup_transfer_limit" + case expirationType = "expiration_type" + case isExclusive = "is_exclusive" + case termsUrl = "terms_url" + case privacyPolicyUrl = "privacy_policy_url" + case paymentActUrl = "payment_act_url" + case commercialActUrl = "commercial_act_url" + case isTopupQuotaAvailable = "is_topup_quota_available" + case isItrustAuthenticationEnabled = "is_itrust_authentication_enabled" + case canUseCreditCard = "can_use_credit_card" + case topupMethods = "topup_methods" + case fallbackMoneys = "fallback_moneys" + } +} diff --git a/Sources/Pokepay/Responses/PrivateMoneyImages.swift b/Sources/Pokepay/Responses/PrivateMoneyImages.swift new file mode 100644 index 0000000..7e12c54 --- /dev/null +++ b/Sources/Pokepay/Responses/PrivateMoneyImages.swift @@ -0,0 +1,14 @@ +// DO NOT EDIT: File is generated by code generator. +import Foundation + +public struct PrivateMoneyImages: Codable { + public let card: String? + public let n300x300: String? + public let n600x600: String? + + private enum CodingKeys: String, CodingKey { + case card = "card" + case n300x300 = "300x300" + case n600x600 = "600x600" + } +} diff --git a/Sources/Pokepay/Responses/PrivateMoneyLegalText.swift b/Sources/Pokepay/Responses/PrivateMoneyLegalText.swift new file mode 100644 index 0000000..ac06b34 --- /dev/null +++ b/Sources/Pokepay/Responses/PrivateMoneyLegalText.swift @@ -0,0 +1,10 @@ +// DO NOT EDIT: File is generated by code generator. +import Foundation + +public struct PrivateMoneyLegalText: Codable { + public let text: String + + private enum CodingKeys: String, CodingKey { + case text = "text" + } +} diff --git a/Sources/Pokepay/Responses/PrivateMoneySounds.swift b/Sources/Pokepay/Responses/PrivateMoneySounds.swift new file mode 100644 index 0000000..579fdea --- /dev/null +++ b/Sources/Pokepay/Responses/PrivateMoneySounds.swift @@ -0,0 +1,10 @@ +// DO NOT EDIT: File is generated by code generator. +import Foundation + +public struct PrivateMoneySounds: Codable { + public let payment: String? + + private enum CodingKeys: String, CodingKey { + case payment = "payment" + } +} diff --git a/Sources/Pokepay/Responses/PrivateMoneyTopupMethod.swift b/Sources/Pokepay/Responses/PrivateMoneyTopupMethod.swift new file mode 100644 index 0000000..384a617 --- /dev/null +++ b/Sources/Pokepay/Responses/PrivateMoneyTopupMethod.swift @@ -0,0 +1,16 @@ +// DO NOT EDIT: File is generated by code generator. +import Foundation + +public struct PrivateMoneyTopupMethod: Codable { + public let type: String + public let name: String + public let amounts: [Double]? + public let range: [Double]? + + private enum CodingKeys: String, CodingKey { + case type = "type" + case name = "name" + case amounts = "amounts" + case range = "range" + } +} diff --git a/Sources/Pokepay/Responses/Terminal.swift b/Sources/Pokepay/Responses/Terminal.swift index 05d7445..c335ce2 100644 --- a/Sources/Pokepay/Responses/Terminal.swift +++ b/Sources/Pokepay/Responses/Terminal.swift @@ -1,3 +1,4 @@ +// DO NOT EDIT: File is generated by code generator. import Foundation public struct Terminal: Codable { @@ -6,16 +7,16 @@ public struct Terminal: Codable { public let hardwareId: String public let pushService: String? public let pushToken: String? - public let user: User + public let user: UserWithAuthFactors public let account: Account private enum CodingKeys: String, CodingKey { - case id - case name + case id = "id" + case name = "name" case hardwareId = "hardware_id" case pushService = "push_service" case pushToken = "push_token" - case user - case account + case user = "user" + case account = "account" } } diff --git a/Sources/Pokepay/Responses/User.swift b/Sources/Pokepay/Responses/User.swift index d8b6c01..f828b13 100644 --- a/Sources/Pokepay/Responses/User.swift +++ b/Sources/Pokepay/Responses/User.swift @@ -1,3 +1,4 @@ +// DO NOT EDIT: File is generated by code generator. import Foundation public struct User: Codable { @@ -6,8 +7,8 @@ public struct User: Codable { public let isMerchant: Bool private enum CodingKeys: String, CodingKey { - case id - case name + case id = "id" + case name = "name" case isMerchant = "is_merchant" } } diff --git a/Sources/Pokepay/Responses/UserBank.swift b/Sources/Pokepay/Responses/UserBank.swift new file mode 100644 index 0000000..ee7c444 --- /dev/null +++ b/Sources/Pokepay/Responses/UserBank.swift @@ -0,0 +1,26 @@ +// DO NOT EDIT: File is generated by code generator. +import Foundation + +public struct UserBank: Codable { + public let id: String + public let privateMoney: PrivateMoney + public let bankName: String + public let bankCode: String + public let branchNumber: String + public let branchName: String + public let depositType: String + public let maskedAccountNumber: String + public let accountName: String + + private enum CodingKeys: String, CodingKey { + case id = "id" + case privateMoney = "private_money" + case bankName = "bank_name" + case bankCode = "bank_code" + case branchNumber = "branch_number" + case branchName = "branch_name" + case depositType = "deposit_type" + case maskedAccountNumber = "masked_account_number" + case accountName = "account_name" + } +} diff --git a/Sources/Pokepay/Responses/UserTransaction.swift b/Sources/Pokepay/Responses/UserTransaction.swift index 0abdffb..964be21 100644 --- a/Sources/Pokepay/Responses/UserTransaction.swift +++ b/Sources/Pokepay/Responses/UserTransaction.swift @@ -1,33 +1,34 @@ +// DO NOT EDIT: File is generated by code generator. import Foundation public struct UserTransaction: Codable { public let id: String - public let type: String - public let isModified: Bool public let user: User public let balance: Double - public let customerBalance: Double? public let amount: Double public let moneyAmount: Double public let pointAmount: Double + public let rawPointAmount: Double? + public let campaignPointAmount: Double? public let account: Account public let description: String - public let doneAt: Date - public let transfers: [Transfer]? + public let doneAt: String + public let type: String + public let isModified: Bool private enum CodingKeys: String, CodingKey { - case id - case type - case isModified = "is_modified" - case user - case balance - case customerBalance = "customer_balance" - case amount + case id = "id" + case user = "user" + case balance = "balance" + case amount = "amount" case moneyAmount = "money_amount" case pointAmount = "point_amount" - case account - case description + case rawPointAmount = "raw_point_amount" + case campaignPointAmount = "campaign_point_amount" + case account = "account" + case description = "description" case doneAt = "done_at" - case transfers + case type = "type" + case isModified = "is_modified" } } diff --git a/Sources/Pokepay/Responses/UserTransactionWithCustomerBalance.swift b/Sources/Pokepay/Responses/UserTransactionWithCustomerBalance.swift new file mode 100644 index 0000000..92ec0e1 --- /dev/null +++ b/Sources/Pokepay/Responses/UserTransactionWithCustomerBalance.swift @@ -0,0 +1,36 @@ +// DO NOT EDIT: File is generated by code generator. +import Foundation + +public struct UserTransactionWithCustomerBalance: Codable { + public let id: String + public let user: User + public let balance: Double + public let customerBalance: Double + public let amount: Double + public let moneyAmount: Double + public let pointAmount: Double + public let rawPointAmount: Double? + public let campaignPointAmount: Double? + public let account: Account + public let description: String + public let doneAt: String + public let type: String + public let isModified: Bool + + private enum CodingKeys: String, CodingKey { + case id = "id" + case user = "user" + case balance = "balance" + case customerBalance = "customer_balance" + case amount = "amount" + case moneyAmount = "money_amount" + case pointAmount = "point_amount" + case rawPointAmount = "raw_point_amount" + case campaignPointAmount = "campaign_point_amount" + case account = "account" + case description = "description" + case doneAt = "done_at" + case type = "type" + case isModified = "is_modified" + } +} diff --git a/Sources/Pokepay/Responses/UserTransactionWithFallbackAndCustomerBalance.swift b/Sources/Pokepay/Responses/UserTransactionWithFallbackAndCustomerBalance.swift new file mode 100644 index 0000000..081a310 --- /dev/null +++ b/Sources/Pokepay/Responses/UserTransactionWithFallbackAndCustomerBalance.swift @@ -0,0 +1,40 @@ +// DO NOT EDIT: File is generated by code generator. +import Foundation + +public struct UserTransactionWithFallbackAndCustomerBalance: Codable { + public let id: String + public let user: User + public let balance: Double + public let customerBalance: Double + public let amount: Double + public let moneyAmount: Double + public let pointAmount: Double + public let rawPointAmount: Double? + public let campaignPointAmount: Double? + public let account: Account + public let description: String + public let doneAt: String + public let type: String + public let isModified: Bool + public let transfers: [UserTransferWithoutAccount] + public let fallbackTransactions: [UserTransactionWithTransfersAndCustomerBalance]? + + private enum CodingKeys: String, CodingKey { + case id = "id" + case user = "user" + case balance = "balance" + case customerBalance = "customer_balance" + case amount = "amount" + case moneyAmount = "money_amount" + case pointAmount = "point_amount" + case rawPointAmount = "raw_point_amount" + case campaignPointAmount = "campaign_point_amount" + case account = "account" + case description = "description" + case doneAt = "done_at" + case type = "type" + case isModified = "is_modified" + case transfers = "transfers" + case fallbackTransactions = "fallback_transactions" + } +} diff --git a/Sources/Pokepay/Responses/UserTransactionWithTransfersAndCustomerBalance.swift b/Sources/Pokepay/Responses/UserTransactionWithTransfersAndCustomerBalance.swift new file mode 100644 index 0000000..7a162f5 --- /dev/null +++ b/Sources/Pokepay/Responses/UserTransactionWithTransfersAndCustomerBalance.swift @@ -0,0 +1,38 @@ +// DO NOT EDIT: File is generated by code generator. +import Foundation + +public struct UserTransactionWithTransfersAndCustomerBalance: Codable { + public let id: String + public let user: User + public let balance: Double + public let customerBalance: Double + public let amount: Double + public let moneyAmount: Double + public let pointAmount: Double + public let rawPointAmount: Double? + public let campaignPointAmount: Double? + public let account: Account + public let description: String + public let doneAt: String + public let type: String + public let isModified: Bool + public let transfers: [UserTransferWithoutAccount] + + private enum CodingKeys: String, CodingKey { + case id = "id" + case user = "user" + case balance = "balance" + case customerBalance = "customer_balance" + case amount = "amount" + case moneyAmount = "money_amount" + case pointAmount = "point_amount" + case rawPointAmount = "raw_point_amount" + case campaignPointAmount = "campaign_point_amount" + case account = "account" + case description = "description" + case doneAt = "done_at" + case type = "type" + case isModified = "is_modified" + case transfers = "transfers" + } +} diff --git a/Sources/Pokepay/Responses/UserTransfer.swift b/Sources/Pokepay/Responses/UserTransfer.swift new file mode 100644 index 0000000..5cffdd8 --- /dev/null +++ b/Sources/Pokepay/Responses/UserTransfer.swift @@ -0,0 +1,30 @@ +// DO NOT EDIT: File is generated by code generator. +import Foundation + +public struct UserTransfer: Codable { + public let id: String + public let transactionId: String + public let user: User + public let balance: Double + public let amount: Double + public let moneyAmount: Double + public let pointAmount: Double + public let account: Account + public let description: String + public let doneAt: String + public let type: String + + private enum CodingKeys: String, CodingKey { + case id = "id" + case transactionId = "transaction_id" + case user = "user" + case balance = "balance" + case amount = "amount" + case moneyAmount = "money_amount" + case pointAmount = "point_amount" + case account = "account" + case description = "description" + case doneAt = "done_at" + case type = "type" + } +} diff --git a/Sources/Pokepay/Responses/UserWithAuthFactors.swift b/Sources/Pokepay/Responses/UserWithAuthFactors.swift index 5f3399a..ec8259a 100644 --- a/Sources/Pokepay/Responses/UserWithAuthFactors.swift +++ b/Sources/Pokepay/Responses/UserWithAuthFactors.swift @@ -1,3 +1,4 @@ +// DO NOT EDIT: File is generated by code generator. import Foundation public struct UserWithAuthFactors: Codable { @@ -5,15 +6,17 @@ public struct UserWithAuthFactors: Codable { public let name: String public let isMerchant: Bool public let tel: String? + public let countryCode: String? public let email: String? public let isPasswordRegistered: Bool private enum CodingKeys: String, CodingKey { - case id - case name + case id = "id" + case name = "name" case isMerchant = "is_merchant" - case tel - case email + case tel = "tel" + case countryCode = "country_code" + case email = "email" case isPasswordRegistered = "is_password_registered" } } diff --git a/Sources/Pokepay/Responses/UserWithDetails.swift b/Sources/Pokepay/Responses/UserWithDetails.swift new file mode 100644 index 0000000..8844756 --- /dev/null +++ b/Sources/Pokepay/Responses/UserWithDetails.swift @@ -0,0 +1,20 @@ +// DO NOT EDIT: File is generated by code generator. +import Foundation + +public struct UserWithDetails: Codable { + public let id: String + public let name: String + public let isMerchant: Bool + public let tel: String? + public let countryCode: String? + public let email: String? + + private enum CodingKeys: String, CodingKey { + case id = "id" + case name = "name" + case isMerchant = "is_merchant" + case tel = "tel" + case countryCode = "country_code" + case email = "email" + } +} diff --git a/Sources/Pokepay/Responses/VeritransMdkTokenApiKey.swift b/Sources/Pokepay/Responses/VeritransMdkTokenApiKey.swift new file mode 100644 index 0000000..729b36e --- /dev/null +++ b/Sources/Pokepay/Responses/VeritransMdkTokenApiKey.swift @@ -0,0 +1,10 @@ +// DO NOT EDIT: File is generated by code generator. +import Foundation + +public struct VeritransMdkTokenApiKey: Codable { + public let tokenApiKey: String? + + private enum CodingKeys: String, CodingKey { + case tokenApiKey = "token_api_key" + } +}