diff --git a/CHANGELOG.md b/CHANGELOG.md index bb2619f..fa4d35e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1 +1 @@ -# Change Log +# Change Log \ No newline at end of file diff --git a/Sources/AppwriteModels/AlgoArgon2.swift b/Sources/AppwriteModels/AlgoArgon2.swift index b473771..c93c034 100644 --- a/Sources/AppwriteModels/AlgoArgon2.swift +++ b/Sources/AppwriteModels/AlgoArgon2.swift @@ -7,20 +7,16 @@ public class AlgoArgon2 { /// Algo type. public let type: String - /// Memory used to compute hash. public let memoryCost: Int - /// Amount of time consumed to compute hash public let timeCost: Int - /// Number of threads used to compute hash. public let threads: Int - init( type: String, memoryCost: Int, diff --git a/Sources/AppwriteModels/AlgoBcrypt.swift b/Sources/AppwriteModels/AlgoBcrypt.swift index 3635cec..8d59f2d 100644 --- a/Sources/AppwriteModels/AlgoBcrypt.swift +++ b/Sources/AppwriteModels/AlgoBcrypt.swift @@ -8,7 +8,6 @@ public class AlgoBcrypt { public let type: String - init( type: String ) { diff --git a/Sources/AppwriteModels/AlgoMd5.swift b/Sources/AppwriteModels/AlgoMd5.swift index db970a6..050fe5c 100644 --- a/Sources/AppwriteModels/AlgoMd5.swift +++ b/Sources/AppwriteModels/AlgoMd5.swift @@ -8,7 +8,6 @@ public class AlgoMd5 { public let type: String - init( type: String ) { diff --git a/Sources/AppwriteModels/AlgoPhpass.swift b/Sources/AppwriteModels/AlgoPhpass.swift index fe960fb..493463d 100644 --- a/Sources/AppwriteModels/AlgoPhpass.swift +++ b/Sources/AppwriteModels/AlgoPhpass.swift @@ -8,7 +8,6 @@ public class AlgoPhpass { public let type: String - init( type: String ) { diff --git a/Sources/AppwriteModels/AlgoScrypt.swift b/Sources/AppwriteModels/AlgoScrypt.swift index 8821bfb..73254f2 100644 --- a/Sources/AppwriteModels/AlgoScrypt.swift +++ b/Sources/AppwriteModels/AlgoScrypt.swift @@ -7,24 +7,19 @@ public class AlgoScrypt { /// Algo type. public let type: String - /// CPU complexity of computed hash. public let costCpu: Int - /// Memory complexity of computed hash. public let costMemory: Int - /// Parallelization of computed hash. public let costParallel: Int - /// Length used to compute hash. public let length: Int - init( type: String, costCpu: Int, diff --git a/Sources/AppwriteModels/AlgoScryptModified.swift b/Sources/AppwriteModels/AlgoScryptModified.swift index 0adf147..bc1fde5 100644 --- a/Sources/AppwriteModels/AlgoScryptModified.swift +++ b/Sources/AppwriteModels/AlgoScryptModified.swift @@ -7,20 +7,16 @@ public class AlgoScryptModified { /// Algo type. public let type: String - /// Salt used to compute hash. public let salt: String - /// Separator used to compute hash. public let saltSeparator: String - /// Key used to compute hash. public let signerKey: String - init( type: String, salt: String, diff --git a/Sources/AppwriteModels/AlgoSha.swift b/Sources/AppwriteModels/AlgoSha.swift index 88d6bfc..c0a0532 100644 --- a/Sources/AppwriteModels/AlgoSha.swift +++ b/Sources/AppwriteModels/AlgoSha.swift @@ -8,7 +8,6 @@ public class AlgoSha { public let type: String - init( type: String ) { diff --git a/Sources/AppwriteModels/Continent.swift b/Sources/AppwriteModels/Continent.swift index 7eb40b9..f181353 100644 --- a/Sources/AppwriteModels/Continent.swift +++ b/Sources/AppwriteModels/Continent.swift @@ -7,12 +7,10 @@ public class Continent { /// Continent name. public let name: String - /// Continent two letter code. public let code: String - init( name: String, code: String diff --git a/Sources/AppwriteModels/ContinentList.swift b/Sources/AppwriteModels/ContinentList.swift index 0b60954..3cd7620 100644 --- a/Sources/AppwriteModels/ContinentList.swift +++ b/Sources/AppwriteModels/ContinentList.swift @@ -7,12 +7,10 @@ public class ContinentList { /// Total number of continents documents that matched your query. public let total: Int - /// List of continents. public let continents: [Continent] - init( total: Int, continents: [Continent] diff --git a/Sources/AppwriteModels/Country.swift b/Sources/AppwriteModels/Country.swift index 5a79308..3ce533b 100644 --- a/Sources/AppwriteModels/Country.swift +++ b/Sources/AppwriteModels/Country.swift @@ -7,12 +7,10 @@ public class Country { /// Country name. public let name: String - /// Country two-character ISO 3166-1 alpha code. public let code: String - init( name: String, code: String diff --git a/Sources/AppwriteModels/CountryList.swift b/Sources/AppwriteModels/CountryList.swift index 622ebf0..8d120bd 100644 --- a/Sources/AppwriteModels/CountryList.swift +++ b/Sources/AppwriteModels/CountryList.swift @@ -7,12 +7,10 @@ public class CountryList { /// Total number of countries documents that matched your query. public let total: Int - /// List of countries. public let countries: [Country] - init( total: Int, countries: [Country] diff --git a/Sources/AppwriteModels/Currency.swift b/Sources/AppwriteModels/Currency.swift index 7ec64d2..d93ce0c 100644 --- a/Sources/AppwriteModels/Currency.swift +++ b/Sources/AppwriteModels/Currency.swift @@ -7,32 +7,25 @@ public class Currency { /// Currency symbol. public let symbol: String - /// Currency name. public let name: String - /// Currency native symbol. public let symbolNative: String - /// Number of decimal digits. public let decimalDigits: Int - /// Currency digit rounding. public let rounding: Double - /// Currency code in [ISO 4217-1](http://en.wikipedia.org/wiki/ISO_4217) three-character format. public let code: String - /// Currency plural name public let namePlural: String - init( symbol: String, name: String, diff --git a/Sources/AppwriteModels/CurrencyList.swift b/Sources/AppwriteModels/CurrencyList.swift index e42d9ad..a2e9f00 100644 --- a/Sources/AppwriteModels/CurrencyList.swift +++ b/Sources/AppwriteModels/CurrencyList.swift @@ -7,12 +7,10 @@ public class CurrencyList { /// Total number of currencies documents that matched your query. public let total: Int - /// List of currencies. public let currencies: [Currency] - init( total: Int, currencies: [Currency] diff --git a/Sources/AppwriteModels/Document.swift b/Sources/AppwriteModels/Document.swift index 20a4f86..94069f9 100644 --- a/Sources/AppwriteModels/Document.swift +++ b/Sources/AppwriteModels/Document.swift @@ -7,27 +7,21 @@ public class Document { /// Document ID. public let id: String - /// Collection ID. public let collectionId: String - /// Database ID. public let databaseId: String - /// Document creation date in ISO 8601 format. public let createdAt: String - /// Document update date in ISO 8601 format. public let updatedAt: String - /// Document permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). public let permissions: [Any] - /// Additional properties public let data: T diff --git a/Sources/AppwriteModels/DocumentList.swift b/Sources/AppwriteModels/DocumentList.swift index e71c5ad..4a573fe 100644 --- a/Sources/AppwriteModels/DocumentList.swift +++ b/Sources/AppwriteModels/DocumentList.swift @@ -7,12 +7,10 @@ public class DocumentList { /// Total number of documents documents that matched your query. public let total: Int - /// List of documents. public let documents: [Document] - init( total: Int, documents: [Document] diff --git a/Sources/AppwriteModels/Execution.swift b/Sources/AppwriteModels/Execution.swift index 9301a8b..0f04430 100644 --- a/Sources/AppwriteModels/Execution.swift +++ b/Sources/AppwriteModels/Execution.swift @@ -7,72 +7,55 @@ public class Execution { /// Execution ID. public let id: String - /// Execution creation date in ISO 8601 format. public let createdAt: String - /// Execution upate date in ISO 8601 format. public let updatedAt: String - /// Execution roles. public let permissions: [Any] - /// Function ID. public let functionId: String - /// The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`. public let trigger: String - /// The status of the function execution. Possible values can be: `waiting`, `processing`, `completed`, or `failed`. public let status: String - /// HTTP request method type. public let requestMethod: String - /// HTTP request path and query. public let requestPath: String - /// HTTP response headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous. public let requestHeaders: [Headers] - /// HTTP response status code. public let responseStatusCode: Int - /// HTTP response body. This will return empty unless execution is created as synchronous. public let responseBody: String - /// HTTP response headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous. public let responseHeaders: [Headers] - /// Function logs. Includes the last 4,000 characters. This will return an empty string unless the response is returned using an API key or as part of a webhook payload. public let logs: String - /// Function errors. Includes the last 4,000 characters. This will return an empty string unless the response is returned using an API key or as part of a webhook payload. public let errors: String - /// Function execution duration in seconds. public let duration: Double - /// The scheduled time for execution. If left empty, execution will be queued immediately. public let scheduledAt: String? - init( id: String, createdAt: String, @@ -151,7 +134,7 @@ public class Execution { logs: map["logs"] as! String, errors: map["errors"] as! String, duration: map["duration"] as! Double, - scheduledAt: map["scheduledAt"] as? String? + scheduledAt: map["scheduledAt"] as? String ) } } diff --git a/Sources/AppwriteModels/ExecutionList.swift b/Sources/AppwriteModels/ExecutionList.swift index ae92f73..8a502d9 100644 --- a/Sources/AppwriteModels/ExecutionList.swift +++ b/Sources/AppwriteModels/ExecutionList.swift @@ -7,12 +7,10 @@ public class ExecutionList { /// Total number of executions documents that matched your query. public let total: Int - /// List of executions. public let executions: [Execution] - init( total: Int, executions: [Execution] diff --git a/Sources/AppwriteModels/File.swift b/Sources/AppwriteModels/File.swift index e1669ec..04a5b89 100644 --- a/Sources/AppwriteModels/File.swift +++ b/Sources/AppwriteModels/File.swift @@ -7,48 +7,37 @@ public class File { /// File ID. public let id: String - /// Bucket ID. public let bucketId: String - /// File creation date in ISO 8601 format. public let createdAt: String - /// File update date in ISO 8601 format. public let updatedAt: String - /// File permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). public let permissions: [Any] - /// File name. public let name: String - /// File MD5 signature. public let signature: String - /// File mime type. public let mimeType: String - /// File original size in bytes. public let sizeOriginal: Int - /// Total number of chunks available public let chunksTotal: Int - /// Total number of chunks uploaded public let chunksUploaded: Int - init( id: String, bucketId: String, diff --git a/Sources/AppwriteModels/FileList.swift b/Sources/AppwriteModels/FileList.swift index 51dbd44..0d6ad88 100644 --- a/Sources/AppwriteModels/FileList.swift +++ b/Sources/AppwriteModels/FileList.swift @@ -7,12 +7,10 @@ public class FileList { /// Total number of files documents that matched your query. public let total: Int - /// List of files. public let files: [File] - init( total: Int, files: [File] diff --git a/Sources/AppwriteModels/Headers.swift b/Sources/AppwriteModels/Headers.swift index aa1a95f..6f554ac 100644 --- a/Sources/AppwriteModels/Headers.swift +++ b/Sources/AppwriteModels/Headers.swift @@ -7,12 +7,10 @@ public class Headers { /// Header name. public let name: String - /// Header value. public let value: String - init( name: String, value: String diff --git a/Sources/AppwriteModels/Identity.swift b/Sources/AppwriteModels/Identity.swift index 0c7d09e..fb54237 100644 --- a/Sources/AppwriteModels/Identity.swift +++ b/Sources/AppwriteModels/Identity.swift @@ -7,44 +7,34 @@ public class Identity { /// Identity ID. public let id: String - /// Identity creation date in ISO 8601 format. public let createdAt: String - /// Identity update date in ISO 8601 format. public let updatedAt: String - /// User ID. public let userId: String - /// Identity Provider. public let provider: String - /// ID of the User in the Identity Provider. public let providerUid: String - /// Email of the User in the Identity Provider. public let providerEmail: String - /// Identity Provider Access Token. public let providerAccessToken: String - /// The date of when the access token expires in ISO 8601 format. public let providerAccessTokenExpiry: String - /// Identity Provider Refresh Token. public let providerRefreshToken: String - init( id: String, createdAt: String, diff --git a/Sources/AppwriteModels/IdentityList.swift b/Sources/AppwriteModels/IdentityList.swift index a6c3477..b068f4c 100644 --- a/Sources/AppwriteModels/IdentityList.swift +++ b/Sources/AppwriteModels/IdentityList.swift @@ -7,12 +7,10 @@ public class IdentityList { /// Total number of identities documents that matched your query. public let total: Int - /// List of identities. public let identities: [Identity] - init( total: Int, identities: [Identity] diff --git a/Sources/AppwriteModels/Jwt.swift b/Sources/AppwriteModels/Jwt.swift index 902f5b2..5778435 100644 --- a/Sources/AppwriteModels/Jwt.swift +++ b/Sources/AppwriteModels/Jwt.swift @@ -8,7 +8,6 @@ public class Jwt { public let jwt: String - init( jwt: String ) { diff --git a/Sources/AppwriteModels/Language.swift b/Sources/AppwriteModels/Language.swift index 3111149..f385d5a 100644 --- a/Sources/AppwriteModels/Language.swift +++ b/Sources/AppwriteModels/Language.swift @@ -7,16 +7,13 @@ public class Language { /// Language name. public let name: String - /// Language two-character ISO 639-1 codes. public let code: String - /// Language native name. public let nativeName: String - init( name: String, code: String, diff --git a/Sources/AppwriteModels/LanguageList.swift b/Sources/AppwriteModels/LanguageList.swift index acba750..b4515e3 100644 --- a/Sources/AppwriteModels/LanguageList.swift +++ b/Sources/AppwriteModels/LanguageList.swift @@ -7,12 +7,10 @@ public class LanguageList { /// Total number of languages documents that matched your query. public let total: Int - /// List of languages. public let languages: [Language] - init( total: Int, languages: [Language] diff --git a/Sources/AppwriteModels/Locale.swift b/Sources/AppwriteModels/Locale.swift index 2f4d046..7445776 100644 --- a/Sources/AppwriteModels/Locale.swift +++ b/Sources/AppwriteModels/Locale.swift @@ -7,32 +7,25 @@ public class Locale { /// User IP address. public let ip: String - /// Country code in [ISO 3166-1](http://en.wikipedia.org/wiki/ISO_3166-1) two-character format public let countryCode: String - /// Country name. This field support localization. public let country: String - /// Continent code. A two character continent code "AF" for Africa, "AN" for Antarctica, "AS" for Asia, "EU" for Europe, "NA" for North America, "OC" for Oceania, and "SA" for South America. public let continentCode: String - /// Continent name. This field support localization. public let continent: String - /// True if country is part of the European Union. public let eu: Bool - /// Currency code in [ISO 4217-1](http://en.wikipedia.org/wiki/ISO_4217) three-character format public let currency: String - init( ip: String, countryCode: String, diff --git a/Sources/AppwriteModels/LocaleCode.swift b/Sources/AppwriteModels/LocaleCode.swift index 2d6185e..8e561c7 100644 --- a/Sources/AppwriteModels/LocaleCode.swift +++ b/Sources/AppwriteModels/LocaleCode.swift @@ -7,12 +7,10 @@ public class LocaleCode { /// Locale codes in [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) public let code: String - /// Locale name public let name: String - init( code: String, name: String diff --git a/Sources/AppwriteModels/LocaleCodeList.swift b/Sources/AppwriteModels/LocaleCodeList.swift index dca47d8..895ef7d 100644 --- a/Sources/AppwriteModels/LocaleCodeList.swift +++ b/Sources/AppwriteModels/LocaleCodeList.swift @@ -7,12 +7,10 @@ public class LocaleCodeList { /// Total number of localeCodes documents that matched your query. public let total: Int - /// List of localeCodes. public let localeCodes: [LocaleCode] - init( total: Int, localeCodes: [LocaleCode] diff --git a/Sources/AppwriteModels/Log.swift b/Sources/AppwriteModels/Log.swift index bf0135e..df5464d 100644 --- a/Sources/AppwriteModels/Log.swift +++ b/Sources/AppwriteModels/Log.swift @@ -7,88 +7,67 @@ public class Log { /// Event name. public let event: String - /// User ID. public let userId: String - /// User Email. public let userEmail: String - /// User Name. public let userName: String - /// API mode when event triggered. public let mode: String - /// IP session in use when the session was created. public let ip: String - /// Log creation date in ISO 8601 format. public let time: String - /// Operating system code name. View list of [available options](https://github.com/appwrite/appwrite/blob/master/docs/lists/os.json). public let osCode: String - /// Operating system name. public let osName: String - /// Operating system version. public let osVersion: String - /// Client type. public let clientType: String - /// Client code name. View list of [available options](https://github.com/appwrite/appwrite/blob/master/docs/lists/clients.json). public let clientCode: String - /// Client name. public let clientName: String - /// Client version. public let clientVersion: String - /// Client engine name. public let clientEngine: String - /// Client engine name. public let clientEngineVersion: String - /// Device name. public let deviceName: String - /// Device brand name. public let deviceBrand: String - /// Device model name. public let deviceModel: String - /// Country two-character ISO 3166-1 alpha code. public let countryCode: String - /// Country name. public let countryName: String - init( event: String, userId: String, diff --git a/Sources/AppwriteModels/LogList.swift b/Sources/AppwriteModels/LogList.swift index 241f775..2f99674 100644 --- a/Sources/AppwriteModels/LogList.swift +++ b/Sources/AppwriteModels/LogList.swift @@ -7,12 +7,10 @@ public class LogList { /// Total number of logs documents that matched your query. public let total: Int - /// List of logs. public let logs: [Log] - init( total: Int, logs: [Log] diff --git a/Sources/AppwriteModels/Membership.swift b/Sources/AppwriteModels/Membership.swift index 176b746..55fb199 100644 --- a/Sources/AppwriteModels/Membership.swift +++ b/Sources/AppwriteModels/Membership.swift @@ -7,56 +7,43 @@ public class Membership { /// Membership ID. public let id: String - /// Membership creation date in ISO 8601 format. public let createdAt: String - /// Membership update date in ISO 8601 format. public let updatedAt: String - /// User ID. public let userId: String - /// User name. public let userName: String - /// User email address. public let userEmail: String - /// Team ID. public let teamId: String - /// Team name. public let teamName: String - /// Date, the user has been invited to join the team in ISO 8601 format. public let invited: String - /// Date, the user has accepted the invitation to join the team in ISO 8601 format. public let joined: String - /// User confirmation status, true if the user has joined the team or false otherwise. public let confirm: Bool - /// Multi factor authentication status, true if the user has MFA enabled or false otherwise. public let mfa: Bool - /// User list of roles public let roles: [Any] - init( id: String, createdAt: String, diff --git a/Sources/AppwriteModels/MembershipList.swift b/Sources/AppwriteModels/MembershipList.swift index 5218b20..f27cc99 100644 --- a/Sources/AppwriteModels/MembershipList.swift +++ b/Sources/AppwriteModels/MembershipList.swift @@ -7,12 +7,10 @@ public class MembershipList { /// Total number of memberships documents that matched your query. public let total: Int - /// List of memberships. public let memberships: [Membership] - init( total: Int, memberships: [Membership] diff --git a/Sources/AppwriteModels/MfaChallenge.swift b/Sources/AppwriteModels/MfaChallenge.swift index 6d7481b..5a1e874 100644 --- a/Sources/AppwriteModels/MfaChallenge.swift +++ b/Sources/AppwriteModels/MfaChallenge.swift @@ -7,20 +7,16 @@ public class MfaChallenge { /// Token ID. public let id: String - /// Token creation date in ISO 8601 format. public let createdAt: String - /// User ID. public let userId: String - /// Token expiration date in ISO 8601 format. public let expire: String - init( id: String, createdAt: String, diff --git a/Sources/AppwriteModels/MfaFactors.swift b/Sources/AppwriteModels/MfaFactors.swift index 88adf5e..716c055 100644 --- a/Sources/AppwriteModels/MfaFactors.swift +++ b/Sources/AppwriteModels/MfaFactors.swift @@ -7,20 +7,16 @@ public class MfaFactors { /// Can TOTP be used for MFA challenge for this account. public let totp: Bool - /// Can phone (SMS) be used for MFA challenge for this account. public let phone: Bool - /// Can email be used for MFA challenge for this account. public let email: Bool - /// Can recovery code be used for MFA challenge for this account. public let recoveryCode: Bool - init( totp: Bool, phone: Bool, diff --git a/Sources/AppwriteModels/MfaRecoveryCodes.swift b/Sources/AppwriteModels/MfaRecoveryCodes.swift index 8b57721..8dd063b 100644 --- a/Sources/AppwriteModels/MfaRecoveryCodes.swift +++ b/Sources/AppwriteModels/MfaRecoveryCodes.swift @@ -8,7 +8,6 @@ public class MfaRecoveryCodes { public let recoveryCodes: [Any] - init( recoveryCodes: [Any] ) { diff --git a/Sources/AppwriteModels/MfaType.swift b/Sources/AppwriteModels/MfaType.swift index 80c3526..503134f 100644 --- a/Sources/AppwriteModels/MfaType.swift +++ b/Sources/AppwriteModels/MfaType.swift @@ -7,12 +7,10 @@ public class MfaType { /// Secret token used for TOTP factor. public let secret: String - /// URI for authenticator apps. public let uri: String - init( secret: String, uri: String diff --git a/Sources/AppwriteModels/Phone.swift b/Sources/AppwriteModels/Phone.swift index a1bb096..2e113b4 100644 --- a/Sources/AppwriteModels/Phone.swift +++ b/Sources/AppwriteModels/Phone.swift @@ -7,16 +7,13 @@ public class Phone { /// Phone code. public let code: String - /// Country two-character ISO 3166-1 alpha code. public let countryCode: String - /// Country name. public let countryName: String - init( code: String, countryCode: String, diff --git a/Sources/AppwriteModels/PhoneList.swift b/Sources/AppwriteModels/PhoneList.swift index 6918afa..38a5a6f 100644 --- a/Sources/AppwriteModels/PhoneList.swift +++ b/Sources/AppwriteModels/PhoneList.swift @@ -7,12 +7,10 @@ public class PhoneList { /// Total number of phones documents that matched your query. public let total: Int - /// List of phones. public let phones: [Phone] - init( total: Int, phones: [Phone] diff --git a/Sources/AppwriteModels/Session.swift b/Sources/AppwriteModels/Session.swift index c6aca5b..7214468 100644 --- a/Sources/AppwriteModels/Session.swift +++ b/Sources/AppwriteModels/Session.swift @@ -7,120 +7,91 @@ public class Session { /// Session ID. public let id: String - /// Session creation date in ISO 8601 format. public let createdAt: String - /// Session update date in ISO 8601 format. public let updatedAt: String - /// User ID. public let userId: String - /// Session expiration date in ISO 8601 format. public let expire: String - /// Session Provider. public let provider: String - /// Session Provider User ID. public let providerUid: String - /// Session Provider Access Token. public let providerAccessToken: String - /// The date of when the access token expires in ISO 8601 format. public let providerAccessTokenExpiry: String - /// Session Provider Refresh Token. public let providerRefreshToken: String - /// IP in use when the session was created. public let ip: String - /// Operating system code name. View list of [available options](https://github.com/appwrite/appwrite/blob/master/docs/lists/os.json). public let osCode: String - /// Operating system name. public let osName: String - /// Operating system version. public let osVersion: String - /// Client type. public let clientType: String - /// Client code name. View list of [available options](https://github.com/appwrite/appwrite/blob/master/docs/lists/clients.json). public let clientCode: String - /// Client name. public let clientName: String - /// Client version. public let clientVersion: String - /// Client engine name. public let clientEngine: String - /// Client engine name. public let clientEngineVersion: String - /// Device name. public let deviceName: String - /// Device brand name. public let deviceBrand: String - /// Device model name. public let deviceModel: String - /// Country two-character ISO 3166-1 alpha code. public let countryCode: String - /// Country name. public let countryName: String - /// Returns true if this the current user session. public let current: Bool - /// Returns a list of active session factors. public let factors: [Any] - /// Secret used to authenticate the user. Only included if the request was made with an API key public let secret: String - /// Most recent date in ISO 8601 format when the session successfully passed MFA challenge. public let mfaUpdatedAt: String - init( id: String, createdAt: String, diff --git a/Sources/AppwriteModels/SessionList.swift b/Sources/AppwriteModels/SessionList.swift index c526af9..409f72a 100644 --- a/Sources/AppwriteModels/SessionList.swift +++ b/Sources/AppwriteModels/SessionList.swift @@ -7,12 +7,10 @@ public class SessionList { /// Total number of sessions documents that matched your query. public let total: Int - /// List of sessions. public let sessions: [Session] - init( total: Int, sessions: [Session] diff --git a/Sources/AppwriteModels/Subscriber.swift b/Sources/AppwriteModels/Subscriber.swift index f990bb4..5ab202d 100644 --- a/Sources/AppwriteModels/Subscriber.swift +++ b/Sources/AppwriteModels/Subscriber.swift @@ -7,40 +7,31 @@ public class Subscriber { /// Subscriber ID. public let id: String - /// Subscriber creation time in ISO 8601 format. public let createdAt: String - /// Subscriber update date in ISO 8601 format. public let updatedAt: String - /// Target ID. public let targetId: String - /// Target. public let target: Target - /// Topic ID. public let userId: String - /// User Name. public let userName: String - /// Topic ID. public let topicId: String - /// The target provider type. Can be one of the following: `email`, `sms` or `push`. public let providerType: String - init( id: String, createdAt: String, diff --git a/Sources/AppwriteModels/Target.swift b/Sources/AppwriteModels/Target.swift index eaaf267..087eca6 100644 --- a/Sources/AppwriteModels/Target.swift +++ b/Sources/AppwriteModels/Target.swift @@ -7,36 +7,28 @@ public class Target { /// Target ID. public let id: String - /// Target creation time in ISO 8601 format. public let createdAt: String - /// Target update date in ISO 8601 format. public let updatedAt: String - /// Target Name. public let name: String - /// User ID. public let userId: String - /// Provider ID. public let providerId: String? - /// The target provider type. Can be one of the following: `email`, `sms` or `push`. public let providerType: String - /// The target identifier. public let identifier: String - init( id: String, createdAt: String, @@ -77,7 +69,7 @@ public class Target { updatedAt: map["$updatedAt"] as! String, name: map["name"] as! String, userId: map["userId"] as! String, - providerId: map["providerId"] as? String?, + providerId: map["providerId"] as? String, providerType: map["providerType"] as! String, identifier: map["identifier"] as! String ) diff --git a/Sources/AppwriteModels/Team.swift b/Sources/AppwriteModels/Team.swift index 9830c39..a44c305 100644 --- a/Sources/AppwriteModels/Team.swift +++ b/Sources/AppwriteModels/Team.swift @@ -7,28 +7,22 @@ public class Team { /// Team ID. public let id: String - /// Team creation date in ISO 8601 format. public let createdAt: String - /// Team update date in ISO 8601 format. public let updatedAt: String - /// Team name. public let name: String - /// Total number of team members. public let total: Int - /// Team preferences as a key-value object public let prefs: Preferences - init( id: String, createdAt: String, diff --git a/Sources/AppwriteModels/TeamList.swift b/Sources/AppwriteModels/TeamList.swift index 2934a13..ec7e0bd 100644 --- a/Sources/AppwriteModels/TeamList.swift +++ b/Sources/AppwriteModels/TeamList.swift @@ -7,12 +7,10 @@ public class TeamList { /// Total number of teams documents that matched your query. public let total: Int - /// List of teams. public let teams: [Team] - init( total: Int, teams: [Team] diff --git a/Sources/AppwriteModels/Token.swift b/Sources/AppwriteModels/Token.swift index 5facdef..31d4b4a 100644 --- a/Sources/AppwriteModels/Token.swift +++ b/Sources/AppwriteModels/Token.swift @@ -7,28 +7,22 @@ public class Token { /// Token ID. public let id: String - /// Token creation date in ISO 8601 format. public let createdAt: String - /// User ID. public let userId: String - /// Token secret key. This will return an empty string unless the response is returned using an API key or as part of a webhook payload. public let secret: String - /// Token expiration date in ISO 8601 format. public let expire: String - /// Security phrase of a token. Empty if security phrase was not requested when creating a token. It includes randomly generated phrase which is also sent in the external resource such as email. public let phrase: String - init( id: String, createdAt: String, diff --git a/Sources/AppwriteModels/User.swift b/Sources/AppwriteModels/User.swift index a087357..d12c343 100644 --- a/Sources/AppwriteModels/User.swift +++ b/Sources/AppwriteModels/User.swift @@ -7,80 +7,61 @@ public class User { /// User ID. public let id: String - /// User creation date in ISO 8601 format. public let createdAt: String - /// User update date in ISO 8601 format. public let updatedAt: String - /// User name. public let name: String - /// Hashed user password. public let password: String? - /// Password hashing algorithm. public let hash: String? - /// Password hashing algorithm configuration. public let hashOptions: Any? - /// User registration date in ISO 8601 format. public let registration: String - /// User status. Pass `true` for enabled and `false` for disabled. public let status: Bool - /// Labels for the user. public let labels: [Any] - /// Password update time in ISO 8601 format. public let passwordUpdate: String - /// User email address. public let email: String - /// User phone number in E.164 format. public let phone: String - /// Email verification status. public let emailVerification: Bool - /// Phone verification status. public let phoneVerification: Bool - /// Multi factor authentication status. public let mfa: Bool - /// User preferences as a key-value object public let prefs: Preferences - /// A user-owned message receiver. A single user may have multiple e.g. emails, phones, and a browser. Each target is registered with a single provider. public let targets: [Target] - /// Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours. public let accessedAt: String - init( id: String, createdAt: String, @@ -153,9 +134,9 @@ public class User { createdAt: map["$createdAt"] as! String, updatedAt: map["$updatedAt"] as! String, name: map["name"] as! String, - password: map["password"] as? String?, - hash: map["hash"] as? String?, - hashOptions: map["hashOptions"] as? Any?, + password: map["password"] as? String, + hash: map["hash"] as? String, + hashOptions: map["hashOptions"] as? Any, registration: map["registration"] as! String, status: map["status"] as! Bool, labels: map["labels"] as! [Any],