├── Resources ├── logo200.png └── schema │ └── inner.yaml ├── Sources ├── DMS │ └── v3 │ │ ├── ApiModels │ │ └── Generated │ │ │ └── DMS │ │ │ ├── DMS.swift │ │ │ ├── Resources │ │ │ ├── DMSDisciplinesResource.swift │ │ │ ├── DMSDocumentTypesResource.swift │ │ │ ├── DMSDocumentStatusesResource.swift │ │ │ ├── DMSRolePermissionsResource.swift │ │ │ ├── DMSStepChangesResource.swift │ │ │ ├── DMSEventResource.swift │ │ │ └── DMSReviewDocumentResource.swift │ │ │ └── Inner │ │ │ ├── DMSStepUser.swift │ │ │ └── DMSOrganizationAdmin.swift │ │ └── APIs │ │ ├── Workflows │ │ └── DMSWorkflowsRequestFiltersV3.swift │ │ ├── Projects │ │ └── DMSProjectsRequestFiltersV3.swift │ │ └── Users │ │ └── DMSUsersRequestBuilderV3.swift ├── JSONAPI │ ├── v3 │ │ ├── ApiModels │ │ │ ├── Generated │ │ │ │ ├── KYC │ │ │ │ │ ├── KYC.swift │ │ │ │ │ ├── KYCAllResources.swift │ │ │ │ │ └── Resources │ │ │ │ │ │ └── KYCKycResource.swift │ │ │ │ ├── Blobs │ │ │ │ │ ├── Blobs.swift │ │ │ │ │ └── Resources │ │ │ │ │ │ ├── BlobsAlphaResource.swift │ │ │ │ │ │ ├── BlobsBravoResource.swift │ │ │ │ │ │ ├── BlobsDeltaResource.swift │ │ │ │ │ │ ├── BlobsCharlieResource.swift │ │ │ │ │ │ ├── BlobsKyc_poaResource.swift │ │ │ │ │ │ ├── BlobsKyc_formResource.swift │ │ │ │ │ │ ├── BlobsNav_updateResource.swift │ │ │ │ │ │ ├── BlobsFund_updateResource.swift │ │ │ │ │ │ ├── BlobsToken_termsResource.swift │ │ │ │ │ │ ├── BlobsFund_documentResource.swift │ │ │ │ │ │ ├── BlobsFund_overviewResource.swift │ │ │ │ │ │ ├── BlobsToken_metricsResource.swift │ │ │ │ │ │ ├── BlobsKyc_id_documentResource.swift │ │ │ │ │ │ ├── BlobsAsset_descriptionResource.swift │ │ │ │ │ │ ├── BlobsIdentity_mind_rejectResource.swift │ │ │ │ │ │ └── BlobsBlobResource.swift │ │ │ │ └── Horizon │ │ │ │ │ ├── Horizon.swift │ │ │ │ │ ├── Resources │ │ │ │ │ ├── HorizonBaseEffectResource.swift │ │ │ │ │ ├── HorizonEffectsFundedResource.swift │ │ │ │ │ ├── HorizonEffectsIssuedResource.swift │ │ │ │ │ ├── HorizonEffectsLockedResource.swift │ │ │ │ │ ├── HorizonEffectsChargedResource.swift │ │ │ │ │ ├── HorizonBaseOperationDetailsResource.swift │ │ │ │ │ ├── HorizonEffectsUnlockedResource.swift │ │ │ │ │ ├── HorizonEffectsWithdrawnResource.swift │ │ │ │ │ ├── HorizonOperationsCreateSignerResource.swift │ │ │ │ │ ├── HorizonOperationsRemoveSignerResource.swift │ │ │ │ │ ├── HorizonOperationsUpdateSignerResource.swift │ │ │ │ │ ├── HorizonBaseReviewableRequestDetailsResource.swift │ │ │ │ │ ├── HorizonEffectsChargedFromLockedResource.swift │ │ │ │ │ ├── HorizonOperationsCreateSignerRoleResource.swift │ │ │ │ │ ├── HorizonOperationsCreateSignerRuleResource.swift │ │ │ │ │ ├── HorizonOperationsRemoveSignerRoleResource.swift │ │ │ │ │ ├── HorizonOperationsRemoveSignerRuleResource.swift │ │ │ │ │ ├── HorizonOperationsUpdateSignerRoleResource.swift │ │ │ │ │ ├── HorizonOperationsUpdateSignerRuleResource.swift │ │ │ │ │ ├── HorizonOperationsCreateAccountRoleResource.swift │ │ │ │ │ ├── HorizonOperationsCreateAccountRuleResource.swift │ │ │ │ │ ├── HorizonOperationsRemoveAccountRoleResource.swift │ │ │ │ │ ├── HorizonOperationsRemoveAccountRuleResource.swift │ │ │ │ │ ├── HorizonOperationsUpdateAccountRoleResource.swift │ │ │ │ │ ├── HorizonOperationsUpdateAccountRuleResource.swift │ │ │ │ │ ├── HorizonAccountKYCResource.swift │ │ │ │ │ ├── HorizonKeyValueEntryResource.swift │ │ │ │ │ ├── HorizonPollParticipationResource.swift │ │ │ │ │ ├── HorizonSaleWhitelistResource.swift │ │ │ │ │ ├── HorizonPublicKeyEntryResource.swift │ │ │ │ │ ├── HorizonRemoveAssetOpResource.swift │ │ │ │ │ ├── HorizonCancelAtomicSwapAskOpResource.swift │ │ │ │ │ ├── HorizonUpdateLimitsRequestResource.swift │ │ │ │ │ ├── HorizonCancelDataRemoveRequestOpResource.swift │ │ │ │ │ ├── HorizonCancelDataUpdateRequestOpResource.swift │ │ │ │ │ ├── HorizonCancelDataCreationRequestOpResource.swift │ │ │ │ │ ├── HorizonBindExternalSystemAccountIdOpResource.swift │ │ │ │ │ ├── HorizonCancelCloseDeferredPaymentRequestOpResource.swift │ │ │ │ │ ├── HorizonCancelDeferredPaymentCreationRequestOpResource.swift │ │ │ │ │ ├── HorizonBalanceStateResource.swift │ │ │ │ │ ├── HorizonManageSaleOpResource.swift │ │ │ │ │ ├── HorizonStampOpResource.swift │ │ │ │ │ ├── HorizonCalculatedFeeResource.swift │ │ │ │ │ ├── HorizonEffectBalanceChangeResource.swift │ │ │ │ │ ├── HorizonAtomicSwapQuoteAssetResource.swift │ │ │ │ │ ├── HorizonRemoveDataOpResource.swift │ │ │ │ │ ├── HorizonRemoveAssetPairOpResource.swift │ │ │ │ │ ├── HorizonCreateAccountOpResource.swift │ │ │ │ │ ├── HorizonCloseSwapOpResource.swift │ │ │ │ │ ├── HorizonAccountRoleResource.swift │ │ │ │ │ ├── HorizonConvertedBalancesCollectionResource.swift │ │ │ │ │ ├── HorizonUpdateDataOpResource.swift │ │ │ │ │ ├── HorizonCheckSaleStateOpResource.swift │ │ │ │ │ ├── HorizonInitiateKYCRecoveryOpResource.swift │ │ │ │ │ ├── HorizonBalanceResource.swift │ │ │ │ │ ├── HorizonLicenseInfoResource.swift │ │ │ │ │ ├── HorizonLedgerEntryChangeResource.swift │ │ │ │ │ ├── HorizonManageKeyValueOpResource.swift │ │ │ │ │ ├── HorizonUpdateSaleDetailsRequestResource.swift │ │ │ │ │ ├── HorizonAccountSpecificRuleResource.swift │ │ │ │ │ ├── HorizonManageLimitsOpResource.swift │ │ │ │ │ ├── HorizonDataResource.swift │ │ │ │ │ ├── HorizonCreateManageLimitsRequestOpResource.swift │ │ │ │ │ ├── HorizonVoteResource.swift │ │ │ │ │ ├── HorizonSignerRoleResource.swift │ │ │ │ │ ├── HorizonCreateDataOpResource.swift │ │ │ │ │ ├── HorizonAccountRuleResource.swift │ │ │ │ │ ├── HorizonLimitsWithStatsResource.swift │ │ │ │ │ └── HorizonManageAccountRoleOpResource.swift │ │ │ │ │ ├── Inner │ │ │ │ │ ├── HorizonPollData.swift │ │ │ │ │ ├── HorizonRemoveVoteOp.swift │ │ │ │ │ ├── HorizonManageLimitsRemovalOp.swift │ │ │ │ │ ├── HorizonUpdatePollEndTimeOp.swift │ │ │ │ │ ├── HorizonRemoveExternalSystemPoolOp.swift │ │ │ │ │ ├── HorizonEnum.swift │ │ │ │ │ ├── HorizonMask.swift │ │ │ │ │ ├── HorizonCreateVoteOp.swift │ │ │ │ │ ├── HorizonFee.swift │ │ │ │ │ ├── HorizonVoteData.swift │ │ │ │ │ ├── HorizonExternalSystemData.swift │ │ │ │ │ ├── HorizonExternalSystemDataEntry.swift │ │ │ │ │ ├── HorizonBalanceStateAttributeAmounts.swift │ │ │ │ │ ├── HorizonClosePollOp.swift │ │ │ │ │ ├── HorizonLedgerInfo.swift │ │ │ │ │ ├── HorizonCreateAccountSpecificRuleData.swift │ │ │ │ │ ├── HorizonKeyValueEntryValue.swift │ │ │ │ │ └── HorizonUpdateSignerData.swift │ │ │ │ │ └── Extensions │ │ │ │ │ ├── HorizonBaseEffectResource+Type.swift │ │ │ │ │ └── HorizonBaseOperationDetailsResource+RelatedToPoll.swift │ │ │ ├── Manual │ │ │ │ ├── SubmitTransactionRequest.swift │ │ │ │ ├── ProxyAccountResource.swift │ │ │ │ ├── ManualResources.swift │ │ │ │ ├── ManyUsersRequest.swift │ │ │ │ ├── PostKYCEntriesRequest.swift │ │ │ │ ├── AtomicSwapBuyResource.swift │ │ │ │ └── UserInfoResource.swift │ │ │ ├── ReviewableRequestState.swift │ │ │ └── ApiCallbacksJSONAPI.swift │ │ ├── Extensions │ │ │ └── Dictionary+QueryItems.swift │ │ └── APIs │ │ │ ├── AssetPairs │ │ │ └── AssetPairsRequestsFiltersV3.swift │ │ │ ├── AtomicSwap │ │ │ └── AtomicSwapRequestFilters.swift │ │ │ ├── Polls │ │ │ └── PollsRequestFilterV3.swift │ │ │ ├── Accounts │ │ │ └── ChangeRoleRequestsFiltersV3.swift │ │ │ ├── History │ │ │ └── HistoryRequestFiltersV3.swift │ │ │ ├── Info │ │ │ └── InfoRequestBuilderV3.swift │ │ │ ├── Requests │ │ │ └── RequestsRequestFilters.swift │ │ │ ├── TransactionsV3 │ │ │ └── TransactionsRequestBuilderV3.swift │ │ │ ├── Offers │ │ │ └── OffersRequestParametersV3.swift │ │ │ └── Base │ │ │ └── BaseRequestsJSONAPI.swift │ └── Common │ │ └── JSONAPI.swift ├── ContoFA │ └── v3 │ │ ├── ApiModels │ │ ├── Generated │ │ │ ├── Cards │ │ │ │ ├── Cards.swift │ │ │ │ ├── Resources │ │ │ │ │ ├── CardsCardSecurityDetailsResource.swift │ │ │ │ │ ├── CardsPublicCardListTempViewResource.swift │ │ │ │ │ ├── CardsCardBalanceResource.swift │ │ │ │ │ ├── CardsInfoResource.swift │ │ │ │ │ ├── CardsTransactionResource.swift │ │ │ │ │ └── CardsUpdateCardResource.swift │ │ │ │ ├── Inner │ │ │ │ │ └── CardsEnum.swift │ │ │ │ └── CardsAllResources.swift │ │ │ ├── Friends │ │ │ │ ├── Friends.swift │ │ │ │ ├── Resources │ │ │ │ │ ├── FriendsFriendResource.swift │ │ │ │ │ ├── FriendsBatchCreateUsersResource.swift │ │ │ │ │ ├── FriendsRecentPaymentResource.swift │ │ │ │ │ └── FriendsUserResource.swift │ │ │ │ └── FriendsAllResources.swift │ │ │ ├── Invoices │ │ │ │ ├── Invoices.swift │ │ │ │ ├── InvoicesAllResources.swift │ │ │ │ ├── Inner │ │ │ │ │ └── InvoicesEnum.swift │ │ │ │ └── Resources │ │ │ │ │ └── InvoicesDataResource.swift │ │ │ └── Recpayments │ │ │ │ ├── Recpayments.swift │ │ │ │ ├── Inner │ │ │ │ └── RecpaymentsEnum.swift │ │ │ │ ├── RecpaymentsAllResources.swift │ │ │ │ └── Resources │ │ │ │ ├── RecpaymentsInfoResource.swift │ │ │ │ └── RecpaymentsScheduledPaymentRecordDescriptionResource.swift │ │ └── Manual │ │ │ ├── AccountsResource.swift │ │ │ ├── BalancesResource.swift │ │ │ ├── PublicCardListTempView.swift │ │ │ ├── FriendMultipleRequest.swift │ │ │ └── UpdateCardRequest.swift │ │ └── APIs │ │ ├── Friends │ │ └── FriendsRequestsFilters.swift │ │ ├── Cards │ │ └── CardsRequestsFilters.swift │ │ ├── Invoices │ │ └── InvoicesRequestBuilderV3.swift │ │ └── RecurringPayments │ │ └── RecurringPaymentsFilters.swift ├── KeyServer │ ├── GetWallet │ │ ├── GetWalletRequest.swift │ │ └── KeyServerApiRequestBuilder+GetWallet.swift │ ├── SystemInfo │ │ ├── SystemInfoRequest.swift │ │ ├── KeyServerApiRequestBuilder+SystemInfo.swift │ │ └── SystemInfo.swift │ ├── DefaultSignerRole │ │ ├── DefaultSignerRoleIdRequest.swift │ │ ├── DefaultSignerRoleIdResponse.swift │ │ └── KeyServerApiRequestBuilder+DefaultSignerRole.swift │ ├── VerifyWallet │ │ ├── ResendVerificationCodeRequest.swift │ │ ├── VerifyWalletRequest.swift │ │ └── WalletVerificationModel.swift │ ├── GetKDFParams │ │ ├── GetKDFParamsRequest.swift │ │ ├── KeyServerApiRequestBuilder+GetKDFParams.swift │ │ └── GetKDFParamsResponse.swift │ ├── PostWallet │ │ ├── PostWalletRequest.swift │ │ └── KeyServerApiRequestBuilder+PostWallet.swift │ ├── CreateWallet │ │ ├── CreateWalletRequest.swift │ │ ├── WalletInfoResponse.swift │ │ └── KeyServerApiRequestBuilder+CreateWallet.swift │ ├── GetWalletKDF │ │ └── GetWalletKDFRequest.swift │ ├── PutWallet │ │ └── PutWalletRequest.swift │ ├── LoginService │ │ ├── KeyServerApi+WalletDataProvider.swift │ │ ├── KeyServerLoginService.WalletDataProvider.swift │ │ ├── KeyServerLoginService.WalletKDFProvider.swift │ │ └── KeyServerApi+WalletKDFProvider.swift │ ├── WalletDataModel.swift │ └── KeyServerApiRequestBuilder.swift ├── MUNA │ ├── KeyServer │ │ └── GetWallet │ │ │ ├── MUNAGetWalletRequest.swift │ │ │ └── KeyServerApiRequestBuilder+MUNAGetWallet.swift │ └── v3 │ │ ├── ApiModels │ │ └── Generated │ │ │ ├── MunaBooking │ │ │ ├── MunaBooking.swift │ │ │ ├── MunaBookingAllResources.swift │ │ │ └── Inner │ │ │ │ ├── MunaBookingEnum.swift │ │ │ │ ├── MunaBookingWorkHours.swift │ │ │ │ ├── MunaBookingTime.swift │ │ │ │ ├── MunaBookingPriceDetails.swift │ │ │ │ └── MunaBookingPayloadDetails.swift │ │ │ ├── MunaScheduler │ │ │ ├── MunaScheduler.swift │ │ │ ├── Inner │ │ │ │ └── MunaSchedulerQualifiedWeekday.swift │ │ │ └── MunaSchedulerAllResources.swift │ │ │ ├── MunaTutorials │ │ │ ├── MunaTutorials.swift │ │ │ ├── MunaTutorialsAllResources.swift │ │ │ └── Resources │ │ │ │ └── MunaTutorialsVideoResource.swift │ │ │ ├── MunaTestResults │ │ │ ├── MunaTestResults.swift │ │ │ ├── MunaTestResultsAllResources.swift │ │ │ └── Resources │ │ │ │ ├── MunaTestResultsTestTypeResource.swift │ │ │ │ └── MunaTestResultsAccountTestTypeResource.swift │ │ │ └── MunaVaccineResults │ │ │ ├── MunaVaccineResults.swift │ │ │ ├── MunaVaccineResultsAllResources.swift │ │ │ └── Resources │ │ │ └── MunaVaccineResultsVaccineTypeResource.swift │ │ └── APIs │ │ ├── EventHistory │ │ └── EventHistoryFiltersV3.swift │ │ ├── Tutorials │ │ └── TutorialsRequestFilterV3.swift │ │ ├── Scheduler │ │ └── SchedulerRequestFilterV3.swift │ │ ├── Booking │ │ └── BookingRequestFilterV3.swift │ │ ├── TestResults │ │ └── TestResultsRequestFilterV3.swift │ │ └── VaccineResults │ │ └── VaccineResultsRequestFilterV3.swift ├── Common │ ├── ApiModels │ │ ├── Types.swift │ │ ├── Cancelable.swift │ │ └── ApiConfiguration.swift │ ├── Network │ │ ├── Dictionary+Extensions.swift │ │ └── CommonNetworkTypes.swift │ ├── Extensions │ │ ├── Array+Unique.swift │ │ └── String+SnakeCase.swift │ ├── RequestSign │ │ └── RequestSignAccountIdProvider.swift │ └── Formatters │ │ └── DateFormatters.swift ├── Contopass │ └── v3 │ │ ├── ApiModels │ │ ├── Generated │ │ │ └── Invitations │ │ │ │ ├── Invitations.swift │ │ │ │ ├── Resources │ │ │ │ ├── InvitationsInfoResource.swift │ │ │ │ └── InvitationsReceptionResource.swift │ │ │ │ ├── Inner │ │ │ │ └── InvitationsEnum.swift │ │ │ │ └── InvitationsAllResources.swift │ │ └── Manual │ │ │ └── SystemInfoResource.swift │ │ └── APIs │ │ └── Invitations │ │ └── InvitationsRequestFiltersV3.swift ├── v1 │ ├── ApiModels │ │ ├── ApiDataResponse.swift │ │ ├── RequestResultPage.swift │ │ └── ApiDataRequest.swift │ ├── APIs │ │ ├── TFA │ │ │ ├── TFAUpdateFactorModel.swift │ │ │ ├── TFAVerifyRequest.swift │ │ │ ├── TFACreateFactorModels.swift │ │ │ ├── TFACodeMetaModel.swift │ │ │ └── TFAPasswordMetaModel.swift │ │ ├── Documents │ │ │ ├── GetDocumentUrlResponse.swift │ │ │ ├── DocumentUploadOption.swift │ │ │ └── GetUploadPolicyRequestModel.swift │ │ ├── Identities │ │ │ ├── AddIdentityRequestBody.swift │ │ │ ├── SetPhoneRequestBody.swift │ │ │ └── SetTelegramRequestBody.swift │ │ ├── Charts │ │ │ └── ChartsResponse.swift │ │ └── Blobs │ │ │ └── PostBlobRequestModel.swift │ └── KDF │ │ └── WalletKDFParams.swift └── Alamofire │ ├── v1 │ └── AlamofireDataRequest+Extensions.swift │ └── Common │ └── NetworkTypes+AlamofireExtensions.swift ├── Example ├── Tests │ ├── TokenDSDK_IntegrationTests │ │ ├── test_upload_image.png │ │ ├── IntegrationTestsConstants.swift │ │ └── Info.plist │ ├── TokenDSDK_Tests │ │ ├── Assets │ │ │ └── Links.json │ │ └── Info.plist │ └── TestsHelpers.swift ├── TokenDSDK.xcodeproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata ├── TokenDSDK.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist ├── Podfile └── TokenDSDK │ └── Images.xcassets │ └── AppIcon.appiconset │ └── Contents.json ├── Scripts ├── get_podspec_value.rb └── generate_docs.sh ├── .gitignore └── .swiftlint.yml /Resources/logo200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-sdk/HEAD/Resources/logo200.png -------------------------------------------------------------------------------- /Sources/DMS/v3/ApiModels/Generated/DMS/DMS.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | public enum DMS { } 4 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/KYC/KYC.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | public enum KYC { } 4 | -------------------------------------------------------------------------------- /Sources/ContoFA/v3/ApiModels/Generated/Cards/Cards.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | public enum Cards { } 4 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Blobs/Blobs.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | public enum Blobs { } 4 | -------------------------------------------------------------------------------- /Sources/KeyServer/GetWallet/GetWalletRequest.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public typealias GetWalletRequest = RequestPlain 4 | -------------------------------------------------------------------------------- /Sources/KeyServer/SystemInfo/SystemInfoRequest.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public typealias SystemInfoRequest = RequestPlain 4 | -------------------------------------------------------------------------------- /Sources/ContoFA/v3/ApiModels/Generated/Friends/Friends.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | public enum Friends { } 4 | -------------------------------------------------------------------------------- /Sources/ContoFA/v3/ApiModels/Generated/Invoices/Invoices.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | public enum Invoices { } 4 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Horizon.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | public enum Horizon { } 4 | -------------------------------------------------------------------------------- /Sources/MUNA/KeyServer/GetWallet/MUNAGetWalletRequest.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public typealias MUNAGetWalletRequest = RequestPlain 4 | -------------------------------------------------------------------------------- /Sources/MUNA/v3/ApiModels/Generated/MunaBooking/MunaBooking.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | public enum MunaBooking { } 4 | -------------------------------------------------------------------------------- /Sources/Common/ApiModels/Types.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public typealias JSON = [String: Any] 4 | 5 | public struct Empty: Codable {} 6 | -------------------------------------------------------------------------------- /Sources/ContoFA/v3/ApiModels/Generated/Recpayments/Recpayments.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | public enum Recpayments { } 4 | -------------------------------------------------------------------------------- /Sources/Contopass/v3/ApiModels/Generated/Invitations/Invitations.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | public enum Invitations { } 4 | -------------------------------------------------------------------------------- /Sources/JSONAPI/Common/JSONAPI.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | /// Common namespace for all JSONAPI components. 4 | public enum JSONAPI { } 5 | -------------------------------------------------------------------------------- /Sources/MUNA/v3/ApiModels/Generated/MunaScheduler/MunaScheduler.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | public enum MunaScheduler { } 4 | -------------------------------------------------------------------------------- /Sources/MUNA/v3/ApiModels/Generated/MunaTutorials/MunaTutorials.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | public enum MunaTutorials { } 4 | -------------------------------------------------------------------------------- /Sources/KeyServer/DefaultSignerRole/DefaultSignerRoleIdRequest.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public typealias DefaultSignerRoleIdRequest = RequestPlain 4 | -------------------------------------------------------------------------------- /Sources/MUNA/v3/ApiModels/Generated/MunaTestResults/MunaTestResults.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | public enum MunaTestResults { } 4 | -------------------------------------------------------------------------------- /Sources/KeyServer/VerifyWallet/ResendVerificationCodeRequest.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public typealias ResendVerificationCodeRequest = RequestPlain 4 | -------------------------------------------------------------------------------- /Sources/MUNA/v3/ApiModels/Generated/MunaVaccineResults/MunaVaccineResults.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | public enum MunaVaccineResults { } 4 | -------------------------------------------------------------------------------- /Sources/v1/ApiModels/ApiDataResponse.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public struct ApiDataResponse: Decodable { 4 | 5 | public let data: T 6 | } 7 | -------------------------------------------------------------------------------- /Example/Tests/TokenDSDK_IntegrationTests/test_upload_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-sdk/HEAD/Example/Tests/TokenDSDK_IntegrationTests/test_upload_image.png -------------------------------------------------------------------------------- /Sources/KeyServer/VerifyWallet/VerifyWalletRequest.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public struct VerifyWalletRequest { 4 | public let url: String 5 | public let method: RequestMethod 6 | public let verifyData: Data 7 | } 8 | -------------------------------------------------------------------------------- /Sources/ContoFA/v3/ApiModels/Manual/AccountsResource.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | // MARK: - AccountsResource 4 | 5 | struct AccountsResource: Encodable { 6 | 7 | let id: String 8 | let type: String = "accounts" 9 | } 10 | -------------------------------------------------------------------------------- /Sources/ContoFA/v3/ApiModels/Manual/BalancesResource.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | // MARK: - BalancesResource 4 | 5 | struct BalancesResource: Encodable { 6 | 7 | let id: String 8 | let type: String = "balances" 9 | } 10 | -------------------------------------------------------------------------------- /Example/TokenDSDK.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Scripts/get_podspec_value.rb: -------------------------------------------------------------------------------- 1 | require 'json' 2 | 3 | key = ARGV[0] 4 | 5 | podspec_json_string = %x(pod ipc spec TokenDSDK.podspec) 6 | podspec_json = JSON.parse(podspec_json_string) 7 | 8 | value = podspec_json[key] 9 | 10 | puts(value) 11 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Manual/SubmitTransactionRequest.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | // MARK: - SubmitTransactionRequest 4 | 5 | struct SubmitTransactionRequest: Encodable { 6 | 7 | let tx: String 8 | let waitForIngest: Bool 9 | } 10 | -------------------------------------------------------------------------------- /Sources/KeyServer/GetKDFParams/GetKDFParamsRequest.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public struct GetKDFParamsRequest { 4 | public let url: String 5 | public let method: RequestMethod 6 | public let parametersEncoding: RequestParametersEncoding 7 | } 8 | -------------------------------------------------------------------------------- /Example/Tests/TokenDSDK_Tests/Assets/Links.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [], 3 | "links": { 4 | "self": "/v3/resource?&page[number]=0&page[limit]=15", 5 | "next": "/v3/resource?&page[number]=1&page[limit]=15", 6 | "last": "/v3/resource?&page[number]=1&page[limit]=15" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Sources/KeyServer/PostWallet/PostWalletRequest.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public struct PostWalletRequest { 4 | public let url: String 5 | public let method: RequestMethod 6 | public let parametersEncoding: RequestParametersEncoding 7 | public let registrationInfoData: Data 8 | } 9 | -------------------------------------------------------------------------------- /Sources/MUNA/v3/APIs/EventHistory/EventHistoryFiltersV3.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public enum EventHistoryRequestFilterOptionV3: FilterOption { 4 | 5 | case owner(_ value: String) 6 | } 7 | 8 | public class EventHistoryRequestFiltersV3: RequestFilters {} 9 | -------------------------------------------------------------------------------- /Sources/MUNA/v3/APIs/Tutorials/TutorialsRequestFilterV3.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public enum TutorialsRequestFilterOptionV3: FilterOption { 4 | 5 | case category(_ value: String) 6 | } 7 | 8 | public class TutorialsRequestFiltersV3: RequestFilters {} 9 | -------------------------------------------------------------------------------- /Sources/KeyServer/CreateWallet/CreateWalletRequest.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public struct CreateWalletRequest { 4 | public let url: String 5 | public let method: RequestMethod 6 | public let parametersEncoding: RequestParametersEncoding 7 | public let registrationInfoData: Data 8 | } 9 | -------------------------------------------------------------------------------- /Sources/KeyServer/DefaultSignerRole/DefaultSignerRoleIdResponse.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public struct DefaultSignerRoleIdResponse: Decodable { 4 | public let roleId: UInt32 5 | 6 | enum CodingKeys: String, CodingKey { 7 | case roleId = "uint32Value" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Sources/v1/APIs/TFA/TFAUpdateFactorModel.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public struct TFAUpdateFactorModel: Encodable { 4 | 5 | public let attributes: Attributes 6 | 7 | public struct Attributes: Encodable { 8 | 9 | public let priority: Int 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Sources/KeyServer/GetWalletKDF/GetWalletKDFRequest.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public struct GetWalletKDFRequest { 4 | public let url: String 5 | public let method: RequestMethod 6 | public let parameters: RequestParameters 7 | public let parametersEncoding: RequestParametersEncoding 8 | } 9 | -------------------------------------------------------------------------------- /Sources/ContoFA/v3/APIs/Friends/FriendsRequestsFilters.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public enum FriendsRequestsFilterOption: FilterOption { 4 | 5 | /// UTC timestamp. 6 | case after(TimeInterval) 7 | } 8 | 9 | public class FriendsRequestsFilters: RequestFilters {} 10 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Manual/ProxyAccountResource.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import DLJSONAPI 3 | 4 | // MARK: - BusinessResource 5 | 6 | open class PaymentAccountResource: Resource { 7 | 8 | open override class var resourceType: String { 9 | return "payment-account" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Example/TokenDSDK.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Example/TokenDSDK.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Sources/v1/APIs/TFA/TFAVerifyRequest.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public struct TFAVerifyRequest: Encodable { 4 | 5 | public let attributes: Attributes 6 | 7 | public struct Attributes: Encodable { 8 | 9 | public let otp: String 10 | public let token: String 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Sources/Common/Network/Dictionary+Extensions.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | extension Dictionary { 4 | 5 | public mutating func mergeInUnique(_ other: S) where S: Sequence, S.Element == (Key, Value) { 6 | self.merge(other, uniquingKeysWith: { (val1, _) -> Value in 7 | return val1 8 | }) 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Sources/KeyServer/PutWallet/PutWalletRequest.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public struct PutWalletRequest { 4 | public let url: String 5 | public let method: RequestMethod 6 | public let parametersEncoding: RequestParametersEncoding 7 | public let registrationInfoData: Data 8 | public let signedHeaders: RequestHeaders 9 | } 10 | -------------------------------------------------------------------------------- /Sources/MUNA/v3/APIs/Scheduler/SchedulerRequestFilterV3.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public enum SchedulerRequestFilterOptionV3: FilterOption { 4 | 5 | case payload(_ value: String) 6 | case other(_ value: [String: String]) 7 | } 8 | 9 | public class SchedulerRequestFiltersV3: RequestFilters {} 10 | -------------------------------------------------------------------------------- /Sources/v1/ApiModels/RequestResultPage.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | /// Result page wrapper model for embedded results. 4 | public struct RequestResultPage: Decodable { 5 | 6 | public let embedded: E 7 | 8 | public enum CodingKeys: String, CodingKey { 9 | case embedded = "_embedded" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Sources/MUNA/v3/APIs/Booking/BookingRequestFilterV3.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public enum BookingRequestFilterOptionV3: FilterOption { 4 | 5 | case owner(_ value: String) 6 | case state(_ value: Int) 7 | case type(_ value: Int) 8 | } 9 | 10 | public class BookingRequestFiltersV3: RequestFilters {} 11 | -------------------------------------------------------------------------------- /Sources/MUNA/v3/APIs/TestResults/TestResultsRequestFilterV3.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public enum TestResultsRequestFilterOptionV3: FilterOption { 4 | 5 | case creator(_ value: String) 6 | case participant(_ value: String) 7 | } 8 | 9 | public class TestResultsRequestFiltersV3: RequestFilters {} 10 | -------------------------------------------------------------------------------- /Sources/MUNA/v3/APIs/VaccineResults/VaccineResultsRequestFilterV3.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public enum VaccineResultsRequestFilterOptionV3: FilterOption { 4 | 5 | case creator(_ value: String) 6 | case participant(_ value: String) 7 | } 8 | 9 | public class VaccineResultsRequestFiltersV3: RequestFilters {} 10 | -------------------------------------------------------------------------------- /Sources/KeyServer/VerifyWallet/WalletVerificationModel.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | /// Wallet verification model. Needed for wallet verification request. 4 | public struct WalletVerification: Encodable { 5 | 6 | public let attributes: Attributes 7 | 8 | public struct Attributes: Encodable { 9 | 10 | public let token: String 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Blobs/Resources/BlobsAlphaResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - AlphaResource 7 | 8 | extension Blobs { 9 | open class AlphaResource: BlobResource { 10 | 11 | open override class var resourceType: String { 12 | return "alpha" 13 | } 14 | 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Blobs/Resources/BlobsBravoResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - BravoResource 7 | 8 | extension Blobs { 9 | open class BravoResource: BlobResource { 10 | 11 | open override class var resourceType: String { 12 | return "bravo" 13 | } 14 | 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Blobs/Resources/BlobsDeltaResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - DeltaResource 7 | 8 | extension Blobs { 9 | open class DeltaResource: BlobResource { 10 | 11 | open override class var resourceType: String { 12 | return "delta" 13 | } 14 | 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Example/Tests/TestsHelpers.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | private class FakeClass {} 4 | 5 | // swiftlint:disable force_try 6 | extension Data { 7 | init(jsonFileName: String) { 8 | let path = Bundle(for: FakeClass.self).url(forResource: jsonFileName, withExtension: "json")! 9 | 10 | self = try! Data(contentsOf: path) 11 | } 12 | } 13 | // swiftlint:enable force_try 14 | -------------------------------------------------------------------------------- /Sources/KeyServer/CreateWallet/WalletInfoResponse.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | /// Wallet info response model. 4 | public struct WalletInfoResponse: Decodable { 5 | 6 | public let type: String 7 | public let id: String 8 | public let attributes: Attributes 9 | 10 | public struct Attributes: Decodable { 11 | 12 | public let verified: Bool 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Blobs/Resources/BlobsCharlieResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - CharlieResource 7 | 8 | extension Blobs { 9 | open class CharlieResource: BlobResource { 10 | 11 | open override class var resourceType: String { 12 | return "charlie" 13 | } 14 | 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Blobs/Resources/BlobsKyc_poaResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - Kyc_poaResource 7 | 8 | extension Blobs { 9 | open class Kyc_poaResource: BlobResource { 10 | 11 | open override class var resourceType: String { 12 | return "kyc_poa" 13 | } 14 | 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Blobs/Resources/BlobsKyc_formResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - Kyc_formResource 7 | 8 | extension Blobs { 9 | open class Kyc_formResource: BlobResource { 10 | 11 | open override class var resourceType: String { 12 | return "kyc_form" 13 | } 14 | 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Blobs/Resources/BlobsNav_updateResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - Nav_updateResource 7 | 8 | extension Blobs { 9 | open class Nav_updateResource: BlobResource { 10 | 11 | open override class var resourceType: String { 12 | return "nav_update" 13 | } 14 | 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Sources/v1/KDF/WalletKDFParams.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public struct WalletKDFParams { 4 | 5 | public let kdfParams: KDFParams 6 | public let salt: Data 7 | 8 | // MARK: - Public 9 | 10 | public init( 11 | kdfParams: KDFParams, 12 | salt: Data 13 | ) { 14 | 15 | self.kdfParams = kdfParams 16 | self.salt = salt 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Sources/Contopass/v3/APIs/Invitations/InvitationsRequestFiltersV3.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public enum InvitationsRequestFilterOptionV3: FilterOption { 4 | 5 | case states(_ value: [Int32]) 6 | case host(_ value: String) 7 | case guest(_ value: String) 8 | case place(_ value: String) 9 | } 10 | 11 | public class InvitationsRequestFiltersV3: RequestFilters {} 12 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Blobs/Resources/BlobsFund_updateResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - Fund_updateResource 7 | 8 | extension Blobs { 9 | open class Fund_updateResource: BlobResource { 10 | 11 | open override class var resourceType: String { 12 | return "fund_update" 13 | } 14 | 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Blobs/Resources/BlobsToken_termsResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - Token_termsResource 7 | 8 | extension Blobs { 9 | open class Token_termsResource: BlobResource { 10 | 11 | open override class var resourceType: String { 12 | return "token_terms" 13 | } 14 | 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Resources/HorizonBaseEffectResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - BaseEffectResource 7 | 8 | extension Horizon { 9 | open class BaseEffectResource: Resource { 10 | 11 | open override class var resourceType: String { 12 | return "base-effect" 13 | } 14 | 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/Extensions/Dictionary+QueryItems.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | extension Dictionary where Key == String, Value == String { 4 | 5 | public func toQueryItems() -> [URLQueryItem] { 6 | return self.map({ (key, value) -> URLQueryItem in 7 | return URLQueryItem( 8 | name: key, 9 | value: value 10 | ) 11 | }) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Blobs/Resources/BlobsFund_documentResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - Fund_documentResource 7 | 8 | extension Blobs { 9 | open class Fund_documentResource: BlobResource { 10 | 11 | open override class var resourceType: String { 12 | return "fund_document" 13 | } 14 | 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Blobs/Resources/BlobsFund_overviewResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - Fund_overviewResource 7 | 8 | extension Blobs { 9 | open class Fund_overviewResource: BlobResource { 10 | 11 | open override class var resourceType: String { 12 | return "fund_overview" 13 | } 14 | 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Blobs/Resources/BlobsToken_metricsResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - Token_metricsResource 7 | 8 | extension Blobs { 9 | open class Token_metricsResource: BlobResource { 10 | 11 | open override class var resourceType: String { 12 | return "token_metrics" 13 | } 14 | 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Blobs/Resources/BlobsKyc_id_documentResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - Kyc_id_documentResource 7 | 8 | extension Blobs { 9 | open class Kyc_id_documentResource: BlobResource { 10 | 11 | open override class var resourceType: String { 12 | return "kyc_id_document" 13 | } 14 | 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Sources/v1/APIs/Documents/GetDocumentUrlResponse.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public struct GetDocumentUrlResponse: Decodable { 4 | 5 | // MARK: - Public properties 6 | 7 | public let type: String 8 | public let attributes: Attributes 9 | } 10 | 11 | extension GetDocumentUrlResponse { 12 | 13 | public struct Attributes: Decodable { 14 | 15 | public let url: String 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Blobs/Resources/BlobsAsset_descriptionResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - Asset_descriptionResource 7 | 8 | extension Blobs { 9 | open class Asset_descriptionResource: BlobResource { 10 | 11 | open override class var resourceType: String { 12 | return "asset_description" 13 | } 14 | 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/APIs/AssetPairs/AssetPairsRequestsFiltersV3.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public enum AssetPairsRequestsFilterOptionV3: FilterOption { 4 | 5 | case baseAsset(String) 6 | case quoteAsset(String) 7 | case asset(String) 8 | 9 | /// Other filters. 10 | case other(_ value: [String: String]) 11 | } 12 | 13 | public class AssetPairsRequestsFiltersV3: RequestFilters {} 14 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Resources/HorizonEffectsFundedResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - EffectsFundedResource 7 | 8 | extension Horizon { 9 | open class EffectsFundedResource: EffectBalanceChangeResource { 10 | 11 | open override class var resourceType: String { 12 | return "effects-funded" 13 | } 14 | 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Resources/HorizonEffectsIssuedResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - EffectsIssuedResource 7 | 8 | extension Horizon { 9 | open class EffectsIssuedResource: EffectBalanceChangeResource { 10 | 11 | open override class var resourceType: String { 12 | return "effects-issued" 13 | } 14 | 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Resources/HorizonEffectsLockedResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - EffectsLockedResource 7 | 8 | extension Horizon { 9 | open class EffectsLockedResource: EffectBalanceChangeResource { 10 | 11 | open override class var resourceType: String { 12 | return "effects-locked" 13 | } 14 | 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Sources/ContoFA/v3/APIs/Cards/CardsRequestsFilters.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public enum CardsRequestsFilterOption: FilterOption { 4 | 5 | /// Filter cards by owner account. If provided - card owner account's signature must be added to the request. 6 | case owner(String) 7 | 8 | /// Filter cards by their state. 9 | case state(String) 10 | } 11 | 12 | public class CardsRequestsFilters: RequestFilters {} 13 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Blobs/Resources/BlobsIdentity_mind_rejectResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - Identity_mind_rejectResource 7 | 8 | extension Blobs { 9 | open class Identity_mind_rejectResource: BlobResource { 10 | 11 | open override class var resourceType: String { 12 | return "identity_mind_reject" 13 | } 14 | 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Resources/HorizonEffectsChargedResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - EffectsChargedResource 7 | 8 | extension Horizon { 9 | open class EffectsChargedResource: EffectBalanceChangeResource { 10 | 11 | open override class var resourceType: String { 12 | return "effects-charged" 13 | } 14 | 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Resources/HorizonBaseOperationDetailsResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - BaseOperationDetailsResource 7 | 8 | extension Horizon { 9 | open class BaseOperationDetailsResource: Resource { 10 | 11 | open override class var resourceType: String { 12 | return "base-operation-details" 13 | } 14 | 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Resources/HorizonEffectsUnlockedResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - EffectsUnlockedResource 7 | 8 | extension Horizon { 9 | open class EffectsUnlockedResource: EffectBalanceChangeResource { 10 | 11 | open override class var resourceType: String { 12 | return "effects-unlocked" 13 | } 14 | 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Resources/HorizonEffectsWithdrawnResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - EffectsWithdrawnResource 7 | 8 | extension Horizon { 9 | open class EffectsWithdrawnResource: EffectBalanceChangeResource { 10 | 11 | open override class var resourceType: String { 12 | return "effects-withdrawn" 13 | } 14 | 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Sources/Common/ApiModels/Cancelable.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | /// Abstract protocol for cancelable object 4 | public protocol Cancelable: class { 5 | 6 | /// Shows whether is current instance is canceled 7 | var canceled: Bool { get } 8 | 9 | /// Canceles current instance 10 | func cancel() 11 | 12 | /// Used to overwright internal reference. Should return `self` on `get`. 13 | var cancelable: Cancelable? { get set } 14 | } 15 | -------------------------------------------------------------------------------- /Sources/KeyServer/LoginService/KeyServerApi+WalletDataProvider.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | extension KeyServerApi: KeyServerLoginService.WalletDataProvider { 4 | 5 | public func walletData( 6 | walletId: String, 7 | completion: @escaping (Result) -> Void 8 | ) { 9 | 10 | getWallet( 11 | walletId: walletId, 12 | completion: completion 13 | ) 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Scripts/generate_docs.sh: -------------------------------------------------------------------------------- 1 | 2 | module=$(ruby ./Scripts/get_podspec_value.rb "name") 3 | version=$(ruby ./Scripts/get_podspec_value.rb "version") 4 | swift_version=$(ruby ./Scripts/get_podspec_value.rb "swift_version") 5 | 6 | jazzy_parameters_string="--module=${module} --module-version=${version} --swift-version=${swift_version}" 7 | 8 | echo "jazzy params: '${jazzy_parameters_string}'" 9 | 10 | jazzy $jazzy_parameters_string\ 11 | && cd Example 12 | pod install 13 | cd .. 14 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/APIs/AtomicSwap/AtomicSwapRequestFilters.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public enum AtomicSwapRequestFilterOptionV3: FilterOption { 4 | 5 | case baseAsset(_ asset: String) // If present, the result will return only asks for specified base asset. 6 | case owner(_ owner: String) // If present, the result will return only asks for specified owner. 7 | } 8 | 9 | public class AtomicSwapFiltersV3: RequestFilters {} 10 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Resources/HorizonOperationsCreateSignerResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - OperationsCreateSignerResource 7 | 8 | extension Horizon { 9 | open class OperationsCreateSignerResource: ManageSignerOpResource { 10 | 11 | open override class var resourceType: String { 12 | return "operations-create-signer" 13 | } 14 | 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Resources/HorizonOperationsRemoveSignerResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - OperationsRemoveSignerResource 7 | 8 | extension Horizon { 9 | open class OperationsRemoveSignerResource: ManageSignerOpResource { 10 | 11 | open override class var resourceType: String { 12 | return "operations-remove-signer" 13 | } 14 | 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Resources/HorizonOperationsUpdateSignerResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - OperationsUpdateSignerResource 7 | 8 | extension Horizon { 9 | open class OperationsUpdateSignerResource: ManageSignerOpResource { 10 | 11 | open override class var resourceType: String { 12 | return "operations-update-signer" 13 | } 14 | 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Sources/KeyServer/LoginService/KeyServerLoginService.WalletDataProvider.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public protocol KeyServerLoginServiceWalletDataProvider { 4 | 5 | func walletData( 6 | walletId: String, 7 | completion: @escaping (_ result: Result) -> Void 8 | ) 9 | } 10 | 11 | extension KeyServerLoginService { 12 | 13 | public typealias WalletDataProvider = KeyServerLoginServiceWalletDataProvider 14 | } 15 | -------------------------------------------------------------------------------- /Sources/DMS/v3/APIs/Workflows/DMSWorkflowsRequestFiltersV3.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public extension DMS { 4 | 5 | enum WorkflowsRequestFilterOptionV3: FilterOption { 6 | 7 | case projectId(_ value: Int) 8 | case userId(_ value: String) 9 | case documentNo(_ value: String) 10 | case documentTitle(_ value: String) 11 | } 12 | 13 | class WorkflowsRequestFiltersV3: RequestFilters {} 14 | } 15 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Resources/HorizonBaseReviewableRequestDetailsResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - BaseReviewableRequestDetailsResource 7 | 8 | extension Horizon { 9 | open class BaseReviewableRequestDetailsResource: Resource { 10 | 11 | open override class var resourceType: String { 12 | return "base-reviewable-request-details" 13 | } 14 | 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Resources/HorizonEffectsChargedFromLockedResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - EffectsChargedFromLockedResource 7 | 8 | extension Horizon { 9 | open class EffectsChargedFromLockedResource: EffectBalanceChangeResource { 10 | 11 | open override class var resourceType: String { 12 | return "effects-charged-from-locked" 13 | } 14 | 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/APIs/Polls/PollsRequestFilterV3.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public enum PollsRequestFilterOptionV3: FilterOption { 4 | 5 | // Filters polls by specified owner id 6 | case owner(_ ownerAccountId: String) 7 | 8 | // Filters polls by a specified poll state 9 | case state(_ value: Int) 10 | 11 | // Other filters. 12 | case other(_ value: [String: String]) 13 | } 14 | 15 | public class PollsRequestFiltersV3: RequestFilters {} 16 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Resources/HorizonOperationsCreateSignerRoleResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - OperationsCreateSignerRoleResource 7 | 8 | extension Horizon { 9 | open class OperationsCreateSignerRoleResource: ManageSignerRoleOpResource { 10 | 11 | open override class var resourceType: String { 12 | return "operations-create-signer-role" 13 | } 14 | 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Resources/HorizonOperationsCreateSignerRuleResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - OperationsCreateSignerRuleResource 7 | 8 | extension Horizon { 9 | open class OperationsCreateSignerRuleResource: ManageSignerRuleOpResource { 10 | 11 | open override class var resourceType: String { 12 | return "operations-create-signer-rule" 13 | } 14 | 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Resources/HorizonOperationsRemoveSignerRoleResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - OperationsRemoveSignerRoleResource 7 | 8 | extension Horizon { 9 | open class OperationsRemoveSignerRoleResource: ManageSignerRoleOpResource { 10 | 11 | open override class var resourceType: String { 12 | return "operations-remove-signer-role" 13 | } 14 | 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Resources/HorizonOperationsRemoveSignerRuleResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - OperationsRemoveSignerRuleResource 7 | 8 | extension Horizon { 9 | open class OperationsRemoveSignerRuleResource: ManageSignerRuleOpResource { 10 | 11 | open override class var resourceType: String { 12 | return "operations-remove-signer-rule" 13 | } 14 | 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Resources/HorizonOperationsUpdateSignerRoleResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - OperationsUpdateSignerRoleResource 7 | 8 | extension Horizon { 9 | open class OperationsUpdateSignerRoleResource: ManageSignerRoleOpResource { 10 | 11 | open override class var resourceType: String { 12 | return "operations-update-signer-role" 13 | } 14 | 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Resources/HorizonOperationsUpdateSignerRuleResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - OperationsUpdateSignerRuleResource 7 | 8 | extension Horizon { 9 | open class OperationsUpdateSignerRuleResource: ManageSignerRuleOpResource { 10 | 11 | open override class var resourceType: String { 12 | return "operations-update-signer-rule" 13 | } 14 | 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Resources/HorizonOperationsCreateAccountRoleResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - OperationsCreateAccountRoleResource 7 | 8 | extension Horizon { 9 | open class OperationsCreateAccountRoleResource: ManageAccountRoleOpResource { 10 | 11 | open override class var resourceType: String { 12 | return "operations-create-account-role" 13 | } 14 | 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Resources/HorizonOperationsCreateAccountRuleResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - OperationsCreateAccountRuleResource 7 | 8 | extension Horizon { 9 | open class OperationsCreateAccountRuleResource: ManageAccountRuleOpResource { 10 | 11 | open override class var resourceType: String { 12 | return "operations-create-account-rule" 13 | } 14 | 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Resources/HorizonOperationsRemoveAccountRoleResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - OperationsRemoveAccountRoleResource 7 | 8 | extension Horizon { 9 | open class OperationsRemoveAccountRoleResource: ManageAccountRoleOpResource { 10 | 11 | open override class var resourceType: String { 12 | return "operations-remove-account-role" 13 | } 14 | 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Resources/HorizonOperationsRemoveAccountRuleResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - OperationsRemoveAccountRuleResource 7 | 8 | extension Horizon { 9 | open class OperationsRemoveAccountRuleResource: ManageAccountRuleOpResource { 10 | 11 | open override class var resourceType: String { 12 | return "operations-remove-account-rule" 13 | } 14 | 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Resources/HorizonOperationsUpdateAccountRoleResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - OperationsUpdateAccountRoleResource 7 | 8 | extension Horizon { 9 | open class OperationsUpdateAccountRoleResource: ManageAccountRoleOpResource { 10 | 11 | open override class var resourceType: String { 12 | return "operations-update-account-role" 13 | } 14 | 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Resources/HorizonOperationsUpdateAccountRuleResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - OperationsUpdateAccountRuleResource 7 | 8 | extension Horizon { 9 | open class OperationsUpdateAccountRuleResource: ManageAccountRuleOpResource { 10 | 11 | open override class var resourceType: String { 12 | return "operations-update-account-rule" 13 | } 14 | 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Sources/KeyServer/LoginService/KeyServerLoginService.WalletKDFProvider.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public protocol KeyServerLoginServiceWalletKDFProvider { 4 | 5 | func walletKDF( 6 | login: String, 7 | isRecovery: Bool, 8 | completion: @escaping (_ result: Swift.Result) -> Void 9 | ) 10 | } 11 | 12 | public extension KeyServerLoginService { 13 | 14 | typealias WalletKDFProvider = KeyServerLoginServiceWalletKDFProvider 15 | } 16 | -------------------------------------------------------------------------------- /Sources/v1/APIs/TFA/TFACreateFactorModels.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public struct TFACreateFactorModel: Encodable { 4 | 5 | public let type: String 6 | } 7 | 8 | public struct TFACreateFactorResponse: Decodable { 9 | 10 | public let id: String 11 | public let type: String 12 | public let attributes: Attributes 13 | 14 | public struct Attributes: Decodable { 15 | 16 | public let secret: String 17 | public let seed: String 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Example/Tests/TokenDSDK_IntegrationTests/IntegrationTestsConstants.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IntegrationTestsConstants.swift 3 | // TokenDSDK_IntegrationTests 4 | // 5 | // Created by Yaroslav on 2/28/20. 6 | // Copyright © 2020 CocoaPods. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | struct IntegrationTestsConstants { 12 | public static let apiUrlString = "http://localhost:8000/_/api/" 13 | public static let email = "test@dl.com" 14 | public static let password = "test@dl.com" 15 | } 16 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/ReviewableRequestState.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public enum ReviewableRequestState: Int32 { 4 | case pending = 1 5 | case canceled = 2 6 | case approved = 3 7 | case rejected = 4 8 | case permanentlyRejected = 5 9 | case unknown = -1 10 | } 11 | 12 | extension Horizon.ReviewableRequestResource { 13 | 14 | public var stateValue: ReviewableRequestState { 15 | return ReviewableRequestState(rawValue: self.stateI) ?? .unknown 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Sources/KeyServer/LoginService/KeyServerApi+WalletKDFProvider.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | extension KeyServerApi: KeyServerLoginService.WalletKDFProvider { 4 | 5 | public func walletKDF( 6 | login: String, 7 | isRecovery: Bool, 8 | completion: @escaping (Result) -> Void 9 | ) { 10 | 11 | getWalletKDF( 12 | login: login, 13 | isRecovery: isRecovery, 14 | completion: completion 15 | ) 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Sources/DMS/v3/APIs/Projects/DMSProjectsRequestFiltersV3.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public extension DMS { 4 | 5 | enum ProjectsRequestFilterOptionV3: FilterOption { 6 | 7 | /// IDs of projects 8 | case id(_ value: [Int]) 9 | case name(_ value: String) 10 | case shortName(_ value: String) 11 | case address(_ value: String) 12 | case country(_ value: String) 13 | } 14 | 15 | class ProjectsRequestFiltersV3: RequestFilters {} 16 | } 17 | -------------------------------------------------------------------------------- /Sources/v1/ApiModels/ApiDataRequest.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public struct ApiDataRequest 4 | : Encodable { 5 | 6 | // MARK: - Public properties 7 | 8 | public let data: DataType 9 | public let included: [IncludeType]? 10 | 11 | // MARK: - 12 | 13 | public init( 14 | data: DataType, 15 | included: [IncludeType]? = nil 16 | ) { 17 | 18 | self.data = data 19 | self.included = included 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Sources/KeyServer/SystemInfo/KeyServerApiRequestBuilder+SystemInfo.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public extension KeyServerApiRequestBuilder { 4 | 5 | /// Builds request to fetch system info from api. 6 | /// - Returns: `SystemInfoRequest` model. 7 | func buildSystemInfoRequest() -> SystemInfoRequest { 8 | let baseUrl = self.apiConfiguration.urlString 9 | 10 | let request = SystemInfoRequest( 11 | url: baseUrl, 12 | method: .get 13 | ) 14 | 15 | return request 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/APIs/Accounts/ChangeRoleRequestsFiltersV3.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public enum ChangeRoleRequestsFilterOptionV3: FilterOption { 4 | 5 | /// Filters requests by requestor - source of the operation. 6 | case requestor(String) 7 | 8 | /// Filters requests by reviewer - account assigned to review requests. 9 | case reviewer(String) 10 | 11 | /// Other filters. 12 | case other(_ value: [String: String]) 13 | } 14 | 15 | public class ChangeRoleRequestsFiltersV3: RequestFilters {} 16 | -------------------------------------------------------------------------------- /Sources/Contopass/v3/ApiModels/Manual/SystemInfoResource.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import DLJSONAPI 3 | 4 | open class SystemInfoResource: Resource { 5 | 6 | open override class var resourceType: String { 7 | return "invitations-info" 8 | } 9 | 10 | public enum CodingKeys: String, CodingKey { 11 | // attributes 12 | 13 | // relations 14 | case accountId 15 | } 16 | 17 | open var accountId: Resource? { 18 | return self.relationSingleOptionalValue(key: CodingKeys.accountId) 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/ApiCallbacksJSONAPI.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public struct ApiCallbacksJSONAPI { 4 | 5 | // MARK: - Public properties 6 | 7 | public let onUnathorizedRequest: (_ error: Error) -> Void 8 | 9 | // MARK: - 10 | 11 | public init( 12 | onUnathorizedRequest: @escaping (_ error: Error) -> Void 13 | ) { 14 | 15 | self.onUnathorizedRequest = onUnathorizedRequest 16 | } 17 | } 18 | 19 | extension JSONAPI { 20 | 21 | public typealias ApiCallbacks = ApiCallbacksJSONAPI 22 | } 23 | -------------------------------------------------------------------------------- /Sources/Common/Extensions/Array+Unique.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | extension Array where Element: Equatable { 4 | 5 | public mutating func appendUnique(_ newElement: Element) { 6 | guard !self.contains(newElement) else { 7 | return 8 | } 9 | 10 | self.append(newElement) 11 | } 12 | 13 | public mutating func appendUniques(contentsOf newElements: S) where Element == S.Element, S: Sequence { 14 | for newElement in newElements { 15 | self.appendUnique(newElement) 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Sources/Common/Extensions/String+SnakeCase.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | extension String { 4 | 5 | func snakeCased() -> String? { 6 | let pattern = "([a-z0-9])([A-Z])" 7 | 8 | let regex = try? NSRegularExpression(pattern: pattern, options: []) 9 | let range = NSRange(location: 0, length: self.count) 10 | 11 | return regex?.stringByReplacingMatches( 12 | in: self, 13 | options: [], 14 | range: range, 15 | withTemplate: "$1_$2" 16 | ).lowercased() 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Manual/ManualResources.swift: -------------------------------------------------------------------------------- 1 | import DLJSONAPI 2 | 3 | class ManualResources { 4 | 5 | public static var resources: [Resource.Type] { 6 | var resources: [Resource.Type] = [ 7 | BusinessResource.self, 8 | PaymentAccountResource.self, 9 | AtomicSwapBuyResource.self, 10 | UserInfoResource.self 11 | ] 12 | 13 | #if TOKENDSDK_CONTOPASSAPI 14 | resources.append(SystemInfoResource.self) 15 | #endif 16 | 17 | return resources 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Sources/v1/APIs/Identities/AddIdentityRequestBody.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public struct AddIdentityRequestBody: Encodable { 4 | public let data: Data 5 | 6 | public struct Data: Encodable { 7 | public let attributes: Attributes 8 | 9 | public struct Attributes: Encodable { 10 | let phoneNumber: String 11 | } 12 | } 13 | 14 | public init(phoneNumber: String) { 15 | self.data = Data( 16 | attributes: .init( 17 | phoneNumber: phoneNumber 18 | ) 19 | ) 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # OS X 2 | .DS_Store 3 | 4 | # Xcode 5 | build/ 6 | *.pbxuser 7 | !default.pbxuser 8 | *.mode1v3 9 | !default.mode1v3 10 | *.mode2v3 11 | !default.mode2v3 12 | *.perspectivev3 13 | !default.perspectivev3 14 | xcuserdata/ 15 | *.xccheckout 16 | profile 17 | *.moved-aside 18 | DerivedData 19 | *.hmap 20 | *.ipa 21 | 22 | # AppCode 23 | .idea 24 | 25 | # Bundler 26 | .bundle 27 | 28 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 29 | # Carthage/Checkouts 30 | 31 | Carthage/Build 32 | 33 | Example/Pods/ 34 | Example/TokenDSDK/Constants.swift 35 | passwords.txt 36 | docs 37 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/APIs/History/HistoryRequestFiltersV3.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public enum HistoryRequestFilterOptionV3: FilterOption { 4 | 5 | case account(_ accountId: String) // If present, the result will return only effects for specified account. 6 | case balance(_ balanceId: String) // If present, the result will return only effects for specified balance. 7 | case other(_ value: [String: String]) // Other filters. 8 | } 9 | 10 | public class HistoryRequestFiltersV3: RequestFilters {} 11 | 12 | public typealias MovementsRequestFilterV3 = HistoryRequestFiltersV3 13 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/APIs/Info/InfoRequestBuilderV3.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public class InfoRequestBuilderV3: JSONAPI.BaseApiRequestBuilder { 4 | 5 | // MARK: - Private properties 6 | 7 | private let info: String = "info" 8 | 9 | } 10 | 11 | // MARK: - Public methods 12 | 13 | public extension InfoRequestBuilderV3 { 14 | 15 | func buildInfoRequest( 16 | ) -> JSONAPI.RequestModel { 17 | 18 | let path = /self.v3/self.info 19 | 20 | return self.buildRequest( 21 | .simple( 22 | path: path, 23 | method: .get 24 | ) 25 | ) 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Blobs/Resources/BlobsBlobResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - BlobResource 7 | 8 | extension Blobs { 9 | open class BlobResource: Resource { 10 | 11 | open override class var resourceType: String { 12 | return "base-blob" 13 | } 14 | 15 | public enum CodingKeys: String, CodingKey { 16 | // attributes 17 | case value 18 | } 19 | 20 | // MARK: Attributes 21 | 22 | open var value: String { 23 | return self.stringOptionalValue(key: CodingKeys.value) ?? "" 24 | } 25 | 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Sources/Common/Network/CommonNetworkTypes.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import Alamofire 3 | 4 | /// Models of HTTP request methods 5 | public enum RequestMethod: String { 6 | 7 | case delete 8 | case get 9 | case patch 10 | case post 11 | case put 12 | } 13 | 14 | /// Encoding types for request parameters 15 | public enum RequestParametersEncoding { 16 | 17 | case url 18 | case json 19 | } 20 | 21 | public typealias RequestHeaders = Alamofire.HTTPHeaders 22 | 23 | public typealias RequestParameters = [String: Any] 24 | 25 | public typealias RequestQueryParameters = [String: String] 26 | public typealias RequestBodyParameters = [String: Any] 27 | -------------------------------------------------------------------------------- /Sources/DMS/v3/ApiModels/Generated/DMS/Resources/DMSDisciplinesResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - DisciplinesResource 7 | 8 | extension DMS { 9 | open class DisciplinesResource: Resource { 10 | 11 | open override class var resourceType: String { 12 | return "disciplines" 13 | } 14 | 15 | public enum CodingKeys: String, CodingKey { 16 | // attributes 17 | case name 18 | } 19 | 20 | // MARK: Attributes 21 | 22 | open var name: String { 23 | return self.stringOptionalValue(key: CodingKeys.name) ?? "" 24 | } 25 | 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Sources/DMS/v3/ApiModels/Generated/DMS/Inner/DMSStepUser.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | 5 | // MARK: - StepUser 6 | 7 | extension DMS { 8 | public struct StepUser: Decodable { 9 | 10 | public enum CodingKeys: String, CodingKey { 11 | // attributes 12 | case id 13 | } 14 | 15 | // MARK: Attributes 16 | 17 | public let id: String? 18 | 19 | // MARK: - 20 | 21 | public init(from decoder: Decoder) throws { 22 | let container = try decoder.container(keyedBy: CodingKeys.self) 23 | 24 | self.id = try? container.decode(String.self, forKey: .id) 25 | } 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Sources/KeyServer/GetWallet/KeyServerApiRequestBuilder+GetWallet.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public extension KeyServerApiRequestBuilder { 4 | 5 | /// Builds request to fetch wallet data. 6 | /// - Parameters: 7 | /// - walletId: Wallet id. 8 | /// - Returns: `GetWalletRequest` model. 9 | func buildGetWalletRequest( 10 | walletId: String 11 | ) -> GetWalletRequest { 12 | 13 | let baseUrl = self.apiConfiguration.urlString 14 | let url = baseUrl/walletsPath/walletId 15 | 16 | let request = GetWalletRequest( 17 | url: url, 18 | method: .get 19 | ) 20 | 21 | return request 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Sources/DMS/v3/ApiModels/Generated/DMS/Resources/DMSDocumentTypesResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - DocumentTypesResource 7 | 8 | extension DMS { 9 | open class DocumentTypesResource: Resource { 10 | 11 | open override class var resourceType: String { 12 | return "document_types" 13 | } 14 | 15 | public enum CodingKeys: String, CodingKey { 16 | // attributes 17 | case name 18 | } 19 | 20 | // MARK: Attributes 21 | 22 | open var name: String { 23 | return self.stringOptionalValue(key: CodingKeys.name) ?? "" 24 | } 25 | 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Sources/v1/APIs/TFA/TFACodeMetaModel.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public struct TFACodeMetaModel { 4 | 5 | public let factorId: Int 6 | public let factorType: TFAMetaResponse.CodeBasedType 7 | public let token: String 8 | public let walletId: String 9 | 10 | /// Method transforms `TFAMetaResponse` model to `TFACodeMetaModel` 11 | public static func fromTFAMetaResponse(_ response: TFAMetaResponse) -> TFACodeMetaModel { 12 | return TFACodeMetaModel( 13 | factorId: response.factorId, 14 | factorType: response.codeBasedType, 15 | token: response.token, 16 | walletId: response.walletId 17 | ) 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/APIs/Requests/RequestsRequestFilters.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public enum RequestsRequestFilterOptionV3: FilterOption { 4 | 5 | case requestor(_ accountId: String) // If present, the result will return only requests for specified requestor. 6 | case reviewer(_ accountId: String) // If present, the result will return only requests for specified reviewer. 7 | case state(_ state: Int) // If present, the result will return only requests for specified state. 8 | case type(_ type: Int) // If present, the result will return only requests for specified type. 9 | } 10 | 11 | public class RequestsFiltersV3: RequestFilters {} 12 | -------------------------------------------------------------------------------- /Sources/KeyServer/SystemInfo/SystemInfo.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public struct SystemInfo: Decodable { 4 | 5 | public let networkPassphrase: String 6 | public let currentTime: Int64 7 | public let deviceTimeDate: Date = Date() 8 | 9 | public enum CodingKeys: String, CodingKey { 10 | 11 | case networkPassphrase 12 | case currentTime 13 | } 14 | 15 | public var serverTimeDate: Date { 16 | return Date(timeIntervalSince1970: TimeInterval(self.currentTime)) 17 | } 18 | 19 | public var timeDifference: Int { 20 | let difference = Int(self.serverTimeDate.timeIntervalSince(self.deviceTimeDate)) 21 | return difference 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Sources/ContoFA/v3/ApiModels/Generated/Friends/Resources/FriendsFriendResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - FriendResource 7 | 8 | extension Friends { 9 | open class FriendResource: Resource { 10 | 11 | open override class var resourceType: String { 12 | return "friend-request" 13 | } 14 | 15 | public enum CodingKeys: String, CodingKey { 16 | // relations 17 | case newFriend 18 | } 19 | 20 | // MARK: Relations 21 | 22 | open var newFriend: Resource? { 23 | return self.relationSingleOptionalValue(key: CodingKeys.newFriend) 24 | } 25 | 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Sources/DMS/v3/ApiModels/Generated/DMS/Resources/DMSDocumentStatusesResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - DocumentStatusesResource 7 | 8 | extension DMS { 9 | open class DocumentStatusesResource: Resource { 10 | 11 | open override class var resourceType: String { 12 | return "document_statuses" 13 | } 14 | 15 | public enum CodingKeys: String, CodingKey { 16 | // attributes 17 | case name 18 | } 19 | 20 | // MARK: Attributes 21 | 22 | open var name: String { 23 | return self.stringOptionalValue(key: CodingKeys.name) ?? "" 24 | } 25 | 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Sources/DMS/v3/ApiModels/Generated/DMS/Resources/DMSRolePermissionsResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - RolePermissionsResource 7 | 8 | extension DMS { 9 | open class RolePermissionsResource: Resource { 10 | 11 | open override class var resourceType: String { 12 | return "role_permissions" 13 | } 14 | 15 | public enum CodingKeys: String, CodingKey { 16 | // attributes 17 | case action 18 | } 19 | 20 | // MARK: Attributes 21 | 22 | open var action: String { 23 | return self.stringOptionalValue(key: CodingKeys.action) ?? "" 24 | } 25 | 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Inner/HorizonPollData.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | 5 | // MARK: - PollData 6 | 7 | extension Horizon { 8 | public struct PollData: Decodable { 9 | 10 | public enum CodingKeys: String, CodingKey { 11 | // attributes 12 | case type 13 | } 14 | 15 | // MARK: Attributes 16 | 17 | public let type: Enum 18 | 19 | // MARK: - 20 | 21 | public init(from decoder: Decoder) throws { 22 | let container = try decoder.container(keyedBy: CodingKeys.self) 23 | 24 | self.type = try container.decode(Enum.self, forKey: .type) 25 | } 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/KYC/KYCAllResources.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | extension KYC { 7 | enum AllResources { 8 | 9 | // swiftlint:disable function_body_length 10 | public static func registerAllResources() { 11 | let allResources: [Resource.Type] = [ 12 | KycResource.self 13 | ] 14 | 15 | for res in allResources { 16 | Context.registerClass(res) 17 | } 18 | 19 | for res in ManualResources.resources { 20 | Context.registerClass(res) 21 | } 22 | } 23 | // swiftlint:enable function_body_length 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Sources/KeyServer/GetKDFParams/KeyServerApiRequestBuilder+GetKDFParams.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public extension KeyServerApiRequestBuilder { 4 | 5 | private var kdfPath: String { "kdf" } 6 | 7 | /// Builds request to fetch KDF params from api. 8 | /// - Returns: `GetKDFParamsRequest` model. 9 | func buildGetKDFParamsRequest( 10 | ) -> GetKDFParamsRequest { 11 | 12 | let baseUrl = self.apiConfiguration.urlString 13 | let url = baseUrl/kdfPath 14 | 15 | let request = GetKDFParamsRequest( 16 | url: url, 17 | method: .get, 18 | parametersEncoding: .url 19 | ) 20 | 21 | return request 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Sources/Contopass/v3/ApiModels/Generated/Invitations/Resources/InvitationsInfoResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - InfoResource 7 | 8 | extension Invitations { 9 | open class InfoResource: Resource { 10 | 11 | open override class var resourceType: String { 12 | return "invitations-info" 13 | } 14 | 15 | public enum CodingKeys: String, CodingKey { 16 | // relations 17 | case accountId 18 | } 19 | 20 | // MARK: Relations 21 | 22 | open var accountId: Resource? { 23 | return self.relationSingleOptionalValue(key: CodingKeys.accountId) 24 | } 25 | 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Resources/HorizonAccountKYCResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - AccountKYCResource 7 | 8 | extension Horizon { 9 | open class AccountKYCResource: Resource { 10 | 11 | open override class var resourceType: String { 12 | return "account-kyc" 13 | } 14 | 15 | public enum CodingKeys: String, CodingKey { 16 | // attributes 17 | case kycData 18 | } 19 | 20 | // MARK: Attributes 21 | 22 | open var kycData: [String: Any] { 23 | return self.dictionaryOptionalValue(key: CodingKeys.kycData) ?? [:] 24 | } 25 | 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Sources/Alamofire/v1/AlamofireDataRequest+Extensions.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import Alamofire 3 | 4 | extension DataRequest { 5 | /// @Returns - DataRequest 6 | /// completionHandler handles JSON Object T 7 | /// - Returns: `DataRequest` 8 | @discardableResult func responseObject ( 9 | queue: DispatchQueue? = nil, 10 | _ type: T.Type, 11 | completionHandler: @escaping (DataResponse) -> Void 12 | ) -> Self { 13 | 14 | return responseDecodable( 15 | of: type, 16 | queue: queue ?? .main, 17 | decoder: JSONCoders.snakeCaseDecoder, 18 | completionHandler: completionHandler 19 | ) 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Inner/HorizonRemoveVoteOp.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | 5 | // MARK: - RemoveVoteOp 6 | 7 | extension Horizon { 8 | public struct RemoveVoteOp: Decodable { 9 | 10 | public enum CodingKeys: String, CodingKey { 11 | // attributes 12 | case pollId 13 | } 14 | 15 | // MARK: Attributes 16 | 17 | public let pollId: Int64 18 | 19 | // MARK: - 20 | 21 | public init(from decoder: Decoder) throws { 22 | let container = try decoder.container(keyedBy: CodingKeys.self) 23 | 24 | self.pollId = try container.decode(Int64.self, forKey: .pollId) 25 | } 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Sources/Contopass/v3/ApiModels/Generated/Invitations/Resources/InvitationsReceptionResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - ReceptionResource 7 | 8 | extension Invitations { 9 | open class ReceptionResource: Resource { 10 | 11 | open override class var resourceType: String { 12 | return "receptions" 13 | } 14 | 15 | public enum CodingKeys: String, CodingKey { 16 | // relations 17 | case receptionist 18 | } 19 | 20 | // MARK: Relations 21 | 22 | open var receptionist: Resource? { 23 | return self.relationSingleOptionalValue(key: CodingKeys.receptionist) 24 | } 25 | 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Resources/HorizonKeyValueEntryResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - KeyValueEntryResource 7 | 8 | extension Horizon { 9 | open class KeyValueEntryResource: Resource { 10 | 11 | open override class var resourceType: String { 12 | return "key-value-entries" 13 | } 14 | 15 | public enum CodingKeys: String, CodingKey { 16 | // attributes 17 | case value 18 | } 19 | 20 | // MARK: Attributes 21 | 22 | open var value: Horizon.KeyValueEntryValue? { 23 | return self.codableOptionalValue(key: CodingKeys.value) 24 | } 25 | 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Sources/ContoFA/v3/ApiModels/Manual/PublicCardListTempView.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | // MARK: - PublicCardListTempView 4 | 5 | struct PublicCardListTempView: Encodable { 6 | 7 | let data: Data 8 | } 9 | 10 | extension PublicCardListTempView { 11 | 12 | struct Data: Encodable { 13 | 14 | let type: String = "public-card-list-temp-view" 15 | let relationships: Relationships 16 | } 17 | } 18 | 19 | extension PublicCardListTempView.Data { 20 | 21 | struct Relationships: Encodable { 22 | 23 | let owners: Owner 24 | } 25 | } 26 | 27 | extension PublicCardListTempView.Data.Relationships { 28 | 29 | struct Owner: Encodable { 30 | 31 | let data: [AccountsResource] 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Sources/MUNA/v3/ApiModels/Generated/MunaTutorials/MunaTutorialsAllResources.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | extension MunaTutorials { 7 | enum AllResources { 8 | 9 | // swiftlint:disable function_body_length 10 | public static func registerAllResources() { 11 | let allResources: [Resource.Type] = [ 12 | VideoResource.self 13 | ] 14 | 15 | for res in allResources { 16 | Context.registerClass(res) 17 | } 18 | 19 | for res in ManualResources.resources { 20 | Context.registerClass(res) 21 | } 22 | } 23 | // swiftlint:enable function_body_length 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Sources/ContoFA/v3/ApiModels/Generated/Cards/Resources/CardsCardSecurityDetailsResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - CardSecurityDetailsResource 7 | 8 | extension Cards { 9 | open class CardSecurityDetailsResource: Resource { 10 | 11 | open override class var resourceType: String { 12 | return "cards-security-details" 13 | } 14 | 15 | public enum CodingKeys: String, CodingKey { 16 | // relations 17 | case card 18 | } 19 | 20 | // MARK: Relations 21 | 22 | open var card: Cards.CardResource? { 23 | return self.relationSingleOptionalValue(key: CodingKeys.card) 24 | } 25 | 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Resources/HorizonPollParticipationResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - PollParticipationResource 7 | 8 | extension Horizon { 9 | open class PollParticipationResource: Resource { 10 | 11 | open override class var resourceType: String { 12 | return "poll-outcome" 13 | } 14 | 15 | public enum CodingKeys: String, CodingKey { 16 | // relations 17 | case votes 18 | } 19 | 20 | // MARK: Relations 21 | 22 | open var votes: [Horizon.VoteResource]? { 23 | return self.relationCollectionOptionalValue(key: CodingKeys.votes) 24 | } 25 | 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Resources/HorizonSaleWhitelistResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - SaleWhitelistResource 7 | 8 | extension Horizon { 9 | open class SaleWhitelistResource: Resource { 10 | 11 | open override class var resourceType: String { 12 | return "sale-whitelist" 13 | } 14 | 15 | public enum CodingKeys: String, CodingKey { 16 | // relations 17 | case participant 18 | } 19 | 20 | // MARK: Relations 21 | 22 | open var participant: Horizon.AccountResource? { 23 | return self.relationSingleOptionalValue(key: CodingKeys.participant) 24 | } 25 | 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Resources/HorizonPublicKeyEntryResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - PublicKeyEntryResource 7 | 8 | extension Horizon { 9 | open class PublicKeyEntryResource: Resource { 10 | 11 | open override class var resourceType: String { 12 | return "public-key-entries" 13 | } 14 | 15 | public enum CodingKeys: String, CodingKey { 16 | // relations 17 | case accounts 18 | } 19 | 20 | // MARK: Relations 21 | 22 | open var accounts: [Horizon.AccountResource]? { 23 | return self.relationCollectionOptionalValue(key: CodingKeys.accounts) 24 | } 25 | 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Sources/ContoFA/v3/ApiModels/Generated/Cards/Resources/CardsPublicCardListTempViewResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - PublicCardListTempViewResource 7 | 8 | extension Cards { 9 | open class PublicCardListTempViewResource: Resource { 10 | 11 | open override class var resourceType: String { 12 | return "public-card-list-temp-view" 13 | } 14 | 15 | public enum CodingKeys: String, CodingKey { 16 | // relations 17 | case owners 18 | } 19 | 20 | // MARK: Relations 21 | 22 | open var owners: [Resource]? { 23 | return self.relationCollectionOptionalValue(key: CodingKeys.owners) 24 | } 25 | 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Sources/ContoFA/v3/ApiModels/Generated/Friends/Resources/FriendsBatchCreateUsersResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - BatchCreateUsersResource 7 | 8 | extension Friends { 9 | open class BatchCreateUsersResource: Resource { 10 | 11 | open override class var resourceType: String { 12 | return "batch-create-users-request" 13 | } 14 | 15 | public enum CodingKeys: String, CodingKey { 16 | // relations 17 | case identities 18 | } 19 | 20 | // MARK: Relations 21 | 22 | open var identities: [Resource]? { 23 | return self.relationCollectionOptionalValue(key: CodingKeys.identities) 24 | } 25 | 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Resources/HorizonRemoveAssetOpResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - RemoveAssetOpResource 7 | 8 | extension Horizon { 9 | open class RemoveAssetOpResource: BaseOperationDetailsResource { 10 | 11 | open override class var resourceType: String { 12 | return "operations-remove-asset" 13 | } 14 | 15 | public enum CodingKeys: String, CodingKey { 16 | // relations 17 | case asset 18 | } 19 | 20 | // MARK: Relations 21 | 22 | open var asset: Horizon.AssetResource? { 23 | return self.relationSingleOptionalValue(key: CodingKeys.asset) 24 | } 25 | 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Resources/schema/inner.yaml: -------------------------------------------------------------------------------- 1 | definitions: 2 | attribute: 3 | type: object 4 | properties: 5 | type: {type: string} 6 | name: {type: string} 7 | description: {type: string} 8 | json_name: {type: string} 9 | optional: {type: boolean, default: false} 10 | is_collection: {type: boolean, default: false} 11 | required: 12 | - type 13 | - name 14 | 15 | description: Inner object included in the resource. 16 | type: object 17 | properties: 18 | name: 19 | type: string 20 | pattern: '^[A-Z].*' 21 | description: 22 | type: string 23 | attributes: 24 | type: array 25 | items: 26 | $ref: '#/definitions/attribute' 27 | required: 28 | - name 29 | - attributes 30 | additionalProperties: false -------------------------------------------------------------------------------- /Sources/ContoFA/v3/ApiModels/Generated/Invoices/InvoicesAllResources.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | extension Invoices { 7 | enum AllResources { 8 | 9 | // swiftlint:disable function_body_length 10 | public static func registerAllResources() { 11 | let allResources: [Resource.Type] = [ 12 | DataResource.self, 13 | InvoiceResource.self 14 | ] 15 | 16 | for res in allResources { 17 | Context.registerClass(res) 18 | } 19 | 20 | for res in ManualResources.resources { 21 | Context.registerClass(res) 22 | } 23 | } 24 | // swiftlint:enable function_body_length 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Inner/HorizonManageLimitsRemovalOp.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | 5 | // MARK: - ManageLimitsRemovalOp 6 | 7 | extension Horizon { 8 | public struct ManageLimitsRemovalOp: Decodable { 9 | 10 | public enum CodingKeys: String, CodingKey { 11 | // attributes 12 | case limitsId 13 | } 14 | 15 | // MARK: Attributes 16 | 17 | public let limitsId: Int64 18 | 19 | // MARK: - 20 | 21 | public init(from decoder: Decoder) throws { 22 | let container = try decoder.container(keyedBy: CodingKeys.self) 23 | 24 | self.limitsId = try container.decode(Int64.self, forKey: .limitsId) 25 | } 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Inner/HorizonUpdatePollEndTimeOp.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | 5 | // MARK: - UpdatePollEndTimeOp 6 | 7 | extension Horizon { 8 | public struct UpdatePollEndTimeOp: Decodable { 9 | 10 | public enum CodingKeys: String, CodingKey { 11 | // attributes 12 | case newEndTime 13 | } 14 | 15 | // MARK: Attributes 16 | 17 | public let newEndTime: Date 18 | 19 | // MARK: - 20 | 21 | public init(from decoder: Decoder) throws { 22 | let container = try decoder.container(keyedBy: CodingKeys.self) 23 | 24 | self.newEndTime = try container.decodeDateString(key: .newEndTime) 25 | } 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Inner/HorizonRemoveExternalSystemPoolOp.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | 5 | // MARK: - RemoveExternalSystemPoolOp 6 | 7 | extension Horizon { 8 | public struct RemoveExternalSystemPoolOp: Decodable { 9 | 10 | public enum CodingKeys: String, CodingKey { 11 | // attributes 12 | case poolId 13 | } 14 | 15 | // MARK: Attributes 16 | 17 | public let poolId: UInt64 18 | 19 | // MARK: - 20 | 21 | public init(from decoder: Decoder) throws { 22 | let container = try decoder.container(keyedBy: CodingKeys.self) 23 | 24 | self.poolId = try container.decode(UInt64.self, forKey: .poolId) 25 | } 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Sources/Common/ApiModels/ApiConfiguration.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | /// Struct containts data which identify api 4 | public struct ApiConfiguration { 5 | 6 | /// API's URL. Trailing slash will be trimmed. 7 | public let urlString: String 8 | 9 | /// User network agent name. 10 | public let userAgent: String? 11 | 12 | // MARK: - 13 | 14 | public init( 15 | urlString: String, 16 | userAgent: String? = nil 17 | ) { 18 | 19 | self.urlString = urlString 20 | self.userAgent = userAgent 21 | } 22 | } 23 | 24 | /// Protocol provides up to date `ApiConfiguration` model 25 | public protocol ApiConfigurationProviderProtocol { 26 | 27 | var apiConfiguration: ApiConfiguration { get } 28 | } 29 | -------------------------------------------------------------------------------- /Sources/KeyServer/DefaultSignerRole/KeyServerApiRequestBuilder+DefaultSignerRole.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public extension KeyServerApiRequestBuilder { 4 | 5 | private var keyValue: String { "key_value" } 6 | private var signerRoleDefault: String { "signer_role:default" } 7 | 8 | /// Builds request to fetch default signer role id. 9 | /// - Returns: `SystemInfoRequest` model. 10 | func buildDefaultSignerRoleIdRequest( 11 | ) -> DefaultSignerRoleIdRequest { 12 | 13 | let baseUrl = self.apiConfiguration.urlString 14 | let url = baseUrl/keyValue/signerRoleDefault 15 | 16 | let request = DefaultSignerRoleIdRequest( 17 | url: url, 18 | method: .get 19 | ) 20 | 21 | return request 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Sources/v1/APIs/Charts/ChartsResponse.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public typealias ChartsResponse = [String: [ChartResponse]] 4 | 5 | public struct ChartResponse: Decodable { 6 | 7 | public let timestamp: Date 8 | public let value: Decimal 9 | 10 | enum CodingKeys: String, CodingKey { 11 | case timestamp 12 | case value 13 | } 14 | 15 | public init(from decoder: Decoder) throws { 16 | let container = try decoder.container(keyedBy: CodingKeys.self) 17 | 18 | self.timestamp = try container.decodeDateString( 19 | key: .timestamp, 20 | dateFormatter: DateFormatters.rfc3339DateFormatter 21 | ) 22 | self.value = try container.decodeDecimalString(key: .value) 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Resources/HorizonCancelAtomicSwapAskOpResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - CancelAtomicSwapAskOpResource 7 | 8 | extension Horizon { 9 | open class CancelAtomicSwapAskOpResource: BaseOperationDetailsResource { 10 | 11 | open override class var resourceType: String { 12 | return "operations-cancel-atomic-swap-ask" 13 | } 14 | 15 | public enum CodingKeys: String, CodingKey { 16 | // relations 17 | case ask 18 | } 19 | 20 | // MARK: Relations 21 | 22 | open var ask: Horizon.AtomicSwapAskResource? { 23 | return self.relationSingleOptionalValue(key: CodingKeys.ask) 24 | } 25 | 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Manual/ManyUsersRequest.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | // MARK: - ManyUsersRequest 4 | 5 | struct ManyUsersRequest: Encodable { 6 | 7 | let data: Data 8 | } 9 | 10 | extension ManyUsersRequest { 11 | 12 | struct Data: Encodable { 13 | 14 | let relationships: Relationships 15 | } 16 | } 17 | 18 | extension ManyUsersRequest.Data { 19 | 20 | struct Relationships: Encodable { 21 | 22 | let users: Users 23 | } 24 | } 25 | 26 | extension ManyUsersRequest.Data.Relationships { 27 | 28 | struct Users: Encodable { 29 | 30 | let data: [Data] 31 | } 32 | } 33 | 34 | extension ManyUsersRequest.Data.Relationships.Users { 35 | 36 | struct Data: Encodable { 37 | 38 | let id: String 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Sources/MUNA/v3/ApiModels/Generated/MunaVaccineResults/MunaVaccineResultsAllResources.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | extension MunaVaccineResults { 7 | enum AllResources { 8 | 9 | // swiftlint:disable function_body_length 10 | public static func registerAllResources() { 11 | let allResources: [Resource.Type] = [ 12 | VaccineResource.self, 13 | VaccineTypeResource.self 14 | ] 15 | 16 | for res in allResources { 17 | Context.registerClass(res) 18 | } 19 | 20 | for res in ManualResources.resources { 21 | Context.registerClass(res) 22 | } 23 | } 24 | // swiftlint:enable function_body_length 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Sources/MUNA/v3/ApiModels/Generated/MunaBooking/MunaBookingAllResources.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | extension MunaBooking { 7 | enum AllResources { 8 | 9 | // swiftlint:disable function_body_length 10 | public static func registerAllResources() { 11 | let allResources: [Resource.Type] = [ 12 | BusinessResource.self, 13 | EventResource.self, 14 | BookingResource.self 15 | ] 16 | 17 | for res in allResources { 18 | Context.registerClass(res) 19 | } 20 | 21 | for res in ManualResources.resources { 22 | Context.registerClass(res) 23 | } 24 | } 25 | // swiftlint:enable function_body_length 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Resources/HorizonUpdateLimitsRequestResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - UpdateLimitsRequestResource 7 | 8 | extension Horizon { 9 | open class UpdateLimitsRequestResource: BaseReviewableRequestDetailsResource { 10 | 11 | open override class var resourceType: String { 12 | return "request-details-limits-update" 13 | } 14 | 15 | public enum CodingKeys: String, CodingKey { 16 | // attributes 17 | case creatorDetails 18 | } 19 | 20 | // MARK: Attributes 21 | 22 | open var creatorDetails: [String: Any] { 23 | return self.dictionaryOptionalValue(key: CodingKeys.creatorDetails) ?? [:] 24 | } 25 | 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Sources/Common/RequestSign/RequestSignAccountIdProvider.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import DLCryptoKit 3 | import TokenDWallet 4 | 5 | public protocol RequestSignAccountIdProviderProtocol { 6 | 7 | func getAccountId(completion: @escaping (_ accountId: String?) -> Void) 8 | } 9 | 10 | public class UnsafeRequestSignAccountIdProvider: RequestSignAccountIdProviderProtocol { 11 | 12 | // MARK: - Private properties 13 | 14 | private let accountId: String 15 | 16 | // MARK: - 17 | 18 | public init(accountId: String) { 19 | self.accountId = accountId 20 | } 21 | 22 | // MARK: - RequestSignAccountIdProviderProtocol 23 | 24 | public func getAccountId(completion: @escaping (String?) -> Void) { 25 | completion(self.accountId) 26 | } 27 | } 28 | 29 | -------------------------------------------------------------------------------- /Sources/v1/APIs/Documents/DocumentUploadOption.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | /// Option to upload document. 4 | public enum DocumentUploadOption { 5 | 6 | /// Option to attach data from memory. 7 | case data(data: Data, meta: MetaInfo) 8 | 9 | /// Option to provide data stream. 10 | case stream(stream: InputStream, length: UInt64, meta: MetaInfo) 11 | } 12 | 13 | extension DocumentUploadOption { 14 | 15 | public struct MetaInfo { 16 | 17 | public let fileName: String 18 | public let mimeType: String 19 | 20 | public init( 21 | fileName: String, 22 | mimeType: String 23 | ) { 24 | 25 | self.fileName = fileName 26 | self.mimeType = mimeType 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Sources/ContoFA/v3/ApiModels/Generated/Cards/Inner/CardsEnum.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | 5 | // MARK: - Enum 6 | 7 | extension Cards { 8 | public struct Enum: Decodable { 9 | 10 | public enum CodingKeys: String, CodingKey { 11 | // attributes 12 | case name 13 | case value 14 | } 15 | 16 | // MARK: Attributes 17 | 18 | public let name: String 19 | public let value: Int32 20 | 21 | // MARK: - 22 | 23 | public init(from decoder: Decoder) throws { 24 | let container = try decoder.container(keyedBy: CodingKeys.self) 25 | 26 | self.name = try container.decode(String.self, forKey: .name) 27 | self.value = try container.decode(Int32.self, forKey: .value) 28 | } 29 | 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Resources/HorizonCancelDataRemoveRequestOpResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - CancelDataRemoveRequestOpResource 7 | 8 | extension Horizon { 9 | open class CancelDataRemoveRequestOpResource: BaseOperationDetailsResource { 10 | 11 | open override class var resourceType: String { 12 | return "operations-cancel-data-remove-request" 13 | } 14 | 15 | public enum CodingKeys: String, CodingKey { 16 | // relations 17 | case request 18 | } 19 | 20 | // MARK: Relations 21 | 22 | open var request: Horizon.ReviewableRequestResource? { 23 | return self.relationSingleOptionalValue(key: CodingKeys.request) 24 | } 25 | 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Resources/HorizonCancelDataUpdateRequestOpResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - CancelDataUpdateRequestOpResource 7 | 8 | extension Horizon { 9 | open class CancelDataUpdateRequestOpResource: BaseOperationDetailsResource { 10 | 11 | open override class var resourceType: String { 12 | return "operations-cancel-data-update-request" 13 | } 14 | 15 | public enum CodingKeys: String, CodingKey { 16 | // relations 17 | case request 18 | } 19 | 20 | // MARK: Relations 21 | 22 | open var request: Horizon.ReviewableRequestResource? { 23 | return self.relationSingleOptionalValue(key: CodingKeys.request) 24 | } 25 | 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Sources/ContoFA/v3/ApiModels/Generated/Invoices/Inner/InvoicesEnum.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | 5 | // MARK: - Enum 6 | 7 | extension Invoices { 8 | public struct Enum: Decodable { 9 | 10 | public enum CodingKeys: String, CodingKey { 11 | // attributes 12 | case name 13 | case value 14 | } 15 | 16 | // MARK: Attributes 17 | 18 | public let name: String 19 | public let value: Int32 20 | 21 | // MARK: - 22 | 23 | public init(from decoder: Decoder) throws { 24 | let container = try decoder.container(keyedBy: CodingKeys.self) 25 | 26 | self.name = try container.decode(String.self, forKey: .name) 27 | self.value = try container.decode(Int32.self, forKey: .value) 28 | } 29 | 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Inner/HorizonEnum.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | 5 | // MARK: - Enum 6 | 7 | extension Horizon { 8 | public struct Enum: Decodable { 9 | 10 | public enum CodingKeys: String, CodingKey { 11 | // attributes 12 | case name 13 | case value 14 | } 15 | 16 | // MARK: Attributes 17 | 18 | public let name: String 19 | public let value: Int32 20 | 21 | // MARK: - 22 | 23 | public init(from decoder: Decoder) throws { 24 | let container = try decoder.container(keyedBy: CodingKeys.self) 25 | 26 | self.name = try container.decode(String.self, forKey: .name) 27 | self.value = try container.decode(Int32.self, forKey: .value) 28 | } 29 | 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Resources/HorizonCancelDataCreationRequestOpResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - CancelDataCreationRequestOpResource 7 | 8 | extension Horizon { 9 | open class CancelDataCreationRequestOpResource: BaseOperationDetailsResource { 10 | 11 | open override class var resourceType: String { 12 | return "operations-cancel-data-creation-request" 13 | } 14 | 15 | public enum CodingKeys: String, CodingKey { 16 | // relations 17 | case request 18 | } 19 | 20 | // MARK: Relations 21 | 22 | open var request: Horizon.ReviewableRequestResource? { 23 | return self.relationSingleOptionalValue(key: CodingKeys.request) 24 | } 25 | 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Inner/HorizonMask.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | 5 | // MARK: - Mask 6 | 7 | extension Horizon { 8 | public struct Mask: Decodable { 9 | 10 | public enum CodingKeys: String, CodingKey { 11 | // attributes 12 | case flags 13 | case value 14 | } 15 | 16 | // MARK: Attributes 17 | 18 | public let flags: [Enum]? 19 | public let value: Int32? 20 | 21 | // MARK: - 22 | 23 | public init(from decoder: Decoder) throws { 24 | let container = try decoder.container(keyedBy: CodingKeys.self) 25 | 26 | self.flags = try? container.decode([Enum].self, forKey: .flags) 27 | self.value = try? container.decode(Int32.self, forKey: .value) 28 | } 29 | 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Sources/ContoFA/v3/ApiModels/Generated/Recpayments/Inner/RecpaymentsEnum.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | 5 | // MARK: - Enum 6 | 7 | extension Recpayments { 8 | public struct Enum: Decodable { 9 | 10 | public enum CodingKeys: String, CodingKey { 11 | // attributes 12 | case name 13 | case value 14 | } 15 | 16 | // MARK: Attributes 17 | 18 | public let name: String 19 | public let value: Int32 20 | 21 | // MARK: - 22 | 23 | public init(from decoder: Decoder) throws { 24 | let container = try decoder.container(keyedBy: CodingKeys.self) 25 | 26 | self.name = try container.decode(String.self, forKey: .name) 27 | self.value = try container.decode(Int32.self, forKey: .value) 28 | } 29 | 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Resources/HorizonBindExternalSystemAccountIdOpResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - BindExternalSystemAccountIdOpResource 7 | 8 | extension Horizon { 9 | open class BindExternalSystemAccountIdOpResource: BaseOperationDetailsResource { 10 | 11 | open override class var resourceType: String { 12 | return "operations-bind-external-system-account-id" 13 | } 14 | 15 | public enum CodingKeys: String, CodingKey { 16 | // attributes 17 | case externalSystemType 18 | } 19 | 20 | // MARK: Attributes 21 | 22 | open var externalSystemType: Int32 { 23 | return self.int32OptionalValue(key: CodingKeys.externalSystemType) ?? 0 24 | } 25 | 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Sources/MUNA/v3/ApiModels/Generated/MunaBooking/Inner/MunaBookingEnum.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | 5 | // MARK: - Enum 6 | 7 | extension MunaBooking { 8 | public struct Enum: Decodable { 9 | 10 | public enum CodingKeys: String, CodingKey { 11 | // attributes 12 | case name 13 | case value 14 | } 15 | 16 | // MARK: Attributes 17 | 18 | public let name: String 19 | public let value: Int32 20 | 21 | // MARK: - 22 | 23 | public init(from decoder: Decoder) throws { 24 | let container = try decoder.container(keyedBy: CodingKeys.self) 25 | 26 | self.name = try container.decode(String.self, forKey: .name) 27 | self.value = try container.decode(Int32.self, forKey: .value) 28 | } 29 | 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Sources/Contopass/v3/ApiModels/Generated/Invitations/Inner/InvitationsEnum.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | 5 | // MARK: - Enum 6 | 7 | extension Invitations { 8 | public struct Enum: Decodable { 9 | 10 | public enum CodingKeys: String, CodingKey { 11 | // attributes 12 | case name 13 | case value 14 | } 15 | 16 | // MARK: Attributes 17 | 18 | public let name: String 19 | public let value: Int32 20 | 21 | // MARK: - 22 | 23 | public init(from decoder: Decoder) throws { 24 | let container = try decoder.container(keyedBy: CodingKeys.self) 25 | 26 | self.name = try container.decode(String.self, forKey: .name) 27 | self.value = try container.decode(Int32.self, forKey: .value) 28 | } 29 | 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Sources/MUNA/v3/ApiModels/Generated/MunaBooking/Inner/MunaBookingWorkHours.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | 5 | // MARK: - WorkHours 6 | 7 | extension MunaBooking { 8 | public struct WorkHours: Decodable { 9 | 10 | public enum CodingKeys: String, CodingKey { 11 | // attributes 12 | case end 13 | case start 14 | } 15 | 16 | // MARK: Attributes 17 | 18 | public let end: Time 19 | public let start: Time 20 | 21 | // MARK: - 22 | 23 | public init(from decoder: Decoder) throws { 24 | let container = try decoder.container(keyedBy: CodingKeys.self) 25 | 26 | self.end = try container.decode(Time.self, forKey: .end) 27 | self.start = try container.decode(Time.self, forKey: .start) 28 | } 29 | 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Sources/Contopass/v3/ApiModels/Generated/Invitations/InvitationsAllResources.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | extension Invitations { 7 | enum AllResources { 8 | 9 | // swiftlint:disable function_body_length 10 | public static func registerAllResources() { 11 | let allResources: [Resource.Type] = [ 12 | EventResource.self, 13 | InfoResource.self, 14 | ReceptionResource.self, 15 | InvitationResource.self 16 | ] 17 | 18 | for res in allResources { 19 | Context.registerClass(res) 20 | } 21 | 22 | for res in ManualResources.resources { 23 | Context.registerClass(res) 24 | } 25 | } 26 | // swiftlint:enable function_body_length 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Sources/MUNA/v3/ApiModels/Generated/MunaBooking/Inner/MunaBookingTime.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | 5 | // MARK: - Time 6 | 7 | extension MunaBooking { 8 | public struct Time: Decodable { 9 | 10 | public enum CodingKeys: String, CodingKey { 11 | // attributes 12 | case hours 13 | case minutes 14 | } 15 | 16 | // MARK: Attributes 17 | 18 | public let hours: Int32 19 | public let minutes: Int32 20 | 21 | // MARK: - 22 | 23 | public init(from decoder: Decoder) throws { 24 | let container = try decoder.container(keyedBy: CodingKeys.self) 25 | 26 | self.hours = try container.decode(Int32.self, forKey: .hours) 27 | self.minutes = try container.decode(Int32.self, forKey: .minutes) 28 | } 29 | 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Sources/MUNA/v3/ApiModels/Generated/MunaScheduler/Inner/MunaSchedulerQualifiedWeekday.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | 5 | // MARK: - QualifiedWeekday 6 | 7 | extension MunaScheduler { 8 | public struct QualifiedWeekday: Decodable { 9 | 10 | public enum CodingKeys: String, CodingKey { 11 | // attributes 12 | case n 13 | case wd 14 | } 15 | 16 | // MARK: Attributes 17 | 18 | public let n: Int32 19 | public let wd: Int32 20 | 21 | // MARK: - 22 | 23 | public init(from decoder: Decoder) throws { 24 | let container = try decoder.container(keyedBy: CodingKeys.self) 25 | 26 | self.n = try container.decode(Int32.self, forKey: .n) 27 | self.wd = try container.decode(Int32.self, forKey: .wd) 28 | } 29 | 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Sources/MUNA/v3/ApiModels/Generated/MunaScheduler/MunaSchedulerAllResources.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | extension MunaScheduler { 7 | enum AllResources { 8 | 9 | // swiftlint:disable function_body_length 10 | public static func registerAllResources() { 11 | let allResources: [Resource.Type] = [ 12 | EventResource.self, 13 | EventRecurrenceResource.self, 14 | FreeBusyResource.self, 15 | CalendarResource.self 16 | ] 17 | 18 | for res in allResources { 19 | Context.registerClass(res) 20 | } 21 | 22 | for res in ManualResources.resources { 23 | Context.registerClass(res) 24 | } 25 | } 26 | // swiftlint:enable function_body_length 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Example/Tests/TokenDSDK_Tests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /Sources/ContoFA/v3/ApiModels/Generated/Cards/Resources/CardsCardBalanceResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - CardBalanceResource 7 | 8 | extension Cards { 9 | open class CardBalanceResource: Resource { 10 | 11 | open override class var resourceType: String { 12 | return "card-balance" 13 | } 14 | 15 | public enum CodingKeys: String, CodingKey { 16 | // relations 17 | case asset 18 | case card 19 | } 20 | 21 | // MARK: Relations 22 | 23 | open var asset: Resource? { 24 | return self.relationSingleOptionalValue(key: CodingKeys.asset) 25 | } 26 | 27 | open var card: Cards.CardResource? { 28 | return self.relationSingleOptionalValue(key: CodingKeys.card) 29 | } 30 | 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Resources/HorizonCancelCloseDeferredPaymentRequestOpResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - CancelCloseDeferredPaymentRequestOpResource 7 | 8 | extension Horizon { 9 | open class CancelCloseDeferredPaymentRequestOpResource: BaseOperationDetailsResource { 10 | 11 | open override class var resourceType: String { 12 | return "operations-cancel-close-deferred-payment-request" 13 | } 14 | 15 | public enum CodingKeys: String, CodingKey { 16 | // relations 17 | case request 18 | } 19 | 20 | // MARK: Relations 21 | 22 | open var request: Horizon.ReviewableRequestResource? { 23 | return self.relationSingleOptionalValue(key: CodingKeys.request) 24 | } 25 | 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Sources/MUNA/v3/ApiModels/Generated/MunaBooking/Inner/MunaBookingPriceDetails.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | 5 | // MARK: - PriceDetails 6 | 7 | extension MunaBooking { 8 | public struct PriceDetails: Decodable { 9 | 10 | public enum CodingKeys: String, CodingKey { 11 | // attributes 12 | case amount 13 | case asset 14 | } 15 | 16 | // MARK: Attributes 17 | 18 | public let amount: Decimal 19 | public let asset: String 20 | 21 | // MARK: - 22 | 23 | public init(from decoder: Decoder) throws { 24 | let container = try decoder.container(keyedBy: CodingKeys.self) 25 | 26 | self.amount = try container.decodeDecimalString(key: .amount) 27 | self.asset = try container.decode(String.self, forKey: .asset) 28 | } 29 | 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Sources/MUNA/v3/ApiModels/Generated/MunaTestResults/MunaTestResultsAllResources.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | extension MunaTestResults { 7 | enum AllResources { 8 | 9 | // swiftlint:disable function_body_length 10 | public static func registerAllResources() { 11 | let allResources: [Resource.Type] = [ 12 | TestResource.self, 13 | TestTypeResource.self, 14 | AccountTestTypeResource.self, 15 | VerificationResource.self 16 | ] 17 | 18 | for res in allResources { 19 | Context.registerClass(res) 20 | } 21 | 22 | for res in ManualResources.resources { 23 | Context.registerClass(res) 24 | } 25 | } 26 | // swiftlint:enable function_body_length 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Inner/HorizonCreateVoteOp.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | 5 | // MARK: - CreateVoteOp 6 | 7 | extension Horizon { 8 | public struct CreateVoteOp: Decodable { 9 | 10 | public enum CodingKeys: String, CodingKey { 11 | // attributes 12 | case pollId 13 | case voteData 14 | } 15 | 16 | // MARK: Attributes 17 | 18 | public let pollId: Int64 19 | public let voteData: VoteData 20 | 21 | // MARK: - 22 | 23 | public init(from decoder: Decoder) throws { 24 | let container = try decoder.container(keyedBy: CodingKeys.self) 25 | 26 | self.pollId = try container.decode(Int64.self, forKey: .pollId) 27 | self.voteData = try container.decode(VoteData.self, forKey: .voteData) 28 | } 29 | 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Inner/HorizonFee.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | 5 | // MARK: - Fee 6 | 7 | extension Horizon { 8 | public struct Fee: Decodable { 9 | 10 | public enum CodingKeys: String, CodingKey { 11 | // attributes 12 | case calculatedPercent 13 | case fixed 14 | } 15 | 16 | // MARK: Attributes 17 | 18 | public let calculatedPercent: Decimal 19 | public let fixed: Decimal 20 | 21 | // MARK: - 22 | 23 | public init(from decoder: Decoder) throws { 24 | let container = try decoder.container(keyedBy: CodingKeys.self) 25 | 26 | self.calculatedPercent = try container.decodeDecimalString(key: .calculatedPercent) 27 | self.fixed = try container.decodeDecimalString(key: .fixed) 28 | } 29 | 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Resources/HorizonCancelDeferredPaymentCreationRequestOpResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - CancelDeferredPaymentCreationRequestOpResource 7 | 8 | extension Horizon { 9 | open class CancelDeferredPaymentCreationRequestOpResource: BaseOperationDetailsResource { 10 | 11 | open override class var resourceType: String { 12 | return "operations-cancel-deferred-payment-creation-request" 13 | } 14 | 15 | public enum CodingKeys: String, CodingKey { 16 | // relations 17 | case request 18 | } 19 | 20 | // MARK: Relations 21 | 22 | open var request: Horizon.ReviewableRequestResource? { 23 | return self.relationSingleOptionalValue(key: CodingKeys.request) 24 | } 25 | 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Resources/HorizonBalanceStateResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - BalanceStateResource 7 | 8 | extension Horizon { 9 | open class BalanceStateResource: Resource { 10 | 11 | open override class var resourceType: String { 12 | return "balances-state" 13 | } 14 | 15 | public enum CodingKeys: String, CodingKey { 16 | // attributes 17 | case available 18 | case locked 19 | } 20 | 21 | // MARK: Attributes 22 | 23 | open var available: Decimal { 24 | return self.decimalOptionalValue(key: CodingKeys.available) ?? 0.0 25 | } 26 | 27 | open var locked: Decimal { 28 | return self.decimalOptionalValue(key: CodingKeys.locked) ?? 0.0 29 | } 30 | 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Sources/Common/Formatters/DateFormatters.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | /// Collection of date formatters used to parse dates in api responses. 4 | public enum DateFormatters { 5 | 6 | /// ISO 8601 date formatter 7 | static public private(set) var iso8601DateFormatter: DateFormatter = { 8 | let dateFormatter = DateFormatter() 9 | dateFormatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss'Z'" 10 | dateFormatter.timeZone = TimeZone(abbreviation: "UTC") 11 | return dateFormatter 12 | }() 13 | 14 | /// RFC 3339 date formatter 15 | static public private(set) var rfc3339DateFormatter: DateFormatter = { 16 | let dateFormatter = DateFormatter() 17 | dateFormatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'" 18 | dateFormatter.timeZone = TimeZone(abbreviation: "UTC") 19 | return dateFormatter 20 | }() 21 | } 22 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Inner/HorizonVoteData.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | 5 | // MARK: - VoteData 6 | 7 | extension Horizon { 8 | public struct VoteData: Decodable { 9 | 10 | public enum CodingKeys: String, CodingKey { 11 | // attributes 12 | case pollType 13 | case singleChoice 14 | } 15 | 16 | // MARK: Attributes 17 | 18 | public let pollType: Enum 19 | public let singleChoice: UInt64? 20 | 21 | // MARK: - 22 | 23 | public init(from decoder: Decoder) throws { 24 | let container = try decoder.container(keyedBy: CodingKeys.self) 25 | 26 | self.pollType = try container.decode(Enum.self, forKey: .pollType) 27 | self.singleChoice = try? container.decode(UInt64.self, forKey: .singleChoice) 28 | } 29 | 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Sources/ContoFA/v3/ApiModels/Generated/Friends/FriendsAllResources.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | extension Friends { 7 | enum AllResources { 8 | 9 | // swiftlint:disable function_body_length 10 | public static func registerAllResources() { 11 | let allResources: [Resource.Type] = [ 12 | RecentPaymentResource.self, 13 | RecordPaymentResource.self, 14 | BatchCreateUsersResource.self, 15 | UserResource.self, 16 | FriendResource.self 17 | ] 18 | 19 | for res in allResources { 20 | Context.registerClass(res) 21 | } 22 | 23 | for res in ManualResources.resources { 24 | Context.registerClass(res) 25 | } 26 | } 27 | // swiftlint:enable function_body_length 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Sources/ContoFA/v3/ApiModels/Generated/Recpayments/RecpaymentsAllResources.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | extension Recpayments { 7 | enum AllResources { 8 | 9 | // swiftlint:disable function_body_length 10 | public static func registerAllResources() { 11 | let allResources: [Resource.Type] = [ 12 | InfoResource.self, 13 | ScheduledPaymentRecordDescriptionResource.self, 14 | SchedulePaymentResource.self, 15 | ScheduledPaymentRecordResource.self 16 | ] 17 | 18 | for res in allResources { 19 | Context.registerClass(res) 20 | } 21 | 22 | for res in ManualResources.resources { 23 | Context.registerClass(res) 24 | } 25 | } 26 | // swiftlint:enable function_body_length 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Resources/HorizonManageSaleOpResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - ManageSaleOpResource 7 | 8 | extension Horizon { 9 | open class ManageSaleOpResource: BaseOperationDetailsResource { 10 | 11 | open override class var resourceType: String { 12 | return "operations-manage-sale" 13 | } 14 | 15 | public enum CodingKeys: String, CodingKey { 16 | // attributes 17 | case action 18 | case saleId 19 | } 20 | 21 | // MARK: Attributes 22 | 23 | open var action: Horizon.Enum? { 24 | return self.codableOptionalValue(key: CodingKeys.action) 25 | } 26 | 27 | open var saleId: UInt64 { 28 | return self.uint64OptionalValue(key: CodingKeys.saleId) ?? 0 29 | } 30 | 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Sources/v1/APIs/Blobs/PostBlobRequestModel.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public struct PostBlobRequestModel: Encodable { 4 | 5 | public let type: String 6 | public let attributes: Attributes 7 | public let relationships: Relationships 8 | } 9 | 10 | public extension PostBlobRequestModel { 11 | 12 | struct Attributes: Encodable { 13 | 14 | public let value: String 15 | } 16 | } 17 | 18 | public extension PostBlobRequestModel { 19 | 20 | struct Relationships: Encodable { 21 | 22 | public let owner: Owner 23 | } 24 | } 25 | 26 | public extension PostBlobRequestModel.Relationships { 27 | 28 | struct Owner: Encodable { 29 | 30 | public let data: Data 31 | } 32 | } 33 | 34 | public extension PostBlobRequestModel.Relationships.Owner { 35 | 36 | struct Data: Encodable { 37 | 38 | public let id: String 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Sources/ContoFA/v3/ApiModels/Generated/Recpayments/Resources/RecpaymentsInfoResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - InfoResource 7 | 8 | extension Recpayments { 9 | open class InfoResource: Resource { 10 | 11 | open override class var resourceType: String { 12 | return "recurring-payments-svc-info" 13 | } 14 | 15 | public enum CodingKeys: String, CodingKey { 16 | // relations 17 | case accountId 18 | case signerPubKey 19 | } 20 | 21 | // MARK: Relations 22 | 23 | open var accountId: Resource? { 24 | return self.relationSingleOptionalValue(key: CodingKeys.accountId) 25 | } 26 | 27 | open var signerPubKey: Resource? { 28 | return self.relationSingleOptionalValue(key: CodingKeys.signerPubKey) 29 | } 30 | 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Resources/HorizonStampOpResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - StampOpResource 7 | 8 | extension Horizon { 9 | open class StampOpResource: BaseOperationDetailsResource { 10 | 11 | open override class var resourceType: String { 12 | return "operations-stamp" 13 | } 14 | 15 | public enum CodingKeys: String, CodingKey { 16 | // attributes 17 | case ledgerHash 18 | case licenseHash 19 | } 20 | 21 | // MARK: Attributes 22 | 23 | open var ledgerHash: String { 24 | return self.stringOptionalValue(key: CodingKeys.ledgerHash) ?? "" 25 | } 26 | 27 | open var licenseHash: String { 28 | return self.stringOptionalValue(key: CodingKeys.licenseHash) ?? "" 29 | } 30 | 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Sources/MUNA/v3/ApiModels/Generated/MunaVaccineResults/Resources/MunaVaccineResultsVaccineTypeResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - VaccineTypeResource 7 | 8 | extension MunaVaccineResults { 9 | open class VaccineTypeResource: Resource { 10 | 11 | open override class var resourceType: String { 12 | return "vaccine_type" 13 | } 14 | 15 | public enum CodingKeys: String, CodingKey { 16 | // attributes 17 | case details 18 | case name 19 | } 20 | 21 | // MARK: Attributes 22 | 23 | open var details: [String: Any] { 24 | return self.dictionaryOptionalValue(key: CodingKeys.details) ?? [:] 25 | } 26 | 27 | open var name: String { 28 | return self.stringOptionalValue(key: CodingKeys.name) ?? "" 29 | } 30 | 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Sources/Alamofire/Common/NetworkTypes+AlamofireExtensions.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import Alamofire 3 | 4 | extension RequestMethod { 5 | 6 | public var method: Alamofire.HTTPMethod { 7 | switch self { 8 | case .delete: return .delete 9 | case .get: return .get 10 | case .patch: return .patch 11 | case .post: return .post 12 | case .put: return .put 13 | } 14 | } 15 | } 16 | 17 | extension RequestParametersEncoding { 18 | 19 | public var encoding: Alamofire.ParameterEncoding { 20 | switch self { 21 | 22 | case .url: 23 | return URLEncoding( 24 | destination: .queryString, 25 | boolEncoding: .literal 26 | ) 27 | 28 | case .json: 29 | return JSONEncoding.default 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Inner/HorizonExternalSystemData.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | 5 | // MARK: - ExternalSystemData 6 | 7 | extension Horizon { 8 | public struct ExternalSystemData: Decodable { 9 | 10 | public enum CodingKeys: String, CodingKey { 11 | // attributes 12 | case data 13 | case type 14 | } 15 | 16 | // MARK: Attributes 17 | 18 | public let data: ExternalSystemDataEntry 19 | public let type: String 20 | 21 | // MARK: - 22 | 23 | public init(from decoder: Decoder) throws { 24 | let container = try decoder.container(keyedBy: CodingKeys.self) 25 | 26 | self.data = try container.decode(ExternalSystemDataEntry.self, forKey: .data) 27 | self.type = try container.decode(String.self, forKey: .type) 28 | } 29 | 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Resources/HorizonCalculatedFeeResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - CalculatedFeeResource 7 | 8 | extension Horizon { 9 | open class CalculatedFeeResource: Resource { 10 | 11 | open override class var resourceType: String { 12 | return "calculated-fee" 13 | } 14 | 15 | public enum CodingKeys: String, CodingKey { 16 | // attributes 17 | case calculatedPercent 18 | case fixed 19 | } 20 | 21 | // MARK: Attributes 22 | 23 | open var calculatedPercent: Decimal { 24 | return self.decimalOptionalValue(key: CodingKeys.calculatedPercent) ?? 0.0 25 | } 26 | 27 | open var fixed: Decimal { 28 | return self.decimalOptionalValue(key: CodingKeys.fixed) ?? 0.0 29 | } 30 | 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Resources/HorizonEffectBalanceChangeResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - EffectBalanceChangeResource 7 | 8 | extension Horizon { 9 | open class EffectBalanceChangeResource: BaseEffectResource { 10 | 11 | open override class var resourceType: String { 12 | return "base-effect-balance-change" 13 | } 14 | 15 | public enum CodingKeys: String, CodingKey { 16 | // attributes 17 | case amount 18 | case fee 19 | } 20 | 21 | // MARK: Attributes 22 | 23 | open var amount: Decimal { 24 | return self.decimalOptionalValue(key: CodingKeys.amount) ?? 0.0 25 | } 26 | 27 | open var fee: Horizon.Fee? { 28 | return self.codableOptionalValue(key: CodingKeys.fee) 29 | } 30 | 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Inner/HorizonExternalSystemDataEntry.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | 5 | // MARK: - ExternalSystemDataEntry 6 | 7 | extension Horizon { 8 | public struct ExternalSystemDataEntry: Decodable { 9 | 10 | public enum CodingKeys: String, CodingKey { 11 | // attributes 12 | case address 13 | case payload 14 | } 15 | 16 | // MARK: Attributes 17 | 18 | public let address: String 19 | public let payload: String? 20 | 21 | // MARK: - 22 | 23 | public init(from decoder: Decoder) throws { 24 | let container = try decoder.container(keyedBy: CodingKeys.self) 25 | 26 | self.address = try container.decode(String.self, forKey: .address) 27 | self.payload = try? container.decode(String.self, forKey: .payload) 28 | } 29 | 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Resources/HorizonAtomicSwapQuoteAssetResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - AtomicSwapQuoteAssetResource 7 | 8 | extension Horizon { 9 | open class AtomicSwapQuoteAssetResource: Resource { 10 | 11 | open override class var resourceType: String { 12 | return "atomic-swap-quote-assets" 13 | } 14 | 15 | public enum CodingKeys: String, CodingKey { 16 | // attributes 17 | case price 18 | case quoteAsset 19 | } 20 | 21 | // MARK: Attributes 22 | 23 | open var price: Decimal { 24 | return self.decimalOptionalValue(key: CodingKeys.price) ?? 0.0 25 | } 26 | 27 | open var quoteAsset: String { 28 | return self.stringOptionalValue(key: CodingKeys.quoteAsset) ?? "" 29 | } 30 | 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Manual/PostKYCEntriesRequest.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | // MARK: - PostKYCEntriesRequest 4 | 5 | struct PostKYCEntriesRequest: Encodable { 6 | 7 | let data: Data 8 | } 9 | 10 | extension PostKYCEntriesRequest { 11 | 12 | struct Data: Encodable { 13 | 14 | let type: String = "accounts" 15 | let relationships: Relationships 16 | } 17 | } 18 | 19 | extension PostKYCEntriesRequest.Data { 20 | 21 | struct Relationships: Encodable { 22 | 23 | let accounts: Accounts 24 | } 25 | } 26 | 27 | extension PostKYCEntriesRequest.Data.Relationships { 28 | 29 | struct Accounts: Encodable { 30 | 31 | let data: [Data] 32 | } 33 | } 34 | 35 | extension PostKYCEntriesRequest.Data.Relationships.Accounts { 36 | 37 | struct Data: Encodable { 38 | 39 | let id: String 40 | let type: String = "accounts" 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Resources/HorizonRemoveDataOpResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - RemoveDataOpResource 7 | 8 | extension Horizon { 9 | open class RemoveDataOpResource: BaseOperationDetailsResource { 10 | 11 | open override class var resourceType: String { 12 | return "operations-remove-data" 13 | } 14 | 15 | public enum CodingKeys: String, CodingKey { 16 | // relations 17 | case data 18 | case owner 19 | } 20 | 21 | // MARK: Relations 22 | 23 | open var data: Horizon.DataResource? { 24 | return self.relationSingleOptionalValue(key: CodingKeys.data) 25 | } 26 | 27 | open var owner: Horizon.AccountResource? { 28 | return self.relationSingleOptionalValue(key: CodingKeys.owner) 29 | } 30 | 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Manual/AtomicSwapBuyResource.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import DLJSONAPI 3 | 4 | // MARK: - BusinessResource 5 | 6 | open class AtomicSwapBuyResource: Resource { 7 | 8 | open override class var resourceType: String { 9 | return "" 10 | } 11 | 12 | public enum CodingKeys: String, CodingKey { 13 | // attributes 14 | case type 15 | case data 16 | } 17 | 18 | // MARK: Attributes 19 | 20 | open var paymentType: String { 21 | get { return self.stringOptionalValue(key: CodingKeys.type) ?? "" } 22 | set { self.setStringOptionalValue(newValue, key: CodingKeys.type) } 23 | } 24 | 25 | open var data: [String: Any] { 26 | get { return self.dictionaryOptionalValue(key: CodingKeys.data) ?? [:] } 27 | set { self.setDictionaryOptionalValue(newValue, key: CodingKeys.data) } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Inner/HorizonBalanceStateAttributeAmounts.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | 5 | // MARK: - BalanceStateAttributeAmounts 6 | 7 | extension Horizon { 8 | public struct BalanceStateAttributeAmounts: Decodable { 9 | 10 | public enum CodingKeys: String, CodingKey { 11 | // attributes 12 | case available 13 | case locked 14 | } 15 | 16 | // MARK: Attributes 17 | 18 | public let available: Decimal 19 | public let locked: Decimal 20 | 21 | // MARK: - 22 | 23 | public init(from decoder: Decoder) throws { 24 | let container = try decoder.container(keyedBy: CodingKeys.self) 25 | 26 | self.available = try container.decodeDecimalString(key: .available) 27 | self.locked = try container.decodeDecimalString(key: .locked) 28 | } 29 | 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Sources/KeyServer/WalletDataModel.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public struct WalletDataModel { 4 | 5 | public let login: String 6 | public let accountId: String 7 | public let walletId: String 8 | public let type: String 9 | public let keychainData: String 10 | public let walletKDF: WalletKDFParams 11 | public let verified: Bool 12 | 13 | // MARK: - 14 | 15 | public init( 16 | login: String, 17 | accountId: String, 18 | walletId: String, 19 | type: String, 20 | keychainData: String, 21 | walletKDF: WalletKDFParams, 22 | verified: Bool 23 | ) { 24 | 25 | self.login = login 26 | self.accountId = accountId 27 | self.walletId = walletId 28 | self.type = type 29 | self.keychainData = keychainData 30 | self.walletKDF = walletKDF 31 | self.verified = verified 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Resources/HorizonRemoveAssetPairOpResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - RemoveAssetPairOpResource 7 | 8 | extension Horizon { 9 | open class RemoveAssetPairOpResource: BaseOperationDetailsResource { 10 | 11 | open override class var resourceType: String { 12 | return "operations-remove-asset-pair" 13 | } 14 | 15 | public enum CodingKeys: String, CodingKey { 16 | // relations 17 | case base 18 | case quote 19 | } 20 | 21 | // MARK: Relations 22 | 23 | open var base: Horizon.AssetResource? { 24 | return self.relationSingleOptionalValue(key: CodingKeys.base) 25 | } 26 | 27 | open var quote: Horizon.AssetResource? { 28 | return self.relationSingleOptionalValue(key: CodingKeys.quote) 29 | } 30 | 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Resources/HorizonCreateAccountOpResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - CreateAccountOpResource 7 | 8 | extension Horizon { 9 | open class CreateAccountOpResource: BaseOperationDetailsResource { 10 | 11 | open override class var resourceType: String { 12 | return "operations-create-account" 13 | } 14 | 15 | public enum CodingKeys: String, CodingKey { 16 | // relations 17 | case account 18 | case role 19 | } 20 | 21 | // MARK: Relations 22 | 23 | open var account: Horizon.AccountResource? { 24 | return self.relationSingleOptionalValue(key: CodingKeys.account) 25 | } 26 | 27 | open var role: Horizon.AccountRoleResource? { 28 | return self.relationSingleOptionalValue(key: CodingKeys.role) 29 | } 30 | 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Sources/v1/APIs/Identities/SetPhoneRequestBody.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public struct SetPhoneRequestBody: Encodable { 4 | public let data: Data 5 | 6 | public struct Data: Encodable { 7 | public let attributes: Attributes 8 | 9 | public struct Attributes: Encodable { 10 | public let phone: String 11 | } 12 | } 13 | 14 | public init(phone: String) { 15 | self.data = Data(attributes: Data.Attributes(phone: phone)) 16 | } 17 | 18 | public func toJSON() -> [String: Any]? { 19 | guard let jsonData = try? JSONEncoder().encode(self), 20 | let json = try? JSONSerialization.jsonObject( 21 | with: jsonData, 22 | options: .allowFragments 23 | ) as? [String: Any] else { 24 | 25 | return nil 26 | } 27 | 28 | return json 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Example/Tests/TokenDSDK_IntegrationTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | NSAppTransportSecurity 22 | 23 | NSAllowsLocalNetworking 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /Sources/ContoFA/v3/ApiModels/Manual/FriendMultipleRequest.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | // MARK: - FriendMultipleRequest 4 | 5 | struct FriendMultipleRequest: Encodable { 6 | 7 | let data: Data 8 | } 9 | 10 | extension FriendMultipleRequest { 11 | 12 | struct Data: Encodable { 13 | 14 | let type: String = "friend-multiple-request" 15 | let relationships: Relationships 16 | } 17 | } 18 | 19 | extension FriendMultipleRequest.Data { 20 | 21 | struct Relationships: Encodable { 22 | 23 | let newFriends: NewFriends 24 | } 25 | } 26 | 27 | extension FriendMultipleRequest.Data.Relationships { 28 | 29 | struct NewFriends: Encodable { 30 | 31 | let data: [NewFriend] 32 | } 33 | } 34 | 35 | extension FriendMultipleRequest.Data.Relationships.NewFriends { 36 | 37 | struct NewFriend: Encodable { 38 | 39 | let id: String 40 | let type: String = "identifiers" 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Sources/v1/APIs/Documents/GetUploadPolicyRequestModel.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public struct GetUploadPolicyRequestModel: Encodable { 4 | 5 | public let type: String 6 | public let attributes: Attributes 7 | public let relationships: Relationships 8 | } 9 | 10 | public extension GetUploadPolicyRequestModel { 11 | 12 | struct Attributes: Encodable { 13 | 14 | let contentType: String 15 | } 16 | } 17 | 18 | public extension GetUploadPolicyRequestModel { 19 | 20 | struct Relationships: Encodable { 21 | 22 | public let owner: Owner 23 | } 24 | } 25 | 26 | public extension GetUploadPolicyRequestModel.Relationships { 27 | 28 | struct Owner: Encodable { 29 | 30 | public let data: Data 31 | } 32 | } 33 | 34 | public extension GetUploadPolicyRequestModel.Relationships.Owner { 35 | 36 | struct Data: Encodable { 37 | 38 | public let id: String 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Sources/v1/APIs/Identities/SetTelegramRequestBody.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public struct SetTelegramRequestBody: Encodable { 4 | public let data: Data 5 | 6 | public struct Data: Encodable { 7 | public let attributes: Attributes 8 | 9 | public struct Attributes: Encodable { 10 | public let username: String 11 | } 12 | } 13 | 14 | public init(username: String) { 15 | self.data = Data(attributes: Data.Attributes(username: username)) 16 | } 17 | 18 | public func toJSON() -> [String: Any]? { 19 | guard let jsonData = try? JSONEncoder().encode(self), 20 | let json = try? JSONSerialization.jsonObject( 21 | with: jsonData, 22 | options: .allowFragments 23 | ) as? [String: Any] else { 24 | 25 | return nil 26 | } 27 | 28 | return json 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/APIs/TransactionsV3/TransactionsRequestBuilderV3.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public class TransactionsRequestBuilderV3: JSONAPI.BaseApiRequestBuilder { 4 | 5 | // MARK: - Private properties 6 | 7 | private let transactions: String = "transactions" 8 | 9 | // MARK: - Public 10 | 11 | /// Builds request to submit transaction 12 | public func buildSubmitTransactionRequest( 13 | bodyParameters: [String: Any], 14 | sendDate: Date = Date(), 15 | completion: @escaping (JSONAPI.RequestModel?) -> Void 16 | ) { 17 | 18 | let path = self.v3/self.transactions 19 | 20 | self.buildRequest( 21 | .simpleBody( 22 | path: path, 23 | method: .post, 24 | bodyParameters: bodyParameters 25 | ), 26 | shouldSign: true, 27 | sendDate: sendDate, 28 | completion: completion 29 | ) 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Resources/HorizonCloseSwapOpResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - CloseSwapOpResource 7 | 8 | extension Horizon { 9 | open class CloseSwapOpResource: BaseOperationDetailsResource { 10 | 11 | open override class var resourceType: String { 12 | return "operations-close-swap" 13 | } 14 | 15 | public enum CodingKeys: String, CodingKey { 16 | // attributes 17 | case secret 18 | 19 | // relations 20 | case swap 21 | } 22 | 23 | // MARK: Attributes 24 | 25 | open var secret: String? { 26 | return self.stringOptionalValue(key: CodingKeys.secret) 27 | } 28 | 29 | // MARK: Relations 30 | 31 | open var swap: Horizon.SwapResource? { 32 | return self.relationSingleOptionalValue(key: CodingKeys.swap) 33 | } 34 | 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Sources/KeyServer/KeyServerApiRequestBuilder.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | /// Class provides functionality that allows to build requests 4 | /// which are used to communicate with Key Server. 5 | public class KeyServerApiRequestBuilder { 6 | 7 | // MARK: - Public properties 8 | 9 | public var apiConfiguration: ApiConfiguration { 10 | apiConfigurationProvider.apiConfiguration 11 | } 12 | public let apiConfigurationProvider: ApiConfigurationProviderProtocol 13 | public let network: JSONAPI.NetworkProtocol 14 | 15 | // MARK: - Internal properties 16 | 17 | internal var walletsPath: String { "wallets" } 18 | 19 | // MARK: - 20 | 21 | public init( 22 | apiConfigurationProvider: ApiConfigurationProviderProtocol, 23 | network: JSONAPI.NetworkProtocol 24 | ) { 25 | 26 | self.apiConfigurationProvider = apiConfigurationProvider 27 | self.network = network 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Sources/ContoFA/v3/ApiModels/Generated/Recpayments/Resources/RecpaymentsScheduledPaymentRecordDescriptionResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - ScheduledPaymentRecordDescriptionResource 7 | 8 | extension Recpayments { 9 | open class ScheduledPaymentRecordDescriptionResource: Resource { 10 | 11 | open override class var resourceType: String { 12 | return "scheduled-payment-record-description" 13 | } 14 | 15 | public enum CodingKeys: String, CodingKey { 16 | // attributes 17 | case nextTimeSend 18 | case rRule 19 | } 20 | 21 | // MARK: Attributes 22 | 23 | open var nextTimeSend: Date { 24 | return self.dateOptionalValue(key: CodingKeys.nextTimeSend) ?? Date() 25 | } 26 | 27 | open var rRule: String { 28 | return self.stringOptionalValue(key: CodingKeys.rRule) ?? "" 29 | } 30 | 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Resources/HorizonAccountRoleResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - AccountRoleResource 7 | 8 | extension Horizon { 9 | open class AccountRoleResource: Resource { 10 | 11 | open override class var resourceType: String { 12 | return "account-roles" 13 | } 14 | 15 | public enum CodingKeys: String, CodingKey { 16 | // attributes 17 | case details 18 | 19 | // relations 20 | case rules 21 | } 22 | 23 | // MARK: Attributes 24 | 25 | open var details: [String: Any] { 26 | return self.dictionaryOptionalValue(key: CodingKeys.details) ?? [:] 27 | } 28 | 29 | // MARK: Relations 30 | 31 | open var rules: [Horizon.AccountRuleResource]? { 32 | return self.relationCollectionOptionalValue(key: CodingKeys.rules) 33 | } 34 | 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Resources/HorizonConvertedBalancesCollectionResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - ConvertedBalancesCollectionResource 7 | 8 | extension Horizon { 9 | open class ConvertedBalancesCollectionResource: Resource { 10 | 11 | open override class var resourceType: String { 12 | return "converted-balances-collections" 13 | } 14 | 15 | public enum CodingKeys: String, CodingKey { 16 | // relations 17 | case asset 18 | case states 19 | } 20 | 21 | // MARK: Relations 22 | 23 | open var asset: Horizon.AssetResource? { 24 | return self.relationSingleOptionalValue(key: CodingKeys.asset) 25 | } 26 | 27 | open var states: [Horizon.ConvertedBalanceStateResource]? { 28 | return self.relationCollectionOptionalValue(key: CodingKeys.states) 29 | } 30 | 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/KYC/Resources/KYCKycResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - KycResource 7 | 8 | extension KYC { 9 | open class KycResource: Resource { 10 | 11 | open override class var resourceType: String { 12 | return "kyc" 13 | } 14 | 15 | public enum CodingKeys: String, CodingKey { 16 | // attributes 17 | case accountId 18 | case details 19 | case role 20 | } 21 | 22 | // MARK: Attributes 23 | 24 | open var accountId: String { 25 | return self.stringOptionalValue(key: CodingKeys.accountId) ?? "" 26 | } 27 | 28 | open var details: [String: Any]? { 29 | return self.dictionaryOptionalValue(key: CodingKeys.details) 30 | } 31 | 32 | open var role: Int32 { 33 | return self.int32OptionalValue(key: CodingKeys.role) ?? 0 34 | } 35 | 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Sources/v1/APIs/TFA/TFAPasswordMetaModel.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public struct TFAPasswordMetaModel { 4 | 5 | public let factorId: Int 6 | public let keychainData: Data 7 | public let salt: Data 8 | public let token: String 9 | public let walletId: String 10 | 11 | /// Method transforms `TFAMetaResponse` model to `TFAPasswordMetaModel` 12 | public static func fromTFAMetaResponse(_ response: TFAMetaResponse) -> TFAPasswordMetaModel? { 13 | guard 14 | let keychainData = response.keychainData?.dataFromBase64, 15 | let salt = response.salt?.dataFromBase64 16 | else { 17 | return nil 18 | } 19 | 20 | return TFAPasswordMetaModel( 21 | factorId: response.factorId, 22 | keychainData: keychainData, 23 | salt: salt, 24 | token: response.token, 25 | walletId: response.walletId 26 | ) 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Sources/DMS/v3/ApiModels/Generated/DMS/Inner/DMSOrganizationAdmin.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | 5 | // MARK: - OrganizationAdmin 6 | 7 | extension DMS { 8 | public struct OrganizationAdmin: Decodable { 9 | 10 | public enum CodingKeys: String, CodingKey { 11 | // attributes 12 | case email 13 | case name 14 | case phone 15 | } 16 | 17 | // MARK: Attributes 18 | 19 | public let email: String 20 | public let name: String 21 | public let phone: String 22 | 23 | // MARK: - 24 | 25 | public init(from decoder: Decoder) throws { 26 | let container = try decoder.container(keyedBy: CodingKeys.self) 27 | 28 | self.email = try container.decode(String.self, forKey: .email) 29 | self.name = try container.decode(String.self, forKey: .name) 30 | self.phone = try container.decode(String.self, forKey: .phone) 31 | } 32 | 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Resources/HorizonUpdateDataOpResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - UpdateDataOpResource 7 | 8 | extension Horizon { 9 | open class UpdateDataOpResource: BaseOperationDetailsResource { 10 | 11 | open override class var resourceType: String { 12 | return "operations-update-data" 13 | } 14 | 15 | public enum CodingKeys: String, CodingKey { 16 | // attributes 17 | case value 18 | 19 | // relations 20 | case data 21 | } 22 | 23 | // MARK: Attributes 24 | 25 | open var value: [String: Any] { 26 | return self.dictionaryOptionalValue(key: CodingKeys.value) ?? [:] 27 | } 28 | 29 | // MARK: Relations 30 | 31 | open var data: Horizon.DataResource? { 32 | return self.relationSingleOptionalValue(key: CodingKeys.data) 33 | } 34 | 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Sources/ContoFA/v3/ApiModels/Generated/Cards/Resources/CardsInfoResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - InfoResource 7 | 8 | extension Cards { 9 | open class InfoResource: Resource { 10 | 11 | open override class var resourceType: String { 12 | return "cards-info" 13 | } 14 | 15 | public enum CodingKeys: String, CodingKey { 16 | // relations 17 | case account 18 | case role 19 | case signer 20 | } 21 | 22 | // MARK: Relations 23 | 24 | open var account: Resource? { 25 | return self.relationSingleOptionalValue(key: CodingKeys.account) 26 | } 27 | 28 | open var role: Resource? { 29 | return self.relationSingleOptionalValue(key: CodingKeys.role) 30 | } 31 | 32 | open var signer: Resource? { 33 | return self.relationSingleOptionalValue(key: CodingKeys.signer) 34 | } 35 | 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Resources/HorizonCheckSaleStateOpResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - CheckSaleStateOpResource 7 | 8 | extension Horizon { 9 | open class CheckSaleStateOpResource: BaseOperationDetailsResource { 10 | 11 | open override class var resourceType: String { 12 | return "operations-check-sale-state" 13 | } 14 | 15 | public enum CodingKeys: String, CodingKey { 16 | // attributes 17 | case effect 18 | 19 | // relations 20 | case sale 21 | } 22 | 23 | // MARK: Attributes 24 | 25 | open var effect: Horizon.Enum? { 26 | return self.codableOptionalValue(key: CodingKeys.effect) 27 | } 28 | 29 | // MARK: Relations 30 | 31 | open var sale: Horizon.SaleResource? { 32 | return self.relationSingleOptionalValue(key: CodingKeys.sale) 33 | } 34 | 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Sources/MUNA/v3/ApiModels/Generated/MunaTutorials/Resources/MunaTutorialsVideoResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - VideoResource 7 | 8 | extension MunaTutorials { 9 | open class VideoResource: Resource { 10 | 11 | open override class var resourceType: String { 12 | return "video" 13 | } 14 | 15 | public enum CodingKeys: String, CodingKey { 16 | // attributes 17 | case category 18 | case name 19 | case url 20 | } 21 | 22 | // MARK: Attributes 23 | 24 | open var category: String { 25 | return self.stringOptionalValue(key: CodingKeys.category) ?? "" 26 | } 27 | 28 | open var name: String { 29 | return self.stringOptionalValue(key: CodingKeys.name) ?? "" 30 | } 31 | 32 | open var url: String { 33 | return self.stringOptionalValue(key: CodingKeys.url) ?? "" 34 | } 35 | 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Sources/ContoFA/v3/APIs/Invoices/InvoicesRequestBuilderV3.swift: -------------------------------------------------------------------------------- 1 | import DLJSONAPI 2 | 3 | public class InvoicesRequestBuilderV3: JSONAPI.BaseApiRequestBuilder { 4 | 5 | // MARK: - Private properties 6 | 7 | private let integrations: String = "integrations" 8 | private let invoices: String = "invoices" 9 | 10 | // MARK: - Public 11 | 12 | /// Builds request to create invoice 13 | public func buildCreateInvoiceRequest( 14 | bodyParameters: [String: Any], 15 | sendDate: Date = Date(), 16 | completion: @escaping (JSONAPI.RequestModel?) -> Void 17 | ) { 18 | 19 | let path = /self.integrations/self.invoices 20 | 21 | self.buildRequest( 22 | .simpleBody( 23 | path: path, 24 | method: .post, 25 | bodyParameters: bodyParameters 26 | ), 27 | shouldSign: true, 28 | sendDate: sendDate, 29 | completion: completion 30 | ) 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Sources/ContoFA/v3/ApiModels/Generated/Cards/CardsAllResources.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | extension Cards { 7 | enum AllResources { 8 | 9 | // swiftlint:disable function_body_length 10 | public static func registerAllResources() { 11 | let allResources: [Resource.Type] = [ 12 | PublicCardListTempViewResource.self, 13 | UpdateCardResource.self, 14 | TransactionResource.self, 15 | CreateCardResource.self, 16 | CardSecurityDetailsResource.self, 17 | CardBalanceResource.self, 18 | InfoResource.self, 19 | CardResource.self 20 | ] 21 | 22 | for res in allResources { 23 | Context.registerClass(res) 24 | } 25 | 26 | for res in ManualResources.resources { 27 | Context.registerClass(res) 28 | } 29 | } 30 | // swiftlint:enable function_body_length 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Sources/MUNA/KeyServer/GetWallet/KeyServerApiRequestBuilder+MUNAGetWallet.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public extension KeyServerApiRequestBuilder { 4 | 5 | /// Builds request to fetch wallet data. 6 | /// - Parameters: 7 | /// - walletId: Wallet id. 8 | /// - latitude: User's location latitude. 9 | /// - longitude: User's location longitude. 10 | /// - Returns: `GetWalletRequest` model. 11 | func buildMUNAGetWalletRequest( 12 | walletId: String, 13 | latitude: String, 14 | longitude: String 15 | ) -> MUNAGetWalletRequest { 16 | 17 | let baseUrl = self.apiConfiguration.urlString 18 | let url = baseUrl/walletsPath/walletId 19 | .addParam(key: "location_lat", value: latitude) 20 | .addParam(key: "location_long", value: longitude) 21 | 22 | let request = MUNAGetWalletRequest( 23 | url: url, 24 | method: .get 25 | ) 26 | 27 | return request 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Example/Podfile: -------------------------------------------------------------------------------- 1 | platform :ios, '10.0' 2 | 3 | source 'git@github.com:tokend/ios-specs.git' 4 | source 'https://github.com/CocoaPods/Specs.git' 5 | 6 | use_modular_headers! 7 | 8 | def main_pods 9 | pod 'TokenDSDK', path: '../' 10 | pod 'TokenDSDK/AlamofireNetwork', :path => '../' 11 | pod 'TokenDSDK/MUNA', path: '../' 12 | pod 'TokenDSDK/ContoFA', path: '../' 13 | pod 'TokenDSDK/Contopass', path: '../' 14 | pod 'TokenDSDK/DMS', path: '../' 15 | pod 'TokenDSDK/MUNAKeyServer', path: '../' 16 | 17 | pod 'TokenDSDK/AlamofireNetworkJSONAPI', path: '../' 18 | pod 'TokenDSDK/RxJSONAPI', path: '../' 19 | 20 | pod 'SnapKit', '5.0.1' 21 | pod 'Alamofire', '5.3.0' 22 | pod 'RxCocoa', '6.0.0-rc.1' 23 | pod 'RxSwift', '6.0.0-rc.1' 24 | end 25 | 26 | target 'TokenDSDK_Example' do 27 | main_pods 28 | end 29 | 30 | target 'TokenDSDK_Tests' do 31 | inherit! :search_paths 32 | 33 | main_pods 34 | end 35 | 36 | target 'TokenDSDK_IntegrationTests' do 37 | inherit! :search_paths 38 | 39 | main_pods 40 | end 41 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Resources/HorizonInitiateKYCRecoveryOpResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - InitiateKYCRecoveryOpResource 7 | 8 | extension Horizon { 9 | open class InitiateKYCRecoveryOpResource: BaseOperationDetailsResource { 10 | 11 | open override class var resourceType: String { 12 | return "operations-initiate-kyc-recovery" 13 | } 14 | 15 | public enum CodingKeys: String, CodingKey { 16 | // attributes 17 | case signer 18 | 19 | // relations 20 | case account 21 | } 22 | 23 | // MARK: Attributes 24 | 25 | open var signer: String { 26 | return self.stringOptionalValue(key: CodingKeys.signer) ?? "" 27 | } 28 | 29 | // MARK: Relations 30 | 31 | open var account: Horizon.AccountResource? { 32 | return self.relationSingleOptionalValue(key: CodingKeys.account) 33 | } 34 | 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Sources/MUNA/v3/ApiModels/Generated/MunaTestResults/Resources/MunaTestResultsTestTypeResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - TestTypeResource 7 | 8 | extension MunaTestResults { 9 | open class TestTypeResource: Resource { 10 | 11 | open override class var resourceType: String { 12 | return "test_type" 13 | } 14 | 15 | public enum CodingKeys: String, CodingKey { 16 | // attributes 17 | case details 18 | // case id 19 | case name 20 | } 21 | 22 | // MARK: Attributes 23 | 24 | open var details: [String: Any] { 25 | return self.dictionaryOptionalValue(key: CodingKeys.details) ?? [:] 26 | } 27 | 28 | // open var id: Int32 { 29 | // return self.int32OptionalValue(key: CodingKeys.id) ?? 0 30 | // } 31 | 32 | open var name: String { 33 | return self.stringOptionalValue(key: CodingKeys.name) ?? "" 34 | } 35 | 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Inner/HorizonClosePollOp.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | 5 | // MARK: - ClosePollOp 6 | 7 | extension Horizon { 8 | public struct ClosePollOp: Decodable { 9 | 10 | public enum CodingKeys: String, CodingKey { 11 | // attributes 12 | case details 13 | case pollId 14 | case pollResult 15 | } 16 | 17 | // MARK: Attributes 18 | 19 | public let details: [String: Any] 20 | public let pollId: Int64 21 | public let pollResult: Enum 22 | 23 | // MARK: - 24 | 25 | public init(from decoder: Decoder) throws { 26 | let container = try decoder.container(keyedBy: CodingKeys.self) 27 | 28 | self.details = try container.decodeDictionary([String: Any].self, forKey: .details) 29 | self.pollId = try container.decode(Int64.self, forKey: .pollId) 30 | self.pollResult = try container.decode(Enum.self, forKey: .pollResult) 31 | } 32 | 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Sources/ContoFA/v3/APIs/RecurringPayments/RecurringPaymentsFilters.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public enum RecurringPaymentsRequestsFilterOption: FilterOption { 4 | 5 | /// Filter schedules by destination balance. 6 | /// If provided - destination account's (owner of the provided balance) signature must be added to the request. 7 | case destinationBalance(String) 8 | 9 | /// Filter schedules by destination account. 10 | /// If provided - destination account's signature must be added to the request. 11 | case destinationAccount(String) 12 | 13 | /// Filter schedules by source account. If provided - source account's signature must be added to the request. 14 | case sourceAccount(String) 15 | 16 | /// Filter schedules by source balance. 17 | /// If provided - source account's (owner of the provided balance) signature must be added to the request. 18 | case sourceBalance(String) 19 | } 20 | 21 | public class RecurringPaymentsRequestsFilters: RequestFilters {} 22 | -------------------------------------------------------------------------------- /Sources/DMS/v3/ApiModels/Generated/DMS/Resources/DMSStepChangesResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - StepChangesResource 7 | 8 | extension DMS { 9 | open class StepChangesResource: Resource { 10 | 11 | open override class var resourceType: String { 12 | return "step_changes" 13 | } 14 | 15 | public enum CodingKeys: String, CodingKey { 16 | // attributes 17 | case comments 18 | case documentVersion 19 | case fileChanges 20 | } 21 | 22 | // MARK: Attributes 23 | 24 | open var comments: String? { 25 | return self.stringOptionalValue(key: CodingKeys.comments) 26 | } 27 | 28 | open var documentVersion: Int32 { 29 | return self.int32OptionalValue(key: CodingKeys.documentVersion) ?? 0 30 | } 31 | 32 | open var fileChanges: [String: Any]? { 33 | return self.dictionaryOptionalValue(key: CodingKeys.fileChanges) 34 | } 35 | 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Resources/HorizonBalanceResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - BalanceResource 7 | 8 | extension Horizon { 9 | open class BalanceResource: Resource { 10 | 11 | open override class var resourceType: String { 12 | return "balances" 13 | } 14 | 15 | public enum CodingKeys: String, CodingKey { 16 | // relations 17 | case asset 18 | case owner 19 | case state 20 | } 21 | 22 | // MARK: Relations 23 | 24 | open var asset: Horizon.AssetResource? { 25 | return self.relationSingleOptionalValue(key: CodingKeys.asset) 26 | } 27 | 28 | open var owner: Horizon.AccountResource? { 29 | return self.relationSingleOptionalValue(key: CodingKeys.owner) 30 | } 31 | 32 | open var state: Horizon.BalanceStateResource? { 33 | return self.relationSingleOptionalValue(key: CodingKeys.state) 34 | } 35 | 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Resources/HorizonLicenseInfoResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - LicenseInfoResource 7 | 8 | extension Horizon { 9 | open class LicenseInfoResource: Resource { 10 | 11 | open override class var resourceType: String { 12 | return "license-info" 13 | } 14 | 15 | public enum CodingKeys: String, CodingKey { 16 | // attributes 17 | case adminCount 18 | case currentAdminCount 19 | case dueDate 20 | } 21 | 22 | // MARK: Attributes 23 | 24 | open var adminCount: Int64 { 25 | return self.int64OptionalValue(key: CodingKeys.adminCount) ?? 0 26 | } 27 | 28 | open var currentAdminCount: Int64 { 29 | return self.int64OptionalValue(key: CodingKeys.currentAdminCount) ?? 0 30 | } 31 | 32 | open var dueDate: Date { 33 | return self.dateOptionalValue(key: CodingKeys.dueDate) ?? Date() 34 | } 35 | 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Resources/HorizonLedgerEntryChangeResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - LedgerEntryChangeResource 7 | 8 | extension Horizon { 9 | open class LedgerEntryChangeResource: Resource { 10 | 11 | open override class var resourceType: String { 12 | return "ledger-entry-changes" 13 | } 14 | 15 | public enum CodingKeys: String, CodingKey { 16 | // attributes 17 | case changeType 18 | case entryType 19 | case payload 20 | } 21 | 22 | // MARK: Attributes 23 | 24 | open var changeType: Horizon.Enum? { 25 | return self.codableOptionalValue(key: CodingKeys.changeType) 26 | } 27 | 28 | open var entryType: Horizon.Enum? { 29 | return self.codableOptionalValue(key: CodingKeys.entryType) 30 | } 31 | 32 | open var payload: String { 33 | return self.stringOptionalValue(key: CodingKeys.payload) ?? "" 34 | } 35 | 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Sources/MUNA/v3/ApiModels/Generated/MunaBooking/Inner/MunaBookingPayloadDetails.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | 5 | // MARK: - PayloadDetails 6 | 7 | extension MunaBooking { 8 | public struct PayloadDetails: Decodable { 9 | 10 | public enum CodingKeys: String, CodingKey { 11 | // attributes 12 | case capacity 13 | case price 14 | case workDays 15 | } 16 | 17 | // MARK: Attributes 18 | 19 | public let capacity: Int32 20 | public let price: PriceDetails 21 | public let workDays: [String: WorkHours] 22 | 23 | // MARK: - 24 | 25 | public init(from decoder: Decoder) throws { 26 | let container = try decoder.container(keyedBy: CodingKeys.self) 27 | 28 | self.capacity = try container.decode(Int32.self, forKey: .capacity) 29 | self.price = try container.decode(PriceDetails.self, forKey: .price) 30 | self.workDays = try container.decode([String: WorkHours].self, forKey: .workDays) 31 | } 32 | 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Resources/HorizonManageKeyValueOpResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - ManageKeyValueOpResource 7 | 8 | extension Horizon { 9 | open class ManageKeyValueOpResource: BaseOperationDetailsResource { 10 | 11 | open override class var resourceType: String { 12 | return "operations-manage-key-value" 13 | } 14 | 15 | public enum CodingKeys: String, CodingKey { 16 | // attributes 17 | case action 18 | case key 19 | case value 20 | } 21 | 22 | // MARK: Attributes 23 | 24 | open var action: Horizon.Enum? { 25 | return self.codableOptionalValue(key: CodingKeys.action) 26 | } 27 | 28 | open var key: String { 29 | return self.stringOptionalValue(key: CodingKeys.key) ?? "" 30 | } 31 | 32 | open var value: Horizon.KeyValueEntryValue? { 33 | return self.codableOptionalValue(key: CodingKeys.value) 34 | } 35 | 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Resources/HorizonUpdateSaleDetailsRequestResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - UpdateSaleDetailsRequestResource 7 | 8 | extension Horizon { 9 | open class UpdateSaleDetailsRequestResource: BaseReviewableRequestDetailsResource { 10 | 11 | open override class var resourceType: String { 12 | return "request-details-update-sale-details" 13 | } 14 | 15 | public enum CodingKeys: String, CodingKey { 16 | // attributes 17 | case creatorDetails 18 | 19 | // relations 20 | case sale 21 | } 22 | 23 | // MARK: Attributes 24 | 25 | open var creatorDetails: [String: Any] { 26 | return self.dictionaryOptionalValue(key: CodingKeys.creatorDetails) ?? [:] 27 | } 28 | 29 | // MARK: Relations 30 | 31 | open var sale: Horizon.SaleResource? { 32 | return self.relationSingleOptionalValue(key: CodingKeys.sale) 33 | } 34 | 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Sources/ContoFA/v3/ApiModels/Generated/Friends/Resources/FriendsRecentPaymentResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - RecentPaymentResource 7 | 8 | extension Friends { 9 | open class RecentPaymentResource: Resource { 10 | 11 | open override class var resourceType: String { 12 | return "recent-payments" 13 | } 14 | 15 | public enum CodingKeys: String, CodingKey { 16 | // relations 17 | case destination 18 | case destinationCard 19 | case source 20 | } 21 | 22 | // MARK: Relations 23 | 24 | open var destination: Resource? { 25 | return self.relationSingleOptionalValue(key: CodingKeys.destination) 26 | } 27 | 28 | open var destinationCard: Resource? { 29 | return self.relationSingleOptionalValue(key: CodingKeys.destinationCard) 30 | } 31 | 32 | open var source: Resource? { 33 | return self.relationSingleOptionalValue(key: CodingKeys.source) 34 | } 35 | 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Sources/DMS/v3/APIs/Users/DMSUsersRequestBuilderV3.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public extension DMS { 4 | 5 | class UsersRequestBuilderV3: JSONAPI.BaseApiRequestBuilder { 6 | 7 | // MARK: - Private properties 8 | 9 | private var users: String { "users" } 10 | } 11 | } 12 | 13 | // MARK: - Public methods 14 | 15 | public extension DMS.UsersRequestBuilderV3 { 16 | 17 | func buildGetUser( 18 | for accountId: String, 19 | include: [String]?, 20 | sendDate: Date = Date(), 21 | completion: @escaping (JSONAPI.RequestModel?) -> Void 22 | ) { 23 | 24 | let path = self.users/accountId 25 | 26 | self.buildRequest( 27 | .simpleQueryInclude( 28 | path: path, 29 | method: .get, 30 | queryParameters: [:], 31 | include: include 32 | ), 33 | shouldSign: true, 34 | sendDate: sendDate, 35 | completion: completion 36 | ) 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Resources/HorizonAccountSpecificRuleResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - AccountSpecificRuleResource 7 | 8 | extension Horizon { 9 | open class AccountSpecificRuleResource: Resource { 10 | 11 | open override class var resourceType: String { 12 | return "account-specific-rules" 13 | } 14 | 15 | public enum CodingKeys: String, CodingKey { 16 | // attributes 17 | case accountId 18 | case forbids 19 | case ledgerKey 20 | } 21 | 22 | // MARK: Attributes 23 | 24 | open var accountId: String? { 25 | return self.stringOptionalValue(key: CodingKeys.accountId) 26 | } 27 | 28 | open var forbids: Bool { 29 | return self.boolOptionalValue(key: CodingKeys.forbids) ?? false 30 | } 31 | 32 | open var ledgerKey: [String: Any] { 33 | return self.dictionaryOptionalValue(key: CodingKeys.ledgerKey) ?? [:] 34 | } 35 | 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Resources/HorizonManageLimitsOpResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - ManageLimitsOpResource 7 | 8 | extension Horizon { 9 | open class ManageLimitsOpResource: Resource { 10 | 11 | open override class var resourceType: String { 12 | return "operations-manage-limits" 13 | } 14 | 15 | public enum CodingKeys: String, CodingKey { 16 | // attributes 17 | case action 18 | case create 19 | case remove 20 | } 21 | 22 | // MARK: Attributes 23 | 24 | open var action: Horizon.Enum? { 25 | return self.codableOptionalValue(key: CodingKeys.action) 26 | } 27 | 28 | open var create: Horizon.ManageLimitsCreationOp? { 29 | return self.codableOptionalValue(key: CodingKeys.create) 30 | } 31 | 32 | open var remove: Horizon.ManageLimitsRemovalOp? { 33 | return self.codableOptionalValue(key: CodingKeys.remove) 34 | } 35 | 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Inner/HorizonLedgerInfo.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | 5 | // MARK: - LedgerInfo 6 | 7 | extension Horizon { 8 | public struct LedgerInfo: Decodable { 9 | 10 | public enum CodingKeys: String, CodingKey { 11 | // attributes 12 | case lastLedgerIncreaseTime 13 | case latest 14 | case oldestOnStart 15 | } 16 | 17 | // MARK: Attributes 18 | 19 | public let lastLedgerIncreaseTime: Date 20 | public let latest: UInt64 21 | public let oldestOnStart: UInt64 22 | 23 | // MARK: - 24 | 25 | public init(from decoder: Decoder) throws { 26 | let container = try decoder.container(keyedBy: CodingKeys.self) 27 | 28 | self.lastLedgerIncreaseTime = try container.decodeDateString(key: .lastLedgerIncreaseTime) 29 | self.latest = try container.decode(UInt64.self, forKey: .latest) 30 | self.oldestOnStart = try container.decode(UInt64.self, forKey: .oldestOnStart) 31 | } 32 | 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Sources/DMS/v3/ApiModels/Generated/DMS/Resources/DMSEventResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - EventResource 7 | 8 | extension DMS { 9 | open class EventResource: Resource { 10 | 11 | open override class var resourceType: String { 12 | return "events" 13 | } 14 | 15 | public enum CodingKeys: String, CodingKey { 16 | // attributes 17 | case eventType 18 | case timestamp 19 | 20 | // relations 21 | case initiator 22 | } 23 | 24 | // MARK: Attributes 25 | 26 | open var eventType: Int32 { 27 | return self.int32OptionalValue(key: CodingKeys.eventType) ?? 0 28 | } 29 | 30 | open var timestamp: Date { 31 | return self.dateOptionalValue(key: CodingKeys.timestamp) ?? Date() 32 | } 33 | 34 | // MARK: Relations 35 | 36 | open var initiator: DMS.UserResource? { 37 | return self.relationSingleOptionalValue(key: CodingKeys.initiator) 38 | } 39 | 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Sources/ContoFA/v3/ApiModels/Manual/UpdateCardRequest.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | // MARK: - UpdateCardRequest 4 | 5 | struct UpdateCardRequest: Encodable { 6 | 7 | let data: Data 8 | } 9 | 10 | extension UpdateCardRequest { 11 | 12 | struct Data: Encodable { 13 | 14 | let type: String = "update-card-request" 15 | let attributes: Attributes 16 | let relationships: Relationships 17 | } 18 | } 19 | 20 | extension UpdateCardRequest.Data { 21 | 22 | struct Attributes: Encodable { } 23 | } 24 | 25 | extension UpdateCardRequest.Data { 26 | 27 | struct Relationships: Encodable { 28 | 29 | let bindBalances: Balances? 30 | let unbindBalances: Balances? 31 | } 32 | } 33 | 34 | extension UpdateCardRequest.Data.Relationships { 35 | 36 | struct Balances: Encodable { 37 | 38 | let data: [Balance] 39 | } 40 | } 41 | 42 | extension UpdateCardRequest.Data.Relationships.Balances { 43 | 44 | struct Balance: Encodable { 45 | 46 | let type: String = "balances" 47 | let id: String 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Resources/HorizonDataResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - DataResource 7 | 8 | extension Horizon { 9 | open class DataResource: Resource { 10 | 11 | open override class var resourceType: String { 12 | return "datas" 13 | } 14 | 15 | public enum CodingKeys: String, CodingKey { 16 | // attributes 17 | case type 18 | case value 19 | 20 | // relations 21 | case owner 22 | } 23 | 24 | // MARK: Attributes 25 | 26 | open var attributesType: UInt64 { 27 | return self.uint64OptionalValue(key: CodingKeys.type) ?? 0 28 | } 29 | 30 | open var value: [String: Any] { 31 | return self.dictionaryOptionalValue(key: CodingKeys.value) ?? [:] 32 | } 33 | 34 | // MARK: Relations 35 | 36 | open var owner: Horizon.AccountResource? { 37 | return self.relationSingleOptionalValue(key: CodingKeys.owner) 38 | } 39 | 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Sources/ContoFA/v3/ApiModels/Generated/Invoices/Resources/InvoicesDataResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - DataResource 7 | 8 | extension Invoices { 9 | open class DataResource: Resource { 10 | 11 | open override class var resourceType: String { 12 | return "datas" 13 | } 14 | 15 | public enum CodingKeys: String, CodingKey { 16 | // attributes 17 | case securityType 18 | case value 19 | 20 | // relations 21 | case owner 22 | } 23 | 24 | // MARK: Attributes 25 | 26 | open var securityType: UInt64 { 27 | return self.uint64OptionalValue(key: CodingKeys.securityType) ?? 0 28 | } 29 | 30 | open var value: [String: Any] { 31 | return self.dictionaryOptionalValue(key: CodingKeys.value) ?? [:] 32 | } 33 | 34 | // MARK: Relations 35 | 36 | open var owner: Resource? { 37 | return self.relationSingleOptionalValue(key: CodingKeys.owner) 38 | } 39 | 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /.swiftlint.yml: -------------------------------------------------------------------------------- 1 | excluded: # paths to ignore during linting. Takes precedence over `included`. 2 | - Carthage 3 | - Pods 4 | - Example/Pods 5 | 6 | disabled_rules: # rule identifiers to exclude from running 7 | - multiple_closures_with_trailing_closure 8 | - operator_whitespace 9 | - trailing_whitespace 10 | - function_parameter_count 11 | - cyclomatic_complexity 12 | - discouraged_direct_init 13 | - nesting 14 | - large_tuple 15 | - block_based_kvo 16 | - todo 17 | - fallthrough 18 | 19 | line_length: 120 20 | type_body_length: 21 | warning: 400 22 | error: 600 23 | file_length: 24 | warning: 900 25 | error: 1000 26 | function_body_length: 27 | warning: 100 # Should be 20 28 | error: 200 # Should 40 29 | identifier_name: 30 | min_length: 2 31 | max_length: 50 32 | excluded: 33 | - x 34 | - y 35 | - n 36 | - r 37 | - p 38 | - _default 39 | - _domain 40 | - _selected 41 | type_name: 42 | max_length: 50 43 | excluded: 44 | - iPhone 45 | - iPhoneSize 46 | 47 | nesting: 48 | level: 2 49 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Inner/HorizonCreateAccountSpecificRuleData.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | 5 | // MARK: - CreateAccountSpecificRuleData 6 | 7 | extension Horizon { 8 | public struct CreateAccountSpecificRuleData: Decodable { 9 | 10 | public enum CodingKeys: String, CodingKey { 11 | // attributes 12 | case accountId 13 | case forbids 14 | case ledgerKey 15 | } 16 | 17 | // MARK: Attributes 18 | 19 | public let accountId: String? 20 | public let forbids: Bool 21 | public let ledgerKey: [String: Any] 22 | 23 | // MARK: - 24 | 25 | public init(from decoder: Decoder) throws { 26 | let container = try decoder.container(keyedBy: CodingKeys.self) 27 | 28 | self.accountId = try? container.decode(String.self, forKey: .accountId) 29 | self.forbids = try container.decode(Bool.self, forKey: .forbids) 30 | self.ledgerKey = try container.decodeDictionary([String: Any].self, forKey: .ledgerKey) 31 | } 32 | 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Resources/HorizonCreateManageLimitsRequestOpResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - CreateManageLimitsRequestOpResource 7 | 8 | extension Horizon { 9 | open class CreateManageLimitsRequestOpResource: BaseOperationDetailsResource { 10 | 11 | open override class var resourceType: String { 12 | return "operations-create-manage-limits-request" 13 | } 14 | 15 | public enum CodingKeys: String, CodingKey { 16 | // attributes 17 | case creatorDetails 18 | 19 | // relations 20 | case request 21 | } 22 | 23 | // MARK: Attributes 24 | 25 | open var creatorDetails: [String: Any] { 26 | return self.dictionaryOptionalValue(key: CodingKeys.creatorDetails) ?? [:] 27 | } 28 | 29 | // MARK: Relations 30 | 31 | open var request: Horizon.ReviewableRequestResource? { 32 | return self.relationSingleOptionalValue(key: CodingKeys.request) 33 | } 34 | 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Resources/HorizonVoteResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - VoteResource 7 | 8 | extension Horizon { 9 | open class VoteResource: Resource { 10 | 11 | open override class var resourceType: String { 12 | return "votes" 13 | } 14 | 15 | public enum CodingKeys: String, CodingKey { 16 | // attributes 17 | case voteData 18 | 19 | // relations 20 | case poll 21 | case voter 22 | } 23 | 24 | // MARK: Attributes 25 | 26 | open var voteData: Horizon.VoteData? { 27 | return self.codableOptionalValue(key: CodingKeys.voteData) 28 | } 29 | 30 | // MARK: Relations 31 | 32 | open var poll: Horizon.PollResource? { 33 | return self.relationSingleOptionalValue(key: CodingKeys.poll) 34 | } 35 | 36 | open var voter: Horizon.AccountResource? { 37 | return self.relationSingleOptionalValue(key: CodingKeys.voter) 38 | } 39 | 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Sources/ContoFA/v3/ApiModels/Generated/Friends/Resources/FriendsUserResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - UserResource 7 | 8 | extension Friends { 9 | open class UserResource: Resource { 10 | 11 | open override class var resourceType: String { 12 | return "users" 13 | } 14 | 15 | public enum CodingKeys: String, CodingKey { 16 | // attributes 17 | case identifierValue 18 | 19 | // relations 20 | case account 21 | case identity 22 | } 23 | 24 | // MARK: Attributes 25 | 26 | open var identifierValue: String { 27 | return self.stringOptionalValue(key: CodingKeys.identifierValue) ?? "" 28 | } 29 | 30 | // MARK: Relations 31 | 32 | open var account: Resource? { 33 | return self.relationSingleOptionalValue(key: CodingKeys.account) 34 | } 35 | 36 | open var identity: Resource? { 37 | return self.relationSingleOptionalValue(key: CodingKeys.identity) 38 | } 39 | 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Inner/HorizonKeyValueEntryValue.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | 5 | // MARK: - KeyValueEntryValue 6 | 7 | extension Horizon { 8 | public struct KeyValueEntryValue: Decodable { 9 | 10 | public enum CodingKeys: String, CodingKey { 11 | // attributes 12 | case str 13 | case type 14 | case u32 15 | case u64 16 | } 17 | 18 | // MARK: Attributes 19 | 20 | public let str: String? 21 | public let type: Enum 22 | public let u32: UInt32? 23 | public let u64: UInt64? 24 | 25 | // MARK: - 26 | 27 | public init(from decoder: Decoder) throws { 28 | let container = try decoder.container(keyedBy: CodingKeys.self) 29 | 30 | self.str = try? container.decode(String.self, forKey: .str) 31 | self.type = try container.decode(Enum.self, forKey: .type) 32 | self.u32 = try? container.decode(UInt32.self, forKey: .u32) 33 | self.u64 = try? container.decode(UInt64.self, forKey: .u64) 34 | } 35 | 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Extensions/HorizonBaseEffectResource+Type.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | 5 | public enum BaseEffectType { 6 | 7 | case effectBalanceChange(_ resource: Horizon.EffectBalanceChangeResource) 8 | case effectMatched(_ resource: Horizon.EffectMatchedResource) 9 | case `self`(_ resource: Horizon.BaseEffectResource) 10 | } 11 | 12 | extension Horizon.BaseEffectResource { 13 | 14 | public var baseEffectType: BaseEffectType { 15 | if let resource = self as? Horizon.EffectBalanceChangeResource { 16 | return .effectBalanceChange(resource) 17 | } else if let resource = self as? Horizon.EffectMatchedResource { 18 | return .effectMatched(resource) 19 | } else { 20 | return .`self`(self) 21 | } 22 | } 23 | } 24 | 25 | /* 26 | switch type { 27 | 28 | case .effectBalanceChange(let resource): 29 | 30 | 31 | case .effectMatched(let resource): 32 | 33 | 34 | case .`self`(let resource): 35 | 36 | } 37 | */ 38 | -------------------------------------------------------------------------------- /Example/TokenDSDK/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ios-marketing", 45 | "size" : "1024x1024", 46 | "scale" : "1x" 47 | } 48 | ], 49 | "info" : { 50 | "version" : 1, 51 | "author" : "xcode" 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /Sources/ContoFA/v3/ApiModels/Generated/Cards/Resources/CardsTransactionResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - TransactionResource 7 | 8 | extension Cards { 9 | open class TransactionResource: Resource { 10 | 11 | open override class var resourceType: String { 12 | return "transcations" 13 | } 14 | 15 | public enum CodingKeys: String, CodingKey { 16 | // attributes 17 | case env 18 | 19 | // relations 20 | case destinationCard 21 | case sourceCard 22 | } 23 | 24 | // MARK: Attributes 25 | 26 | open var env: String { 27 | return self.stringOptionalValue(key: CodingKeys.env) ?? "" 28 | } 29 | 30 | // MARK: Relations 31 | 32 | open var destinationCard: Cards.CardResource? { 33 | return self.relationSingleOptionalValue(key: CodingKeys.destinationCard) 34 | } 35 | 36 | open var sourceCard: Cards.CardResource? { 37 | return self.relationSingleOptionalValue(key: CodingKeys.sourceCard) 38 | } 39 | 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Resources/HorizonSignerRoleResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - SignerRoleResource 7 | 8 | extension Horizon { 9 | open class SignerRoleResource: Resource { 10 | 11 | open override class var resourceType: String { 12 | return "signer-roles" 13 | } 14 | 15 | public enum CodingKeys: String, CodingKey { 16 | // attributes 17 | case details 18 | 19 | // relations 20 | case owner 21 | case rules 22 | } 23 | 24 | // MARK: Attributes 25 | 26 | open var details: [String: Any] { 27 | return self.dictionaryOptionalValue(key: CodingKeys.details) ?? [:] 28 | } 29 | 30 | // MARK: Relations 31 | 32 | open var owner: Horizon.AccountResource? { 33 | return self.relationSingleOptionalValue(key: CodingKeys.owner) 34 | } 35 | 36 | open var rules: [Horizon.SignerRuleResource]? { 37 | return self.relationCollectionOptionalValue(key: CodingKeys.rules) 38 | } 39 | 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Sources/ContoFA/v3/ApiModels/Generated/Cards/Resources/CardsUpdateCardResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - UpdateCardResource 7 | 8 | extension Cards { 9 | open class UpdateCardResource: Resource { 10 | 11 | open override class var resourceType: String { 12 | return "update-card-request" 13 | } 14 | 15 | public enum CodingKeys: String, CodingKey { 16 | // attributes 17 | case state 18 | 19 | // relations 20 | case bindBalances 21 | case unbindBalances 22 | } 23 | 24 | // MARK: Attributes 25 | 26 | open var state: Cards.Enum? { 27 | return self.codableOptionalValue(key: CodingKeys.state) 28 | } 29 | 30 | // MARK: Relations 31 | 32 | open var bindBalances: [Resource]? { 33 | return self.relationCollectionOptionalValue(key: CodingKeys.bindBalances) 34 | } 35 | 36 | open var unbindBalances: [Resource]? { 37 | return self.relationCollectionOptionalValue(key: CodingKeys.unbindBalances) 38 | } 39 | 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Resources/HorizonCreateDataOpResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - CreateDataOpResource 7 | 8 | extension Horizon { 9 | open class CreateDataOpResource: BaseOperationDetailsResource { 10 | 11 | open override class var resourceType: String { 12 | return "operations-create-data" 13 | } 14 | 15 | public enum CodingKeys: String, CodingKey { 16 | // attributes 17 | case type 18 | case value 19 | 20 | // relations 21 | case owner 22 | } 23 | 24 | // MARK: Attributes 25 | 26 | open var attributesType: UInt64 { 27 | return self.uint64OptionalValue(key: CodingKeys.type) ?? 0 28 | } 29 | 30 | open var value: [String: Any] { 31 | return self.dictionaryOptionalValue(key: CodingKeys.value) ?? [:] 32 | } 33 | 34 | // MARK: Relations 35 | 36 | open var owner: Horizon.AccountResource? { 37 | return self.relationSingleOptionalValue(key: CodingKeys.owner) 38 | } 39 | 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/APIs/Offers/OffersRequestParametersV3.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | /// Offers request parameters model. 4 | public struct OffersRequestParametersV3 { 5 | 6 | // MARK: - Public properties 7 | 8 | public let baseBalance: String? 9 | public let quoteBalance: String? 10 | public let baseAsset: String? 11 | public let quoteAsset: String? 12 | public let owner: String? 13 | /// - Note: `nil` for pending investments, `"0"` for pending offers. 14 | public let orderBookId: String? 15 | public let offerId: String? 16 | 17 | public init( 18 | baseBalance: String?, 19 | quoteBalance: String?, 20 | baseAsset: String?, 21 | quoteAsset: String?, 22 | owner: String?, 23 | orderBookId: String?, 24 | offerId: String? 25 | ) { 26 | 27 | self.baseBalance = baseBalance 28 | self.quoteBalance = quoteBalance 29 | self.baseAsset = baseAsset 30 | self.quoteAsset = quoteAsset 31 | self.owner = owner 32 | self.orderBookId = orderBookId 33 | self.offerId = offerId 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Sources/KeyServer/CreateWallet/KeyServerApiRequestBuilder+CreateWallet.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public extension KeyServerApiRequestBuilder { 4 | 5 | /// Builds request to fetch wallet KDF params from api. 6 | /// - Parameters: 7 | /// - walletInfo: Wallet info model. 8 | /// - Returns: `CreateWalletRequest` model. 9 | func buildCreateWalletV2Request( 10 | walletInfo: WalletInfoModelV2 11 | ) throws -> CreateWalletRequest { 12 | 13 | let baseUrl = self.apiConfiguration.urlString 14 | let url = baseUrl/walletsPath 15 | 16 | let registrationInfoData = ApiDataRequest( 17 | data: walletInfo.data, 18 | included: walletInfo.included 19 | ) 20 | let registrationInfoDataEncoded = try registrationInfoData.encode() 21 | 22 | let request = CreateWalletRequest( 23 | url: url, 24 | method: .post, 25 | parametersEncoding: .json, 26 | registrationInfoData: registrationInfoDataEncoded 27 | ) 28 | 29 | return request 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/APIs/Base/BaseRequestsJSONAPI.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | /// Base model for plain request. 4 | public class RequestModelJSONAPI { 5 | 6 | // MARK: - Public properties 7 | 8 | public let baseUrl: String 9 | public let path: String 10 | public let method: RequestMethod 11 | public let queryItems: [URLQueryItem] 12 | public let bodyParameters: RequestBodyParameters? 13 | public let headers: RequestHeaders? 14 | 15 | // MARK: - 16 | 17 | public init( 18 | baseUrl: String, 19 | path: String, 20 | method: RequestMethod, 21 | queryItems: [URLQueryItem] = [], 22 | bodyParameters: RequestParameters? = nil, 23 | headers: RequestHeaders? = nil 24 | ) { 25 | 26 | self.baseUrl = baseUrl.getTrailingSlashTrimmed() 27 | self.path = path 28 | self.method = method 29 | self.queryItems = queryItems 30 | self.bodyParameters = bodyParameters 31 | self.headers = headers 32 | } 33 | } 34 | 35 | extension JSONAPI { 36 | 37 | public typealias RequestModel = RequestModelJSONAPI 38 | } 39 | -------------------------------------------------------------------------------- /Sources/MUNA/v3/ApiModels/Generated/MunaTestResults/Resources/MunaTestResultsAccountTestTypeResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - AccountTestTypeResource 7 | 8 | extension MunaTestResults { 9 | open class AccountTestTypeResource: Resource { 10 | 11 | open override class var resourceType: String { 12 | return "account_test_type" 13 | } 14 | 15 | public enum CodingKeys: String, CodingKey { 16 | // attributes 17 | case account 18 | case testTypeId 19 | 20 | // relations 21 | case creator 22 | } 23 | 24 | // MARK: Attributes 25 | 26 | open var account: String { 27 | return self.stringOptionalValue(key: CodingKeys.account) ?? "" 28 | } 29 | 30 | open var testTypeId: Int32 { 31 | return self.int32OptionalValue(key: CodingKeys.testTypeId) ?? 0 32 | } 33 | 34 | // MARK: Relations 35 | 36 | open var creator: MunaTestResults.TestTypeResource? { 37 | return self.relationSingleOptionalValue(key: CodingKeys.creator) 38 | } 39 | 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Manual/UserInfoResource.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import DLJSONAPI 3 | 4 | // MARK: - UserInfoResource 5 | 6 | open class UserInfoResource: Resource { 7 | 8 | open override class var resourceType: String { 9 | return "users-info" 10 | } 11 | 12 | public enum CodingKeys: String, CodingKey { 13 | // attributes 14 | case documents 15 | case firstName 16 | case lastName 17 | } 18 | 19 | // MARK: - Attributes 20 | 21 | open var documents: [String: Any] { 22 | get { return self.dictionaryOptionalValue(key: CodingKeys.documents) ?? [:] } 23 | set { self.setDictionaryOptionalValue(newValue, key: CodingKeys.documents) } 24 | } 25 | 26 | open var firstName: String { 27 | get { return self.stringOptionalValue(key: CodingKeys.firstName) ?? "" } 28 | set { self.setStringOptionalValue(newValue, key: CodingKeys.firstName) } 29 | } 30 | 31 | open var lastName: String { 32 | get { return self.stringOptionalValue(key: CodingKeys.lastName) ?? "" } 33 | set { self.setStringOptionalValue(newValue, key: CodingKeys.lastName) } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Sources/KeyServer/GetKDFParams/GetKDFParamsResponse.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | /// Response model for `GetKDFParamsRequest` api request 4 | public struct GetKDFParamsResponse: Decodable { 5 | 6 | public let attributes: Attributes 7 | public let id: String 8 | public let type: String 9 | 10 | public struct Attributes: Decodable { 11 | 12 | /// KDF algorithm. 13 | /// - Note: Only `Scrypt` is supported currently. 14 | public let algorithm: String 15 | public let bits: Int64 16 | public let n: UInt64 17 | public let p: UInt32 18 | public let r: UInt32 19 | } 20 | } 21 | 22 | extension KDFParams { 23 | 24 | public static func fromResponse( 25 | _ response: GetKDFParamsResponse 26 | ) -> KDFParams { 27 | 28 | return KDFParams( 29 | algorithm: response.attributes.algorithm, 30 | bits: response.attributes.bits, 31 | id: response.id, 32 | n: response.attributes.n, 33 | p: response.attributes.p, 34 | r: response.attributes.r, 35 | type: response.type 36 | ) 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Inner/HorizonUpdateSignerData.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | 5 | // MARK: - UpdateSignerData 6 | 7 | extension Horizon { 8 | public struct UpdateSignerData: Decodable { 9 | 10 | public enum CodingKeys: String, CodingKey { 11 | // attributes 12 | case details 13 | case identity 14 | case roleId 15 | case weight 16 | } 17 | 18 | // MARK: Attributes 19 | 20 | public let details: [String: Any] 21 | public let identity: UInt32 22 | public let roleId: UInt64 23 | public let weight: UInt32 24 | 25 | // MARK: - 26 | 27 | public init(from decoder: Decoder) throws { 28 | let container = try decoder.container(keyedBy: CodingKeys.self) 29 | 30 | self.details = try container.decodeDictionary([String: Any].self, forKey: .details) 31 | self.identity = try container.decode(UInt32.self, forKey: .identity) 32 | self.roleId = try container.decode(UInt64.self, forKey: .roleId) 33 | self.weight = try container.decode(UInt32.self, forKey: .weight) 34 | } 35 | 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Sources/KeyServer/PostWallet/KeyServerApiRequestBuilder+PostWallet.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public extension KeyServerApiRequestBuilder { 4 | 5 | /// Builds request to post new wallet. Used for update login 6 | /// - Parameters: 7 | /// - walletInfo: Wallet info model. 8 | /// - Returns: `CreateWalletRequest` model. 9 | func buildPostWalletV2Request( 10 | walletId: String, 11 | walletInfo: WalletInfoModelV2 12 | ) throws -> PostWalletRequest { 13 | 14 | let baseUrl = self.apiConfiguration.urlString 15 | let url = baseUrl/walletsPath/walletId 16 | 17 | let registrationInfoData = ApiDataRequest( 18 | data: walletInfo.data, 19 | included: walletInfo.included 20 | ) 21 | let registrationInfoDataEncoded = try registrationInfoData.encode() 22 | 23 | let request = PostWalletRequest( 24 | url: url, 25 | method: .post, 26 | parametersEncoding: .json, 27 | registrationInfoData: registrationInfoDataEncoded 28 | ) 29 | 30 | return request 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Extensions/HorizonBaseOperationDetailsResource+RelatedToPoll.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | 5 | public enum BaseOperationDetailsRelatedToPoll { 6 | 7 | case managePollOp(_ resource: Horizon.ManagePollOpResource) 8 | case manageVoteOp(_ resource: Horizon.ManageVoteOpResource) 9 | case `self`(_ resource: Horizon.BaseOperationDetailsResource) 10 | } 11 | 12 | extension Horizon.BaseOperationDetailsResource { 13 | 14 | public var baseOperationDetailsRelatedToPoll: BaseOperationDetailsRelatedToPoll { 15 | if let resource = self as? Horizon.ManagePollOpResource { 16 | return .managePollOp(resource) 17 | } else if let resource = self as? Horizon.ManageVoteOpResource { 18 | return .manageVoteOp(resource) 19 | } else { 20 | return .`self`(self) 21 | } 22 | } 23 | } 24 | 25 | /* 26 | switch type { 27 | 28 | case .managePollOp(let resource): 29 | 30 | 31 | case .manageVoteOp(let resource): 32 | 33 | 34 | case .`self`(let resource): 35 | 36 | } 37 | */ 38 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Resources/HorizonAccountRuleResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - AccountRuleResource 7 | 8 | extension Horizon { 9 | open class AccountRuleResource: Resource { 10 | 11 | open override class var resourceType: String { 12 | return "account-rules" 13 | } 14 | 15 | public enum CodingKeys: String, CodingKey { 16 | // attributes 17 | case action 18 | case details 19 | case forbids 20 | case resource 21 | } 22 | 23 | // MARK: Attributes 24 | 25 | open var action: Horizon.Enum? { 26 | return self.codableOptionalValue(key: CodingKeys.action) 27 | } 28 | 29 | open var details: [String: Any] { 30 | return self.dictionaryOptionalValue(key: CodingKeys.details) ?? [:] 31 | } 32 | 33 | open var forbids: Bool { 34 | return self.boolOptionalValue(key: CodingKeys.forbids) ?? false 35 | } 36 | 37 | open var resource: [String: Any] { 38 | return self.dictionaryOptionalValue(key: CodingKeys.resource) ?? [:] 39 | } 40 | 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Resources/HorizonLimitsWithStatsResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - LimitsWithStatsResource 7 | 8 | extension Horizon { 9 | open class LimitsWithStatsResource: Resource { 10 | 11 | open override class var resourceType: String { 12 | return "limits-with-stats" 13 | } 14 | 15 | public enum CodingKeys: String, CodingKey { 16 | // attributes 17 | case limits 18 | case statistics 19 | 20 | // relations 21 | case account 22 | } 23 | 24 | // MARK: Attributes 25 | 26 | open var limits: Horizon.LimitsResource? { 27 | return self.value(forKey: CodingKeys.limits) as? Horizon.LimitsResource 28 | } 29 | 30 | open var statistics: Horizon.StatisticsResource? { 31 | return self.value(forKey: CodingKeys.statistics) as? Horizon.StatisticsResource 32 | } 33 | 34 | // MARK: Relations 35 | 36 | open var account: Horizon.AccountResource? { 37 | return self.relationSingleOptionalValue(key: CodingKeys.account) 38 | } 39 | 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Sources/DMS/v3/ApiModels/Generated/DMS/Resources/DMSReviewDocumentResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - ReviewDocumentResource 7 | 8 | extension DMS { 9 | open class ReviewDocumentResource: Resource { 10 | 11 | open override class var resourceType: String { 12 | return "review_document" 13 | } 14 | 15 | public enum CodingKeys: String, CodingKey { 16 | // attributes 17 | case comments 18 | case documentVersion 19 | case fileChanges 20 | case outcome 21 | } 22 | 23 | // MARK: Attributes 24 | 25 | open var comments: String? { 26 | return self.stringOptionalValue(key: CodingKeys.comments) 27 | } 28 | 29 | open var documentVersion: Int32 { 30 | return self.int32OptionalValue(key: CodingKeys.documentVersion) ?? 0 31 | } 32 | 33 | open var fileChanges: [String: Any]? { 34 | return self.dictionaryOptionalValue(key: CodingKeys.fileChanges) 35 | } 36 | 37 | open var outcome: Int32 { 38 | return self.int32OptionalValue(key: CodingKeys.outcome) ?? 0 39 | } 40 | 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Sources/JSONAPI/v3/ApiModels/Generated/Horizon/Resources/HorizonManageAccountRoleOpResource.swift: -------------------------------------------------------------------------------- 1 | // Auto-generated code. Do not edit. 2 | 3 | import Foundation 4 | import DLJSONAPI 5 | 6 | // MARK: - ManageAccountRoleOpResource 7 | 8 | extension Horizon { 9 | open class ManageAccountRoleOpResource: BaseOperationDetailsResource { 10 | 11 | open override class var resourceType: String { 12 | return "base-manage-account-role-op" 13 | } 14 | 15 | public enum CodingKeys: String, CodingKey { 16 | // attributes 17 | case details 18 | 19 | // relations 20 | case role 21 | case rules 22 | } 23 | 24 | // MARK: Attributes 25 | 26 | open var details: [String: Any] { 27 | return self.dictionaryOptionalValue(key: CodingKeys.details) ?? [:] 28 | } 29 | 30 | // MARK: Relations 31 | 32 | open var role: Horizon.AccountRoleResource? { 33 | return self.relationSingleOptionalValue(key: CodingKeys.role) 34 | } 35 | 36 | open var rules: [Horizon.AccountRuleResource]? { 37 | return self.relationCollectionOptionalValue(key: CodingKeys.rules) 38 | } 39 | 40 | } 41 | } 42 | --------------------------------------------------------------------------------