Skip to content

Instantly share code, notes, and snippets.

@chessai
Created January 25, 2021 19:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chessai/62783c9857a1dcd0f7b42488ca0f436a to your computer and use it in GitHub Desktop.
Save chessai/62783c9857a1dcd0f7b42488ca0f436a to your computer and use it in GitHub Desktop.
//swiftlint:disable line_length type_name
//
// DO NOT EDIT THIS FILE
// IT HAS BEEN AUTOMATICALLY GENERATED
// BY THE FOLLOWING CODE: https://github.com/MercuryTechnologies/mercury-web-backend
// AT TIME: 2021-01-25T19:56:58 UTC
//
import Foundation
enum AccountCapability: String, CaseIterable, Equatable, Hashable, Codable {
case withdrawFrom
case depositTo
case sendMoneyFrom
case transactWithNonMercuryAccount
case depositChecksTo
case transactWithTreasuryAccount
case _unknown
}
typealias AccountId = String
struct AccountLowBalanceConfigurationUpdate: Equatable, Hashable, Codable {
let accountId: MercuryDepositoryAccount.MercuryDepositoryAccountKey
let lowBalanceThresholdCents: Cents?
}
struct AccountLowBalanceSubscriptionAndThreshold: Equatable, Hashable, Codable {
let accountId: MercuryDepositoryAccount.MercuryDepositoryAccountKey
let subscribed: Bool
let thresholdCents: Cents
}
struct AccountLowBalanceSubscriptionUpdate: Equatable, Hashable, Codable {
let accountId: MercuryDepositoryAccount.MercuryDepositoryAccountKey
let subscribed: Bool
}
typealias AccountNumber = String
enum AccountStatus: String, CaseIterable, Equatable, Hashable, Codable {
case active
case deleted
case pending
case archived
case _unknown
}
enum AccountType: String, CaseIterable, Equatable, Hashable, Codable {
case credit
case depository
case _unknown
}
struct Address: Equatable, Hashable, Codable {
let name: String
let address1: NonEmptyText299
let address2: NonEmptyText299?
let city: NonEmptyText299
let region: Region
let postalCode: NonEmptyText299
let country: ISO3166Alpha2
typealias AddressKey = Tagged<Address, UUID>
}
struct AddPushNotificationsTokenParams: Equatable, Hashable, Codable {
let pushToken: PushNotificationsToken
let pushTokenKind: PushNotificationsTokenKind
}
typealias Callsign = String
enum CardNetwork: String, CaseIterable, Equatable, Hashable, Codable {
case visa
case masterCard
case _unknown
}
enum CardProcessor: String, CaseIterable, Equatable, Hashable, Codable {
case jackHenry
case arrowEye
case bBVAProcessor
case _unknown
}
enum CardRealm: String, CaseIterable, Equatable, Hashable, Codable {
case physical
case virtual
case _unknown
}
enum CardType: String, CaseIterable, Equatable, Hashable, Codable {
case debit
case credit
case _unknown
}
typealias Cents = Int
struct CheckDepositData: Equatable, Hashable, Codable {
let frontImage: CheckDepositImage
let backImage: CheckDepositImage
}
struct CheckDepositImage: Equatable, Hashable, Codable {
let url: String
}
typealias Country = String
typealias DailyAtmWithdrawalLimit = Int
typealias DailyTransactionLimit = Int
struct DailyTreasuryValuation: Equatable, Hashable, Codable {
let day: Day
let cents: Cents
}
struct DebitCard: Equatable, Hashable, Codable {
let nickname: String?
typealias DebitCardKey = Tagged<DebitCard, UUID>
}
struct DebitCardRevealResponse: Equatable, Hashable, Codable {
let cardNumber: String?
let exp: String?
let cvc: String?
}
enum DebitCardStatus: String, CaseIterable, Equatable, Hashable, Codable {
case active
case frozen
case cancelled
case inactive
case locked
case deleted
case _unknown
}
enum DepositoryAccountRoutingInfo {
case automaticRouting(DepositoryAccountRoutingInfoAutomatic)
case manualRouting(DepositoryAccountRoutingInfoManual)
}
struct DepositoryAccountRoutingInfoAutomatic: Equatable, Hashable, Codable {
let accountNumber: AccountNumber
let routingNumber: RoutingNumber
let inputMethod: RoutingInfoInputMethodAutomatic
}
struct DepositoryAccountRoutingInfoManual: Equatable, Hashable, Codable {
let accountNumber: AccountNumber?
let routingNumber: RoutingNumber?
let inputMethod: RoutingInfoInputMethodManual
let accountNumberLastFour: String
}
typealias Email = String
struct EmailSubscriptions: Equatable, Hashable, Codable {
let transactionFailed: Bool
let transactionIncoming: Bool
let transactionOutgoing: Bool
let transactionMicrodeposit: Bool
let transactionStaleCheck: Bool
let accountsLowBalance: [AccountLowBalanceSubscriptionAndThreshold]
let activityAll: Bool
let statementReady: Bool
let paymentRequest: Bool
let marketingFeature: Bool
let marketingEvent: Bool
let marketingAll: Bool
}
struct EmailSubscriptionsUpdate: Equatable, Hashable, Codable {
let transactionFailed: Bool?
let transactionIncoming: Bool?
let transactionOutgoing: Bool?
let accountsLowBalance: [AccountLowBalanceSubscriptionUpdate]?
let transactionMicrodeposit: Bool?
let transactionStaleCheck: Bool?
let activityAll: Bool?
let statementReady: Bool?
let paymentRequest: Bool?
let marketingFeature: Bool?
let marketingEvent: Bool?
let marketingAll: Bool?
}
struct GetTeamAndInvitesResponse: Equatable, Hashable, Codable {
let teamMembers: [TeamMember]
}
struct GetTreasuryAccountOverviewResponse: Equatable, Hashable, Codable {
let treasuryAccount: MercuryTreasuryAccountData
let dashboardData: TreasuryAccountDashboardData
}
typealias Iban = String
struct Idempotency: Equatable, Hashable, Codable {
typealias IdempotencyKey = Tagged<Idempotency, String>
}
typealias IntercomHMAC = String
typealias InternationalPhoneNumber = String
typealias ISO3166Alpha2 = Country
struct MaxDebitCardLimits: Equatable, Hashable, Codable {
let maxDailyAtmWithdrawalLimit: DailyAtmWithdrawalLimit
let maxDailyTransactionLimit: DailyTransactionLimit
}
struct MercuryAccount: Equatable, Hashable, Codable {
let organizationId: Organization.OrganizationKey
let transactionPartyId: TransactionParty.TransactionPartyKey
let availableBalance: Dollar
let currentBalance: Dollar
let kind: MercuryAccountKind
let createdAt: Date
typealias MercuryAccountKey = Tagged<MercuryAccount, UUID>
}
enum MercuryAccountKind: String, CaseIterable, Equatable, Hashable, Codable {
case checkingAccountKind
case savingsAccountKind
case treasuryAccountKind
case _unknown
}
struct MercuryDepositoryAccount: Equatable, Hashable, Codable {
let mercuryAccountId: MercuryAccount.MercuryAccountKey
let partnerBank: PartnerBank
typealias MercuryDepositoryAccountKey = Tagged<MercuryDepositoryAccount, MercuryAccount.MercuryAccountKey>
}
struct MercuryDepositoryAccountData: Equatable, Hashable, Codable {
let id: MercuryDepositoryAccount.MercuryDepositoryAccountKey
let transactionPartyId: TransactionParty.TransactionPartyKey
let name: NonEmptyText299
let nickname: String?
let routingInfo: DepositoryAccountRoutingInfoAutomatic
let availableBalance: Dollar
let currentBalance: Dollar
let hasPendingTransactions: Bool
let paymentCards: [PaymentCardData]
let dayOfEarliestTransaction: Day?
let partnerBank: PartnerBank
let kindData: MercuryDepositoryAccountKindData
let capabilities: [AccountCapability]
let createdAt: Date
let accountStatus: AccountStatus
}
struct MercuryDepositoryAccountKindData: Equatable, Hashable, Codable {
let kind: MercuryAccountKind
let interestBasisPoints: Double?
let maxDebitCardLimits: MaxDebitCardLimits?
}
struct MercuryTreasuryAccountData: Equatable, Hashable, Codable {
let transactionPartyId: TransactionParty.TransactionPartyKey
let name: String
let nickname: String?
let currentValueCents: Cents
let capabilities: [AccountCapability]
let createdAt: Date
}
struct MoneyFlow: Equatable, Hashable, Codable {
let total: Dollar
}
typealias NonEmptyText299 = String
struct NotificationPreferences: Equatable, Hashable, Codable {
let subscriptions: EmailSubscriptions
let config: TransactionConfiguration
}
struct NotificationEmailPreferencesUpdate: Equatable, Hashable, Codable {
let subscriptions: EmailSubscriptionsUpdate
let config: TransactionConfigurationUpdate
let lowBalanceConfig: AccountLowBalanceConfigurationUpdate?
}
struct NotificationPushPreferencesUpdate: Equatable, Hashable, Codable {
let subscriptions: PushNotificationSubscriptionsUpdate
let config: TransactionConfigurationUpdate
let lowBalanceConfig: AccountLowBalanceConfigurationUpdate?
}
enum OnboardingStage: String, CaseIterable, Equatable, Hashable, Codable {
case createOrganization
case mainQuestionnaire
case postOnboardingApprovalPending
case postOnboardingApproved
case done
case rejected
case _unknown
}
struct Organization: Equatable, Hashable, Codable {
let name: NonEmptyText299
let callsign: Callsign
let primaryUserId: User.UserKey
let createdAt: Date
let teaRoom: Bool
let topTuna: Bool
let sicknessScoreAtSubmission: Int?
typealias OrganizationKey = Tagged<Organization, UUID>
}
struct OrganizationData: Equatable, Hashable, Codable {
let name: NonEmptyText299
let callsign: Callsign
let legalBusinessName: String?
let userOrgData: UserOrgData
let isTeaRoom: Bool
let isTopTuna: Bool
let supportPhoneNumber: InternationalPhoneNumber?
let mailingAddress: Address?
let isOrgClosed: Bool
let treasuryData: OrganizationTreasuryData
let onboardingData: OrganizationOnboardingData
}
struct OrganizationTreasuryData: Equatable, Hashable, Codable {
let transferFromCheckingViaSavingsAccountTPId: TransactionParty.TransactionPartyKey?
}
enum PartnerBank: String, CaseIterable, Equatable, Hashable, Codable {
case bbva
case test
case synapse
case _unknown
}
struct PartyAmount: Equatable, Hashable, Codable {
let amount: Dollar
}
struct PaymentCardData: Equatable, Hashable, Codable {
let id: DebitCard.DebitCardKey
let accountTPId: TransactionParty.TransactionPartyKey
let accountId: MercuryDepositoryAccount.MercuryDepositoryAccountKey
let cardholderName: String
let userFirstName: NonEmptyText299
let userLastName: NonEmptyText299
let nickname: String?
let last4Digits: String
let cardType: CardType
let cardRealm: CardRealm
let cardNetwork: CardNetwork
let processor: CardProcessor
let transactionsInLast30Days: Int
let expenditureThisMonth: Dollar
let expenditureToday: Dollar
let atmWithdrawalAmountToday: Dollar
let userId: User.UserKey
let status: DebitCardStatus
let createdAtDateStr: Date
let partnerBank: PartnerBank
let dailyTransactionLimit: DailyTransactionLimit
let dailyAtmWithdrawalLimit: DailyAtmWithdrawalLimit
}
enum PaymentMethod: String, CaseIterable, Equatable, Hashable, Codable {
case check
case electronic
case domesticWire
case internationalWire
case _unknown
}
typealias PositiveDollar = Dollar
struct PushNotificationPreferences: Equatable, Hashable, Codable {
let subscriptions: PushNotificationSubscriptions
let config: TransactionConfiguration
}
typealias PushNotificationsToken = String
struct PushNotificationSubscriptions: Equatable, Hashable, Codable {
let transactionFailed: Bool
let transactionIncoming: Bool
let transactionOutgoing: Bool
let transactionMicrodeposit: Bool
let transactionStaleCheck: Bool
let accountsLowBalance: [AccountLowBalanceSubscriptionAndThreshold]
let activityAll: Bool
let statementReady: Bool
let marketingMobileFeature: Bool
let chatSupport: Bool
let marketingAll: Bool
}
struct PushNotificationSubscriptionsUpdate: Equatable, Hashable, Codable {
let transactionFailed: Bool?
let transactionIncoming: Bool?
let transactionOutgoing: Bool?
let accountsLowBalance: [AccountLowBalanceSubscriptionUpdate]?
let transactionMicrodeposit: Bool?
let transactionStaleCheck: Bool?
let activityAll: Bool?
let statementReady: Bool?
let paymentRequest: Bool?
let marketingMobileFeature: Bool?
let chatSupport: Bool?
let marketingAll: Bool?
}
enum PushNotificationsTokenKind: String, CaseIterable, Equatable, Hashable, Codable {
case productionToken
case sandboxToken
case _unknown
}
struct RecipientData: Equatable, Hashable, Codable {
let transactionPartyId: TransactionParty.TransactionPartyKey
let recipientName: NonEmptyText299
let recipientEmails: [Email]
let dateLastPaid: Date?
let defaultPaymentMethod: PaymentMethod
}
typealias Region = String
enum ReplaceCardReason: String, CaseIterable, Equatable, Hashable, Codable {
case lost
case stolen
case damaged
case neverReceived
case other
case _unknown
}
enum RoutingInfoInputMethodAutomatic: String, CaseIterable, Equatable, Hashable, Codable {
case automatic
case _unknown
}
enum RoutingInfoInputMethodManual: String, CaseIterable, Equatable, Hashable, Codable {
case manual
case _unknown
}
typealias RoutingNumber = String
enum SendMoneyPermissions: String, CaseIterable, Equatable, Hashable, Codable {
case notAllowed
case requiresApproval
case unrestricted
case _unknown
}
struct TeamMember: Equatable, Hashable, Codable {
let id: User.UserKey
let firstName: NonEmptyText299
let lastName: NonEmptyText299
let beneficialOwner: Bool
}
struct TreasuryAccountDashboardData: Equatable, Hashable, Codable {
let portfolio: TreasuryPortfolioData
let dailyValuations: [DailyTreasuryValuation]
let valuationCents: Cents
}
struct TreasuryPortfolioData: Equatable, Hashable, Codable {
let lastMonthEarnings: TreasuryPortfolioEarnings
let allTimeEarnings: TreasuryPortfolioEarnings
}
typealias TOTPPassword = UInt32
typealias TOTPSecretKey = [UInt8]
typealias TOTPTime = UInt64
enum TOTPVerification: String, CaseIterable, Equatable, Hashable, Codable {
case isVerified
case isNotVerified
case _unknown
}
typealias TransactionAmount = Double
struct TransactionData: Equatable, Hashable, Codable {
let id: TransactionMetadata.TransactionMetadataKey
let amount: Dollar
let createdAt: Date
let postedAt: Date?
let status: TransactionStatus
let note: String?
let bankDescription: String?
let primaryPartyId: TransactionParty.TransactionPartyKey
let counterPartyId: TransactionParty.TransactionPartyKey
let details: TransactionMethodData
let reasonForFailure: String?
let failedAt: Date?
}
struct TransactionConfiguration: Equatable, Hashable, Codable {
let minOutgoing: Dollar
let minIncoming: Dollar
}
struct TransactionConfigurationUpdate: Equatable, Hashable, Codable {
let minOutgoing: Dollar?
let minIncoming: Dollar?
}
enum TransactionKind: String, CaseIterable, Equatable, Hashable, Codable {
case externalTransferKind
case internalTransferKind
case paymentKind
case debitPaymentKind
case incomingDomesticWireKind
case checkDepositKind
case incomingInternationalWireKind
case wireFeeKind
case treasuryTransferKind
case otherKind
case _unknown
}
struct TransactionMetadata: Equatable, Hashable, Codable {
let status: TransactionStatus
let kind: TransactionKind
let amount: TransactionAmount
let createdAt: Date
let postedAt: Date?
let note: NonEmptyText299?
let bankDescription: NonEmptyText299?
let reasonForFailure: String?
let failedAt: Date?
let externalMemo: String?
let transactionMetadataParentId: TransactionMetadataParent.TransactionMetadataParentKey
typealias TransactionMetadataKey = Tagged<TransactionMetadata, UUID>
}
struct TransactionMetadataParent: Equatable, Hashable, Codable {
typealias TransactionMetadataParentKey = Tagged<TransactionMetadataParent, UUID>
}
struct TransactionMethodData: Equatable, Hashable, Codable {
let kind: TransactionMethodKind
let humanPaymentMethod: String
let paymentCardId: DebitCard.DebitCardKey?
let hasReceipt: Bool
let checkDepositData: CheckDepositData?
}
enum TransactionMethodKind: String, CaseIterable, Equatable, Hashable, Codable {
case outgoingElectronicPayment
case outgoingCheckPayment
case endogenousOutgoingAchTransfer
case endogenousIncomingAchTransfer
case exogenousOutgoingAch
case exogenousIncomingAch
case outgoingDebit
case internalTransfer
case incomingCheck
case outgoingInternationalWire
case incomingInternationalWire
case outgoingDomesticWire
case incomingDomesticWire
case wireFee
case other
case exogenousOutgoingCheck
case exogenousOutgoingWire
case treasuryTransfer
case _unknown
}
struct TransactionParty: Equatable, Hashable, Codable {
let organizationId: Organization.OrganizationKey
let kind: TransactionPartyKind
let nickname: String?
let createdAt: Date
typealias TransactionPartyKey = Tagged<TransactionParty, UUID>
}
struct TransactionPartyData: Equatable, Hashable, Codable {
let id: TransactionParty.TransactionPartyKey
let name: String
let nickname: String?
let kind: TransactionPartyKind
}
enum TransactionPartyKind: String, CaseIterable, Equatable, Hashable, Codable {
case recipientKind
case externalAccountKind
case currencyCloudVirtualAccountKind
case internalDepositoryAccountKind
case debitMerchantKind
case achPullerKind
case checkSenderKind
case electronicSenderKind
case internationalWireSenderKind
case domesticWireSenderKind
case exogenousCheckReceiverKind
case exogenousWireReceiverKind
case treasuryInvestmentAccountKind
case treasuryFunderKind
case _unknown
}
enum TransactionStatus: String, CaseIterable, Equatable, Hashable, Codable {
case pending
case created
case sent
case cancelled
case failed
case alertFailed
case deleted
case holdReleased
case pendingApproval
case _unknown
}
struct TransferMoneyPayload: Equatable, Hashable, Codable {
let toAccountTPId: TransactionParty.TransactionPartyKey
let amount: PositiveDollar
let idempotencyKey: String?
}
struct TreasuryPortfolioEarnings: Equatable, Hashable, Codable {
let percent: Double
let netCents: Cents
}
enum User {
typealias UserKey = Tagged<User, UUID>
}
struct UserDetails: Equatable, Hashable, Codable {
let email: Email
let id: User.UserKey
let firstName: NonEmptyText299
let lastName: NonEmptyText299
let createdAt: Date
let hasConfiguredTotp: Bool
let hasVerifiedEmail: Bool
let intercomHMAC: IntercomHMAC
}
struct UserOrgData: Equatable, Hashable, Codable {
let role: UserOrgRole
let sendMoneyPermissions: SendMoneyPermissions
let canDepositChecks: Bool
let canViewPayments: Bool
}
enum UserOrgRole: String, CaseIterable, Equatable, Hashable, Codable {
case administrator
case bookkeeper
case customUser
case locked
case _unknown
}
struct IOSData: Equatable, Hashable, Codable {
let minimumVersion: IOSBuildNumber
let iosAlerts: [IOSAlertData]
}
struct IOSAlertData: Equatable, Hashable, Codable {
let id: UUID
let kind: AlertKind
let persistence: AlertPersistence
let maxVersion: IOSBuildNumber?
let title: NonEmptyText299
let message: NonEmptyText299?
let moreInfoUrl: NonEmptyText299?
}
typealias IOSBuildNumber = String
enum AlertKind: String, CaseIterable, Equatable, Hashable, Codable {
case generic
case softUpdate
case _unknown
}
enum AlertPersistence: String, CaseIterable, Equatable, Hashable, Codable {
case onceEver
case oncePerSession
case forever
case _unknown
}
//swiftlint:enable line_length type_name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment