From 28b5b73e5fff7a677c53cc1837ba94db09fe4c87 Mon Sep 17 00:00:00 2001 From: pokepay-ci Date: Thu, 23 Jul 2026 06:23:19 +0000 Subject: [PATCH] Generate ios-sdk by pokepay-server generate-mobile-sdk-pr.yml --- Sources/Pokepay/BankAPI.swift | 7 -- .../BankAPI/Account/CreateAccount.swift | 39 ---------- .../Account/CreateAccountCpmToken.swift | 76 ------------------- .../CreateAccountSevenElevenAtmSession.swift | 41 ---------- .../Pokepay/BankAPI/Account/GetAccount.swift | 21 ----- .../GetAccountCampaignPointAmounts.swift | 23 ------ .../Account/GetAccountCouponDetail.swift | 23 ------ .../GetAccountSevenElevenAtmSession.swift | 22 ------ .../Account/GetAccountTransactions.swift | 41 ---------- .../BankAPI/Account/GetAccountTransfers.swift | 42 ---------- .../Pokepay/BankAPI/Account/GetBalances.swift | 41 ---------- .../Account/PatchAccountCouponDetail.swift | 37 --------- .../Pokepay/BankAPI/AuthorizedRequest.swift | 27 ------- .../BankAPI/BankAPIDateFormatter.swift | 11 --- Sources/Pokepay/BankAPI/BankAPIError.swift | 30 -------- .../Pokepay/BankAPI/BankAPIJSONDecoder.swift | 13 ---- Sources/Pokepay/BankAPI/BankAPIRequest.swift | 60 --------------- Sources/Pokepay/BankAPI/Bill/CreateBill.swift | 41 ---------- Sources/Pokepay/BankAPI/Bill/DeleteBill.swift | 21 ----- Sources/Pokepay/BankAPI/Bill/GetBill.swift | 21 ----- Sources/Pokepay/BankAPI/Bill/UpdateBill.swift | 34 --------- .../BankAPI/Cashtray/CreateCashtray.swift | 41 ---------- .../BankAPI/Cashtray/DeleteCashtray.swift | 21 ----- .../BankAPI/Cashtray/GetCashtray.swift | 21 ----- .../Cashtray/GetCashtrayAttempts.swift | 21 ----- .../BankAPI/Cashtray/UpdateCashtray.swift | 41 ---------- .../Pokepay/BankAPI/Check/CreateCheck.swift | 45 ----------- .../Pokepay/BankAPI/Check/DeleteCheck.swift | 21 ----- Sources/Pokepay/BankAPI/Check/GetCheck.swift | 21 ----- .../Pokepay/BankAPI/Check/UpdateCheck.swift | 36 --------- .../BankAPI/CpmToken/GetCpmToken.swift | 21 ----- .../PrivateMoney/GetPrivateMoney.swift | 28 ------- .../PrivateMoney/GetPrivateMoneyCoupons.swift | 41 ---------- .../PrivateMoney/SearchPrivateMoneys.swift | 47 ------------ .../Pokepay/BankAPI/Shop/GetListOfShops.swift | 8 +- .../Terminal/AddTerminalPublicKey.swift | 27 ------- .../BankAPI/Terminal/GetTerminal.swift | 17 ----- .../BankAPI/Terminal/UpdateTerminal.swift | 33 -------- .../Transaction/CancelTransaction.swift | 21 ----- ...Bill.swift => CreateBillTransaction.swift} | 39 +++++----- ....swift => CreateCashtrayTransaction.swift} | 29 ++++--- ...eck.swift => CreateCheckTransaction.swift} | 23 +++--- ...thCpm.swift => CreateCpmTransaction.swift} | 32 ++++---- .../CreateTransactionWithJwt.swift | 48 ------------ .../BankAPI/Transaction/GetTransaction.swift | 21 ----- .../BankAPI/Transaction/SendToAccount.swift | 43 ----------- .../BankAPI/Transaction/SendToUser.swift | 43 ----------- .../Pokepay/BankAPI/User/BankPayTopUp.swift | 47 ------------ Sources/Pokepay/BankAPI/User/CardsTopUp.swift | 36 --------- .../Pokepay/BankAPI/User/CreateBankPay.swift | 39 ---------- Sources/Pokepay/BankAPI/User/CreateCard.swift | 27 ------- .../Pokepay/BankAPI/User/DeleteBankPay.swift | 31 -------- .../BankAPI/User/DeleteUserEmail.swift | 23 ------ Sources/Pokepay/BankAPI/User/GetBankPay.swift | 33 -------- .../BankAPI/User/GetUserAccounts.swift | 41 ---------- .../Pokepay/BankAPI/User/GetUserCards.swift | 41 ---------- .../BankAPI/User/GetUserSettingUrl.swift | 22 ------ .../BankAPI/User/GetUserTransactions.swift | 41 ---------- .../BankAPI/User/GetUserWithAuthFactors.swift | 22 ------ .../BankAPI/User/RegisterUserEmail.swift | 21 ----- .../BankAPI/User/SendConfirmationEmail.swift | 23 ------ Sources/Pokepay/BankAPI/User/UpdateUser.swift | 31 -------- .../UserTag/GetUserTagGroupItems.swift | 8 +- .../GetUserTagSubgroups.swift} | 30 ++++---- Sources/Pokepay/Responses/AccessToken.swift | 15 ---- Sources/Pokepay/Responses/Account.swift | 25 ------ .../Pokepay/Responses/AccountBalance.swift | 13 ---- .../AccountCampaignPointAmounts.swift | 13 ---- .../Pokepay/Responses/AccountCpmToken.swift | 19 ----- Sources/Pokepay/Responses/BankPay.swift | 25 ------ .../Responses/BankPayRedirectUrl.swift | 12 --- Sources/Pokepay/Responses/Bill.swift | 29 ------- Sources/Pokepay/Responses/Card.swift | 11 --- Sources/Pokepay/Responses/Cashtray.swift | 27 ------- .../Pokepay/Responses/CashtrayAttempt.swift | 21 ----- .../Pokepay/Responses/CashtrayAttempts.swift | 9 --- Sources/Pokepay/Responses/Check.swift | 33 -------- Sources/Pokepay/Responses/Coupon.swift | 37 --------- Sources/Pokepay/Responses/CouponDetail.swift | 43 ----------- .../Pokepay/Responses/CvsAuthorization.swift | 8 ++ .../Responses/DetailedShopInformation.swift | 2 + Sources/Pokepay/Responses/Error.swift | 40 ---------- .../Pokepay/Responses/ExchangedToken.swift | 23 ------ .../Responses/IdentificationMatch.swift | 15 ---- .../Responses/IdentificationResult.swift | 13 ---- Sources/Pokepay/Responses/Images.swift | 13 ---- Sources/Pokepay/Responses/JwtResult.swift | 55 -------------- Sources/Pokepay/Responses/Message.swift | 27 ------- .../Pokepay/Responses/MessageAttachment.swift | 17 ----- .../Responses/MessageUnreadCount.swift | 9 --- Sources/Pokepay/Responses/NoContent.swift | 4 - Sources/Pokepay/Responses/Organization.swift | 6 -- .../Responses/PaginatedAccountBalances.swift | 17 ----- .../Pokepay/Responses/PaginatedAccounts.swift | 17 ----- .../Pokepay/Responses/PaginatedCards.swift | 17 ----- .../Pokepay/Responses/PaginatedCoupons.swift | 17 ----- .../Pokepay/Responses/PaginatedMessages.swift | 17 ----- .../Responses/PaginatedPrivateMoneys.swift | 17 ----- .../Responses/PaginatedTransactions.swift | 17 ----- .../Responses/PaginatedTransfers.swift | 17 ----- .../Responses/PaginatedUserTagSubgroups.swift | 18 +++++ Sources/Pokepay/Responses/PrivateMoney.swift | 49 ------------ Sources/Pokepay/Responses/ServerKey.swift | 9 --- .../Responses/SevenElevenAtmSession.swift | 13 ---- Sources/Pokepay/Responses/Terminal.swift | 21 ----- Sources/Pokepay/Responses/TokenInfo.swift | 7 -- Sources/Pokepay/Responses/TopupMethod.swift | 9 --- Sources/Pokepay/Responses/Transfer.swift | 29 ------- Sources/Pokepay/Responses/User.swift | 13 ---- .../Pokepay/Responses/UserSettingUrl.swift | 6 -- Sources/Pokepay/Responses/UserTagGroup.swift | 2 + .../Pokepay/Responses/UserTagGroupItem.swift | 2 + .../Pokepay/Responses/UserTagSubgroup.swift | 12 +++ .../Pokepay/Responses/UserTransaction.swift | 33 -------- .../UserTransactionWithFallback.swift | 38 ++++++++++ .../Responses/UserWithAuthFactors.swift | 19 ----- .../Pokepay/Responses/VeritransToken.swift | 9 --- 117 files changed, 184 insertions(+), 2781 deletions(-) delete mode 100644 Sources/Pokepay/BankAPI/Account/CreateAccount.swift delete mode 100644 Sources/Pokepay/BankAPI/Account/CreateAccountCpmToken.swift delete mode 100644 Sources/Pokepay/BankAPI/Account/CreateAccountSevenElevenAtmSession.swift delete mode 100644 Sources/Pokepay/BankAPI/Account/GetAccount.swift delete mode 100644 Sources/Pokepay/BankAPI/Account/GetAccountCampaignPointAmounts.swift delete mode 100644 Sources/Pokepay/BankAPI/Account/GetAccountCouponDetail.swift delete mode 100644 Sources/Pokepay/BankAPI/Account/GetAccountSevenElevenAtmSession.swift delete mode 100644 Sources/Pokepay/BankAPI/Account/GetAccountTransactions.swift delete mode 100644 Sources/Pokepay/BankAPI/Account/GetAccountTransfers.swift delete mode 100644 Sources/Pokepay/BankAPI/Account/GetBalances.swift delete mode 100644 Sources/Pokepay/BankAPI/Account/PatchAccountCouponDetail.swift delete mode 100644 Sources/Pokepay/BankAPI/AuthorizedRequest.swift delete mode 100644 Sources/Pokepay/BankAPI/BankAPIDateFormatter.swift delete mode 100644 Sources/Pokepay/BankAPI/BankAPIError.swift delete mode 100644 Sources/Pokepay/BankAPI/BankAPIJSONDecoder.swift delete mode 100644 Sources/Pokepay/BankAPI/BankAPIRequest.swift delete mode 100644 Sources/Pokepay/BankAPI/Bill/CreateBill.swift delete mode 100644 Sources/Pokepay/BankAPI/Bill/DeleteBill.swift delete mode 100644 Sources/Pokepay/BankAPI/Bill/GetBill.swift delete mode 100644 Sources/Pokepay/BankAPI/Bill/UpdateBill.swift delete mode 100644 Sources/Pokepay/BankAPI/Cashtray/CreateCashtray.swift delete mode 100644 Sources/Pokepay/BankAPI/Cashtray/DeleteCashtray.swift delete mode 100644 Sources/Pokepay/BankAPI/Cashtray/GetCashtray.swift delete mode 100644 Sources/Pokepay/BankAPI/Cashtray/GetCashtrayAttempts.swift delete mode 100644 Sources/Pokepay/BankAPI/Cashtray/UpdateCashtray.swift delete mode 100644 Sources/Pokepay/BankAPI/Check/CreateCheck.swift delete mode 100644 Sources/Pokepay/BankAPI/Check/DeleteCheck.swift delete mode 100644 Sources/Pokepay/BankAPI/Check/GetCheck.swift delete mode 100644 Sources/Pokepay/BankAPI/Check/UpdateCheck.swift delete mode 100644 Sources/Pokepay/BankAPI/CpmToken/GetCpmToken.swift delete mode 100644 Sources/Pokepay/BankAPI/PrivateMoney/GetPrivateMoney.swift delete mode 100644 Sources/Pokepay/BankAPI/PrivateMoney/GetPrivateMoneyCoupons.swift delete mode 100644 Sources/Pokepay/BankAPI/PrivateMoney/SearchPrivateMoneys.swift delete mode 100644 Sources/Pokepay/BankAPI/Terminal/AddTerminalPublicKey.swift delete mode 100644 Sources/Pokepay/BankAPI/Terminal/GetTerminal.swift delete mode 100644 Sources/Pokepay/BankAPI/Terminal/UpdateTerminal.swift delete mode 100644 Sources/Pokepay/BankAPI/Transaction/CancelTransaction.swift rename Sources/Pokepay/BankAPI/Transaction/{CreateTransactionWithBill.swift => CreateBillTransaction.swift} (54%) rename Sources/Pokepay/BankAPI/Transaction/{CreateTransactionWithCashtray.swift => CreateCashtrayTransaction.swift} (62%) rename Sources/Pokepay/BankAPI/Transaction/{CreateTransactionWithCheck.swift => CreateCheckTransaction.swift} (67%) rename Sources/Pokepay/BankAPI/Transaction/{CreateTransactionWithCpm.swift => CreateCpmTransaction.swift} (59%) delete mode 100644 Sources/Pokepay/BankAPI/Transaction/CreateTransactionWithJwt.swift delete mode 100644 Sources/Pokepay/BankAPI/Transaction/GetTransaction.swift delete mode 100644 Sources/Pokepay/BankAPI/Transaction/SendToAccount.swift delete mode 100644 Sources/Pokepay/BankAPI/Transaction/SendToUser.swift delete mode 100644 Sources/Pokepay/BankAPI/User/BankPayTopUp.swift delete mode 100644 Sources/Pokepay/BankAPI/User/CardsTopUp.swift delete mode 100644 Sources/Pokepay/BankAPI/User/CreateBankPay.swift delete mode 100644 Sources/Pokepay/BankAPI/User/CreateCard.swift delete mode 100644 Sources/Pokepay/BankAPI/User/DeleteBankPay.swift delete mode 100644 Sources/Pokepay/BankAPI/User/DeleteUserEmail.swift delete mode 100644 Sources/Pokepay/BankAPI/User/GetBankPay.swift delete mode 100644 Sources/Pokepay/BankAPI/User/GetUserAccounts.swift delete mode 100644 Sources/Pokepay/BankAPI/User/GetUserCards.swift delete mode 100644 Sources/Pokepay/BankAPI/User/GetUserSettingUrl.swift delete mode 100644 Sources/Pokepay/BankAPI/User/GetUserTransactions.swift delete mode 100644 Sources/Pokepay/BankAPI/User/GetUserWithAuthFactors.swift delete mode 100644 Sources/Pokepay/BankAPI/User/RegisterUserEmail.swift delete mode 100644 Sources/Pokepay/BankAPI/User/SendConfirmationEmail.swift delete mode 100644 Sources/Pokepay/BankAPI/User/UpdateUser.swift rename Sources/Pokepay/BankAPI/{Account/GetAccountCoupons.swift => UserTag/GetUserTagSubgroups.swift} (51%) delete mode 100644 Sources/Pokepay/Responses/AccessToken.swift delete mode 100644 Sources/Pokepay/Responses/Account.swift delete mode 100644 Sources/Pokepay/Responses/AccountBalance.swift delete mode 100644 Sources/Pokepay/Responses/AccountCampaignPointAmounts.swift delete mode 100644 Sources/Pokepay/Responses/AccountCpmToken.swift delete mode 100644 Sources/Pokepay/Responses/BankPay.swift delete mode 100644 Sources/Pokepay/Responses/BankPayRedirectUrl.swift delete mode 100644 Sources/Pokepay/Responses/Bill.swift delete mode 100644 Sources/Pokepay/Responses/Card.swift delete mode 100644 Sources/Pokepay/Responses/Cashtray.swift delete mode 100644 Sources/Pokepay/Responses/CashtrayAttempt.swift delete mode 100644 Sources/Pokepay/Responses/CashtrayAttempts.swift delete mode 100644 Sources/Pokepay/Responses/Check.swift delete mode 100644 Sources/Pokepay/Responses/Coupon.swift delete mode 100644 Sources/Pokepay/Responses/CouponDetail.swift delete mode 100644 Sources/Pokepay/Responses/Error.swift delete mode 100644 Sources/Pokepay/Responses/ExchangedToken.swift delete mode 100644 Sources/Pokepay/Responses/IdentificationMatch.swift delete mode 100644 Sources/Pokepay/Responses/IdentificationResult.swift delete mode 100644 Sources/Pokepay/Responses/Images.swift delete mode 100644 Sources/Pokepay/Responses/JwtResult.swift delete mode 100644 Sources/Pokepay/Responses/Message.swift delete mode 100644 Sources/Pokepay/Responses/MessageAttachment.swift delete mode 100644 Sources/Pokepay/Responses/MessageUnreadCount.swift delete mode 100644 Sources/Pokepay/Responses/NoContent.swift delete mode 100644 Sources/Pokepay/Responses/Organization.swift delete mode 100644 Sources/Pokepay/Responses/PaginatedAccountBalances.swift delete mode 100644 Sources/Pokepay/Responses/PaginatedAccounts.swift delete mode 100644 Sources/Pokepay/Responses/PaginatedCards.swift delete mode 100644 Sources/Pokepay/Responses/PaginatedCoupons.swift delete mode 100644 Sources/Pokepay/Responses/PaginatedMessages.swift delete mode 100644 Sources/Pokepay/Responses/PaginatedPrivateMoneys.swift delete mode 100644 Sources/Pokepay/Responses/PaginatedTransactions.swift delete mode 100644 Sources/Pokepay/Responses/PaginatedTransfers.swift create mode 100644 Sources/Pokepay/Responses/PaginatedUserTagSubgroups.swift delete mode 100644 Sources/Pokepay/Responses/PrivateMoney.swift delete mode 100644 Sources/Pokepay/Responses/ServerKey.swift delete mode 100644 Sources/Pokepay/Responses/SevenElevenAtmSession.swift delete mode 100644 Sources/Pokepay/Responses/Terminal.swift delete mode 100644 Sources/Pokepay/Responses/TokenInfo.swift delete mode 100644 Sources/Pokepay/Responses/TopupMethod.swift delete mode 100644 Sources/Pokepay/Responses/Transfer.swift delete mode 100644 Sources/Pokepay/Responses/User.swift delete mode 100644 Sources/Pokepay/Responses/UserSettingUrl.swift create mode 100644 Sources/Pokepay/Responses/UserTagSubgroup.swift delete mode 100644 Sources/Pokepay/Responses/UserTransaction.swift create mode 100644 Sources/Pokepay/Responses/UserTransactionWithFallback.swift delete mode 100644 Sources/Pokepay/Responses/UserWithAuthFactors.swift delete mode 100644 Sources/Pokepay/Responses/VeritransToken.swift diff --git a/Sources/Pokepay/BankAPI.swift b/Sources/Pokepay/BankAPI.swift index efd74b0..1b19d22 100644 --- a/Sources/Pokepay/BankAPI.swift +++ b/Sources/Pokepay/BankAPI.swift @@ -2,17 +2,10 @@ public struct BankAPI { public struct Account {} - public struct Bill {} - public struct Cashtray {} - public struct Check {} - public struct CpmToken {} public struct CreditCard {} public struct Cvs {} public struct Jihanpi {} - public struct PrivateMoney {} public struct Shop {} - public struct Terminal {} public struct Transaction {} - public struct User {} public struct UserTag {} } diff --git a/Sources/Pokepay/BankAPI/Account/CreateAccount.swift b/Sources/Pokepay/BankAPI/Account/CreateAccount.swift deleted file mode 100644 index ebaaa3b..0000000 --- a/Sources/Pokepay/BankAPI/Account/CreateAccount.swift +++ /dev/null @@ -1,39 +0,0 @@ -import APIKit - -public extension BankAPI.Account { - struct Create: BankRequest { - public let name: String? - public let privateMoneyId: String - public let externalId: String? - - public typealias Response = Account - - public init(name: String? = nil, privateMoneyId: String, externalId: String? = nil) { - self.name = name - self.privateMoneyId = privateMoneyId - self.externalId = externalId - } - - public var method: HTTPMethod { - return .post - } - - public var path: String { - return "/accounts" - } - - 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 deleted file mode 100644 index 3efcf89..0000000 --- a/Sources/Pokepay/BankAPI/Account/CreateAccountCpmToken.swift +++ /dev/null @@ -1,76 +0,0 @@ -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 expiresIn: Int? - public let metadata: [String:String]? - - public typealias Response = AccountCpmToken - - 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 - self.scopes = scopes - self.expiresIn = expiresIn - self.metadata = metadata - } - - public var method: HTTPMethod { - return .post - } - - public var path: String { - return "/accounts/\(accountId)/cpm" - } - - 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") - } - dict["scopes"] = scopesArr - if expiresIn != nil { - dict["expires_in"] = expiresIn - } - if metadata != nil { - - dict["metadata"] = self.toJsonString(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(",") - } - jsonString.removeLast() - jsonString.append("}") - return jsonString - } - } -} diff --git a/Sources/Pokepay/BankAPI/Account/CreateAccountSevenElevenAtmSession.swift b/Sources/Pokepay/BankAPI/Account/CreateAccountSevenElevenAtmSession.swift deleted file mode 100644 index bbfcf16..0000000 --- a/Sources/Pokepay/BankAPI/Account/CreateAccountSevenElevenAtmSession.swift +++ /dev/null @@ -1,41 +0,0 @@ -import APIKit - -public extension BankAPI.Account { - - struct CreateAccountSevenElevenAtmSessions: BankRequest { - public let accountId: String - public let qrInfo: String - public let amount: Double - public let topupQuotaId: Int? - - public typealias Response = SevenElevenAtmSession - - public init(accountId: String, qrInfo: String, amount: Double, topupQuotaId: Int? = nil) { - self.accountId = accountId - self.qrInfo = qrInfo - self.amount = amount - self.topupQuotaId = topupQuotaId - } - - public var method: HTTPMethod { - return .post - } - - public var path: String { - return "/accounts/\(accountId)/seven-bank-atm-sessions" - } - - public var parameters: Any? { - var dict: [String: Any] = [:] - dict["qr_info"] = qrInfo - dict["amount"] = amount - if topupQuotaId != nil { - dict["topup_quota_id"] = topupQuotaId - } - - return dict - } - - } - -} diff --git a/Sources/Pokepay/BankAPI/Account/GetAccount.swift b/Sources/Pokepay/BankAPI/Account/GetAccount.swift deleted file mode 100644 index 0eb7c47..0000000 --- a/Sources/Pokepay/BankAPI/Account/GetAccount.swift +++ /dev/null @@ -1,21 +0,0 @@ -import APIKit - -public extension BankAPI.Account { - struct Get: BankRequest { - public let id: String - - public typealias Response = Account - - public init(id: String) { - self.id = id - } - - public var method: HTTPMethod { - return .get - } - - public var path: String { - return "/accounts/\(id)" - } - } -} diff --git a/Sources/Pokepay/BankAPI/Account/GetAccountCampaignPointAmounts.swift b/Sources/Pokepay/BankAPI/Account/GetAccountCampaignPointAmounts.swift deleted file mode 100644 index b083f6a..0000000 --- a/Sources/Pokepay/BankAPI/Account/GetAccountCampaignPointAmounts.swift +++ /dev/null @@ -1,23 +0,0 @@ -import APIKit -import Foundation - -public extension BankAPI.Account { - 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" - } - } -} \ No newline at end of file diff --git a/Sources/Pokepay/BankAPI/Account/GetAccountCouponDetail.swift b/Sources/Pokepay/BankAPI/Account/GetAccountCouponDetail.swift deleted file mode 100644 index 8bf76c3..0000000 --- a/Sources/Pokepay/BankAPI/Account/GetAccountCouponDetail.swift +++ /dev/null @@ -1,23 +0,0 @@ -import APIKit - -public extension BankAPI.Account { - struct GetCouponDetail:BankRequest { - public let accountId: String - public let couponId:String - - public typealias Response = CouponDetail - - public init(accountId: String, couponId:String) { - self.accountId = accountId - self.couponId = couponId - } - - public var method: HTTPMethod { - return .get - } - - public var path: String { - return "/accounts/\(accountId)/coupons/\(couponId)" - } - } -} diff --git a/Sources/Pokepay/BankAPI/Account/GetAccountSevenElevenAtmSession.swift b/Sources/Pokepay/BankAPI/Account/GetAccountSevenElevenAtmSession.swift deleted file mode 100644 index 73194fa..0000000 --- a/Sources/Pokepay/BankAPI/Account/GetAccountSevenElevenAtmSession.swift +++ /dev/null @@ -1,22 +0,0 @@ -import APIKit - -public extension BankAPI.Account { - struct GetAccountSevenElevenAtmSession: BankRequest { - public let qrInfo: String - - public typealias Response = SevenElevenAtmSession - - public init(qrInfo: String) { - self.qrInfo = qrInfo - } - - public var method: HTTPMethod { - return .get - } - - public var path: String { - return "/seven-bank-atm-sessions/\(qrInfo)" - } - } -} - diff --git a/Sources/Pokepay/BankAPI/Account/GetAccountTransactions.swift b/Sources/Pokepay/BankAPI/Account/GetAccountTransactions.swift deleted file mode 100644 index fe8bd0b..0000000 --- a/Sources/Pokepay/BankAPI/Account/GetAccountTransactions.swift +++ /dev/null @@ -1,41 +0,0 @@ -import APIKit - -public extension BankAPI.Account { - struct GetTransactions: BankRequest { - public let id: String - public let before: String? - public let after: String? - public let perPage: Int32? - - public typealias Response = PaginatedTransactions - - public init(id: String, before: String? = nil, after: String? = nil, perPage: Int32? = nil) { - self.id = id - self.before = before - self.after = after - self.perPage = perPage - } - - public var method: HTTPMethod { - return .get - } - - public var path: String { - return "/accounts/\(id)/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 deleted file mode 100644 index 36700cf..0000000 --- a/Sources/Pokepay/BankAPI/Account/GetAccountTransfers.swift +++ /dev/null @@ -1,42 +0,0 @@ -import APIKit - -public extension BankAPI.Account { - struct GetTransfers: BankRequest { - public let id: String - public let before: String? - public let after: String? - public let perPage: Int32? - - public typealias Response = PaginatedTransfers - - public init(id: String, before: String? = nil, after: String? = nil, perPage: Int32? = nil) { - self.id = id - self.before = before - self.after = after - self.perPage = perPage - } - - public var method: HTTPMethod { - return .get - } - - public var path: String { - return "/accounts/\(id)/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/GetBalances.swift b/Sources/Pokepay/BankAPI/Account/GetBalances.swift deleted file mode 100644 index f669180..0000000 --- a/Sources/Pokepay/BankAPI/Account/GetBalances.swift +++ /dev/null @@ -1,41 +0,0 @@ -import APIKit - -public extension BankAPI.Account { - struct GetBalances: BankRequest { - public let id: String - public let before: String? - public let after: String? - public let perPage: Int32? - - public typealias Response = PaginatedAccountBalances - - public init(id: String, before: String? = nil, after: String? = nil, perPage: Int32? = nil) { - self.id = id - self.before = before - self.after = after - self.perPage = perPage - } - - public var method: HTTPMethod { - return .get - } - - public var path: String { - return "/accounts/\(id)/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 - } - return dict - } - } -} diff --git a/Sources/Pokepay/BankAPI/Account/PatchAccountCouponDetail.swift b/Sources/Pokepay/BankAPI/Account/PatchAccountCouponDetail.swift deleted file mode 100644 index 5470eff..0000000 --- a/Sources/Pokepay/BankAPI/Account/PatchAccountCouponDetail.swift +++ /dev/null @@ -1,37 +0,0 @@ -import APIKit - -public extension BankAPI.Account { - struct PatchCouponDetail:BankRequest { - public let accountId: String - public let couponId:String - public let isReceived: Bool - public let code: String? - - public typealias Response = CouponDetail - - public init(accountId: String, couponId:String, isReceived: Bool = true, code: String? = nil) { - self.accountId = accountId - self.couponId = couponId - self.isReceived = isReceived - self.code = code - } - - public var method: HTTPMethod { - return .patch - } - - public var path: String { - return "/accounts/\(accountId)/coupons/\(couponId)" - } - - public var parameters: Any? { - var dict: [String: Any] = [:] - dict["is_received"] = isReceived - if code != nil { - dict["code"] = code - } - return dict - } - } -} - diff --git a/Sources/Pokepay/BankAPI/AuthorizedRequest.swift b/Sources/Pokepay/BankAPI/AuthorizedRequest.swift deleted file mode 100644 index 0ac0e9f..0000000 --- a/Sources/Pokepay/BankAPI/AuthorizedRequest.swift +++ /dev/null @@ -1,27 +0,0 @@ -import Foundation -import APIKit - -struct AuthorizedRequest: RequestProxy { - typealias Request = R - typealias Response = R.Response - let request: R - let accessToken: String - var headerFields: [String: String] { - var h = request.headerFields - - h["Authorization"] = "Bearer \(accessToken)" - h["X-SDK-Version"] = SDKVersion - - return h - } - var endpoint: URL - var baseURL: URL { - return endpoint - } - - public init(request: R, accessToken: String, endpoint: URL) { - self.request = request - self.accessToken = accessToken - self.endpoint = endpoint - } -} diff --git a/Sources/Pokepay/BankAPI/BankAPIDateFormatter.swift b/Sources/Pokepay/BankAPI/BankAPIDateFormatter.swift deleted file mode 100644 index 9fa0822..0000000 --- a/Sources/Pokepay/BankAPI/BankAPIDateFormatter.swift +++ /dev/null @@ -1,11 +0,0 @@ -import Foundation - -public class BankAPIDateFormatter { - public static func string(date: Date) -> String { - let dateFormatter = DateFormatter() - dateFormatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSSSS'Z'" - dateFormatter.timeZone = TimeZone(secondsFromGMT: 0) - dateFormatter.locale = Locale(identifier: "en_US_POSIX") - return dateFormatter.string(from: date) - } -} diff --git a/Sources/Pokepay/BankAPI/BankAPIError.swift b/Sources/Pokepay/BankAPI/BankAPIError.swift deleted file mode 100644 index c8b7cb6..0000000 --- a/Sources/Pokepay/BankAPI/BankAPIError.swift +++ /dev/null @@ -1,30 +0,0 @@ -import Foundation - -public enum BankAPIError: Error { - case invalidJSON(Swift.Error) - case unknownError(Int?, APIError) - case clientError(Int, APIError) - case serverError(Int, APIError) - - init(statusCode: Int? = nil, object: Data) { - do { - let error = try JSONDecoder().decode(APIError.self, from: object) - guard let code = statusCode else { - self = .unknownError(statusCode, error) - return - } - if ((400..<500).contains(code)) { - self = .clientError(code, error) - } - else if ((500..<600).contains(code)) { - self = .serverError(code, error) - } - else { - self = .unknownError(code, error) - } - } catch let decodeError { - self = .invalidJSON(decodeError) - return - } - } -} diff --git a/Sources/Pokepay/BankAPI/BankAPIJSONDecoder.swift b/Sources/Pokepay/BankAPI/BankAPIJSONDecoder.swift deleted file mode 100644 index 82f4189..0000000 --- a/Sources/Pokepay/BankAPI/BankAPIJSONDecoder.swift +++ /dev/null @@ -1,13 +0,0 @@ -import Foundation - -public class BankAPIJSONDecoder: JSONDecoder, @unchecked Sendable { - public let dateFormatter = DateFormatter() - - override public init() { - super.init() - dateFormatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSSSS'Z'" - dateFormatter.timeZone = TimeZone(secondsFromGMT: 0) - dateFormatter.locale = Locale(identifier: "en_US_POSIX") - dateDecodingStrategy = .formatted(dateFormatter) - } -} \ No newline at end of file diff --git a/Sources/Pokepay/BankAPI/BankAPIRequest.swift b/Sources/Pokepay/BankAPI/BankAPIRequest.swift deleted file mode 100644 index d3e745a..0000000 --- a/Sources/Pokepay/BankAPI/BankAPIRequest.swift +++ /dev/null @@ -1,60 +0,0 @@ -import Foundation -import APIKit - -let DEFAULT_API_BASE_URL = "https://api-sandbox.pokepay.jp" - -public protocol BankRequest: Request { - var responseContentType: String { get } -} - -public extension BankRequest { - var baseURL: URL { - return URL(string: DEFAULT_API_BASE_URL)! - } - - var responseContentType: String { - return "application/json" - } -} - -public extension BankRequest { - func intercept(object: Any, urlResponse: HTTPURLResponse) throws -> Any { - guard (200..<300).contains(urlResponse.statusCode) else { - throw BankAPIError(statusCode: urlResponse.statusCode, object: object as! Data) - } - return object - } -} - -extension BankRequest where Response: Decodable { - public var dataParser: DataParser { - switch responseContentType { - case "text/html": - return HTMLDataParser() - default: - return DecodableDataParser() - } - } - - public func response(from object: Any, urlResponse: HTTPURLResponse) throws -> Response { - guard let data = object as? Data else { - throw BankAPIError(statusCode: urlResponse.statusCode, object: Data()) - } - - guard data.count != 0 else { - let emptyJson = "{}" - return try BankAPIJSONDecoder().decode(Response.self, from: emptyJson.data(using: .utf8)!) - } - - switch responseContentType { - case "text/html": - if let htmlString = String(data: data, encoding: .utf8) as? Response { - return htmlString - } else { - throw BankAPIError(statusCode: urlResponse.statusCode, object: data) - } - default: - return try BankAPIJSONDecoder().decode(Response.self, from: data) - } - } -} diff --git a/Sources/Pokepay/BankAPI/Bill/CreateBill.swift b/Sources/Pokepay/BankAPI/Bill/CreateBill.swift deleted file mode 100644 index c4fef2c..0000000 --- a/Sources/Pokepay/BankAPI/Bill/CreateBill.swift +++ /dev/null @@ -1,41 +0,0 @@ -import APIKit - -public extension BankAPI.Bill { - struct Create: BankRequest { - public let amount: Double? - public let accountId: String? - public let description: String? - public let products: [Product]? - - public typealias Response = Bill - - public init(amount: Double? = nil, accountId: String? = nil, description: String? = nil, products: [Product]? = nil) { - self.amount = amount - self.accountId = accountId - self.description = description - self.products = products - } - - public var method: HTTPMethod { - return .post - } - - public var path: String { - return "/bills" - } - - public var parameters: Any? { - var dict: [String: Any] = ["amount": amount as Any] - if accountId != nil { - dict["account_id"] = accountId - } - if description != nil { - dict["description"] = description - } - if products != nil { - dict["products"] = products!.map { $0.dictionary } - } - return dict - } - } -} diff --git a/Sources/Pokepay/BankAPI/Bill/DeleteBill.swift b/Sources/Pokepay/BankAPI/Bill/DeleteBill.swift deleted file mode 100644 index b14bba4..0000000 --- a/Sources/Pokepay/BankAPI/Bill/DeleteBill.swift +++ /dev/null @@ -1,21 +0,0 @@ -import APIKit - -public extension BankAPI.Bill { - struct Delete: BankRequest { - public let id: String - - public typealias Response = NoContent - - public init(id: String) { - self.id = id - } - - public var method: HTTPMethod { - return .delete - } - - public var path: String { - return "/bills/\(id)" - } - } -} diff --git a/Sources/Pokepay/BankAPI/Bill/GetBill.swift b/Sources/Pokepay/BankAPI/Bill/GetBill.swift deleted file mode 100644 index 0280072..0000000 --- a/Sources/Pokepay/BankAPI/Bill/GetBill.swift +++ /dev/null @@ -1,21 +0,0 @@ -import APIKit - -public extension BankAPI.Bill { - struct Get: BankRequest { - public let id: String - - public typealias Response = Bill - - public init(id: String) { - self.id = id - } - - public var method: HTTPMethod { - return .get - } - - public var path: String { - return "/bills/\(id)" - } - } -} diff --git a/Sources/Pokepay/BankAPI/Bill/UpdateBill.swift b/Sources/Pokepay/BankAPI/Bill/UpdateBill.swift deleted file mode 100644 index 27713e3..0000000 --- a/Sources/Pokepay/BankAPI/Bill/UpdateBill.swift +++ /dev/null @@ -1,34 +0,0 @@ -import APIKit - -public extension BankAPI.Bill { - struct Update: BankRequest { - public let id: String - public let amount: Double? - public let description: String? - - public typealias Response = Bill - - public init(id: String, amount: Double? = nil, description: String? = nil) { - self.id = id - self.amount = amount - self.description = description - } - - public var method: HTTPMethod { - return .patch - } - - public var path: String { - return "/bills/\(id)" - } - - public var parameters: Any? { - // 'amount' will be sent anyway even when it's nil (unsetting it) - var dict: [String: Any] = ["amount": amount as Any] - if description != nil { - dict["description"] = description - } - return dict - } - } -} diff --git a/Sources/Pokepay/BankAPI/Cashtray/CreateCashtray.swift b/Sources/Pokepay/BankAPI/Cashtray/CreateCashtray.swift deleted file mode 100644 index cf691bc..0000000 --- a/Sources/Pokepay/BankAPI/Cashtray/CreateCashtray.swift +++ /dev/null @@ -1,41 +0,0 @@ -import APIKit - -public extension BankAPI.Cashtray { - struct Create: BankRequest { - public let amount: Double - public let description: String? - public let expiresIn: Int32? - public let products: [Product]? - - public typealias Response = Cashtray - - public init(amount: Double, description: String? = nil, expiresIn: Int32? = nil, products: [Product]? = nil) { - self.amount = amount - self.description = description - self.expiresIn = expiresIn - self.products = products - } - - public var method: HTTPMethod { - return .post - } - - public var path: String { - return "/cashtrays" - } - - public var parameters: Any? { - var dict: [String: Any] = ["amount": amount as Any] - if description != nil { - dict["description"] = description - } - if expiresIn != nil { - dict["expires_in"] = expiresIn - } - if products != nil { - dict["products"] = products!.map { $0.dictionary } - } - return dict - } - } -} diff --git a/Sources/Pokepay/BankAPI/Cashtray/DeleteCashtray.swift b/Sources/Pokepay/BankAPI/Cashtray/DeleteCashtray.swift deleted file mode 100644 index 1ec01d9..0000000 --- a/Sources/Pokepay/BankAPI/Cashtray/DeleteCashtray.swift +++ /dev/null @@ -1,21 +0,0 @@ -import APIKit - -public extension BankAPI.Cashtray { - struct Delete: BankRequest { - public let id: String - - public typealias Response = NoContent - - public init(id: String) { - self.id = id - } - - public var method: HTTPMethod { - return .delete - } - - public var path: String { - return "/cashtrays/\(id)" - } - } -} diff --git a/Sources/Pokepay/BankAPI/Cashtray/GetCashtray.swift b/Sources/Pokepay/BankAPI/Cashtray/GetCashtray.swift deleted file mode 100644 index 7e9fe71..0000000 --- a/Sources/Pokepay/BankAPI/Cashtray/GetCashtray.swift +++ /dev/null @@ -1,21 +0,0 @@ -import APIKit - -public extension BankAPI.Cashtray { - struct Get: BankRequest { - public let id: String - - public typealias Response = Cashtray - - public init(id: String) { - self.id = id - } - - public var method: HTTPMethod { - return .get - } - - public var path: String { - return "/cashtrays/\(id)" - } - } -} diff --git a/Sources/Pokepay/BankAPI/Cashtray/GetCashtrayAttempts.swift b/Sources/Pokepay/BankAPI/Cashtray/GetCashtrayAttempts.swift deleted file mode 100644 index ee41e66..0000000 --- a/Sources/Pokepay/BankAPI/Cashtray/GetCashtrayAttempts.swift +++ /dev/null @@ -1,21 +0,0 @@ -import APIKit - -public extension BankAPI.Cashtray { - struct GetAttempts: BankRequest { - public let id: String - - public typealias Response = CashtrayAttempts - - public init(id: String) { - self.id = id - } - - public var method: HTTPMethod { - return .get - } - - public var path: String { - return "/cashtrays/\(id)/attempts" - } - } -} diff --git a/Sources/Pokepay/BankAPI/Cashtray/UpdateCashtray.swift b/Sources/Pokepay/BankAPI/Cashtray/UpdateCashtray.swift deleted file mode 100644 index 8f8b6a8..0000000 --- a/Sources/Pokepay/BankAPI/Cashtray/UpdateCashtray.swift +++ /dev/null @@ -1,41 +0,0 @@ -import APIKit - -public extension BankAPI.Cashtray { - struct Update: BankRequest { - public let id: String - public let amount: Double? - public let description: String? - public let expiresIn: Int32? - - public typealias Response = Cashtray - - public init(id: String, amount: Double? = nil, description: String? = nil, expiresIn: Int32? = nil) { - self.id = id - self.amount = amount - self.description = description - self.expiresIn = expiresIn - } - - public var method: HTTPMethod { - return .patch - } - - public var path: String { - return "/cashtrays/\(id)" - } - - 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 - } - return dict - } - } -} diff --git a/Sources/Pokepay/BankAPI/Check/CreateCheck.swift b/Sources/Pokepay/BankAPI/Check/CreateCheck.swift deleted file mode 100644 index cd22044..0000000 --- a/Sources/Pokepay/BankAPI/Check/CreateCheck.swift +++ /dev/null @@ -1,45 +0,0 @@ -import Foundation -import APIKit - -public extension BankAPI.Check { - struct Create: BankRequest { - public let amount: Double? - public let accountId: String? - public let description: String? - public let expiresAt: Date? - - public typealias Response = Check - - public init(amount: Double? = nil, accountId: String? = nil, description: String? = nil, expiresAt: Date? = nil) { - self.amount = amount - self.accountId = accountId - self.description = description - self.expiresAt = expiresAt - } - - public var method: HTTPMethod { - return .post - } - - public var path: String { - return "/checks" - } - - public var parameters: Any? { - var dict: [String: Any] = [:] - if amount != nil { - dict["amount"] = amount - } - if accountId != nil { - dict["account_id"] = accountId - } - if description != nil { - dict["description"] = description - } - if let p = expiresAt { - dict["expires_at"] = BankAPIDateFormatter.string(date: p) - } - return dict - } - } -} diff --git a/Sources/Pokepay/BankAPI/Check/DeleteCheck.swift b/Sources/Pokepay/BankAPI/Check/DeleteCheck.swift deleted file mode 100644 index 9bc7044..0000000 --- a/Sources/Pokepay/BankAPI/Check/DeleteCheck.swift +++ /dev/null @@ -1,21 +0,0 @@ -import APIKit - -public extension BankAPI.Check { - struct Delete: BankRequest { - public let id: String - - public typealias Response = NoContent - - public init(id: String) { - self.id = id - } - - public var method: HTTPMethod { - return .delete - } - - public var path: String { - return "/checks/\(id)" - } - } -} diff --git a/Sources/Pokepay/BankAPI/Check/GetCheck.swift b/Sources/Pokepay/BankAPI/Check/GetCheck.swift deleted file mode 100644 index 5f2c240..0000000 --- a/Sources/Pokepay/BankAPI/Check/GetCheck.swift +++ /dev/null @@ -1,21 +0,0 @@ -import APIKit - -public extension BankAPI.Check { - struct Get: BankRequest { - public let id: String - - public typealias Response = Check - - public init(id: String) { - self.id = id - } - - public var method: HTTPMethod { - return .get - } - - public var path: String { - return "/checks/\(id)" - } - } -} diff --git a/Sources/Pokepay/BankAPI/Check/UpdateCheck.swift b/Sources/Pokepay/BankAPI/Check/UpdateCheck.swift deleted file mode 100644 index af004a8..0000000 --- a/Sources/Pokepay/BankAPI/Check/UpdateCheck.swift +++ /dev/null @@ -1,36 +0,0 @@ -import APIKit - -public extension BankAPI.Check { - struct Update: BankRequest { - public let id: String - public let amount: Double? - public let description: String? - - public typealias Response = Check - - public init(id: String, amount: Double? = nil, description: String? = nil) { - self.id = id - self.amount = amount - self.description = description - } - - public var method: HTTPMethod { - return .patch - } - - public var path: String { - return "/checks/\(id)" - } - - public var parameters: Any? { - var dict: [String: Any] = [:] - if amount != nil { - dict["amount"] = amount - } - if description != nil { - dict["description"] = description - } - return dict - } - } -} diff --git a/Sources/Pokepay/BankAPI/CpmToken/GetCpmToken.swift b/Sources/Pokepay/BankAPI/CpmToken/GetCpmToken.swift deleted file mode 100644 index 34caf33..0000000 --- a/Sources/Pokepay/BankAPI/CpmToken/GetCpmToken.swift +++ /dev/null @@ -1,21 +0,0 @@ -import APIKit - -public extension BankAPI.CpmToken { - struct Get: BankRequest { - public let cpmToken: String - - public typealias Response = AccountCpmToken - - public init(cpmToken: String) { - self.cpmToken = cpmToken - } - - public var method: HTTPMethod { - return .get - } - - public var path: String { - return "/cpm/\(cpmToken)" - } - } -} diff --git a/Sources/Pokepay/BankAPI/PrivateMoney/GetPrivateMoney.swift b/Sources/Pokepay/BankAPI/PrivateMoney/GetPrivateMoney.swift deleted file mode 100644 index f6f9b1d..0000000 --- a/Sources/Pokepay/BankAPI/PrivateMoney/GetPrivateMoney.swift +++ /dev/null @@ -1,28 +0,0 @@ -import APIKit - -public extension BankAPI.PrivateMoney { - - struct GetPrivateMoney: BankRequest { - public let privateMoneyId:String - - public typealias Response = PrivateMoney - - public init(privateMoneyId: String) { - self.privateMoneyId = privateMoneyId - } - - public var method: HTTPMethod { - return .get - } - - public var path: String { - return "/private-moneys/\(privateMoneyId)" - } - - public var parameters: Any? { - return [:] - } - - } - -} diff --git a/Sources/Pokepay/BankAPI/PrivateMoney/GetPrivateMoneyCoupons.swift b/Sources/Pokepay/BankAPI/PrivateMoney/GetPrivateMoneyCoupons.swift deleted file mode 100644 index 135aeaf..0000000 --- a/Sources/Pokepay/BankAPI/PrivateMoney/GetPrivateMoneyCoupons.swift +++ /dev/null @@ -1,41 +0,0 @@ -import APIKit - -public extension BankAPI.PrivateMoney { - struct GetPrivateMoneyCoupons: BankRequest { - public let privateMoneyId:String - public let before:String? - public let after:String? - public let perPage:Int32? - - public typealias Response = PaginatedCoupons - - public init(privateMoneyId: String, before: String? = nil, after: String? = nil, perPage: Int32? = 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/PrivateMoney/SearchPrivateMoneys.swift b/Sources/Pokepay/BankAPI/PrivateMoney/SearchPrivateMoneys.swift deleted file mode 100644 index 5f0a4c4..0000000 --- a/Sources/Pokepay/BankAPI/PrivateMoney/SearchPrivateMoneys.swift +++ /dev/null @@ -1,47 +0,0 @@ -import APIKit - -public extension BankAPI.PrivateMoney { - struct Search: BankRequest { - public let name: String? - public let includeExclusive: Bool - public let before: String? - public let after: String? - public let perPage: Int32? - - public typealias Response = PaginatedPrivateMoneys - - public init(name: String? = nil, includeExclusive: Bool = false, before: String? = nil, after: String? = nil, perPage: Int32? = nil) { - self.name = name - self.includeExclusive = includeExclusive - self.before = before - self.after = after - self.perPage = perPage - } - - public var method: HTTPMethod { - return .get - } - - public var path: String { - return "/private-moneys" - } - - public var parameters: Any? { - var dict: [String: Any] = [:] - if name != nil { - dict["name"] = name - } - 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 4e4cd29..3083f1f 100644 --- a/Sources/Pokepay/BankAPI/Shop/GetListOfShops.swift +++ b/Sources/Pokepay/BankAPI/Shop/GetListOfShops.swift @@ -5,15 +5,17 @@ public extension BankAPI.Shop { struct GetListOfShops: BankRequest { public let privateMoneyId: String public let userTagGroupItemId: String? + public let userTagSubgroupId: String? public let before: String? public let after: String? public let perPage: Int? public typealias Response = PaginatedShops - public init(privateMoneyId: String, userTagGroupItemId: String? = nil, before: String? = nil, after: String? = nil, perPage: Int? = nil) { + public init(privateMoneyId: String, userTagGroupItemId: String? = nil, userTagSubgroupId: String? = nil, before: String? = nil, after: String? = nil, perPage: Int? = nil) { self.privateMoneyId = privateMoneyId self.userTagGroupItemId = userTagGroupItemId + self.userTagSubgroupId = userTagSubgroupId self.before = before self.after = after self.perPage = perPage @@ -36,6 +38,10 @@ public extension BankAPI.Shop { dict["user_tag_group_item_id"] = userTagGroupItemId } + if userTagSubgroupId != nil { + dict["user_tag_subgroup_id"] = userTagSubgroupId + } + if before != nil { dict["before"] = before } diff --git a/Sources/Pokepay/BankAPI/Terminal/AddTerminalPublicKey.swift b/Sources/Pokepay/BankAPI/Terminal/AddTerminalPublicKey.swift deleted file mode 100644 index a7d47ab..0000000 --- a/Sources/Pokepay/BankAPI/Terminal/AddTerminalPublicKey.swift +++ /dev/null @@ -1,27 +0,0 @@ -import APIKit - -public extension BankAPI.Terminal { - struct AddPublicKey: BankRequest { - public let key: String - - public typealias Response = ServerKey - - public init(key: String) { - self.key = key - } - - public var method: HTTPMethod { - return .post - } - - public var path: String { - return "/terminal/keys" - } - - public var parameters: Any? { - return [ - "key": self.key - ] - } - } -} diff --git a/Sources/Pokepay/BankAPI/Terminal/GetTerminal.swift b/Sources/Pokepay/BankAPI/Terminal/GetTerminal.swift deleted file mode 100644 index 9bc0e3b..0000000 --- a/Sources/Pokepay/BankAPI/Terminal/GetTerminal.swift +++ /dev/null @@ -1,17 +0,0 @@ -import APIKit - -public extension BankAPI.Terminal { - struct Get: BankRequest { - public typealias Response = Terminal - - public init() {} - - public var method: HTTPMethod { - return .get - } - - public var path: String { - return "/terminal" - } - } -} diff --git a/Sources/Pokepay/BankAPI/Terminal/UpdateTerminal.swift b/Sources/Pokepay/BankAPI/Terminal/UpdateTerminal.swift deleted file mode 100644 index 1c19555..0000000 --- a/Sources/Pokepay/BankAPI/Terminal/UpdateTerminal.swift +++ /dev/null @@ -1,33 +0,0 @@ -import APIKit - -public extension BankAPI.Terminal { - struct Update: BankRequest { - let accountId: String - let name: String - let pushToken: String? - - public typealias Response = Terminal - - public init(name: String, accountId: String, pushToken: String? = nil) { - self.name = name - self.accountId = accountId - self.pushToken = pushToken - } - - public var method: HTTPMethod { - return .patch - } - - public var path: String { - return "/terminal" - } - - public var parameters: Any? { - return [ - "account_id": accountId, - "name": name, - "push_token": pushToken - ] - } - } -} diff --git a/Sources/Pokepay/BankAPI/Transaction/CancelTransaction.swift b/Sources/Pokepay/BankAPI/Transaction/CancelTransaction.swift deleted file mode 100644 index d34f20e..0000000 --- a/Sources/Pokepay/BankAPI/Transaction/CancelTransaction.swift +++ /dev/null @@ -1,21 +0,0 @@ -import APIKit - -public extension BankAPI.Transaction { - struct Cancel: BankRequest { - public let id: String - - public typealias Response = NoContent - - public init(id: String) { - self.id = id - } - - public var method: HTTPMethod { - return .delete - } - - public var path: String { - return "/transactions/\(id)" - } - } -} diff --git a/Sources/Pokepay/BankAPI/Transaction/CreateTransactionWithBill.swift b/Sources/Pokepay/BankAPI/Transaction/CreateBillTransaction.swift similarity index 54% rename from Sources/Pokepay/BankAPI/Transaction/CreateTransactionWithBill.swift rename to Sources/Pokepay/BankAPI/Transaction/CreateBillTransaction.swift index f65b44c..ef0662f 100644 --- a/Sources/Pokepay/BankAPI/Transaction/CreateTransactionWithBill.swift +++ b/Sources/Pokepay/BankAPI/Transaction/CreateBillTransaction.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 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: 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 amount: Int? + public let couponId: String? + public let strategy: String? + + public typealias Response = UserTransactionWithFallback + + public init(requestId: String, billId: String, accountId: String? = nil, amount: Int? = 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/CreateCashtrayTransaction.swift similarity index 62% rename from Sources/Pokepay/BankAPI/Transaction/CreateTransactionWithCashtray.swift rename to Sources/Pokepay/BankAPI/Transaction/CreateCashtrayTransaction.swift index e0b4348..8cd8f20 100644 --- a/Sources/Pokepay/BankAPI/Transaction/CreateTransactionWithCashtray.swift +++ b/Sources/Pokepay/BankAPI/Transaction/CreateCashtrayTransaction.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 CreateCashtrayTransaction: 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/CreateCheckTransaction.swift similarity index 67% rename from Sources/Pokepay/BankAPI/Transaction/CreateTransactionWithCheck.swift rename to Sources/Pokepay/BankAPI/Transaction/CreateCheckTransaction.swift index 98a23cb..22ac25a 100644 --- a/Sources/Pokepay/BankAPI/Transaction/CreateTransactionWithCheck.swift +++ b/Sources/Pokepay/BankAPI/Transaction/CreateCheckTransaction.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 CreateCheckTransaction: 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/CreateCpmTransaction.swift similarity index 59% rename from Sources/Pokepay/BankAPI/Transaction/CreateTransactionWithCpm.swift rename to Sources/Pokepay/BankAPI/Transaction/CreateCpmTransaction.swift index a4bd81f..25d2f1f 100644 --- a/Sources/Pokepay/BankAPI/Transaction/CreateTransactionWithCpm.swift +++ b/Sources/Pokepay/BankAPI/Transaction/CreateCpmTransaction.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 CreateCpmTransaction: BankRequest { + public let requestId: String public let cpmToken: String public let accountId: String? - public let amount: Double + public let amount: Int public let products: [Product]? - public let requestId: UUID? public let topupQuotaId: Int? - public typealias Response = UserTransaction + public typealias Response = UserTransactionWithFallback - 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: Int, 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/CreateTransactionWithJwt.swift b/Sources/Pokepay/BankAPI/Transaction/CreateTransactionWithJwt.swift deleted file mode 100644 index 3b1dee6..0000000 --- a/Sources/Pokepay/BankAPI/Transaction/CreateTransactionWithJwt.swift +++ /dev/null @@ -1,48 +0,0 @@ -import APIKit - -public extension BankAPI.Transaction { - struct CreateWithJwt: BankRequest { - - public let data: String - public let accountId: String? - public let couponId:String? - public let strategy: TransactionStrategy? - public let topupQuotaId: Int? - - public typealias Response = JwtResult - - public init(data: String, accountId: String? = nil, couponId:String? = nil, strategy: TransactionStrategy? = .pointPreferred, topupQuotaId: Int? = nil) { - self.data = data - self.accountId = accountId - self.couponId = couponId - self.strategy = strategy - self.topupQuotaId = topupQuotaId - } - - public var method: HTTPMethod { - return .post - } - - public var path: String { - return "/transactions" - } - - public var parameters: Any? { - var dict: [String: Any] = [:] - dict["data"] = data - if accountId != nil { - dict["account_id"] = accountId - } - if couponId != nil { - dict["coupon_id"] = couponId - } - if strategy != nil { - dict["strategy"] = strategy?.rawValue - } - 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 deleted file mode 100644 index 9c76482..0000000 --- a/Sources/Pokepay/BankAPI/Transaction/GetTransaction.swift +++ /dev/null @@ -1,21 +0,0 @@ -import APIKit - -public extension BankAPI.Transaction { - struct Get: BankRequest { - public let id: String - - public typealias Response = UserTransaction - - public init(id: String) { - self.id = id - } - - public var method: HTTPMethod { - return .get - } - - public var path: String { - return "/transactions/\(id)" - } - } -} diff --git a/Sources/Pokepay/BankAPI/Transaction/SendToAccount.swift b/Sources/Pokepay/BankAPI/Transaction/SendToAccount.swift deleted file mode 100644 index 533ba25..0000000 --- a/Sources/Pokepay/BankAPI/Transaction/SendToAccount.swift +++ /dev/null @@ -1,43 +0,0 @@ -import APIKit - -public extension BankAPI.Transaction { - struct SendToAccount: BankRequest { - public let accountId: String - public let amount: Double - public let receiverTerminalId: String? - public let senderAccountId: String? - public let description: String? - - public typealias Response = UserTransaction - - public init(accountId: String, amount: Double, receiverTerminalId: String? = nil, senderAccountId: String?, description: String? = nil) { - self.accountId = accountId - self.amount = amount - self.receiverTerminalId = receiverTerminalId - self.senderAccountId = senderAccountId - self.description = description - } - - public var method: HTTPMethod { - return .post - } - - public var path: String { - return "/accounts/\(accountId)/transactions" - } - - public var parameters: Any? { - var dict: [String: Any] = ["amount": amount] - if receiverTerminalId != nil { - dict["receiver_terminal_id"] = receiverTerminalId - } - if senderAccountId != nil { - dict["sender_account_id"] = senderAccountId - } - if description != nil { - dict["description"] = description - } - return dict - } - } -} diff --git a/Sources/Pokepay/BankAPI/Transaction/SendToUser.swift b/Sources/Pokepay/BankAPI/Transaction/SendToUser.swift deleted file mode 100644 index efa6b64..0000000 --- a/Sources/Pokepay/BankAPI/Transaction/SendToUser.swift +++ /dev/null @@ -1,43 +0,0 @@ -import APIKit - -public extension BankAPI.Transaction { - struct SendToUser: BankRequest { - public let userId: String - public let amount: Double - public let receiverTerminalId: String? - public let senderAccountId: String? - public let description: String? - - public typealias Response = UserTransaction - - public init(userId: String, amount: Double, receiverTerminalId: String? = nil, senderAccountId: String? = nil, description: String? = nil) { - self.userId = userId - self.amount = amount - self.receiverTerminalId = receiverTerminalId - self.senderAccountId = senderAccountId - self.description = description - } - - public var method: HTTPMethod { - return .post - } - - public var path: String { - return "/users/\(userId)/transactions" - } - - public var parameters: Any? { - var dict: [String: Any] = ["amount": amount] - if receiverTerminalId != nil { - dict["receiver_terminal_id"] = receiverTerminalId - } - if senderAccountId != nil { - dict["sender_account_id"] = senderAccountId - } - if description != nil { - dict["description"] = description - } - return dict - } - } -} diff --git a/Sources/Pokepay/BankAPI/User/BankPayTopUp.swift b/Sources/Pokepay/BankAPI/User/BankPayTopUp.swift deleted file mode 100644 index 118b4a3..0000000 --- a/Sources/Pokepay/BankAPI/User/BankPayTopUp.swift +++ /dev/null @@ -1,47 +0,0 @@ -import APIKit - -public extension BankAPI.User { - struct BankPayTopUp: BankRequest { - public let id: String - public let accountId: String - public let bankId: String - public let amount: String - public typealias Response = UserTransaction - public let requestId: String? - public let topupQuotaId: Int? - - public init(id: String, accountId: String , bankId: String, amount: String, requestId: String? = nil, topupQuotaId: Int? = nil) { - self.id = id - self.accountId = accountId - self.bankId = bankId - self.amount = amount - self.requestId = requestId - self.topupQuotaId = topupQuotaId - } - - public var method: HTTPMethod { - return .post - } - - public var path: String { - return "/users/\(id)/banks/topup" - } - - public var parameters: Any? { - var dict: [String: Any] = [ - "account_id": accountId, - "bank_id": bankId, - "amount": amount - ] - if requestId != nil { - dict["request_id"] = requestId - } - if topupQuotaId != nil { - dict["topup_quota_id"] = topupQuotaId - } - - return dict - } - - } -} diff --git a/Sources/Pokepay/BankAPI/User/CardsTopUp.swift b/Sources/Pokepay/BankAPI/User/CardsTopUp.swift deleted file mode 100644 index 7a4b018..0000000 --- a/Sources/Pokepay/BankAPI/User/CardsTopUp.swift +++ /dev/null @@ -1,36 +0,0 @@ -import APIKit - -public extension BankAPI.User { - struct CardsTopUp: BankRequest { - public let id: String - public let accountId: String - public let cardRegisteredAt: String - public let amount: String - public typealias Response = UserTransaction - - public init(id: String, accountId: String ,cardRegisteredAt: String, amount: String) { - self.id = id - self.accountId = accountId - self.cardRegisteredAt = cardRegisteredAt - self.amount = amount - } - - public var method: HTTPMethod { - return .post - } - - public var path: String { - return "/users/\(id)/cards/topup" - } - - public var parameters: Any? { - let dict: [String: Any] = [ - "account_id": accountId, - "card_registered_at": cardRegisteredAt, - "amount": amount - ] - return dict - } - - } -} diff --git a/Sources/Pokepay/BankAPI/User/CreateBankPay.swift b/Sources/Pokepay/BankAPI/User/CreateBankPay.swift deleted file mode 100644 index 2b8b17c..0000000 --- a/Sources/Pokepay/BankAPI/User/CreateBankPay.swift +++ /dev/null @@ -1,39 +0,0 @@ -import APIKit - -public extension BankAPI.User { - struct CreateBankPay: BankRequest { - public let id: String - public let callbackUrl: String - public let privateMoneyId: String - public let kana: String? - public typealias Response = BankPayRedirectUrl - - public init(id: String, callbackUrl: String, privateMoneyId: String, kana: String? = nil) { - self.id = id - self.callbackUrl = callbackUrl - self.privateMoneyId = privateMoneyId - self.kana = kana - } - - public var method: HTTPMethod { - return .post - } - - public var path: String { - return "/users/\(id)/banks" - } - - public var parameters: Any? { - var dict: [String: Any] = [:] - - dict["callback_url"] = callbackUrl - dict["private_money_id"] = privateMoneyId - - if kana != nil { - dict["kana"] = kana - } - - return dict - } - } -} diff --git a/Sources/Pokepay/BankAPI/User/CreateCard.swift b/Sources/Pokepay/BankAPI/User/CreateCard.swift deleted file mode 100644 index c2ec21f..0000000 --- a/Sources/Pokepay/BankAPI/User/CreateCard.swift +++ /dev/null @@ -1,27 +0,0 @@ -import APIKit - -public extension BankAPI.User { - struct CreateCard: BankRequest { - public let id: String - public let token: String - public typealias Response = Card - - public init(id: String, token: String) { - self.id = id - self.token = token - } - - public var method: HTTPMethod { - return .post - } - - public var path: String { - return "/users/\(id)/cards" - } - - public var parameters: Any? { - let dict = ["token": token] - return dict - } - } -} diff --git a/Sources/Pokepay/BankAPI/User/DeleteBankPay.swift b/Sources/Pokepay/BankAPI/User/DeleteBankPay.swift deleted file mode 100644 index d572edd..0000000 --- a/Sources/Pokepay/BankAPI/User/DeleteBankPay.swift +++ /dev/null @@ -1,31 +0,0 @@ -import APIKit - -public extension BankAPI.User { - struct DeleteBankPay: BankRequest { - public let id: String - public let bankId: String - - public typealias Response = NoContent - - public init(id: String, bankId: String) { - self.id = id - self.bankId = bankId - } - - public var method: HTTPMethod { - return .delete - } - - public var path: String { - return "/users/\(id)/banks" - } - - public var bodyParameters: BodyParameters? { - var dict: [String: Any] = [:] - - dict["bank_id"] = bankId - - return JSONBodyParameters(JSONObject: dict) - } - } -} diff --git a/Sources/Pokepay/BankAPI/User/DeleteUserEmail.swift b/Sources/Pokepay/BankAPI/User/DeleteUserEmail.swift deleted file mode 100644 index 5a4e01b..0000000 --- a/Sources/Pokepay/BankAPI/User/DeleteUserEmail.swift +++ /dev/null @@ -1,23 +0,0 @@ -import APIKit - -public extension BankAPI.User { - struct DeleteEmail: BankRequest { - public let id: String - public let email: String - - public typealias Response = NoContent - - public init(id: String, email: String) { - self.id = id - self.email = email - } - - public var method: HTTPMethod { - return .delete - } - - public var path: String { - return "/users/\(id)/emails/\(email)" - } - } -} diff --git a/Sources/Pokepay/BankAPI/User/GetBankPay.swift b/Sources/Pokepay/BankAPI/User/GetBankPay.swift deleted file mode 100644 index 0b7d4d7..0000000 --- a/Sources/Pokepay/BankAPI/User/GetBankPay.swift +++ /dev/null @@ -1,33 +0,0 @@ -import APIKit - -public extension BankAPI.User { - struct GetBankPay: BankRequest { - public let id: String - public let privateMoneyId: String? - - public typealias Response = [BankPay] - - public init(id: String, privateMoneyId: String? = nil) { - self.id = id - self.privateMoneyId = privateMoneyId - } - - public var method: HTTPMethod { - return .get - } - - public var path: String { - return "/users/\(id)/banks" - } - - public var parameters: Any? { - var dict: [String: Any] = [:] - - if privateMoneyId != nil { - dict["private_money_id"] = privateMoneyId - } - - return dict - } - } -} diff --git a/Sources/Pokepay/BankAPI/User/GetUserAccounts.swift b/Sources/Pokepay/BankAPI/User/GetUserAccounts.swift deleted file mode 100644 index fb774d2..0000000 --- a/Sources/Pokepay/BankAPI/User/GetUserAccounts.swift +++ /dev/null @@ -1,41 +0,0 @@ -import APIKit - -public extension BankAPI.User { - struct GetAccounts: BankRequest { - public let id: String - public let before: String? - public let after: String? - public let perPage: Int32? - - public typealias Response = PaginatedAccounts - - public init(id: String, before: String? = nil, after: String? = nil, perPage: Int32? = nil) { - self.id = id - self.before = before - self.after = after - self.perPage = perPage - } - - public var method: HTTPMethod { - return .get - } - - public var path: String { - return "/users/\(id)/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/GetUserCards.swift b/Sources/Pokepay/BankAPI/User/GetUserCards.swift deleted file mode 100644 index 43f06f6..0000000 --- a/Sources/Pokepay/BankAPI/User/GetUserCards.swift +++ /dev/null @@ -1,41 +0,0 @@ -import APIKit - -public extension BankAPI.User { - struct GetUserCards: BankRequest { - public let id: String - public let before: String? - public let after: String? - public let perPage: Int32? - - public typealias Response = PaginatedCards - - public init(id: String, before: String? = nil, after: String? = nil, perPage: Int32? = nil) { - self.id = id - self.before = before - self.after = after - self.perPage = perPage - } - - public var method: HTTPMethod { - return .get - } - - public var path: String { - return "/users/\(id)/cards" - } - - 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 deleted file mode 100644 index 7a0aaf4..0000000 --- a/Sources/Pokepay/BankAPI/User/GetUserSettingUrl.swift +++ /dev/null @@ -1,22 +0,0 @@ - -import APIKit - -public extension BankAPI.User { - struct GetUserSettingUrl: BankRequest { - public let accessCode: String - - public typealias Response = UserSettingUrl - - public init(accessCode: String) { - self.accessCode = accessCode - } - - public var method: HTTPMethod { - return .post - } - - public var path: String { - return "/oauth/full-access" - } - } -} diff --git a/Sources/Pokepay/BankAPI/User/GetUserTransactions.swift b/Sources/Pokepay/BankAPI/User/GetUserTransactions.swift deleted file mode 100644 index a3c62c8..0000000 --- a/Sources/Pokepay/BankAPI/User/GetUserTransactions.swift +++ /dev/null @@ -1,41 +0,0 @@ -import APIKit - -public extension BankAPI.User { - struct GetTransactions: BankRequest { - public let id: String - public let before: String? - public let after: String? - public let perPage: Int32? - - public typealias Response = PaginatedTransactions - - public init(id: String, before: String? = nil, after: String? = nil, perPage: Int32? = nil) { - self.id = id - self.before = before - self.after = after - self.perPage = perPage - } - - public var method: HTTPMethod { - return .get - } - - public var path: String { - return "/users/\(id)/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 deleted file mode 100644 index 07db12f..0000000 --- a/Sources/Pokepay/BankAPI/User/GetUserWithAuthFactors.swift +++ /dev/null @@ -1,22 +0,0 @@ -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" - } - - } -} diff --git a/Sources/Pokepay/BankAPI/User/RegisterUserEmail.swift b/Sources/Pokepay/BankAPI/User/RegisterUserEmail.swift deleted file mode 100644 index ea2b3b8..0000000 --- a/Sources/Pokepay/BankAPI/User/RegisterUserEmail.swift +++ /dev/null @@ -1,21 +0,0 @@ -import APIKit - -public extension BankAPI.User { - struct RegisterEmail: BankRequest { - public let token: String - - public typealias Response = NoContent - - public init(token: String) { - self.token = token - } - - public var method: HTTPMethod { - return .post - } - - public var path: String { - return "/emails" - } - } -} diff --git a/Sources/Pokepay/BankAPI/User/SendConfirmationEmail.swift b/Sources/Pokepay/BankAPI/User/SendConfirmationEmail.swift deleted file mode 100644 index a117bee..0000000 --- a/Sources/Pokepay/BankAPI/User/SendConfirmationEmail.swift +++ /dev/null @@ -1,23 +0,0 @@ -import APIKit - -public extension BankAPI.User { - struct SendConfirmationEmail: BankRequest { - public let id: String - public let email: String - - public typealias Response = NoContent - - public init(id: String, email: String) { - self.id = id - self.email = email - } - - public var method: HTTPMethod { - return .put - } - - public var path: String { - return "/users/\(id)/emails/\(email)" - } - } -} diff --git a/Sources/Pokepay/BankAPI/User/UpdateUser.swift b/Sources/Pokepay/BankAPI/User/UpdateUser.swift deleted file mode 100644 index 55e4822..0000000 --- a/Sources/Pokepay/BankAPI/User/UpdateUser.swift +++ /dev/null @@ -1,31 +0,0 @@ -import APIKit - -public extension BankAPI.User { - struct Update: BankRequest { - public let id: String - public let name: String? - - public typealias Response = User - - public init(id: String, name: String? = nil) { - self.id = id - self.name = name - } - - public var method: HTTPMethod { - return .patch - } - - public var path: String { - return "/users/\(id)" - } - - public var parameters: Any? { - var dict: [String: Any] = [:] - if name != nil { - dict["name"] = name - } - return dict - } - } -} diff --git a/Sources/Pokepay/BankAPI/UserTag/GetUserTagGroupItems.swift b/Sources/Pokepay/BankAPI/UserTag/GetUserTagGroupItems.swift index 2647f99..357b422 100644 --- a/Sources/Pokepay/BankAPI/UserTag/GetUserTagGroupItems.swift +++ b/Sources/Pokepay/BankAPI/UserTag/GetUserTagGroupItems.swift @@ -5,15 +5,17 @@ public extension BankAPI.UserTag { struct GetUserTagGroupItems: BankRequest { public let organizationCode: String public let tagGroupId: String + public let subgroupId: String? public let before: String? public let after: String? public let perPage: Int? public typealias Response = PaginatedUserTagGroupItems - public init(organizationCode: String, tagGroupId: String, before: String? = nil, after: String? = nil, perPage: Int? = nil) { + public init(organizationCode: String, tagGroupId: String, subgroupId: String? = nil, before: String? = nil, after: String? = nil, perPage: Int? = nil) { self.organizationCode = organizationCode self.tagGroupId = tagGroupId + self.subgroupId = subgroupId self.before = before self.after = after self.perPage = perPage @@ -32,6 +34,10 @@ public extension BankAPI.UserTag { dict["tag_group_id"] = tagGroupId + if subgroupId != nil { + dict["subgroup_id"] = subgroupId + } + if before != nil { dict["before"] = before } diff --git a/Sources/Pokepay/BankAPI/Account/GetAccountCoupons.swift b/Sources/Pokepay/BankAPI/UserTag/GetUserTagSubgroups.swift similarity index 51% rename from Sources/Pokepay/BankAPI/Account/GetAccountCoupons.swift rename to Sources/Pokepay/BankAPI/UserTag/GetUserTagSubgroups.swift index 1d92fe4..b20a16c 100644 --- a/Sources/Pokepay/BankAPI/Account/GetAccountCoupons.swift +++ b/Sources/Pokepay/BankAPI/UserTag/GetUserTagSubgroups.swift @@ -1,18 +1,19 @@ +// 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 extension BankAPI.UserTag { + struct GetUserTagSubgroups: BankRequest { + public let organizationCode: String + public let tagGroupId: String public let before: String? public let after: String? - public let perPage: Int32? + public let perPage: Int? - public typealias Response = PaginatedCoupons + public typealias Response = PaginatedUserTagSubgroups - public init(accountId: String,isAvailable:Bool? = nil , before: String? = nil, after: String? = nil, perPage: Int32? = nil) { - self.accountId = accountId - self.isAvailable = isAvailable + public init(organizationCode: String, tagGroupId: String, before: String? = nil, after: String? = nil, perPage: Int? = nil) { + self.organizationCode = organizationCode + self.tagGroupId = tagGroupId self.before = before self.after = after self.perPage = perPage @@ -23,23 +24,26 @@ public extension BankAPI.Account { } public var path: String { - return "/accounts/\(accountId)/coupons" + return "/user-tag-groups/\(organizationCode)/subgroups" } public var parameters: Any? { var dict: [String: Any] = [:] - if isAvailable != nil { - dict["is_available"] = isAvailable - } + + dict["tag_group_id"] = tagGroupId + 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/Responses/AccessToken.swift b/Sources/Pokepay/Responses/AccessToken.swift deleted file mode 100644 index a4215f0..0000000 --- a/Sources/Pokepay/Responses/AccessToken.swift +++ /dev/null @@ -1,15 +0,0 @@ -import Foundation - -public struct AccessToken: Codable { - public let accessToken: String - public let refreshToken: String - public let tokenType: String - public let expiresIn: Int32 - - private enum CodingKeys: String, CodingKey { - case accessToken = "access_token" - case refreshToken = "refresh_token" - case tokenType = "token_type" - case expiresIn = "expires_in" - } -} diff --git a/Sources/Pokepay/Responses/Account.swift b/Sources/Pokepay/Responses/Account.swift deleted file mode 100644 index ba7915a..0000000 --- a/Sources/Pokepay/Responses/Account.swift +++ /dev/null @@ -1,25 +0,0 @@ -import Foundation - -public struct Account: Codable { - public let id: String - public let name: String - public let balance: Double - public let moneyBalance: Double - public let pointBalance: Double - public let isSuspended: Bool - public let privateMoney: PrivateMoney - public let nearestExpiresAt: Date? - public let pointDebt: Double - - private enum CodingKeys: String, CodingKey { - case id - case name - case balance - case moneyBalance = "money_balance" - case pointBalance = "point_balance" - case isSuspended = "is_suspended" - 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 deleted file mode 100644 index 7137cdc..0000000 --- a/Sources/Pokepay/Responses/AccountBalance.swift +++ /dev/null @@ -1,13 +0,0 @@ -import Foundation - -public struct AccountBalance: Codable { - public let expiresAt: Date - public let moneyAmount: Double - public let pointAmount: Double - - private enum CodingKeys: String, CodingKey { - case expiresAt = "expires_at" - case moneyAmount = "money_amount" - case pointAmount = "point_amount" - } -} diff --git a/Sources/Pokepay/Responses/AccountCampaignPointAmounts.swift b/Sources/Pokepay/Responses/AccountCampaignPointAmounts.swift deleted file mode 100644 index 38ca371..0000000 --- a/Sources/Pokepay/Responses/AccountCampaignPointAmounts.swift +++ /dev/null @@ -1,13 +0,0 @@ -import Foundation - -public struct AccountCampaignPointAmounts: Codable { - public let maxTotalPointAmount: Double? - public let totalPointAmount: Double? - public let remainPointAmount: Double? - - private enum CodingKeys: String, CodingKey { - case maxTotalPointAmount = "max_total_point_amount" - case totalPointAmount = "total_point_amount" - case remainPointAmount = "remain_point_amount" - } -} diff --git a/Sources/Pokepay/Responses/AccountCpmToken.swift b/Sources/Pokepay/Responses/AccountCpmToken.swift deleted file mode 100644 index 05e9996..0000000 --- a/Sources/Pokepay/Responses/AccountCpmToken.swift +++ /dev/null @@ -1,19 +0,0 @@ -import Foundation - -public struct AccountCpmToken: Codable { - public let cpmToken: String - public let account: Account - public let transaction: UserTransaction? - public let scopes: [String] - public let expiresAt: Date - public let metadata: [String:String]? - - private enum CodingKeys: String, CodingKey { - case cpmToken = "cpm_token" - case account - case transaction - case scopes - case expiresAt = "expires_at" - case metadata - } -} diff --git a/Sources/Pokepay/Responses/BankPay.swift b/Sources/Pokepay/Responses/BankPay.swift deleted file mode 100644 index 7187000..0000000 --- a/Sources/Pokepay/Responses/BankPay.swift +++ /dev/null @@ -1,25 +0,0 @@ -import Foundation - -public struct BankPay: Codable { - public let id: String - 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 - public let privateMoneyId: String? - - private enum CodingKeys: String, CodingKey { - case id - 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" - case privateMoneyId = "private_money_id" - } -} diff --git a/Sources/Pokepay/Responses/BankPayRedirectUrl.swift b/Sources/Pokepay/Responses/BankPayRedirectUrl.swift deleted file mode 100644 index 58aeb12..0000000 --- a/Sources/Pokepay/Responses/BankPayRedirectUrl.swift +++ /dev/null @@ -1,12 +0,0 @@ -import Foundation - -public struct BankPayRedirectUrl: Codable { - public let redirectUrl: String - public let paytreeCustomerNumber: String? - - private enum CodingKeys: String, CodingKey { - case redirectUrl - case paytreeCustomerNumber - } -} - diff --git a/Sources/Pokepay/Responses/Bill.swift b/Sources/Pokepay/Responses/Bill.swift deleted file mode 100644 index 52224cb..0000000 --- a/Sources/Pokepay/Responses/Bill.swift +++ /dev/null @@ -1,29 +0,0 @@ -import Foundation - -public struct Bill: Codable { - public let id: String - 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 token: String - public let minAmount: Double? - public let maxAmount: Double? - public let additionalPrivateMoneys: [PrivateMoney]? - - private enum CodingKeys: String, CodingKey { - case id - case amount - case description - case user - case privateMoney = "private_money" - case isOnetime = "is_onetime" - case isDisabled = "is_disabled" - case token - case minAmount = "min_amount" - case maxAmount = "max_amount" - case additionalPrivateMoneys = "additional_private_moneys" - } -} diff --git a/Sources/Pokepay/Responses/Card.swift b/Sources/Pokepay/Responses/Card.swift deleted file mode 100644 index dd80506..0000000 --- a/Sources/Pokepay/Responses/Card.swift +++ /dev/null @@ -1,11 +0,0 @@ -import Foundation - -public struct Card: Codable { - public let card_number: String - public let registeredAt: String - - private enum CodingKeys: String, CodingKey { - case card_number - case registeredAt = "registered_at" - } -} diff --git a/Sources/Pokepay/Responses/Cashtray.swift b/Sources/Pokepay/Responses/Cashtray.swift deleted file mode 100644 index 51fb95e..0000000 --- a/Sources/Pokepay/Responses/Cashtray.swift +++ /dev/null @@ -1,27 +0,0 @@ -import Foundation - -public struct Cashtray: Codable { - public let id: String - public let amount: Double - public let description: String - public let user: User - public let privateMoney: PrivateMoney - public let expiresAt: Date - public let canceledAt: Date? - 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 privateMoney = "private_money" - case expiresAt = "expires_at" - case canceledAt = "canceled_at" - case token - case attempt - case transaction - } -} diff --git a/Sources/Pokepay/Responses/CashtrayAttempt.swift b/Sources/Pokepay/Responses/CashtrayAttempt.swift deleted file mode 100644 index 1de6e3f..0000000 --- a/Sources/Pokepay/Responses/CashtrayAttempt.swift +++ /dev/null @@ -1,21 +0,0 @@ -import Foundation - -public struct CashtrayAttempt: Codable { - 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 strategy: String? - - private enum CodingKeys: String, CodingKey { - case user - case account - case statusCode = "status_code" - case errorType = "error_type" - case errorMessage = "error_message" - case createdAt = "created_at" - case strategy - } -} diff --git a/Sources/Pokepay/Responses/CashtrayAttempts.swift b/Sources/Pokepay/Responses/CashtrayAttempts.swift deleted file mode 100644 index bb1edc3..0000000 --- a/Sources/Pokepay/Responses/CashtrayAttempts.swift +++ /dev/null @@ -1,9 +0,0 @@ -import Foundation - -public struct CashtrayAttempts: Codable { - public let rows: [CashtrayAttempt] - - private enum CodingKeys: String, CodingKey { - case rows - } -} diff --git a/Sources/Pokepay/Responses/Check.swift b/Sources/Pokepay/Responses/Check.swift deleted file mode 100644 index 3a14839..0000000 --- a/Sources/Pokepay/Responses/Check.swift +++ /dev/null @@ -1,33 +0,0 @@ -import Foundation - -public struct Check: Codable { - public let id: String - public let amount: Double - public let moneyAmount: Double - 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 token: String - public let pointExpiresAt: Date? - public let pointExpiresInDays: Int32? - - private enum CodingKeys: String, CodingKey { - case id - case amount - case moneyAmount = "money_amount" - case pointAmount = "point_amount" - case description - case user - case privateMoney = "private_money" - 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" - } -} diff --git a/Sources/Pokepay/Responses/Coupon.swift b/Sources/Pokepay/Responses/Coupon.swift deleted file mode 100644 index 3c07fb3..0000000 --- a/Sources/Pokepay/Responses/Coupon.swift +++ /dev/null @@ -1,37 +0,0 @@ -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? - - private enum CodingKeys: String, CodingKey { - case id - case name - case 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 usageLimit = "usage_limit" - case minAmount = "min_amount" - case isShopSpecified = "is_shop_specified" - case isDisabled = "is_disabled" - case isHidden = "is_hidden" - case couponImage = "coupon_image" - } -} diff --git a/Sources/Pokepay/Responses/CouponDetail.swift b/Sources/Pokepay/Responses/CouponDetail.swift deleted file mode 100644 index 02bcf7b..0000000 --- a/Sources/Pokepay/Responses/CouponDetail.swift +++ /dev/null @@ -1,43 +0,0 @@ -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 - 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 usageLimit = "usage_limit" - case minAmount = "min_amount" - case isShopSpecified = "is_shop_specified" - case isDisabled = "is_disabled" - case isHidden = "is_hidden" - case couponImage = "coupon_image" - case receivedAt = "received_at" - case usageCount = "usage_count" - case availableShops = "available_shops" - } -} diff --git a/Sources/Pokepay/Responses/CvsAuthorization.swift b/Sources/Pokepay/Responses/CvsAuthorization.swift index 8f31bcc..5c19922 100644 --- a/Sources/Pokepay/Responses/CvsAuthorization.swift +++ b/Sources/Pokepay/Responses/CvsAuthorization.swift @@ -10,6 +10,10 @@ public struct CvsAuthorization: Codable { public let tel: String public let payLimit: String public let account: Account + public let haraikomiUrl: String + public let receiptNo: String + public let doneAt: String? + public let canceledAt: String? private enum CodingKeys: String, CodingKey { case id = "id" @@ -20,5 +24,9 @@ public struct CvsAuthorization: Codable { case tel = "tel" case payLimit = "pay_limit" case account = "account" + case haraikomiUrl = "haraikomi_url" + case receiptNo = "receipt_no" + case doneAt = "done_at" + case canceledAt = "canceled_at" } } diff --git a/Sources/Pokepay/Responses/DetailedShopInformation.swift b/Sources/Pokepay/Responses/DetailedShopInformation.swift index 0ebd9e9..827a6b2 100644 --- a/Sources/Pokepay/Responses/DetailedShopInformation.swift +++ b/Sources/Pokepay/Responses/DetailedShopInformation.swift @@ -8,6 +8,7 @@ public struct DetailedShopInformation: Codable { public let businessHours: String public let regularClosedDays: String public let url: String? + public let description: String public let logoImageUrl: String? public let imageUrls: [String] public let address: String? @@ -20,6 +21,7 @@ public struct DetailedShopInformation: Codable { case businessHours = "business_hours" case regularClosedDays = "regular_closed_days" case url = "url" + case description = "description" case logoImageUrl = "logo_image_url" case imageUrls = "image_urls" case address = "address" diff --git a/Sources/Pokepay/Responses/Error.swift b/Sources/Pokepay/Responses/Error.swift deleted file mode 100644 index 83c302d..0000000 --- a/Sources/Pokepay/Responses/Error.swift +++ /dev/null @@ -1,40 +0,0 @@ -import Foundation - -public struct APIError: Codable { - public let type: String - public let message: String - public let errors: DynamicErrors? -} - -public enum DynamicErrors: Codable { - case empty - case string(String) - case invalid([String]) - - public init(from decoder: Decoder) throws { - let container = try decoder.singleValueContainer() - - if let stringResult = try? container.decode(String.self) { - self = .string(stringResult) - } else if let invalidErrs = try? container.decode(InvalidParametersError.self) { - self = .invalid(invalidErrs.invalid) - } else { - self = .empty - } - } - -} - -public struct InvalidParametersError: Codable { - public let invalid: [String] -} - -public struct OAuthError: Codable { - public let error: String -} - -public struct VeritransError: Codable { - public let status: String - public let code: String - public let message: String -} diff --git a/Sources/Pokepay/Responses/ExchangedToken.swift b/Sources/Pokepay/Responses/ExchangedToken.swift deleted file mode 100644 index 63ecb7b..0000000 --- a/Sources/Pokepay/Responses/ExchangedToken.swift +++ /dev/null @@ -1,23 +0,0 @@ -import Foundation - -public struct ExchangedToken: Codable { - public let accessToken: String - public let issuedTokenType: String - public let tokenType: String - public let expiresIn: Int32? - public let scope: String? - public let refreshToken: String? - - public func scopes() -> [String] { - return scope?.split(separator: " ").map(String.init) ?? [] - } - - private enum CodingKeys: String, CodingKey { - case accessToken = "access_token" - case issuedTokenType = "issued_token_type" - case tokenType = "token_type" - case expiresIn = "expires_in" - case scope - case refreshToken = "refresh_token" - } -} diff --git a/Sources/Pokepay/Responses/IdentificationMatch.swift b/Sources/Pokepay/Responses/IdentificationMatch.swift deleted file mode 100644 index 3cdb12d..0000000 --- a/Sources/Pokepay/Responses/IdentificationMatch.swift +++ /dev/null @@ -1,15 +0,0 @@ -import Foundation - -public struct IdentificationMatch: Codable { - public let name: Bool - public let gender: Bool - public let address: Bool - public let dateOfBirth: Bool - - private enum CodingKeys: String, CodingKey { - case name - case gender - case 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 deleted file mode 100644 index 290310b..0000000 --- a/Sources/Pokepay/Responses/IdentificationResult.swift +++ /dev/null @@ -1,13 +0,0 @@ -import Foundation - -public struct IdentificationResult: Codable { - public let isValid: Bool - public let identifiedAt: String? - public let match: IdentificationMatch - - private enum CodingKeys: String, CodingKey { - case isValid = "is_valid" - case identifiedAt = "identified_at" - case match - } -} \ No newline at end of file diff --git a/Sources/Pokepay/Responses/Images.swift b/Sources/Pokepay/Responses/Images.swift deleted file mode 100644 index bd64dce..0000000 --- a/Sources/Pokepay/Responses/Images.swift +++ /dev/null @@ -1,13 +0,0 @@ -import Foundation - -public struct Images: Codable { - public let card: String? - public let res300: String? - public let res600: String? - - private enum CodingKeys: String, CodingKey { - case card - case res300 = "300x300" - case res600 = "600x600" - } -} diff --git a/Sources/Pokepay/Responses/JwtResult.swift b/Sources/Pokepay/Responses/JwtResult.swift deleted file mode 100644 index bbc89df..0000000 --- a/Sources/Pokepay/Responses/JwtResult.swift +++ /dev/null @@ -1,55 +0,0 @@ -import Foundation - -func base64urlToBase64(base64url: String) -> String { - var base64 = base64url - .replacingOccurrences(of: "-", with: "+") - .replacingOccurrences(of: "_", with: "/") - if base64.count % 4 != 0 { - base64.append(String(repeating: "=", count: 4 - base64.count % 4)) - } - return base64 -} - -public enum JwtResultError : Error { - case invalidConvertionError(String) -} - -public struct JwtResult: Codable { - public let data: String? - public let error: String? - - private enum CodingKeys: String, CodingKey { - case data - case error - } - - private func getJWTBodyData(jwtToken: String) throws -> Data { - let parts = jwtToken.components(separatedBy: ".") - if parts.count > 1 { - let payloadPart = parts[1] - let payloadPartBase64 = base64urlToBase64(base64url: payloadPart) - if let data = Data(base64Encoded: payloadPartBase64) { - return data - } - } - throw JwtResultError.invalidConvertionError("invalid jwt token") - } - - public func parseAsUserTransaction() throws -> UserTransaction { - if data != nil { - let data = try getJWTBodyData(jwtToken: self.data!) - let ut: UserTransaction = try BankAPIJSONDecoder().decode(UserTransaction.self, from: data) - return ut - } - throw JwtResultError.invalidConvertionError("data is not set") - } - - public func parseAsAPIError() throws -> APIError { - if error != nil { - let error = try getJWTBodyData(jwtToken: self.error!) - let ae: APIError = try BankAPIJSONDecoder().decode(APIError.self, from: error) - return ae - } - throw JwtResultError.invalidConvertionError("error is not set") - } -} diff --git a/Sources/Pokepay/Responses/Message.swift b/Sources/Pokepay/Responses/Message.swift deleted file mode 100644 index 3e39b50..0000000 --- a/Sources/Pokepay/Responses/Message.swift +++ /dev/null @@ -1,27 +0,0 @@ -import Foundation - -public struct Message: Codable { - public let id: String - public let subject: String - public let body: String - public let fromUser: User - public let toUser: User - public let sendBy: User - public let sendTo: User - public let sentAt: Date - public let isUnread: Bool - public let attachment: MessageAttachment - - private enum CodingKeys: String, CodingKey { - case id - case subject - case body - case fromUser = "from_user" - case toUser = "to_user" - case sendBy = "send_by" - case sendTo = "send_to" - case sentAt = "sent_at" - case isUnread = "is_unread" - case attachment - } -} diff --git a/Sources/Pokepay/Responses/MessageAttachment.swift b/Sources/Pokepay/Responses/MessageAttachment.swift deleted file mode 100644 index 9598965..0000000 --- a/Sources/Pokepay/Responses/MessageAttachment.swift +++ /dev/null @@ -1,17 +0,0 @@ -import Foundation - -public struct MessageAttachment: Codable { - public let moneyAmount: Double? - public let pointAmount: Double? - public let privateMoney: PrivateMoney? - public let isReceived: Bool - public let expiresAt: Date? - - private enum CodingKeys: String, CodingKey { - case moneyAmount = "money_amount" - case pointAmount = "point_amount" - case privateMoney = "private_money" - case isReceived = "is_received" - case expiresAt = "expires_at" - } -} diff --git a/Sources/Pokepay/Responses/MessageUnreadCount.swift b/Sources/Pokepay/Responses/MessageUnreadCount.swift deleted file mode 100644 index 8529779..0000000 --- a/Sources/Pokepay/Responses/MessageUnreadCount.swift +++ /dev/null @@ -1,9 +0,0 @@ -import Foundation - -public struct MessageUnreadCount: Codable { - public let count: Int32 - - private enum CodingKeys: String, CodingKey { - case count - } -} diff --git a/Sources/Pokepay/Responses/NoContent.swift b/Sources/Pokepay/Responses/NoContent.swift deleted file mode 100644 index bb86b3c..0000000 --- a/Sources/Pokepay/Responses/NoContent.swift +++ /dev/null @@ -1,4 +0,0 @@ -import Foundation - -public struct NoContent: Codable { -} diff --git a/Sources/Pokepay/Responses/Organization.swift b/Sources/Pokepay/Responses/Organization.swift deleted file mode 100644 index 1158dc7..0000000 --- a/Sources/Pokepay/Responses/Organization.swift +++ /dev/null @@ -1,6 +0,0 @@ -import Foundation - -public struct Organization: Codable { - public let code: String - public let name: String -} diff --git a/Sources/Pokepay/Responses/PaginatedAccountBalances.swift b/Sources/Pokepay/Responses/PaginatedAccountBalances.swift deleted file mode 100644 index a3443a2..0000000 --- a/Sources/Pokepay/Responses/PaginatedAccountBalances.swift +++ /dev/null @@ -1,17 +0,0 @@ -import Foundation - -public struct PaginatedAccountBalances: Codable { - public let perPage: Int32 - public let count: Int32 - 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 - } -} diff --git a/Sources/Pokepay/Responses/PaginatedAccounts.swift b/Sources/Pokepay/Responses/PaginatedAccounts.swift deleted file mode 100644 index 3152c14..0000000 --- a/Sources/Pokepay/Responses/PaginatedAccounts.swift +++ /dev/null @@ -1,17 +0,0 @@ -import Foundation - -public struct PaginatedAccounts: Codable { - public let perPage: Int32 - public let count: Int32 - public let next: String? - public let prev: String? - public let items: [Account] - - private enum CodingKeys: String, CodingKey { - case perPage = "per_page" - case count - case next - case prev - case items - } -} diff --git a/Sources/Pokepay/Responses/PaginatedCards.swift b/Sources/Pokepay/Responses/PaginatedCards.swift deleted file mode 100644 index 40ab0b2..0000000 --- a/Sources/Pokepay/Responses/PaginatedCards.swift +++ /dev/null @@ -1,17 +0,0 @@ -import Foundation - -public struct PaginatedCards: Codable { - public let perPage: Int32 - public let count: Int32 - public let next: String? - public let prev: String? - public let items: [Card] - - private enum CodingKeys: String, CodingKey { - case perPage = "per_page" - case count - case next - case prev - case items - } -} diff --git a/Sources/Pokepay/Responses/PaginatedCoupons.swift b/Sources/Pokepay/Responses/PaginatedCoupons.swift deleted file mode 100644 index e03f4bd..0000000 --- a/Sources/Pokepay/Responses/PaginatedCoupons.swift +++ /dev/null @@ -1,17 +0,0 @@ -import Foundation - -public struct PaginatedCoupons: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 - case next - case prev - case items - } -} diff --git a/Sources/Pokepay/Responses/PaginatedMessages.swift b/Sources/Pokepay/Responses/PaginatedMessages.swift deleted file mode 100644 index 84fe388..0000000 --- a/Sources/Pokepay/Responses/PaginatedMessages.swift +++ /dev/null @@ -1,17 +0,0 @@ -import Foundation - -public struct PaginatedMessages: Codable { - public let perPage: Int32 - public let count: Int32 - public let next: String? - public let prev: String? - public let items: [Message] - - private enum CodingKeys: String, CodingKey { - case perPage = "per_page" - case count - case next - case prev - case items - } -} diff --git a/Sources/Pokepay/Responses/PaginatedPrivateMoneys.swift b/Sources/Pokepay/Responses/PaginatedPrivateMoneys.swift deleted file mode 100644 index e375cb9..0000000 --- a/Sources/Pokepay/Responses/PaginatedPrivateMoneys.swift +++ /dev/null @@ -1,17 +0,0 @@ -import Foundation - -public struct PaginatedPrivateMoneys: Codable { - public let perPage: Int32 - public let count: Int32 - 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 - } -} diff --git a/Sources/Pokepay/Responses/PaginatedTransactions.swift b/Sources/Pokepay/Responses/PaginatedTransactions.swift deleted file mode 100644 index 9ef0bbb..0000000 --- a/Sources/Pokepay/Responses/PaginatedTransactions.swift +++ /dev/null @@ -1,17 +0,0 @@ -import Foundation - -public struct PaginatedTransactions: Codable { - public let perPage: Int32 - public let count: Int32 - public let next: String? - public let prev: String? - public let items: [UserTransaction] - - private enum CodingKeys: String, CodingKey { - case perPage = "per_page" - case count - case next - case prev - case items - } -} diff --git a/Sources/Pokepay/Responses/PaginatedTransfers.swift b/Sources/Pokepay/Responses/PaginatedTransfers.swift deleted file mode 100644 index e075997..0000000 --- a/Sources/Pokepay/Responses/PaginatedTransfers.swift +++ /dev/null @@ -1,17 +0,0 @@ -import Foundation - -public struct PaginatedTransfers: Codable { - public let perPage: Int32 - public let count: Int32 - public let next: String? - public let prev: String? - public let items: [Transfer] - - private enum CodingKeys: String, CodingKey { - case perPage = "per_page" - case count - case next - case prev - case items - } -} diff --git a/Sources/Pokepay/Responses/PaginatedUserTagSubgroups.swift b/Sources/Pokepay/Responses/PaginatedUserTagSubgroups.swift new file mode 100644 index 0000000..353b7aa --- /dev/null +++ b/Sources/Pokepay/Responses/PaginatedUserTagSubgroups.swift @@ -0,0 +1,18 @@ +// DO NOT EDIT: File is generated by code generator. +import Foundation + +public struct PaginatedUserTagSubgroups: Codable { + public let perPage: Int + public let count: Int + public let next: String? + public let prev: String? + public let items: [UserTagSubgroup] + + 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 deleted file mode 100644 index 5a8914d..0000000 --- a/Sources/Pokepay/Responses/PrivateMoney.swift +++ /dev/null @@ -1,49 +0,0 @@ -import Foundation - -public struct PrivateMoney: 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 accountImage: String? - public let images: Images - public let organization: Organization - public let maxBalance: Double - public let transferLimit: 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]? - - private enum CodingKeys: String, CodingKey { - case id - case name - case type - case unit - case description - case onelineMessage = "oneline_message" - case accountImage = "account_image" - case images - case organization - case maxBalance = "max_balance" - case transferLimit = "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 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/ServerKey.swift b/Sources/Pokepay/Responses/ServerKey.swift deleted file mode 100644 index ca19ae3..0000000 --- a/Sources/Pokepay/Responses/ServerKey.swift +++ /dev/null @@ -1,9 +0,0 @@ -import Foundation - -public struct ServerKey: Codable{ - public let key:String - - private enum CodingKeys: String, CodingKey{ - case key = "server_key" - } -} diff --git a/Sources/Pokepay/Responses/SevenElevenAtmSession.swift b/Sources/Pokepay/Responses/SevenElevenAtmSession.swift deleted file mode 100644 index 7105b1c..0000000 --- a/Sources/Pokepay/Responses/SevenElevenAtmSession.swift +++ /dev/null @@ -1,13 +0,0 @@ -public struct SevenElevenAtmSession: Codable { - public let qrInfo: String - public let amount: Double - public let account: Account - public let transaction: UserTransaction? - - private enum CodingKeys: String, CodingKey { - case qrInfo = "qr_info" - case amount - case account - case transaction - } -} diff --git a/Sources/Pokepay/Responses/Terminal.swift b/Sources/Pokepay/Responses/Terminal.swift deleted file mode 100644 index 05d7445..0000000 --- a/Sources/Pokepay/Responses/Terminal.swift +++ /dev/null @@ -1,21 +0,0 @@ -import Foundation - -public struct Terminal: Codable { - public let id: String - public let name: String - public let hardwareId: String - public let pushService: String? - public let pushToken: String? - public let user: User - public let account: Account - - private enum CodingKeys: String, CodingKey { - case id - case name - case hardwareId = "hardware_id" - case pushService = "push_service" - case pushToken = "push_token" - case user - case account - } -} diff --git a/Sources/Pokepay/Responses/TokenInfo.swift b/Sources/Pokepay/Responses/TokenInfo.swift deleted file mode 100644 index bc7f058..0000000 --- a/Sources/Pokepay/Responses/TokenInfo.swift +++ /dev/null @@ -1,7 +0,0 @@ -public enum TokenInfo { - case cashtray (String) - case bill (BankAPI.Bill.Get.Response) - case check (BankAPI.Check.Get.Response) - case cpm (BankAPI.CpmToken.Get.Response) - case pokeregi (String) -} diff --git a/Sources/Pokepay/Responses/TopupMethod.swift b/Sources/Pokepay/Responses/TopupMethod.swift deleted file mode 100644 index 7437fa2..0000000 --- a/Sources/Pokepay/Responses/TopupMethod.swift +++ /dev/null @@ -1,9 +0,0 @@ -import Foundation - -public struct TopupMethod: Codable { - // "type" can be "credit-card", "sevenbank-atm", "paytree-bank", or "cvs" - public let type: String - public let name: String - public let amounts: [Double]? - public let range: [Double]? -} diff --git a/Sources/Pokepay/Responses/Transfer.swift b/Sources/Pokepay/Responses/Transfer.swift deleted file mode 100644 index 151f965..0000000 --- a/Sources/Pokepay/Responses/Transfer.swift +++ /dev/null @@ -1,29 +0,0 @@ -import Foundation - -public struct Transfer: Codable { - public let id: String - public let type: String - public let amount: Double? - public let balance: Double? - public let description: String - public let user: User? - public let account: Account? - public let doneAt: Date - public let moneyAmount: Double - public let pointAmount: Double - public let transactionId: String? - - private enum CodingKeys: String, CodingKey { - case id - case type - case amount - case balance - case description - case user - case account - case doneAt = "done_at" - case moneyAmount = "money_amount" - case pointAmount = "point_amount" - case transactionId = "transaction_id" - } -} diff --git a/Sources/Pokepay/Responses/User.swift b/Sources/Pokepay/Responses/User.swift deleted file mode 100644 index d8b6c01..0000000 --- a/Sources/Pokepay/Responses/User.swift +++ /dev/null @@ -1,13 +0,0 @@ -import Foundation - -public struct User: Codable { - public let id: String - public let name: String - public let isMerchant: Bool - - private enum CodingKeys: String, CodingKey { - case id - case name - case isMerchant = "is_merchant" - } -} diff --git a/Sources/Pokepay/Responses/UserSettingUrl.swift b/Sources/Pokepay/Responses/UserSettingUrl.swift deleted file mode 100644 index c2c6aed..0000000 --- a/Sources/Pokepay/Responses/UserSettingUrl.swift +++ /dev/null @@ -1,6 +0,0 @@ -import Foundation - -public struct UserSettingUrl: Codable { - public let url: String -} - diff --git a/Sources/Pokepay/Responses/UserTagGroup.swift b/Sources/Pokepay/Responses/UserTagGroup.swift index b293bbf..7938255 100644 --- a/Sources/Pokepay/Responses/UserTagGroup.swift +++ b/Sources/Pokepay/Responses/UserTagGroup.swift @@ -4,9 +4,11 @@ import Foundation public struct UserTagGroup: Codable { public let groupName: String public let id: String + public let hasSubgroups: Bool private enum CodingKeys: String, CodingKey { case groupName = "group_name" case id = "id" + case hasSubgroups = "has_subgroups" } } diff --git a/Sources/Pokepay/Responses/UserTagGroupItem.swift b/Sources/Pokepay/Responses/UserTagGroupItem.swift index 4635f12..7223ad7 100644 --- a/Sources/Pokepay/Responses/UserTagGroupItem.swift +++ b/Sources/Pokepay/Responses/UserTagGroupItem.swift @@ -4,9 +4,11 @@ import Foundation public struct UserTagGroupItem: Codable { public let itemName: String public let id: String + public let subgroupId: String? private enum CodingKeys: String, CodingKey { case itemName = "item_name" case id = "id" + case subgroupId = "subgroup_id" } } diff --git a/Sources/Pokepay/Responses/UserTagSubgroup.swift b/Sources/Pokepay/Responses/UserTagSubgroup.swift new file mode 100644 index 0000000..4cc37f5 --- /dev/null +++ b/Sources/Pokepay/Responses/UserTagSubgroup.swift @@ -0,0 +1,12 @@ +// DO NOT EDIT: File is generated by code generator. +import Foundation + +public struct UserTagSubgroup: Codable { + public let subgroupName: String + public let id: String + + private enum CodingKeys: String, CodingKey { + case subgroupName = "subgroup_name" + case id = "id" + } +} diff --git a/Sources/Pokepay/Responses/UserTransaction.swift b/Sources/Pokepay/Responses/UserTransaction.swift deleted file mode 100644 index 0abdffb..0000000 --- a/Sources/Pokepay/Responses/UserTransaction.swift +++ /dev/null @@ -1,33 +0,0 @@ -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 account: Account - public let description: String - public let doneAt: Date - public let transfers: [Transfer]? - - private enum CodingKeys: String, CodingKey { - case id - case type - case isModified = "is_modified" - case user - case balance - case customerBalance = "customer_balance" - case amount - case moneyAmount = "money_amount" - case pointAmount = "point_amount" - case account - case description - case doneAt = "done_at" - case transfers - } -} diff --git a/Sources/Pokepay/Responses/UserTransactionWithFallback.swift b/Sources/Pokepay/Responses/UserTransactionWithFallback.swift new file mode 100644 index 0000000..9f65aed --- /dev/null +++ b/Sources/Pokepay/Responses/UserTransactionWithFallback.swift @@ -0,0 +1,38 @@ +// DO NOT EDIT: File is generated by code generator. +import Foundation + +public struct UserTransactionWithFallback: Codable { + public let id: String + public let user: User + public let balance: Int + public let amount: Int + public let moneyAmount: Int + public let pointAmount: Int + public let rawPointAmount: Int? + public let campaignPointAmount: Int? + 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: [UserTransactionWithTransfers]? + + private enum CodingKeys: String, CodingKey { + case id = "id" + case user = "user" + case balance = "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/UserWithAuthFactors.swift b/Sources/Pokepay/Responses/UserWithAuthFactors.swift deleted file mode 100644 index 5f3399a..0000000 --- a/Sources/Pokepay/Responses/UserWithAuthFactors.swift +++ /dev/null @@ -1,19 +0,0 @@ -import Foundation - -public struct UserWithAuthFactors: Codable { - public let id: String - public let name: String - public let isMerchant: Bool - public let tel: String? - public let email: String? - public let isPasswordRegistered: Bool - - private enum CodingKeys: String, CodingKey { - case id - case name - case isMerchant = "is_merchant" - case tel - case email - case isPasswordRegistered = "is_password_registered" - } -} diff --git a/Sources/Pokepay/Responses/VeritransToken.swift b/Sources/Pokepay/Responses/VeritransToken.swift deleted file mode 100644 index b96d16a..0000000 --- a/Sources/Pokepay/Responses/VeritransToken.swift +++ /dev/null @@ -1,9 +0,0 @@ -import Foundation - -public struct VeritransToken: Codable { - public let token: String - - private enum CodingKeys: String, CodingKey { - case token = "token" - } -}