diff --git a/Appwrite/Appwrite.csproj b/Appwrite/Appwrite.csproj index aa58a56b..4d16cb8e 100644 --- a/Appwrite/Appwrite.csproj +++ b/Appwrite/Appwrite.csproj @@ -2,7 +2,7 @@ netstandard2.0;net462 Appwrite - 8.2.0 + 9.0.0 Appwrite Team Appwrite Team @@ -20,7 +20,7 @@ - + diff --git a/Appwrite/Client.cs b/Appwrite/Client.cs index 8d7b21eb..36be1cd5 100644 --- a/Appwrite/Client.cs +++ b/Appwrite/Client.cs @@ -77,12 +77,12 @@ public Client( _headers = new Dictionary() { { "content-type", "application/json" }, - { "user-agent", $"AppwriteDotNetSDK/8.2.0 ({Environment.OSVersion.Platform}; {Environment.OSVersion.VersionString})"}, + { "user-agent", $"AppwriteDotNetSDK/9.0.0 ({Environment.OSVersion.Platform}; {Environment.OSVersion.VersionString})"}, { "x-sdk-name", ".NET" }, { "x-sdk-platform", "server" }, { "x-sdk-language", "dotnet" }, - { "x-sdk-version", "8.2.0"}, - { "X-Appwrite-Response-Format", "2.0.0" } + { "x-sdk-version", "9.0.0"}, + { "X-Appwrite-Response-Format", "2.4.0" } }; _config = new Dictionary(); @@ -188,15 +188,6 @@ public Client SetForwardedUserAgent(string value) return this; } - /// Your secret dev API key - public Client SetDevKey(string value) - { - _config["devKey"] = value; - AddHeader("X-Appwrite-Dev-Key", value); - - return this; - } - /// The user cookie to authenticate with. Used by SDKs that forward an incoming Cookie header in server-side runtimes. public Client SetCookie(string value) { @@ -269,13 +260,13 @@ private HttpRequestMessage PrepareRequest( foreach (var parameter in parameters) { if (parameter.Value == null) continue; - if (parameter.Key == "file") + if (parameter.Value is MultipartFormDataContent fileContent) { - var fileContent = parameters["file"] as MultipartFormDataContent; - if (fileContent != null) - { - form.Add(fileContent.First()!); - } + form.Add(fileContent.First()!); + } + else if (parameter.Value is System.Collections.IDictionary) + { + form.Add(new StringContent(JsonSerializer.Serialize(parameter.Value, SerializerOptions)), parameter.Key); } else if (parameter.Value is IEnumerable enumerable) { @@ -471,6 +462,10 @@ public async Task Call( return (dict as T)!; } + else if (typeof(T) == typeof(string)) + { + return ((await response.Content.ReadAsStringAsync()) as T)!; + } else { return ((await response.Content.ReadAsByteArrayAsync()) as T)!; @@ -481,18 +476,27 @@ public async Task ChunkedUpload( string path, Dictionary headers, Dictionary parameters, - Func, T> converter, + Func, T>? converter, string paramName, string? idParamName = null, - Action? onProgress = null) where T : class + Action? onProgress = null, + string method = "POST") where T : class { if (string.IsNullOrEmpty(paramName)) throw new ArgumentException("Parameter name cannot be null or empty", nameof(paramName)); - if (!parameters.ContainsKey(paramName)) - throw new ArgumentException($"Parameter {paramName} not found", nameof(paramName)); + if (!parameters.TryGetValue(paramName, out var value) || value == null) + { + return await Call( + method: method, + path, + headers, + parameters, + converter + ); + } - var input = parameters[paramName] as InputFile; + var input = value as InputFile; if (input == null) throw new ArgumentException($"Parameter {paramName} must be an InputFile", nameof(paramName)); @@ -518,11 +522,11 @@ public async Task ChunkedUpload( } var offset = 0L; - var buffer = new byte[Math.Min(size, ChunkSize)]; var result = new Dictionary(); - if (size < ChunkSize) + if (size <= ChunkSize || typeof(T) == typeof(string)) { + byte[] buffer; switch (input.SourceType) { case "path": @@ -532,7 +536,15 @@ public async Task ChunkedUpload( var dataStream = input.Data as Stream; if (dataStream == null) throw new InvalidOperationException("Stream data is null"); - await dataStream.ReadAsync(buffer, 0, (int)size); + buffer = new byte[size]; + var bytesRead = 0; + while (bytesRead < size) + { + var count = await dataStream.ReadAsync(buffer, bytesRead, (int)size - bytesRead); + if (count == 0) + break; + bytesRead += count; + } break; case "bytes": var dataBytes = input.Data as byte[]; @@ -540,6 +552,8 @@ public async Task ChunkedUpload( throw new InvalidOperationException("Byte array data is null"); buffer = dataBytes; break; + default: + throw new InvalidOperationException($"Unsupported source type: {input.SourceType}"); } var content = new MultipartFormDataContent { @@ -549,7 +563,7 @@ public async Task ChunkedUpload( parameters[paramName] = content; return await Call( - method: "POST", + method: method, path, headers, parameters, @@ -656,7 +670,7 @@ async Task ReadChunkAsync(long start, long end) }; var chunkResult = await Call>( - method: "POST", + method: method, path, chunkHeaders, chunkParameters @@ -773,7 +787,7 @@ bool IsUploadComplete(Dictionary chunkResult) var nonNullableResult = result.Where(kvp => kvp.Value != null) .ToDictionary(kvp => kvp.Key, kvp => kvp.Value!); - return converter(nonNullableResult); + return converter != null ? converter(nonNullableResult) : (nonNullableResult as T)!; } } } diff --git a/Appwrite/Enums/BillingPlanGroup.cs b/Appwrite/Enums/BillingPlanGroup.cs index 9340d570..5013f37c 100644 --- a/Appwrite/Enums/BillingPlanGroup.cs +++ b/Appwrite/Enums/BillingPlanGroup.cs @@ -11,7 +11,8 @@ public BillingPlanGroup(string value) Value = value; } - public static BillingPlanGroup Starter => new BillingPlanGroup("starter"); + public static BillingPlanGroup Free => new BillingPlanGroup("free"); + public static BillingPlanGroup Start => new BillingPlanGroup("start"); public static BillingPlanGroup Pro => new BillingPlanGroup("pro"); public static BillingPlanGroup Scale => new BillingPlanGroup("scale"); } diff --git a/Appwrite/Enums/BuildRuntime.cs b/Appwrite/Enums/BuildRuntime.cs index f2440976..8373bb02 100644 --- a/Appwrite/Enums/BuildRuntime.cs +++ b/Appwrite/Enums/BuildRuntime.cs @@ -62,6 +62,7 @@ public BuildRuntime(string value) public static BuildRuntime Dart310 => new BuildRuntime("dart-3.10"); public static BuildRuntime Dart311 => new BuildRuntime("dart-3.11"); public static BuildRuntime Dart312 => new BuildRuntime("dart-3.12"); + public static BuildRuntime Dart313 => new BuildRuntime("dart-3.13"); public static BuildRuntime Dotnet60 => new BuildRuntime("dotnet-6.0"); public static BuildRuntime Dotnet70 => new BuildRuntime("dotnet-7.0"); public static BuildRuntime Dotnet80 => new BuildRuntime("dotnet-8.0"); @@ -104,5 +105,6 @@ public BuildRuntime(string value) public static BuildRuntime Flutter338 => new BuildRuntime("flutter-3.38"); public static BuildRuntime Flutter341 => new BuildRuntime("flutter-3.41"); public static BuildRuntime Flutter344 => new BuildRuntime("flutter-3.44"); + public static BuildRuntime Flutter347 => new BuildRuntime("flutter-3.47"); } } diff --git a/Appwrite/Enums/DomainRegistrationType.cs b/Appwrite/Enums/DomainRegistrationType.cs new file mode 100644 index 00000000..32e1973a --- /dev/null +++ b/Appwrite/Enums/DomainRegistrationType.cs @@ -0,0 +1,19 @@ +using System; + +namespace Appwrite.Enums +{ + public class DomainRegistrationType : IEnum + { + public string Value { get; private set; } + + public DomainRegistrationType(string value) + { + Value = value; + } + + public static DomainRegistrationType New => new DomainRegistrationType("new"); + public static DomainRegistrationType Transfer => new DomainRegistrationType("transfer"); + public static DomainRegistrationType Renewal => new DomainRegistrationType("renewal"); + public static DomainRegistrationType Trade => new DomainRegistrationType("trade"); + } +} diff --git a/Appwrite/Enums/DomainTransferStatusEnum.cs b/Appwrite/Enums/DomainTransferStatusEnum.cs new file mode 100644 index 00000000..2666a008 --- /dev/null +++ b/Appwrite/Enums/DomainTransferStatusEnum.cs @@ -0,0 +1,23 @@ +using System; + +namespace Appwrite.Enums +{ + public class DomainTransferStatusEnum : IEnum + { + public string Value { get; private set; } + + public DomainTransferStatusEnum(string value) + { + Value = value; + } + + public static DomainTransferStatusEnum Transferrable => new DomainTransferStatusEnum("transferrable"); + public static DomainTransferStatusEnum NotTransferrable => new DomainTransferStatusEnum("not_transferrable"); + public static DomainTransferStatusEnum PendingOwner => new DomainTransferStatusEnum("pending_owner"); + public static DomainTransferStatusEnum PendingAdmin => new DomainTransferStatusEnum("pending_admin"); + public static DomainTransferStatusEnum PendingRegistry => new DomainTransferStatusEnum("pending_registry"); + public static DomainTransferStatusEnum Completed => new DomainTransferStatusEnum("completed"); + public static DomainTransferStatusEnum Cancelled => new DomainTransferStatusEnum("cancelled"); + public static DomainTransferStatusEnum ServiceUnavailable => new DomainTransferStatusEnum("service_unavailable"); + } +} diff --git a/Appwrite/Enums/Framework.cs b/Appwrite/Enums/Framework.cs index 72864656..3f52930f 100644 --- a/Appwrite/Enums/Framework.cs +++ b/Appwrite/Enums/Framework.cs @@ -23,6 +23,7 @@ public Framework(string value) public static Framework Remix => new Framework("remix"); public static Framework Lynx => new Framework("lynx"); public static Framework Flutter => new Framework("flutter"); + public static Framework Jaspr => new Framework("jaspr"); public static Framework ReactNative => new Framework("react-native"); public static Framework Vite => new Framework("vite"); public static Framework Other => new Framework("other"); diff --git a/Appwrite/Enums/IdTokenProvider.cs b/Appwrite/Enums/IdTokenProvider.cs new file mode 100644 index 00000000..d7108823 --- /dev/null +++ b/Appwrite/Enums/IdTokenProvider.cs @@ -0,0 +1,17 @@ +using System; + +namespace Appwrite.Enums +{ + public class IdTokenProvider : IEnum + { + public string Value { get; private set; } + + public IdTokenProvider(string value) + { + Value = value; + } + + public static IdTokenProvider Apple => new IdTokenProvider("apple"); + public static IdTokenProvider Google => new IdTokenProvider("google"); + } +} diff --git a/Appwrite/Enums/ImageGravity.cs b/Appwrite/Enums/ImageGravity.cs index 70ffbb64..85847231 100644 --- a/Appwrite/Enums/ImageGravity.cs +++ b/Appwrite/Enums/ImageGravity.cs @@ -11,6 +11,7 @@ public ImageGravity(string value) Value = value; } + public static ImageGravity Auto => new ImageGravity("auto"); public static ImageGravity Center => new ImageGravity("center"); public static ImageGravity TopLeft => new ImageGravity("top-left"); public static ImageGravity Top => new ImageGravity("top"); diff --git a/Appwrite/Enums/OAuth2Auth0Prompt.cs b/Appwrite/Enums/OAuth2Auth0Prompt.cs new file mode 100644 index 00000000..bc76b613 --- /dev/null +++ b/Appwrite/Enums/OAuth2Auth0Prompt.cs @@ -0,0 +1,18 @@ +using System; + +namespace Appwrite.Enums +{ + public class OAuth2Auth0Prompt : IEnum + { + public string Value { get; private set; } + + public OAuth2Auth0Prompt(string value) + { + Value = value; + } + + public static OAuth2Auth0Prompt None => new OAuth2Auth0Prompt("none"); + public static OAuth2Auth0Prompt Login => new OAuth2Auth0Prompt("login"); + public static OAuth2Auth0Prompt Consent => new OAuth2Auth0Prompt("consent"); + } +} diff --git a/Appwrite/Enums/OAuth2DiscordPrompt.cs b/Appwrite/Enums/OAuth2DiscordPrompt.cs new file mode 100644 index 00000000..2ed48dd6 --- /dev/null +++ b/Appwrite/Enums/OAuth2DiscordPrompt.cs @@ -0,0 +1,17 @@ +using System; + +namespace Appwrite.Enums +{ + public class OAuth2DiscordPrompt : IEnum + { + public string Value { get; private set; } + + public OAuth2DiscordPrompt(string value) + { + Value = value; + } + + public static OAuth2DiscordPrompt None => new OAuth2DiscordPrompt("none"); + public static OAuth2DiscordPrompt Consent => new OAuth2DiscordPrompt("consent"); + } +} diff --git a/Appwrite/Enums/OAuth2GithubPrompt.cs b/Appwrite/Enums/OAuth2GithubPrompt.cs new file mode 100644 index 00000000..02eca196 --- /dev/null +++ b/Appwrite/Enums/OAuth2GithubPrompt.cs @@ -0,0 +1,16 @@ +using System; + +namespace Appwrite.Enums +{ + public class OAuth2GithubPrompt : IEnum + { + public string Value { get; private set; } + + public OAuth2GithubPrompt(string value) + { + Value = value; + } + + public static OAuth2GithubPrompt SelectAccount => new OAuth2GithubPrompt("select_account"); + } +} diff --git a/Appwrite/Enums/OAuth2KakaoPrompt.cs b/Appwrite/Enums/OAuth2KakaoPrompt.cs new file mode 100644 index 00000000..5ef7899d --- /dev/null +++ b/Appwrite/Enums/OAuth2KakaoPrompt.cs @@ -0,0 +1,19 @@ +using System; + +namespace Appwrite.Enums +{ + public class OAuth2KakaoPrompt : IEnum + { + public string Value { get; private set; } + + public OAuth2KakaoPrompt(string value) + { + Value = value; + } + + public static OAuth2KakaoPrompt None => new OAuth2KakaoPrompt("none"); + public static OAuth2KakaoPrompt Login => new OAuth2KakaoPrompt("login"); + public static OAuth2KakaoPrompt Create => new OAuth2KakaoPrompt("create"); + public static OAuth2KakaoPrompt SelectAccount => new OAuth2KakaoPrompt("select_account"); + } +} diff --git a/Appwrite/Enums/OAuth2MicrosoftPrompt.cs b/Appwrite/Enums/OAuth2MicrosoftPrompt.cs new file mode 100644 index 00000000..8f095643 --- /dev/null +++ b/Appwrite/Enums/OAuth2MicrosoftPrompt.cs @@ -0,0 +1,19 @@ +using System; + +namespace Appwrite.Enums +{ + public class OAuth2MicrosoftPrompt : IEnum + { + public string Value { get; private set; } + + public OAuth2MicrosoftPrompt(string value) + { + Value = value; + } + + public static OAuth2MicrosoftPrompt None => new OAuth2MicrosoftPrompt("none"); + public static OAuth2MicrosoftPrompt Login => new OAuth2MicrosoftPrompt("login"); + public static OAuth2MicrosoftPrompt Consent => new OAuth2MicrosoftPrompt("consent"); + public static OAuth2MicrosoftPrompt SelectAccount => new OAuth2MicrosoftPrompt("select_account"); + } +} diff --git a/Appwrite/Enums/OAuth2OktaPrompt.cs b/Appwrite/Enums/OAuth2OktaPrompt.cs new file mode 100644 index 00000000..414a8a6e --- /dev/null +++ b/Appwrite/Enums/OAuth2OktaPrompt.cs @@ -0,0 +1,18 @@ +using System; + +namespace Appwrite.Enums +{ + public class OAuth2OktaPrompt : IEnum + { + public string Value { get; private set; } + + public OAuth2OktaPrompt(string value) + { + Value = value; + } + + public static OAuth2OktaPrompt None => new OAuth2OktaPrompt("none"); + public static OAuth2OktaPrompt Login => new OAuth2OktaPrompt("login"); + public static OAuth2OktaPrompt Consent => new OAuth2OktaPrompt("consent"); + } +} diff --git a/Appwrite/Enums/OAuth2SalesforcePrompt.cs b/Appwrite/Enums/OAuth2SalesforcePrompt.cs new file mode 100644 index 00000000..0f11a302 --- /dev/null +++ b/Appwrite/Enums/OAuth2SalesforcePrompt.cs @@ -0,0 +1,17 @@ +using System; + +namespace Appwrite.Enums +{ + public class OAuth2SalesforcePrompt : IEnum + { + public string Value { get; private set; } + + public OAuth2SalesforcePrompt(string value) + { + Value = value; + } + + public static OAuth2SalesforcePrompt Login => new OAuth2SalesforcePrompt("login"); + public static OAuth2SalesforcePrompt Consent => new OAuth2SalesforcePrompt("consent"); + } +} diff --git a/Appwrite/Enums/OAuth2ZohoPrompt.cs b/Appwrite/Enums/OAuth2ZohoPrompt.cs new file mode 100644 index 00000000..3a36ace4 --- /dev/null +++ b/Appwrite/Enums/OAuth2ZohoPrompt.cs @@ -0,0 +1,16 @@ +using System; + +namespace Appwrite.Enums +{ + public class OAuth2ZohoPrompt : IEnum + { + public string Value { get; private set; } + + public OAuth2ZohoPrompt(string value) + { + Value = value; + } + + public static OAuth2ZohoPrompt Consent => new OAuth2ZohoPrompt("consent"); + } +} diff --git a/Appwrite/Enums/OAuthProvider.cs b/Appwrite/Enums/OAuthProvider.cs index b3d03b43..005e7bff 100644 --- a/Appwrite/Enums/OAuthProvider.cs +++ b/Appwrite/Enums/OAuthProvider.cs @@ -33,6 +33,7 @@ public OAuthProvider(string value) public static OAuthProvider Gitlab => new OAuthProvider("gitlab"); public static OAuthProvider Google => new OAuthProvider("google"); public static OAuthProvider Huggingface => new OAuthProvider("huggingface"); + public static OAuthProvider Kakao => new OAuthProvider("kakao"); public static OAuthProvider Keycloak => new OAuthProvider("keycloak"); public static OAuthProvider Kick => new OAuthProvider("kick"); public static OAuthProvider Linkedin => new OAuthProvider("linkedin"); @@ -48,9 +49,11 @@ public OAuthProvider(string value) public static OAuthProvider Slack => new OAuthProvider("slack"); public static OAuthProvider Spotify => new OAuthProvider("spotify"); public static OAuthProvider Stripe => new OAuthProvider("stripe"); + public static OAuthProvider Tiktok => new OAuthProvider("tiktok"); public static OAuthProvider Tradeshift => new OAuthProvider("tradeshift"); public static OAuthProvider TradeshiftBox => new OAuthProvider("tradeshiftBox"); public static OAuthProvider Twitch => new OAuthProvider("twitch"); + public static OAuthProvider Webflow => new OAuthProvider("webflow"); public static OAuthProvider Wordpress => new OAuthProvider("wordpress"); public static OAuthProvider X => new OAuthProvider("x"); public static OAuthProvider Yahoo => new OAuthProvider("yahoo"); diff --git a/Appwrite/Enums/OrganizationKeyScopes.cs b/Appwrite/Enums/OrganizationKeyScopes.cs deleted file mode 100644 index 8e848a17..00000000 --- a/Appwrite/Enums/OrganizationKeyScopes.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System; - -namespace Appwrite.Enums -{ - public class OrganizationKeyScopes : IEnum - { - public string Value { get; private set; } - - public OrganizationKeyScopes(string value) - { - Value = value; - } - - public static OrganizationKeyScopes ProjectsRead => new OrganizationKeyScopes("projects.read"); - public static OrganizationKeyScopes ProjectsWrite => new OrganizationKeyScopes("projects.write"); - public static OrganizationKeyScopes DevKeysRead => new OrganizationKeyScopes("devKeys.read"); - public static OrganizationKeyScopes DevKeysWrite => new OrganizationKeyScopes("devKeys.write"); - public static OrganizationKeyScopes OrganizationKeysRead => new OrganizationKeyScopes("organization.keys.read"); - public static OrganizationKeyScopes OrganizationKeysWrite => new OrganizationKeyScopes("organization.keys.write"); - public static OrganizationKeyScopes OrganizationInstallationsRead => new OrganizationKeyScopes("organization.installations.read"); - public static OrganizationKeyScopes OrganizationInstallationsWrite => new OrganizationKeyScopes("organization.installations.write"); - public static OrganizationKeyScopes OrganizationMembershipsRead => new OrganizationKeyScopes("organization.memberships.read"); - public static OrganizationKeyScopes OrganizationMembershipsWrite => new OrganizationKeyScopes("organization.memberships.write"); - public static OrganizationKeyScopes OrganizationRead => new OrganizationKeyScopes("organization.read"); - public static OrganizationKeyScopes OrganizationWrite => new OrganizationKeyScopes("organization.write"); - public static OrganizationKeyScopes DomainsRead => new OrganizationKeyScopes("domains.read"); - public static OrganizationKeyScopes DomainsWrite => new OrganizationKeyScopes("domains.write"); - public static OrganizationKeyScopes KeysRead => new OrganizationKeyScopes("keys.read"); - public static OrganizationKeyScopes KeysWrite => new OrganizationKeyScopes("keys.write"); - } -} diff --git a/Appwrite/Enums/ProjectAuthMethodId.cs b/Appwrite/Enums/ProjectAuthMethodId.cs index 240a1cb2..e51a74ed 100644 --- a/Appwrite/Enums/ProjectAuthMethodId.cs +++ b/Appwrite/Enums/ProjectAuthMethodId.cs @@ -18,5 +18,6 @@ public ProjectAuthMethodId(string value) public static ProjectAuthMethodId Invites => new ProjectAuthMethodId("invites"); public static ProjectAuthMethodId Jwt => new ProjectAuthMethodId("jwt"); public static ProjectAuthMethodId Phone => new ProjectAuthMethodId("phone"); + public static ProjectAuthMethodId Passkey => new ProjectAuthMethodId("passkey"); } } diff --git a/Appwrite/Enums/ProjectEmailTemplateId.cs b/Appwrite/Enums/ProjectEmailTemplateId.cs index 1c47a42f..c05d8329 100644 --- a/Appwrite/Enums/ProjectEmailTemplateId.cs +++ b/Appwrite/Enums/ProjectEmailTemplateId.cs @@ -18,5 +18,7 @@ public ProjectEmailTemplateId(string value) public static ProjectEmailTemplateId MfaChallenge => new ProjectEmailTemplateId("mfaChallenge"); public static ProjectEmailTemplateId SessionAlert => new ProjectEmailTemplateId("sessionAlert"); public static ProjectEmailTemplateId OtpSession => new ProjectEmailTemplateId("otpSession"); + public static ProjectEmailTemplateId OtpVerification => new ProjectEmailTemplateId("otpVerification"); + public static ProjectEmailTemplateId OtpRecovery => new ProjectEmailTemplateId("otpRecovery"); } } diff --git a/Appwrite/Enums/ProjectKeyScopes.cs b/Appwrite/Enums/ProjectKeyScopes.cs index 2ecb5b92..6b6461bd 100644 --- a/Appwrite/Enums/ProjectKeyScopes.cs +++ b/Appwrite/Enums/ProjectKeyScopes.cs @@ -101,6 +101,7 @@ public ProjectKeyScopes(string value) public static ProjectKeyScopes WebhooksWrite => new ProjectKeyScopes("webhooks.write"); public static ProjectKeyScopes LocaleRead => new ProjectKeyScopes("locale.read"); public static ProjectKeyScopes AvatarsRead => new ProjectKeyScopes("avatars.read"); + public static ProjectKeyScopes AvatarsWrite => new ProjectKeyScopes("avatars.write"); public static ProjectKeyScopes HealthRead => new ProjectKeyScopes("health.read"); public static ProjectKeyScopes AssistantRead => new ProjectKeyScopes("assistant.read"); public static ProjectKeyScopes MigrationsRead => new ProjectKeyScopes("migrations.read"); @@ -115,6 +116,7 @@ public ProjectKeyScopes(string value) public static ProjectKeyScopes ReportsWrite => new ProjectKeyScopes("reports.write"); public static ProjectKeyScopes PresencesRead => new ProjectKeyScopes("presences.read"); public static ProjectKeyScopes PresencesWrite => new ProjectKeyScopes("presences.write"); + public static ProjectKeyScopes DedicatedDatabasesExecute => new ProjectKeyScopes("dedicatedDatabases.execute"); public static ProjectKeyScopes BackupsPoliciesRead => new ProjectKeyScopes("backups.policies.read"); public static ProjectKeyScopes BackupsPoliciesWrite => new ProjectKeyScopes("backups.policies.write"); public static ProjectKeyScopes ArchivesRead => new ProjectKeyScopes("archives.read"); @@ -132,5 +134,7 @@ public ProjectKeyScopes(string value) public static ProjectKeyScopes Oauth2Read => new ProjectKeyScopes("oauth2.read"); public static ProjectKeyScopes Oauth2Write => new ProjectKeyScopes("oauth2.write"); public static ProjectKeyScopes Oauth2Introspect => new ProjectKeyScopes("oauth2.introspect"); + public static ProjectKeyScopes AnalyticsRead => new ProjectKeyScopes("analytics.read"); + public static ProjectKeyScopes AnalyticsWrite => new ProjectKeyScopes("analytics.write"); } } diff --git a/Appwrite/Enums/ProjectOAuth2Auth0Prompt.cs b/Appwrite/Enums/ProjectOAuth2Auth0Prompt.cs new file mode 100644 index 00000000..2e62b0b2 --- /dev/null +++ b/Appwrite/Enums/ProjectOAuth2Auth0Prompt.cs @@ -0,0 +1,18 @@ +using System; + +namespace Appwrite.Enums +{ + public class ProjectOAuth2Auth0Prompt : IEnum + { + public string Value { get; private set; } + + public ProjectOAuth2Auth0Prompt(string value) + { + Value = value; + } + + public static ProjectOAuth2Auth0Prompt None => new ProjectOAuth2Auth0Prompt("none"); + public static ProjectOAuth2Auth0Prompt Login => new ProjectOAuth2Auth0Prompt("login"); + public static ProjectOAuth2Auth0Prompt Consent => new ProjectOAuth2Auth0Prompt("consent"); + } +} diff --git a/Appwrite/Enums/ProjectOAuth2DiscordPrompt.cs b/Appwrite/Enums/ProjectOAuth2DiscordPrompt.cs new file mode 100644 index 00000000..5d7de4d0 --- /dev/null +++ b/Appwrite/Enums/ProjectOAuth2DiscordPrompt.cs @@ -0,0 +1,17 @@ +using System; + +namespace Appwrite.Enums +{ + public class ProjectOAuth2DiscordPrompt : IEnum + { + public string Value { get; private set; } + + public ProjectOAuth2DiscordPrompt(string value) + { + Value = value; + } + + public static ProjectOAuth2DiscordPrompt None => new ProjectOAuth2DiscordPrompt("none"); + public static ProjectOAuth2DiscordPrompt Consent => new ProjectOAuth2DiscordPrompt("consent"); + } +} diff --git a/Appwrite/Enums/ProjectOAuth2GitHubPrompt.cs b/Appwrite/Enums/ProjectOAuth2GitHubPrompt.cs new file mode 100644 index 00000000..c7fc21ed --- /dev/null +++ b/Appwrite/Enums/ProjectOAuth2GitHubPrompt.cs @@ -0,0 +1,16 @@ +using System; + +namespace Appwrite.Enums +{ + public class ProjectOAuth2GitHubPrompt : IEnum + { + public string Value { get; private set; } + + public ProjectOAuth2GitHubPrompt(string value) + { + Value = value; + } + + public static ProjectOAuth2GitHubPrompt SelectAccount => new ProjectOAuth2GitHubPrompt("select_account"); + } +} diff --git a/Appwrite/Enums/ProjectOAuth2KakaoPrompt.cs b/Appwrite/Enums/ProjectOAuth2KakaoPrompt.cs new file mode 100644 index 00000000..cc1bb0fc --- /dev/null +++ b/Appwrite/Enums/ProjectOAuth2KakaoPrompt.cs @@ -0,0 +1,19 @@ +using System; + +namespace Appwrite.Enums +{ + public class ProjectOAuth2KakaoPrompt : IEnum + { + public string Value { get; private set; } + + public ProjectOAuth2KakaoPrompt(string value) + { + Value = value; + } + + public static ProjectOAuth2KakaoPrompt None => new ProjectOAuth2KakaoPrompt("none"); + public static ProjectOAuth2KakaoPrompt Login => new ProjectOAuth2KakaoPrompt("login"); + public static ProjectOAuth2KakaoPrompt Create => new ProjectOAuth2KakaoPrompt("create"); + public static ProjectOAuth2KakaoPrompt SelectAccount => new ProjectOAuth2KakaoPrompt("select_account"); + } +} diff --git a/Appwrite/Enums/ProjectOAuth2MicrosoftPrompt.cs b/Appwrite/Enums/ProjectOAuth2MicrosoftPrompt.cs new file mode 100644 index 00000000..0176b295 --- /dev/null +++ b/Appwrite/Enums/ProjectOAuth2MicrosoftPrompt.cs @@ -0,0 +1,19 @@ +using System; + +namespace Appwrite.Enums +{ + public class ProjectOAuth2MicrosoftPrompt : IEnum + { + public string Value { get; private set; } + + public ProjectOAuth2MicrosoftPrompt(string value) + { + Value = value; + } + + public static ProjectOAuth2MicrosoftPrompt None => new ProjectOAuth2MicrosoftPrompt("none"); + public static ProjectOAuth2MicrosoftPrompt Login => new ProjectOAuth2MicrosoftPrompt("login"); + public static ProjectOAuth2MicrosoftPrompt Consent => new ProjectOAuth2MicrosoftPrompt("consent"); + public static ProjectOAuth2MicrosoftPrompt SelectAccount => new ProjectOAuth2MicrosoftPrompt("select_account"); + } +} diff --git a/Appwrite/Enums/ProjectOAuth2OktaPrompt.cs b/Appwrite/Enums/ProjectOAuth2OktaPrompt.cs new file mode 100644 index 00000000..7c106f05 --- /dev/null +++ b/Appwrite/Enums/ProjectOAuth2OktaPrompt.cs @@ -0,0 +1,18 @@ +using System; + +namespace Appwrite.Enums +{ + public class ProjectOAuth2OktaPrompt : IEnum + { + public string Value { get; private set; } + + public ProjectOAuth2OktaPrompt(string value) + { + Value = value; + } + + public static ProjectOAuth2OktaPrompt None => new ProjectOAuth2OktaPrompt("none"); + public static ProjectOAuth2OktaPrompt Login => new ProjectOAuth2OktaPrompt("login"); + public static ProjectOAuth2OktaPrompt Consent => new ProjectOAuth2OktaPrompt("consent"); + } +} diff --git a/Appwrite/Enums/ProjectOAuth2SalesforcePrompt.cs b/Appwrite/Enums/ProjectOAuth2SalesforcePrompt.cs new file mode 100644 index 00000000..1ae024bc --- /dev/null +++ b/Appwrite/Enums/ProjectOAuth2SalesforcePrompt.cs @@ -0,0 +1,17 @@ +using System; + +namespace Appwrite.Enums +{ + public class ProjectOAuth2SalesforcePrompt : IEnum + { + public string Value { get; private set; } + + public ProjectOAuth2SalesforcePrompt(string value) + { + Value = value; + } + + public static ProjectOAuth2SalesforcePrompt Login => new ProjectOAuth2SalesforcePrompt("login"); + public static ProjectOAuth2SalesforcePrompt Consent => new ProjectOAuth2SalesforcePrompt("consent"); + } +} diff --git a/Appwrite/Enums/ProjectOAuth2ZohoPrompt.cs b/Appwrite/Enums/ProjectOAuth2ZohoPrompt.cs new file mode 100644 index 00000000..dd4d32fa --- /dev/null +++ b/Appwrite/Enums/ProjectOAuth2ZohoPrompt.cs @@ -0,0 +1,16 @@ +using System; + +namespace Appwrite.Enums +{ + public class ProjectOAuth2ZohoPrompt : IEnum + { + public string Value { get; private set; } + + public ProjectOAuth2ZohoPrompt(string value) + { + Value = value; + } + + public static ProjectOAuth2ZohoPrompt Consent => new ProjectOAuth2ZohoPrompt("consent"); + } +} diff --git a/Appwrite/Enums/ProjectOAuthProviderId.cs b/Appwrite/Enums/ProjectOAuthProviderId.cs index c1fa023d..dd2b4b0f 100644 --- a/Appwrite/Enums/ProjectOAuthProviderId.cs +++ b/Appwrite/Enums/ProjectOAuthProviderId.cs @@ -33,6 +33,7 @@ public ProjectOAuthProviderId(string value) public static ProjectOAuthProviderId Gitlab => new ProjectOAuthProviderId("gitlab"); public static ProjectOAuthProviderId Google => new ProjectOAuthProviderId("google"); public static ProjectOAuthProviderId Huggingface => new ProjectOAuthProviderId("huggingface"); + public static ProjectOAuthProviderId Kakao => new ProjectOAuthProviderId("kakao"); public static ProjectOAuthProviderId Keycloak => new ProjectOAuthProviderId("keycloak"); public static ProjectOAuthProviderId Kick => new ProjectOAuthProviderId("kick"); public static ProjectOAuthProviderId Linkedin => new ProjectOAuthProviderId("linkedin"); @@ -48,9 +49,11 @@ public ProjectOAuthProviderId(string value) public static ProjectOAuthProviderId Slack => new ProjectOAuthProviderId("slack"); public static ProjectOAuthProviderId Spotify => new ProjectOAuthProviderId("spotify"); public static ProjectOAuthProviderId Stripe => new ProjectOAuthProviderId("stripe"); + public static ProjectOAuthProviderId Tiktok => new ProjectOAuthProviderId("tiktok"); public static ProjectOAuthProviderId Tradeshift => new ProjectOAuthProviderId("tradeshift"); public static ProjectOAuthProviderId TradeshiftBox => new ProjectOAuthProviderId("tradeshiftBox"); public static ProjectOAuthProviderId Twitch => new ProjectOAuthProviderId("twitch"); + public static ProjectOAuthProviderId Webflow => new ProjectOAuthProviderId("webflow"); public static ProjectOAuthProviderId Wordpress => new ProjectOAuthProviderId("wordpress"); public static ProjectOAuthProviderId X => new ProjectOAuthProviderId("x"); public static ProjectOAuthProviderId Yahoo => new ProjectOAuthProviderId("yahoo"); diff --git a/Appwrite/Enums/ProjectPolicyId.cs b/Appwrite/Enums/ProjectPolicyId.cs index f3049a93..0eb70a38 100644 --- a/Appwrite/Enums/ProjectPolicyId.cs +++ b/Appwrite/Enums/ProjectPolicyId.cs @@ -15,6 +15,8 @@ public ProjectPolicyId(string value) public static ProjectPolicyId PasswordHistory => new ProjectPolicyId("password-history"); public static ProjectPolicyId PasswordStrength => new ProjectPolicyId("password-strength"); public static ProjectPolicyId PasswordPersonalData => new ProjectPolicyId("password-personal-data"); + public static ProjectPolicyId PasswordPwned => new ProjectPolicyId("password-pwned"); + public static ProjectPolicyId PasswordRotation => new ProjectPolicyId("password-rotation"); public static ProjectPolicyId SessionAlert => new ProjectPolicyId("session-alert"); public static ProjectPolicyId SessionDuration => new ProjectPolicyId("session-duration"); public static ProjectPolicyId SessionInvalidation => new ProjectPolicyId("session-invalidation"); @@ -26,5 +28,6 @@ public ProjectPolicyId(string value) public static ProjectPolicyId DenyDisposableEmail => new ProjectPolicyId("deny-disposable-email"); public static ProjectPolicyId DenyFreeEmail => new ProjectPolicyId("deny-free-email"); public static ProjectPolicyId DenyCorporateEmail => new ProjectPolicyId("deny-corporate-email"); + public static ProjectPolicyId Passkey => new ProjectPolicyId("passkey"); } } diff --git a/Appwrite/Enums/ProxyRuleDeploymentResourceType.cs b/Appwrite/Enums/ProxyRuleDeploymentResourceType.cs index bc93425b..9e5bc523 100644 --- a/Appwrite/Enums/ProxyRuleDeploymentResourceType.cs +++ b/Appwrite/Enums/ProxyRuleDeploymentResourceType.cs @@ -13,5 +13,6 @@ public ProxyRuleDeploymentResourceType(string value) public static ProxyRuleDeploymentResourceType Function => new ProxyRuleDeploymentResourceType("function"); public static ProxyRuleDeploymentResourceType Site => new ProxyRuleDeploymentResourceType("site"); + public static ProxyRuleDeploymentResourceType DedicatedDatabase => new ProxyRuleDeploymentResourceType("dedicatedDatabase"); } } diff --git a/Appwrite/Enums/Runtime.cs b/Appwrite/Enums/Runtime.cs index 6b3ddc0e..ac4513a9 100644 --- a/Appwrite/Enums/Runtime.cs +++ b/Appwrite/Enums/Runtime.cs @@ -62,6 +62,7 @@ public Runtime(string value) public static Runtime Dart310 => new Runtime("dart-3.10"); public static Runtime Dart311 => new Runtime("dart-3.11"); public static Runtime Dart312 => new Runtime("dart-3.12"); + public static Runtime Dart313 => new Runtime("dart-3.13"); public static Runtime Dotnet60 => new Runtime("dotnet-6.0"); public static Runtime Dotnet70 => new Runtime("dotnet-7.0"); public static Runtime Dotnet80 => new Runtime("dotnet-8.0"); @@ -104,5 +105,6 @@ public Runtime(string value) public static Runtime Flutter338 => new Runtime("flutter-3.38"); public static Runtime Flutter341 => new Runtime("flutter-3.41"); public static Runtime Flutter344 => new Runtime("flutter-3.44"); + public static Runtime Flutter347 => new Runtime("flutter-3.47"); } } diff --git a/Appwrite/Enums/WafRuleAction.cs b/Appwrite/Enums/WafRuleAction.cs new file mode 100644 index 00000000..44a14d8d --- /dev/null +++ b/Appwrite/Enums/WafRuleAction.cs @@ -0,0 +1,20 @@ +using System; + +namespace Appwrite.Enums +{ + public class WafRuleAction : IEnum + { + public string Value { get; private set; } + + public WafRuleAction(string value) + { + Value = value; + } + + public static WafRuleAction Bypass => new WafRuleAction("bypass"); + public static WafRuleAction Deny => new WafRuleAction("deny"); + public static WafRuleAction Challenge => new WafRuleAction("challenge"); + public static WafRuleAction RateLimit => new WafRuleAction("rateLimit"); + public static WafRuleAction Redirect => new WafRuleAction("redirect"); + } +} diff --git a/Appwrite/Models/Account.cs b/Appwrite/Models/Account.cs new file mode 100644 index 00000000..85c2abb2 --- /dev/null +++ b/Appwrite/Models/Account.cs @@ -0,0 +1,206 @@ + +using System; +using System.Linq; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; +using Appwrite.Enums; +using Appwrite.Extensions; + +namespace Appwrite.Models +{ + public class Account + { + [JsonPropertyName("$id")] + public string Id { get; private set; } + + [JsonPropertyName("$createdAt")] + public string CreatedAt { get; private set; } + + [JsonPropertyName("$updatedAt")] + public string UpdatedAt { get; private set; } + + [JsonPropertyName("name")] + public string Name { get; private set; } + + [JsonPropertyName("registration")] + public string Registration { get; private set; } + + [JsonPropertyName("status")] + public bool Status { get; private set; } + + [JsonPropertyName("labels")] + public List Labels { get; private set; } + + [JsonPropertyName("passwordUpdate")] + public string PasswordUpdate { get; private set; } + + [JsonPropertyName("email")] + public string Email { get; private set; } + + [JsonPropertyName("phone")] + public string Phone { get; private set; } + + [JsonPropertyName("emailVerification")] + public bool EmailVerification { get; private set; } + + [JsonPropertyName("emailCanonical")] + public string? EmailCanonical { get; private set; } + + [JsonPropertyName("emailIsFree")] + public bool? EmailIsFree { get; private set; } + + [JsonPropertyName("emailIsDisposable")] + public bool? EmailIsDisposable { get; private set; } + + [JsonPropertyName("emailIsCorporate")] + public bool? EmailIsCorporate { get; private set; } + + [JsonPropertyName("emailIsCanonical")] + public bool? EmailIsCanonical { get; private set; } + + [JsonPropertyName("passwordPwned")] + public bool? PasswordPwned { get; private set; } + + [JsonPropertyName("phoneVerification")] + public bool PhoneVerification { get; private set; } + + [JsonPropertyName("mfa")] + public bool Mfa { get; private set; } + + [JsonPropertyName("prefs")] + public Preferences Prefs { get; private set; } + + [JsonPropertyName("targets")] + public List Targets { get; private set; } + + [JsonPropertyName("accessedAt")] + public string AccessedAt { get; private set; } + + [JsonPropertyName("impersonator")] + public bool? Impersonator { get; private set; } + + [JsonPropertyName("impersonatorUserId")] + public string? ImpersonatorUserId { get; private set; } + + public Account( + string id, + string createdAt, + string updatedAt, + string name, + string registration, + bool status, + List labels, + string passwordUpdate, + string email, + string phone, + bool emailVerification, + string? emailCanonical, + bool? emailIsFree, + bool? emailIsDisposable, + bool? emailIsCorporate, + bool? emailIsCanonical, + bool? passwordPwned, + bool phoneVerification, + bool mfa, + Preferences prefs, + List targets, + string accessedAt, + bool? impersonator, + string? impersonatorUserId + ) + { + Id = id; + CreatedAt = createdAt; + UpdatedAt = updatedAt; + Name = name; + Registration = registration; + Status = status; + Labels = labels; + PasswordUpdate = passwordUpdate; + Email = email; + Phone = phone; + EmailVerification = emailVerification; + EmailCanonical = emailCanonical; + EmailIsFree = emailIsFree; + EmailIsDisposable = emailIsDisposable; + EmailIsCorporate = emailIsCorporate; + EmailIsCanonical = emailIsCanonical; + PasswordPwned = passwordPwned; + PhoneVerification = phoneVerification; + Mfa = mfa; + Prefs = prefs; + Targets = targets; + AccessedAt = accessedAt; + Impersonator = impersonator; + ImpersonatorUserId = impersonatorUserId; + } + + public static Account From(Dictionary map) => new Account( + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), + name: (map.ContainsKey("name") ? map["name"] : "").ToString(), + registration: (map.ContainsKey("registration") ? map["registration"] : "").ToString(), + status: (bool)(map.ContainsKey("status") ? map["status"] : true), + labels: (map.ContainsKey("labels") ? map["labels"] : new List()).ConvertToList(), + passwordUpdate: (map.ContainsKey("passwordUpdate") ? map["passwordUpdate"] : "").ToString(), + email: (map.ContainsKey("email") ? map["email"] : "").ToString(), + phone: (map.ContainsKey("phone") ? map["phone"] : "").ToString(), + emailVerification: (bool)(map.ContainsKey("emailVerification") ? map["emailVerification"] : false), + emailCanonical: map.TryGetValue("emailCanonical", out var emailCanonical) ? emailCanonical?.ToString() : null, + emailIsFree: map.TryGetValue("emailIsFree", out var boolRaw13) && boolRaw13 != null + ? (bool?)boolRaw13 + : null, + emailIsDisposable: map.TryGetValue("emailIsDisposable", out var boolRaw14) && boolRaw14 != null + ? (bool?)boolRaw14 + : null, + emailIsCorporate: map.TryGetValue("emailIsCorporate", out var boolRaw15) && boolRaw15 != null + ? (bool?)boolRaw15 + : null, + emailIsCanonical: map.TryGetValue("emailIsCanonical", out var boolRaw16) && boolRaw16 != null + ? (bool?)boolRaw16 + : null, + passwordPwned: map.TryGetValue("passwordPwned", out var boolRaw17) && boolRaw17 != null + ? (bool?)boolRaw17 + : null, + phoneVerification: (bool)(map.ContainsKey("phoneVerification") ? map["phoneVerification"] : false), + mfa: (bool)(map.ContainsKey("mfa") ? map["mfa"] : false), + prefs: Appwrite.Models.Preferences.From(map: map["prefs"] is JsonElement jsonObj20 ? jsonObj20.Deserialize>()! : (Dictionary)map["prefs"]), + targets: map["targets"].ConvertToList>().Select(it => Appwrite.Models.Target.From(map: it)).ToList(), + accessedAt: (map.ContainsKey("accessedAt") ? map["accessedAt"] : "").ToString(), + impersonator: map.TryGetValue("impersonator", out var boolRaw23) && boolRaw23 != null + ? (bool?)boolRaw23 + : null, + impersonatorUserId: map.TryGetValue("impersonatorUserId", out var impersonatorUserId) ? impersonatorUserId?.ToString() : null + ); + + public Dictionary ToMap() => new Dictionary() + { + { "$id", Id }, + { "$createdAt", CreatedAt }, + { "$updatedAt", UpdatedAt }, + { "name", Name }, + { "registration", Registration }, + { "status", Status }, + { "labels", Labels }, + { "passwordUpdate", PasswordUpdate }, + { "email", Email }, + { "phone", Phone }, + { "emailVerification", EmailVerification }, + { "emailCanonical", EmailCanonical }, + { "emailIsFree", EmailIsFree }, + { "emailIsDisposable", EmailIsDisposable }, + { "emailIsCorporate", EmailIsCorporate }, + { "emailIsCanonical", EmailIsCanonical }, + { "passwordPwned", PasswordPwned }, + { "phoneVerification", PhoneVerification }, + { "mfa", Mfa }, + { "prefs", Prefs?.ToMap() }, + { "targets", Targets?.Select(it => it.ToMap()).ToList() }, + { "accessedAt", AccessedAt }, + { "impersonator", Impersonator }, + { "impersonatorUserId", ImpersonatorUserId } + }; + } +} diff --git a/Appwrite/Models/ActivityEvent.cs b/Appwrite/Models/ActivityEvent.cs index 04af514f..cff84c36 100644 --- a/Appwrite/Models/ActivityEvent.cs +++ b/Appwrite/Models/ActivityEvent.cs @@ -162,35 +162,35 @@ string sdkVersion } public static ActivityEvent From(Dictionary map) => new ActivityEvent( - id: map["$id"].ToString(), - actorType: map["actorType"].ToString(), - actorId: map["actorId"].ToString(), - actorEmail: map["actorEmail"].ToString(), - actorName: map["actorName"].ToString(), - resourceParent: map["resourceParent"].ToString(), - resourceType: map["resourceType"].ToString(), - resourceId: map["resourceId"].ToString(), - resource: map["resource"].ToString(), - @event: map["event"].ToString(), - userAgent: map["userAgent"].ToString(), - ip: map["ip"].ToString(), - mode: map["mode"].ToString(), - country: map["country"].ToString(), - continentCode: map["continentCode"].ToString(), - city: map["city"].ToString(), - subdivisions: map["subdivisions"].ToString(), - isp: map["isp"].ToString(), - autonomousSystemNumber: map["autonomousSystemNumber"].ToString(), - autonomousSystemOrganization: map["autonomousSystemOrganization"].ToString(), - connectionType: map["connectionType"].ToString(), - connectionUsageType: map["connectionUsageType"].ToString(), - connectionOrganization: map["connectionOrganization"].ToString(), - time: map["time"].ToString(), - projectId: map["projectId"].ToString(), - teamId: map["teamId"].ToString(), - hostname: map["hostname"].ToString(), - sdk: map["sdk"].ToString(), - sdkVersion: map["sdkVersion"].ToString() + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + actorType: (map.ContainsKey("actorType") ? map["actorType"] : "").ToString(), + actorId: (map.ContainsKey("actorId") ? map["actorId"] : "").ToString(), + actorEmail: (map.ContainsKey("actorEmail") ? map["actorEmail"] : "").ToString(), + actorName: (map.ContainsKey("actorName") ? map["actorName"] : "").ToString(), + resourceParent: (map.ContainsKey("resourceParent") ? map["resourceParent"] : "").ToString(), + resourceType: (map.ContainsKey("resourceType") ? map["resourceType"] : "").ToString(), + resourceId: (map.ContainsKey("resourceId") ? map["resourceId"] : "").ToString(), + resource: (map.ContainsKey("resource") ? map["resource"] : "").ToString(), + @event: (map.ContainsKey("event") ? map["event"] : "").ToString(), + userAgent: (map.ContainsKey("userAgent") ? map["userAgent"] : "").ToString(), + ip: (map.ContainsKey("ip") ? map["ip"] : "").ToString(), + mode: (map.ContainsKey("mode") ? map["mode"] : "").ToString(), + country: (map.ContainsKey("country") ? map["country"] : "").ToString(), + continentCode: (map.ContainsKey("continentCode") ? map["continentCode"] : "").ToString(), + city: (map.ContainsKey("city") ? map["city"] : "").ToString(), + subdivisions: (map.ContainsKey("subdivisions") ? map["subdivisions"] : "").ToString(), + isp: (map.ContainsKey("isp") ? map["isp"] : "").ToString(), + autonomousSystemNumber: (map.ContainsKey("autonomousSystemNumber") ? map["autonomousSystemNumber"] : "").ToString(), + autonomousSystemOrganization: (map.ContainsKey("autonomousSystemOrganization") ? map["autonomousSystemOrganization"] : "").ToString(), + connectionType: (map.ContainsKey("connectionType") ? map["connectionType"] : "").ToString(), + connectionUsageType: (map.ContainsKey("connectionUsageType") ? map["connectionUsageType"] : "").ToString(), + connectionOrganization: (map.ContainsKey("connectionOrganization") ? map["connectionOrganization"] : "").ToString(), + time: (map.ContainsKey("time") ? map["time"] : "").ToString(), + projectId: (map.ContainsKey("projectId") ? map["projectId"] : "").ToString(), + teamId: (map.ContainsKey("teamId") ? map["teamId"] : "").ToString(), + hostname: (map.ContainsKey("hostname") ? map["hostname"] : "").ToString(), + sdk: (map.ContainsKey("sdk") ? map["sdk"] : "").ToString(), + sdkVersion: (map.ContainsKey("sdkVersion") ? map["sdkVersion"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/ActivityEventList.cs b/Appwrite/Models/ActivityEventList.cs index 1d42c21b..1a73cc0a 100644 --- a/Appwrite/Models/ActivityEventList.cs +++ b/Appwrite/Models/ActivityEventList.cs @@ -27,7 +27,7 @@ List events } public static ActivityEventList From(Dictionary map) => new ActivityEventList( - total: Convert.ToInt64(map["total"]), + total: Convert.ToInt64((map.ContainsKey("total") ? map["total"] : 0)), events: map["events"].ConvertToList>().Select(it => Appwrite.Models.ActivityEvent.From(map: it)).ToList() ); diff --git a/Appwrite/Models/AdditionalResource.cs b/Appwrite/Models/AdditionalResource.cs index 2034f21f..53c31602 100644 --- a/Appwrite/Models/AdditionalResource.cs +++ b/Appwrite/Models/AdditionalResource.cs @@ -47,12 +47,12 @@ string invoiceDesc } public static AdditionalResource From(Dictionary map) => new AdditionalResource( - name: map["name"].ToString(), - unit: map["unit"].ToString(), - currency: map["currency"].ToString(), - price: Convert.ToDouble(map["price"]), - @value: Convert.ToInt64(map["value"]), - invoiceDesc: map["invoiceDesc"].ToString() + name: (map.ContainsKey("name") ? map["name"] : "").ToString(), + unit: (map.ContainsKey("unit") ? map["unit"] : "").ToString(), + currency: (map.ContainsKey("currency") ? map["currency"] : "").ToString(), + price: Convert.ToDouble((map.ContainsKey("price") ? map["price"] : 0)), + @value: Convert.ToInt64((map.ContainsKey("value") ? map["value"] : 0)), + invoiceDesc: (map.ContainsKey("invoiceDesc") ? map["invoiceDesc"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/AlgoArgon2.cs b/Appwrite/Models/AlgoArgon2.cs index e2f6021f..050680ec 100644 --- a/Appwrite/Models/AlgoArgon2.cs +++ b/Appwrite/Models/AlgoArgon2.cs @@ -37,10 +37,10 @@ long threads } public static AlgoArgon2 From(Dictionary map) => new AlgoArgon2( - type: map["type"].ToString(), - memoryCost: Convert.ToInt64(map["memoryCost"]), - timeCost: Convert.ToInt64(map["timeCost"]), - threads: Convert.ToInt64(map["threads"]) + type: (map.ContainsKey("type") ? map["type"] : "argon2").ToString(), + memoryCost: Convert.ToInt64((map.ContainsKey("memoryCost") ? map["memoryCost"] : 0)), + timeCost: Convert.ToInt64((map.ContainsKey("timeCost") ? map["timeCost"] : 0)), + threads: Convert.ToInt64((map.ContainsKey("threads") ? map["threads"] : 0)) ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/AlgoBcrypt.cs b/Appwrite/Models/AlgoBcrypt.cs index 5ed8edc0..5973f8cd 100644 --- a/Appwrite/Models/AlgoBcrypt.cs +++ b/Appwrite/Models/AlgoBcrypt.cs @@ -22,7 +22,7 @@ string type } public static AlgoBcrypt From(Dictionary map) => new AlgoBcrypt( - type: map["type"].ToString() + type: (map.ContainsKey("type") ? map["type"] : "bcrypt").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/AlgoMd5.cs b/Appwrite/Models/AlgoMd5.cs index 659d6bcc..0a55fad5 100644 --- a/Appwrite/Models/AlgoMd5.cs +++ b/Appwrite/Models/AlgoMd5.cs @@ -22,7 +22,7 @@ string type } public static AlgoMd5 From(Dictionary map) => new AlgoMd5( - type: map["type"].ToString() + type: (map.ContainsKey("type") ? map["type"] : "md5").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/AlgoPhpass.cs b/Appwrite/Models/AlgoPhpass.cs index 096fc066..f0525f6f 100644 --- a/Appwrite/Models/AlgoPhpass.cs +++ b/Appwrite/Models/AlgoPhpass.cs @@ -22,7 +22,7 @@ string type } public static AlgoPhpass From(Dictionary map) => new AlgoPhpass( - type: map["type"].ToString() + type: (map.ContainsKey("type") ? map["type"] : "phpass").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/AlgoScrypt.cs b/Appwrite/Models/AlgoScrypt.cs index c311b095..b55ef89d 100644 --- a/Appwrite/Models/AlgoScrypt.cs +++ b/Appwrite/Models/AlgoScrypt.cs @@ -42,11 +42,11 @@ long length } public static AlgoScrypt From(Dictionary map) => new AlgoScrypt( - type: map["type"].ToString(), - costCpu: Convert.ToInt64(map["costCpu"]), - costMemory: Convert.ToInt64(map["costMemory"]), - costParallel: Convert.ToInt64(map["costParallel"]), - length: Convert.ToInt64(map["length"]) + type: (map.ContainsKey("type") ? map["type"] : "scrypt").ToString(), + costCpu: Convert.ToInt64((map.ContainsKey("costCpu") ? map["costCpu"] : 8)), + costMemory: Convert.ToInt64((map.ContainsKey("costMemory") ? map["costMemory"] : 14)), + costParallel: Convert.ToInt64((map.ContainsKey("costParallel") ? map["costParallel"] : 1)), + length: Convert.ToInt64((map.ContainsKey("length") ? map["length"] : 64)) ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/AlgoScryptModified.cs b/Appwrite/Models/AlgoScryptModified.cs index 05990b0a..575de44f 100644 --- a/Appwrite/Models/AlgoScryptModified.cs +++ b/Appwrite/Models/AlgoScryptModified.cs @@ -37,10 +37,10 @@ string signerKey } public static AlgoScryptModified From(Dictionary map) => new AlgoScryptModified( - type: map["type"].ToString(), - salt: map["salt"].ToString(), - saltSeparator: map["saltSeparator"].ToString(), - signerKey: map["signerKey"].ToString() + type: (map.ContainsKey("type") ? map["type"] : "scryptMod").ToString(), + salt: (map.ContainsKey("salt") ? map["salt"] : "").ToString(), + saltSeparator: (map.ContainsKey("saltSeparator") ? map["saltSeparator"] : "").ToString(), + signerKey: (map.ContainsKey("signerKey") ? map["signerKey"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/AlgoSha.cs b/Appwrite/Models/AlgoSha.cs index afb4c879..a6b51d2b 100644 --- a/Appwrite/Models/AlgoSha.cs +++ b/Appwrite/Models/AlgoSha.cs @@ -22,7 +22,7 @@ string type } public static AlgoSha From(Dictionary map) => new AlgoSha( - type: map["type"].ToString() + type: (map.ContainsKey("type") ? map["type"] : "sha").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/App.cs b/Appwrite/Models/App.cs index 866d9629..492351d3 100644 --- a/Appwrite/Models/App.cs +++ b/Appwrite/Models/App.cs @@ -147,31 +147,31 @@ List secrets } public static App From(Dictionary map) => new App( - id: map["$id"].ToString(), - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), - name: map["name"].ToString(), - description: map["description"].ToString(), - clientUri: map["clientUri"].ToString(), - logoUri: map["logoUri"].ToString(), - privacyPolicyUrl: map["privacyPolicyUrl"].ToString(), - termsUrl: map["termsUrl"].ToString(), - contacts: map["contacts"].ConvertToList(), - tagline: map["tagline"].ToString(), - tags: map["tags"].ConvertToList(), - labels: map["labels"].ConvertToList(), - images: map["images"].ConvertToList(), - supportUrl: map["supportUrl"].ToString(), - dataDeletionUrl: map["dataDeletionUrl"].ToString(), - redirectUris: map["redirectUris"].ConvertToList(), - postLogoutRedirectUris: map["postLogoutRedirectUris"].ConvertToList(), - enabled: (bool)map["enabled"], - type: map["type"].ToString(), - deviceFlow: (bool)map["deviceFlow"], - teamId: map["teamId"].ToString(), - userId: map["userId"].ToString(), - installationScopes: map["installationScopes"].ConvertToList(), - installationRedirectUrl: map["installationRedirectUrl"].ToString(), + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), + name: (map.ContainsKey("name") ? map["name"] : "").ToString(), + description: (map.ContainsKey("description") ? map["description"] : "").ToString(), + clientUri: (map.ContainsKey("clientUri") ? map["clientUri"] : "").ToString(), + logoUri: (map.ContainsKey("logoUri") ? map["logoUri"] : "").ToString(), + privacyPolicyUrl: (map.ContainsKey("privacyPolicyUrl") ? map["privacyPolicyUrl"] : "").ToString(), + termsUrl: (map.ContainsKey("termsUrl") ? map["termsUrl"] : "").ToString(), + contacts: (map.ContainsKey("contacts") ? map["contacts"] : new List()).ConvertToList(), + tagline: (map.ContainsKey("tagline") ? map["tagline"] : "").ToString(), + tags: (map.ContainsKey("tags") ? map["tags"] : new List()).ConvertToList(), + labels: (map.ContainsKey("labels") ? map["labels"] : new List()).ConvertToList(), + images: (map.ContainsKey("images") ? map["images"] : new List()).ConvertToList(), + supportUrl: (map.ContainsKey("supportUrl") ? map["supportUrl"] : "").ToString(), + dataDeletionUrl: (map.ContainsKey("dataDeletionUrl") ? map["dataDeletionUrl"] : "").ToString(), + redirectUris: (map.ContainsKey("redirectUris") ? map["redirectUris"] : new List()).ConvertToList(), + postLogoutRedirectUris: (map.ContainsKey("postLogoutRedirectUris") ? map["postLogoutRedirectUris"] : new List()).ConvertToList(), + enabled: (bool)(map.ContainsKey("enabled") ? map["enabled"] : true), + type: (map.ContainsKey("type") ? map["type"] : "confidential").ToString(), + deviceFlow: (bool)(map.ContainsKey("deviceFlow") ? map["deviceFlow"] : false), + teamId: (map.ContainsKey("teamId") ? map["teamId"] : "").ToString(), + userId: (map.ContainsKey("userId") ? map["userId"] : "").ToString(), + installationScopes: (map.ContainsKey("installationScopes") ? map["installationScopes"] : new List()).ConvertToList(), + installationRedirectUrl: (map.ContainsKey("installationRedirectUrl") ? map["installationRedirectUrl"] : "").ToString(), secrets: map["secrets"].ConvertToList>().Select(it => Appwrite.Models.AppSecret.From(map: it)).ToList() ); diff --git a/Appwrite/Models/AppInstallation.cs b/Appwrite/Models/AppInstallation.cs index d0849954..2380491a 100644 --- a/Appwrite/Models/AppInstallation.cs +++ b/Appwrite/Models/AppInstallation.cs @@ -67,15 +67,15 @@ public AppInstallation( } public static AppInstallation From(Dictionary map) => new AppInstallation( - id: map["$id"].ToString(), - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), - appId: map["appId"].ToString(), - teamId: map["teamId"].ToString(), - scopes: map["scopes"].ConvertToList(), - authorizationDetails: map["authorizationDetails"].ConvertToList(), - createdById: map["createdById"].ToString(), - createdByName: map["createdByName"].ToString(), + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), + appId: (map.ContainsKey("appId") ? map["appId"] : "").ToString(), + teamId: (map.ContainsKey("teamId") ? map["teamId"] : "").ToString(), + scopes: (map.ContainsKey("scopes") ? map["scopes"] : new List()).ConvertToList(), + authorizationDetails: (map.ContainsKey("authorizationDetails") ? map["authorizationDetails"] : new List()).ConvertToList(), + createdById: (map.ContainsKey("createdById") ? map["createdById"] : "").ToString(), + createdByName: (map.ContainsKey("createdByName") ? map["createdByName"] : "").ToString(), lastAccessedAt: map.TryGetValue("lastAccessedAt", out var lastAccessedAt) ? lastAccessedAt?.ToString() : null ); diff --git a/Appwrite/Models/AppInstallationList.cs b/Appwrite/Models/AppInstallationList.cs index a5c8b4a0..0ec13de7 100644 --- a/Appwrite/Models/AppInstallationList.cs +++ b/Appwrite/Models/AppInstallationList.cs @@ -27,7 +27,7 @@ List installations } public static AppInstallationList From(Dictionary map) => new AppInstallationList( - total: Convert.ToInt64(map["total"]), + total: Convert.ToInt64((map.ContainsKey("total") ? map["total"] : 0)), installations: map["installations"].ConvertToList>().Select(it => Appwrite.Models.AppInstallation.From(map: it)).ToList() ); diff --git a/Appwrite/Models/AppKey.cs b/Appwrite/Models/AppKey.cs index ba98c012..de63a545 100644 --- a/Appwrite/Models/AppKey.cs +++ b/Appwrite/Models/AppKey.cs @@ -62,14 +62,14 @@ public AppKey( } public static AppKey From(Dictionary map) => new AppKey( - id: map["$id"].ToString(), - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), - appId: map["appId"].ToString(), - secret: map["secret"].ToString(), - hint: map["hint"].ToString(), - createdById: map["createdById"].ToString(), - createdByName: map["createdByName"].ToString(), + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), + appId: (map.ContainsKey("appId") ? map["appId"] : "").ToString(), + secret: (map.ContainsKey("secret") ? map["secret"] : "").ToString(), + hint: (map.ContainsKey("hint") ? map["hint"] : "").ToString(), + createdById: (map.ContainsKey("createdById") ? map["createdById"] : "").ToString(), + createdByName: (map.ContainsKey("createdByName") ? map["createdByName"] : "").ToString(), lastAccessedAt: map.TryGetValue("lastAccessedAt", out var lastAccessedAt) ? lastAccessedAt?.ToString() : null ); diff --git a/Appwrite/Models/AppKeyList.cs b/Appwrite/Models/AppKeyList.cs index ea0a40b2..5772f67d 100644 --- a/Appwrite/Models/AppKeyList.cs +++ b/Appwrite/Models/AppKeyList.cs @@ -27,7 +27,7 @@ List keys } public static AppKeyList From(Dictionary map) => new AppKeyList( - total: Convert.ToInt64(map["total"]), + total: Convert.ToInt64((map.ContainsKey("total") ? map["total"] : 0)), keys: map["keys"].ConvertToList>().Select(it => Appwrite.Models.AppKey.From(map: it)).ToList() ); diff --git a/Appwrite/Models/AppScope.cs b/Appwrite/Models/AppScope.cs index 8426fc01..9de25822 100644 --- a/Appwrite/Models/AppScope.cs +++ b/Appwrite/Models/AppScope.cs @@ -42,11 +42,11 @@ bool deprecated } public static AppScope From(Dictionary map) => new AppScope( - @value: map["value"].ToString(), - description: map["description"].ToString(), - type: map["type"].ToString(), - category: map["category"].ToString(), - deprecated: (bool)map["deprecated"] + @value: (map.ContainsKey("value") ? map["value"] : "").ToString(), + description: (map.ContainsKey("description") ? map["description"] : "").ToString(), + type: (map.ContainsKey("type") ? map["type"] : "").ToString(), + category: (map.ContainsKey("category") ? map["category"] : "").ToString(), + deprecated: (bool)(map.ContainsKey("deprecated") ? map["deprecated"] : false) ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/AppScopeList.cs b/Appwrite/Models/AppScopeList.cs index f284b002..24b74a3a 100644 --- a/Appwrite/Models/AppScopeList.cs +++ b/Appwrite/Models/AppScopeList.cs @@ -27,7 +27,7 @@ List scopes } public static AppScopeList From(Dictionary map) => new AppScopeList( - total: Convert.ToInt64(map["total"]), + total: Convert.ToInt64((map.ContainsKey("total") ? map["total"] : 0)), scopes: map["scopes"].ConvertToList>().Select(it => Appwrite.Models.AppScope.From(map: it)).ToList() ); diff --git a/Appwrite/Models/AppSecret.cs b/Appwrite/Models/AppSecret.cs index 3c7f9156..0192cdb2 100644 --- a/Appwrite/Models/AppSecret.cs +++ b/Appwrite/Models/AppSecret.cs @@ -62,14 +62,14 @@ public AppSecret( } public static AppSecret From(Dictionary map) => new AppSecret( - id: map["$id"].ToString(), - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), - appId: map["appId"].ToString(), - secret: map["secret"].ToString(), - hint: map["hint"].ToString(), - createdById: map["createdById"].ToString(), - createdByName: map["createdByName"].ToString(), + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), + appId: (map.ContainsKey("appId") ? map["appId"] : "").ToString(), + secret: (map.ContainsKey("secret") ? map["secret"] : "").ToString(), + hint: (map.ContainsKey("hint") ? map["hint"] : "").ToString(), + createdById: (map.ContainsKey("createdById") ? map["createdById"] : "").ToString(), + createdByName: (map.ContainsKey("createdByName") ? map["createdByName"] : "").ToString(), lastAccessedAt: map.TryGetValue("lastAccessedAt", out var lastAccessedAt) ? lastAccessedAt?.ToString() : null ); diff --git a/Appwrite/Models/AppSecretList.cs b/Appwrite/Models/AppSecretList.cs index 9730bfae..7740cb1e 100644 --- a/Appwrite/Models/AppSecretList.cs +++ b/Appwrite/Models/AppSecretList.cs @@ -27,7 +27,7 @@ List secrets } public static AppSecretList From(Dictionary map) => new AppSecretList( - total: Convert.ToInt64(map["total"]), + total: Convert.ToInt64((map.ContainsKey("total") ? map["total"] : 0)), secrets: map["secrets"].ConvertToList>().Select(it => Appwrite.Models.AppSecret.From(map: it)).ToList() ); diff --git a/Appwrite/Models/AppSecretPlaintext.cs b/Appwrite/Models/AppSecretPlaintext.cs index 0fe131b7..c65d0d3c 100644 --- a/Appwrite/Models/AppSecretPlaintext.cs +++ b/Appwrite/Models/AppSecretPlaintext.cs @@ -62,14 +62,14 @@ public AppSecretPlaintext( } public static AppSecretPlaintext From(Dictionary map) => new AppSecretPlaintext( - id: map["$id"].ToString(), - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), - appId: map["appId"].ToString(), - secret: map["secret"].ToString(), - hint: map["hint"].ToString(), - createdById: map["createdById"].ToString(), - createdByName: map["createdByName"].ToString(), + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), + appId: (map.ContainsKey("appId") ? map["appId"] : "").ToString(), + secret: (map.ContainsKey("secret") ? map["secret"] : "").ToString(), + hint: (map.ContainsKey("hint") ? map["hint"] : "").ToString(), + createdById: (map.ContainsKey("createdById") ? map["createdById"] : "").ToString(), + createdByName: (map.ContainsKey("createdByName") ? map["createdByName"] : "").ToString(), lastAccessedAt: map.TryGetValue("lastAccessedAt", out var lastAccessedAt) ? lastAccessedAt?.ToString() : null ); diff --git a/Appwrite/Models/AppsList.cs b/Appwrite/Models/AppsList.cs index f54516e1..ce9d87a6 100644 --- a/Appwrite/Models/AppsList.cs +++ b/Appwrite/Models/AppsList.cs @@ -27,7 +27,7 @@ List apps } public static AppsList From(Dictionary map) => new AppsList( - total: Convert.ToInt64(map["total"]), + total: Convert.ToInt64((map.ContainsKey("total") ? map["total"] : 0)), apps: map["apps"].ConvertToList>().Select(it => Appwrite.Models.App.From(map: it)).ToList() ); diff --git a/Appwrite/Models/AttributeBigint.cs b/Appwrite/Models/AttributeBigint.cs index 416ef66c..82d32d3d 100644 --- a/Appwrite/Models/AttributeBigint.cs +++ b/Appwrite/Models/AttributeBigint.cs @@ -72,16 +72,16 @@ public AttributeBigint( } public static AttributeBigint From(Dictionary map) => new AttributeBigint( - key: map["key"].ToString(), - type: map["type"].ToString(), + key: (map.ContainsKey("key") ? map["key"] : "").ToString(), + type: (map.ContainsKey("type") ? map["type"] : "").ToString(), status: new Appwrite.Enums.AttributeStatus(map["status"].ToString()!), - error: map["error"].ToString(), - required: (bool)map["required"], + error: (map.ContainsKey("error") ? map["error"] : "").ToString(), + required: (bool)(map.ContainsKey("required") ? map["required"] : false), array: map.TryGetValue("array", out var boolRaw6) && boolRaw6 != null ? (bool?)boolRaw6 : null, - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), min: map.TryGetValue("min", out var numberRaw9) && numberRaw9 != null ? Convert.ToInt64(numberRaw9) : null, diff --git a/Appwrite/Models/AttributeBoolean.cs b/Appwrite/Models/AttributeBoolean.cs index bd5b8b1e..c2f53fd0 100644 --- a/Appwrite/Models/AttributeBoolean.cs +++ b/Appwrite/Models/AttributeBoolean.cs @@ -62,16 +62,16 @@ public AttributeBoolean( } public static AttributeBoolean From(Dictionary map) => new AttributeBoolean( - key: map["key"].ToString(), - type: map["type"].ToString(), + key: (map.ContainsKey("key") ? map["key"] : "").ToString(), + type: (map.ContainsKey("type") ? map["type"] : "").ToString(), status: new Appwrite.Enums.AttributeStatus(map["status"].ToString()!), - error: map["error"].ToString(), - required: (bool)map["required"], + error: (map.ContainsKey("error") ? map["error"] : "").ToString(), + required: (bool)(map.ContainsKey("required") ? map["required"] : false), array: map.TryGetValue("array", out var boolRaw6) && boolRaw6 != null ? (bool?)boolRaw6 : null, - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), @default: map.TryGetValue("default", out var boolRaw9) && boolRaw9 != null ? (bool?)boolRaw9 : null diff --git a/Appwrite/Models/AttributeDatetime.cs b/Appwrite/Models/AttributeDatetime.cs index 214f32e9..16cf6227 100644 --- a/Appwrite/Models/AttributeDatetime.cs +++ b/Appwrite/Models/AttributeDatetime.cs @@ -67,16 +67,16 @@ public AttributeDatetime( } public static AttributeDatetime From(Dictionary map) => new AttributeDatetime( - key: map["key"].ToString(), - type: map["type"].ToString(), + key: (map.ContainsKey("key") ? map["key"] : "").ToString(), + type: (map.ContainsKey("type") ? map["type"] : "").ToString(), status: new Appwrite.Enums.AttributeStatus(map["status"].ToString()!), - error: map["error"].ToString(), - required: (bool)map["required"], + error: (map.ContainsKey("error") ? map["error"] : "").ToString(), + required: (bool)(map.ContainsKey("required") ? map["required"] : false), array: map.TryGetValue("array", out var boolRaw6) && boolRaw6 != null ? (bool?)boolRaw6 : null, - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), format: map["format"].ToString(), @default: map.TryGetValue("default", out var @default) ? @default?.ToString() : null ); diff --git a/Appwrite/Models/AttributeEmail.cs b/Appwrite/Models/AttributeEmail.cs index a3cb390d..da0484d9 100644 --- a/Appwrite/Models/AttributeEmail.cs +++ b/Appwrite/Models/AttributeEmail.cs @@ -67,17 +67,17 @@ public AttributeEmail( } public static AttributeEmail From(Dictionary map) => new AttributeEmail( - key: map["key"].ToString(), - type: map["type"].ToString(), + key: (map.ContainsKey("key") ? map["key"] : "").ToString(), + type: (map.ContainsKey("type") ? map["type"] : "").ToString(), status: new Appwrite.Enums.AttributeStatus(map["status"].ToString()!), - error: map["error"].ToString(), - required: (bool)map["required"], + error: (map.ContainsKey("error") ? map["error"] : "").ToString(), + required: (bool)(map.ContainsKey("required") ? map["required"] : false), array: map.TryGetValue("array", out var boolRaw6) && boolRaw6 != null ? (bool?)boolRaw6 : null, - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), - format: map["format"].ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), + format: (map.ContainsKey("format") ? map["format"] : "email").ToString(), @default: map.TryGetValue("default", out var @default) ? @default?.ToString() : null ); diff --git a/Appwrite/Models/AttributeEnum.cs b/Appwrite/Models/AttributeEnum.cs index 387a4947..3a373e53 100644 --- a/Appwrite/Models/AttributeEnum.cs +++ b/Appwrite/Models/AttributeEnum.cs @@ -72,18 +72,18 @@ public AttributeEnum( } public static AttributeEnum From(Dictionary map) => new AttributeEnum( - key: map["key"].ToString(), - type: map["type"].ToString(), + key: (map.ContainsKey("key") ? map["key"] : "").ToString(), + type: (map.ContainsKey("type") ? map["type"] : "").ToString(), status: new Appwrite.Enums.AttributeStatus(map["status"].ToString()!), - error: map["error"].ToString(), - required: (bool)map["required"], + error: (map.ContainsKey("error") ? map["error"] : "").ToString(), + required: (bool)(map.ContainsKey("required") ? map["required"] : false), array: map.TryGetValue("array", out var boolRaw6) && boolRaw6 != null ? (bool?)boolRaw6 : null, - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), elements: map["elements"].ConvertToList(), - format: map["format"].ToString(), + format: (map.ContainsKey("format") ? map["format"] : "enum").ToString(), @default: map.TryGetValue("default", out var @default) ? @default?.ToString() : null ); diff --git a/Appwrite/Models/AttributeFloat.cs b/Appwrite/Models/AttributeFloat.cs index ec166677..3c661386 100644 --- a/Appwrite/Models/AttributeFloat.cs +++ b/Appwrite/Models/AttributeFloat.cs @@ -72,16 +72,16 @@ public AttributeFloat( } public static AttributeFloat From(Dictionary map) => new AttributeFloat( - key: map["key"].ToString(), - type: map["type"].ToString(), + key: (map.ContainsKey("key") ? map["key"] : "").ToString(), + type: (map.ContainsKey("type") ? map["type"] : "").ToString(), status: new Appwrite.Enums.AttributeStatus(map["status"].ToString()!), - error: map["error"].ToString(), - required: (bool)map["required"], + error: (map.ContainsKey("error") ? map["error"] : "").ToString(), + required: (bool)(map.ContainsKey("required") ? map["required"] : false), array: map.TryGetValue("array", out var boolRaw6) && boolRaw6 != null ? (bool?)boolRaw6 : null, - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), min: map.TryGetValue("min", out var numberRaw9) && numberRaw9 != null ? Convert.ToDouble(numberRaw9) : null, diff --git a/Appwrite/Models/AttributeInteger.cs b/Appwrite/Models/AttributeInteger.cs index db12d723..1a22f518 100644 --- a/Appwrite/Models/AttributeInteger.cs +++ b/Appwrite/Models/AttributeInteger.cs @@ -72,16 +72,16 @@ public AttributeInteger( } public static AttributeInteger From(Dictionary map) => new AttributeInteger( - key: map["key"].ToString(), - type: map["type"].ToString(), + key: (map.ContainsKey("key") ? map["key"] : "").ToString(), + type: (map.ContainsKey("type") ? map["type"] : "").ToString(), status: new Appwrite.Enums.AttributeStatus(map["status"].ToString()!), - error: map["error"].ToString(), - required: (bool)map["required"], + error: (map.ContainsKey("error") ? map["error"] : "").ToString(), + required: (bool)(map.ContainsKey("required") ? map["required"] : false), array: map.TryGetValue("array", out var boolRaw6) && boolRaw6 != null ? (bool?)boolRaw6 : null, - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), min: map.TryGetValue("min", out var numberRaw9) && numberRaw9 != null ? Convert.ToInt64(numberRaw9) : null, diff --git a/Appwrite/Models/AttributeIp.cs b/Appwrite/Models/AttributeIp.cs index ca2d5275..1e6af32f 100644 --- a/Appwrite/Models/AttributeIp.cs +++ b/Appwrite/Models/AttributeIp.cs @@ -67,17 +67,17 @@ public AttributeIp( } public static AttributeIp From(Dictionary map) => new AttributeIp( - key: map["key"].ToString(), - type: map["type"].ToString(), + key: (map.ContainsKey("key") ? map["key"] : "").ToString(), + type: (map.ContainsKey("type") ? map["type"] : "").ToString(), status: new Appwrite.Enums.AttributeStatus(map["status"].ToString()!), - error: map["error"].ToString(), - required: (bool)map["required"], + error: (map.ContainsKey("error") ? map["error"] : "").ToString(), + required: (bool)(map.ContainsKey("required") ? map["required"] : false), array: map.TryGetValue("array", out var boolRaw6) && boolRaw6 != null ? (bool?)boolRaw6 : null, - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), - format: map["format"].ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), + format: (map.ContainsKey("format") ? map["format"] : "ip").ToString(), @default: map.TryGetValue("default", out var @default) ? @default?.ToString() : null ); diff --git a/Appwrite/Models/AttributeLine.cs b/Appwrite/Models/AttributeLine.cs index 4d7c00a6..fe4ff726 100644 --- a/Appwrite/Models/AttributeLine.cs +++ b/Appwrite/Models/AttributeLine.cs @@ -62,16 +62,16 @@ public AttributeLine( } public static AttributeLine From(Dictionary map) => new AttributeLine( - key: map["key"].ToString(), - type: map["type"].ToString(), + key: (map.ContainsKey("key") ? map["key"] : "").ToString(), + type: (map.ContainsKey("type") ? map["type"] : "").ToString(), status: new Appwrite.Enums.AttributeStatus(map["status"].ToString()!), - error: map["error"].ToString(), - required: (bool)map["required"], + error: (map.ContainsKey("error") ? map["error"] : "").ToString(), + required: (bool)(map.ContainsKey("required") ? map["required"] : false), array: map.TryGetValue("array", out var boolRaw6) && boolRaw6 != null ? (bool?)boolRaw6 : null, - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), @default: map.TryGetValue("default", out var arrayRaw9) && arrayRaw9 != null ? arrayRaw9.ConvertToList>() : null diff --git a/Appwrite/Models/AttributeList.cs b/Appwrite/Models/AttributeList.cs index 6f1196af..c5e01909 100644 --- a/Appwrite/Models/AttributeList.cs +++ b/Appwrite/Models/AttributeList.cs @@ -27,7 +27,7 @@ List attributes } public static AttributeList From(Dictionary map) => new AttributeList( - total: Convert.ToInt64(map["total"]), + total: Convert.ToInt64((map.ContainsKey("total") ? map["total"] : 0)), attributes: map["attributes"].ConvertToList() ); diff --git a/Appwrite/Models/AttributeLongtext.cs b/Appwrite/Models/AttributeLongtext.cs index 68026989..5da95100 100644 --- a/Appwrite/Models/AttributeLongtext.cs +++ b/Appwrite/Models/AttributeLongtext.cs @@ -67,16 +67,16 @@ public AttributeLongtext( } public static AttributeLongtext From(Dictionary map) => new AttributeLongtext( - key: map["key"].ToString(), - type: map["type"].ToString(), + key: (map.ContainsKey("key") ? map["key"] : "").ToString(), + type: (map.ContainsKey("type") ? map["type"] : "").ToString(), status: new Appwrite.Enums.AttributeStatus(map["status"].ToString()!), - error: map["error"].ToString(), - required: (bool)map["required"], + error: (map.ContainsKey("error") ? map["error"] : "").ToString(), + required: (bool)(map.ContainsKey("required") ? map["required"] : false), array: map.TryGetValue("array", out var boolRaw6) && boolRaw6 != null ? (bool?)boolRaw6 : null, - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), @default: map.TryGetValue("default", out var @default) ? @default?.ToString() : null, encrypt: map.TryGetValue("encrypt", out var boolRaw10) && boolRaw10 != null ? (bool?)boolRaw10 diff --git a/Appwrite/Models/AttributeMediumtext.cs b/Appwrite/Models/AttributeMediumtext.cs index 9bd21121..8bad251a 100644 --- a/Appwrite/Models/AttributeMediumtext.cs +++ b/Appwrite/Models/AttributeMediumtext.cs @@ -67,16 +67,16 @@ public AttributeMediumtext( } public static AttributeMediumtext From(Dictionary map) => new AttributeMediumtext( - key: map["key"].ToString(), - type: map["type"].ToString(), + key: (map.ContainsKey("key") ? map["key"] : "").ToString(), + type: (map.ContainsKey("type") ? map["type"] : "").ToString(), status: new Appwrite.Enums.AttributeStatus(map["status"].ToString()!), - error: map["error"].ToString(), - required: (bool)map["required"], + error: (map.ContainsKey("error") ? map["error"] : "").ToString(), + required: (bool)(map.ContainsKey("required") ? map["required"] : false), array: map.TryGetValue("array", out var boolRaw6) && boolRaw6 != null ? (bool?)boolRaw6 : null, - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), @default: map.TryGetValue("default", out var @default) ? @default?.ToString() : null, encrypt: map.TryGetValue("encrypt", out var boolRaw10) && boolRaw10 != null ? (bool?)boolRaw10 diff --git a/Appwrite/Models/AttributeObject.cs b/Appwrite/Models/AttributeObject.cs index 844316ef..be0fdb6b 100644 --- a/Appwrite/Models/AttributeObject.cs +++ b/Appwrite/Models/AttributeObject.cs @@ -57,16 +57,16 @@ string updatedAt } public static AttributeObject From(Dictionary map) => new AttributeObject( - key: map["key"].ToString(), - type: map["type"].ToString(), + key: (map.ContainsKey("key") ? map["key"] : "").ToString(), + type: (map.ContainsKey("type") ? map["type"] : "").ToString(), status: new Appwrite.Enums.AttributeStatus(map["status"].ToString()!), - error: map["error"].ToString(), - required: (bool)map["required"], + error: (map.ContainsKey("error") ? map["error"] : "").ToString(), + required: (bool)(map.ContainsKey("required") ? map["required"] : false), array: map.TryGetValue("array", out var boolRaw6) && boolRaw6 != null ? (bool?)boolRaw6 : null, - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString() + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/AttributePoint.cs b/Appwrite/Models/AttributePoint.cs index 0d0baf53..9afd70c6 100644 --- a/Appwrite/Models/AttributePoint.cs +++ b/Appwrite/Models/AttributePoint.cs @@ -62,16 +62,16 @@ public AttributePoint( } public static AttributePoint From(Dictionary map) => new AttributePoint( - key: map["key"].ToString(), - type: map["type"].ToString(), + key: (map.ContainsKey("key") ? map["key"] : "").ToString(), + type: (map.ContainsKey("type") ? map["type"] : "").ToString(), status: new Appwrite.Enums.AttributeStatus(map["status"].ToString()!), - error: map["error"].ToString(), - required: (bool)map["required"], + error: (map.ContainsKey("error") ? map["error"] : "").ToString(), + required: (bool)(map.ContainsKey("required") ? map["required"] : false), array: map.TryGetValue("array", out var boolRaw6) && boolRaw6 != null ? (bool?)boolRaw6 : null, - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), @default: map.TryGetValue("default", out var arrayRaw9) && arrayRaw9 != null ? arrayRaw9.ConvertToList() : null diff --git a/Appwrite/Models/AttributePolygon.cs b/Appwrite/Models/AttributePolygon.cs index dc8dc60a..829ddcdd 100644 --- a/Appwrite/Models/AttributePolygon.cs +++ b/Appwrite/Models/AttributePolygon.cs @@ -62,16 +62,16 @@ public AttributePolygon( } public static AttributePolygon From(Dictionary map) => new AttributePolygon( - key: map["key"].ToString(), - type: map["type"].ToString(), + key: (map.ContainsKey("key") ? map["key"] : "").ToString(), + type: (map.ContainsKey("type") ? map["type"] : "").ToString(), status: new Appwrite.Enums.AttributeStatus(map["status"].ToString()!), - error: map["error"].ToString(), - required: (bool)map["required"], + error: (map.ContainsKey("error") ? map["error"] : "").ToString(), + required: (bool)(map.ContainsKey("required") ? map["required"] : false), array: map.TryGetValue("array", out var boolRaw6) && boolRaw6 != null ? (bool?)boolRaw6 : null, - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), @default: map.TryGetValue("default", out var arrayRaw9) && arrayRaw9 != null ? arrayRaw9.ConvertToList>>() : null diff --git a/Appwrite/Models/AttributeRelationship.cs b/Appwrite/Models/AttributeRelationship.cs index 3945bc1e..c85c34b1 100644 --- a/Appwrite/Models/AttributeRelationship.cs +++ b/Appwrite/Models/AttributeRelationship.cs @@ -87,22 +87,22 @@ string side } public static AttributeRelationship From(Dictionary map) => new AttributeRelationship( - key: map["key"].ToString(), - type: map["type"].ToString(), + key: (map.ContainsKey("key") ? map["key"] : "").ToString(), + type: (map.ContainsKey("type") ? map["type"] : "").ToString(), status: new Appwrite.Enums.AttributeStatus(map["status"].ToString()!), - error: map["error"].ToString(), - required: (bool)map["required"], + error: (map.ContainsKey("error") ? map["error"] : "").ToString(), + required: (bool)(map.ContainsKey("required") ? map["required"] : false), array: map.TryGetValue("array", out var boolRaw6) && boolRaw6 != null ? (bool?)boolRaw6 : null, - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), relatedCollection: map["relatedCollection"].ToString(), - relationType: map["relationType"].ToString(), - twoWay: (bool)map["twoWay"], - twoWayKey: map["twoWayKey"].ToString(), - onDelete: map["onDelete"].ToString(), - side: map["side"].ToString() + relationType: (map.ContainsKey("relationType") ? map["relationType"] : "").ToString(), + twoWay: (bool)(map.ContainsKey("twoWay") ? map["twoWay"] : false), + twoWayKey: (map.ContainsKey("twoWayKey") ? map["twoWayKey"] : "").ToString(), + onDelete: (map.ContainsKey("onDelete") ? map["onDelete"] : "restrict").ToString(), + side: (map.ContainsKey("side") ? map["side"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/AttributeString.cs b/Appwrite/Models/AttributeString.cs index 23bfd3ae..a49e694d 100644 --- a/Appwrite/Models/AttributeString.cs +++ b/Appwrite/Models/AttributeString.cs @@ -72,17 +72,17 @@ public AttributeString( } public static AttributeString From(Dictionary map) => new AttributeString( - key: map["key"].ToString(), - type: map["type"].ToString(), + key: (map.ContainsKey("key") ? map["key"] : "").ToString(), + type: (map.ContainsKey("type") ? map["type"] : "").ToString(), status: new Appwrite.Enums.AttributeStatus(map["status"].ToString()!), - error: map["error"].ToString(), - required: (bool)map["required"], + error: (map.ContainsKey("error") ? map["error"] : "").ToString(), + required: (bool)(map.ContainsKey("required") ? map["required"] : false), array: map.TryGetValue("array", out var boolRaw6) && boolRaw6 != null ? (bool?)boolRaw6 : null, - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), - size: Convert.ToInt64(map["size"]), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), + size: Convert.ToInt64((map.ContainsKey("size") ? map["size"] : 0)), @default: map.TryGetValue("default", out var @default) ? @default?.ToString() : null, encrypt: map.TryGetValue("encrypt", out var boolRaw11) && boolRaw11 != null ? (bool?)boolRaw11 diff --git a/Appwrite/Models/AttributeText.cs b/Appwrite/Models/AttributeText.cs index 231cf4a5..c2c43130 100644 --- a/Appwrite/Models/AttributeText.cs +++ b/Appwrite/Models/AttributeText.cs @@ -67,16 +67,16 @@ public AttributeText( } public static AttributeText From(Dictionary map) => new AttributeText( - key: map["key"].ToString(), - type: map["type"].ToString(), + key: (map.ContainsKey("key") ? map["key"] : "").ToString(), + type: (map.ContainsKey("type") ? map["type"] : "").ToString(), status: new Appwrite.Enums.AttributeStatus(map["status"].ToString()!), - error: map["error"].ToString(), - required: (bool)map["required"], + error: (map.ContainsKey("error") ? map["error"] : "").ToString(), + required: (bool)(map.ContainsKey("required") ? map["required"] : false), array: map.TryGetValue("array", out var boolRaw6) && boolRaw6 != null ? (bool?)boolRaw6 : null, - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), @default: map.TryGetValue("default", out var @default) ? @default?.ToString() : null, encrypt: map.TryGetValue("encrypt", out var boolRaw10) && boolRaw10 != null ? (bool?)boolRaw10 diff --git a/Appwrite/Models/AttributeUrl.cs b/Appwrite/Models/AttributeUrl.cs index 68b5ebb7..af5f8fd4 100644 --- a/Appwrite/Models/AttributeUrl.cs +++ b/Appwrite/Models/AttributeUrl.cs @@ -67,17 +67,17 @@ public AttributeUrl( } public static AttributeUrl From(Dictionary map) => new AttributeUrl( - key: map["key"].ToString(), - type: map["type"].ToString(), + key: (map.ContainsKey("key") ? map["key"] : "").ToString(), + type: (map.ContainsKey("type") ? map["type"] : "").ToString(), status: new Appwrite.Enums.AttributeStatus(map["status"].ToString()!), - error: map["error"].ToString(), - required: (bool)map["required"], + error: (map.ContainsKey("error") ? map["error"] : "").ToString(), + required: (bool)(map.ContainsKey("required") ? map["required"] : false), array: map.TryGetValue("array", out var boolRaw6) && boolRaw6 != null ? (bool?)boolRaw6 : null, - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), - format: map["format"].ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), + format: (map.ContainsKey("format") ? map["format"] : "url").ToString(), @default: map.TryGetValue("default", out var @default) ? @default?.ToString() : null ); diff --git a/Appwrite/Models/AttributeVarchar.cs b/Appwrite/Models/AttributeVarchar.cs index a3f407b0..634ff2c4 100644 --- a/Appwrite/Models/AttributeVarchar.cs +++ b/Appwrite/Models/AttributeVarchar.cs @@ -72,17 +72,17 @@ public AttributeVarchar( } public static AttributeVarchar From(Dictionary map) => new AttributeVarchar( - key: map["key"].ToString(), - type: map["type"].ToString(), + key: (map.ContainsKey("key") ? map["key"] : "").ToString(), + type: (map.ContainsKey("type") ? map["type"] : "").ToString(), status: new Appwrite.Enums.AttributeStatus(map["status"].ToString()!), - error: map["error"].ToString(), - required: (bool)map["required"], + error: (map.ContainsKey("error") ? map["error"] : "").ToString(), + required: (bool)(map.ContainsKey("required") ? map["required"] : false), array: map.TryGetValue("array", out var boolRaw6) && boolRaw6 != null ? (bool?)boolRaw6 : null, - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), - size: Convert.ToInt64(map["size"]), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), + size: Convert.ToInt64((map.ContainsKey("size") ? map["size"] : 0)), @default: map.TryGetValue("default", out var @default) ? @default?.ToString() : null, encrypt: map.TryGetValue("encrypt", out var boolRaw11) && boolRaw11 != null ? (bool?)boolRaw11 diff --git a/Appwrite/Models/AttributeVector.cs b/Appwrite/Models/AttributeVector.cs index 632fedb8..5c2419b4 100644 --- a/Appwrite/Models/AttributeVector.cs +++ b/Appwrite/Models/AttributeVector.cs @@ -62,17 +62,17 @@ long size } public static AttributeVector From(Dictionary map) => new AttributeVector( - key: map["key"].ToString(), - type: map["type"].ToString(), + key: (map.ContainsKey("key") ? map["key"] : "").ToString(), + type: (map.ContainsKey("type") ? map["type"] : "").ToString(), status: new Appwrite.Enums.AttributeStatus(map["status"].ToString()!), - error: map["error"].ToString(), - required: (bool)map["required"], + error: (map.ContainsKey("error") ? map["error"] : "").ToString(), + required: (bool)(map.ContainsKey("required") ? map["required"] : false), array: map.TryGetValue("array", out var boolRaw6) && boolRaw6 != null ? (bool?)boolRaw6 : null, - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), - size: Convert.ToInt64(map["size"]) + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), + size: Convert.ToInt64((map.ContainsKey("size") ? map["size"] : 0)) ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/BackupArchive.cs b/Appwrite/Models/BackupArchive.cs index 8fceb7bb..392d5808 100644 --- a/Appwrite/Models/BackupArchive.cs +++ b/Appwrite/Models/BackupArchive.cs @@ -24,13 +24,13 @@ public class BackupArchive public string PolicyId { get; private set; } [JsonPropertyName("size")] - public long Size { get; private set; } + public long? Size { get; private set; } [JsonPropertyName("status")] public string Status { get; private set; } [JsonPropertyName("startedAt")] - public string StartedAt { get; private set; } + public string? StartedAt { get; private set; } [JsonPropertyName("migrationId")] public string MigrationId { get; private set; } @@ -52,9 +52,9 @@ public BackupArchive( string createdAt, string updatedAt, string policyId, - long size, + long? size, string status, - string startedAt, + string? startedAt, string migrationId, List services, List resources, @@ -77,14 +77,16 @@ public BackupArchive( } public static BackupArchive From(Dictionary map) => new BackupArchive( - id: map["$id"].ToString(), - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), - policyId: map["policyId"].ToString(), - size: Convert.ToInt64(map["size"]), - status: map["status"].ToString(), - startedAt: map["startedAt"].ToString(), - migrationId: map["migrationId"].ToString(), + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), + policyId: (map.ContainsKey("policyId") ? map["policyId"] : "").ToString(), + size: map.TryGetValue("size", out var numberRaw5) && numberRaw5 != null + ? Convert.ToInt64(numberRaw5) + : null, + status: (map.ContainsKey("status") ? map["status"] : "").ToString(), + startedAt: map.TryGetValue("startedAt", out var startedAt) ? startedAt?.ToString() : null, + migrationId: (map.ContainsKey("migrationId") ? map["migrationId"] : "").ToString(), services: map["services"].ConvertToList(), resources: map["resources"].ConvertToList(), resourceId: map.TryGetValue("resourceId", out var resourceId) ? resourceId?.ToString() : null, diff --git a/Appwrite/Models/BackupArchiveList.cs b/Appwrite/Models/BackupArchiveList.cs index 75c928e0..6a7bb5e6 100644 --- a/Appwrite/Models/BackupArchiveList.cs +++ b/Appwrite/Models/BackupArchiveList.cs @@ -27,7 +27,7 @@ List archives } public static BackupArchiveList From(Dictionary map) => new BackupArchiveList( - total: Convert.ToInt64(map["total"]), + total: Convert.ToInt64((map.ContainsKey("total") ? map["total"] : 0)), archives: map["archives"].ConvertToList>().Select(it => Appwrite.Models.BackupArchive.From(map: it)).ToList() ); diff --git a/Appwrite/Models/BackupPolicy.cs b/Appwrite/Models/BackupPolicy.cs index c33b80f6..6b635534 100644 --- a/Appwrite/Models/BackupPolicy.cs +++ b/Appwrite/Models/BackupPolicy.cs @@ -77,18 +77,18 @@ bool enabled } public static BackupPolicy From(Dictionary map) => new BackupPolicy( - id: map["$id"].ToString(), - name: map["name"].ToString(), - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + name: (map.ContainsKey("name") ? map["name"] : "").ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), services: map["services"].ConvertToList(), resources: map["resources"].ConvertToList(), resourceId: map.TryGetValue("resourceId", out var resourceId) ? resourceId?.ToString() : null, resourceType: map.TryGetValue("resourceType", out var resourceType) ? resourceType?.ToString() : null, - retention: Convert.ToInt64(map["retention"]), - schedule: map["schedule"].ToString(), - type: map["type"].ToString(), - enabled: (bool)map["enabled"] + retention: Convert.ToInt64((map.ContainsKey("retention") ? map["retention"] : 1)), + schedule: (map.ContainsKey("schedule") ? map["schedule"] : "0 * * * *").ToString(), + type: (map.ContainsKey("type") ? map["type"] : "full").ToString(), + enabled: (bool)(map.ContainsKey("enabled") ? map["enabled"] : false) ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/BackupPolicyList.cs b/Appwrite/Models/BackupPolicyList.cs index 76229f0d..6e44b89f 100644 --- a/Appwrite/Models/BackupPolicyList.cs +++ b/Appwrite/Models/BackupPolicyList.cs @@ -27,7 +27,7 @@ List policies } public static BackupPolicyList From(Dictionary map) => new BackupPolicyList( - total: Convert.ToInt64(map["total"]), + total: Convert.ToInt64((map.ContainsKey("total") ? map["total"] : 0)), policies: map["policies"].ConvertToList>().Select(it => Appwrite.Models.BackupPolicy.From(map: it)).ToList() ); diff --git a/Appwrite/Models/BackupRestoration.cs b/Appwrite/Models/BackupRestoration.cs index a2413458..e87bc148 100644 --- a/Appwrite/Models/BackupRestoration.cs +++ b/Appwrite/Models/BackupRestoration.cs @@ -30,7 +30,7 @@ public class BackupRestoration public string Status { get; private set; } [JsonPropertyName("startedAt")] - public string StartedAt { get; private set; } + public string? StartedAt { get; private set; } [JsonPropertyName("migrationId")] public string MigrationId { get; private set; } @@ -42,7 +42,7 @@ public class BackupRestoration public List Resources { get; private set; } [JsonPropertyName("options")] - public string Options { get; private set; } + public object Options { get; private set; } public BackupRestoration( string id, @@ -51,11 +51,11 @@ public BackupRestoration( string archiveId, string policyId, string status, - string startedAt, + string? startedAt, string migrationId, List services, List resources, - string options + object options ) { Id = id; @@ -72,17 +72,17 @@ string options } public static BackupRestoration From(Dictionary map) => new BackupRestoration( - id: map["$id"].ToString(), - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), - archiveId: map["archiveId"].ToString(), - policyId: map["policyId"].ToString(), - status: map["status"].ToString(), - startedAt: map["startedAt"].ToString(), - migrationId: map["migrationId"].ToString(), + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), + archiveId: (map.ContainsKey("archiveId") ? map["archiveId"] : "").ToString(), + policyId: (map.ContainsKey("policyId") ? map["policyId"] : "").ToString(), + status: (map.ContainsKey("status") ? map["status"] : "").ToString(), + startedAt: map.TryGetValue("startedAt", out var startedAt) ? startedAt?.ToString() : null, + migrationId: (map.ContainsKey("migrationId") ? map["migrationId"] : "").ToString(), services: map["services"].ConvertToList(), resources: map["resources"].ConvertToList(), - options: map["options"].ToString() + options: (map.ContainsKey("options") ? map["options"] : new Dictionary()) ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/BackupRestorationList.cs b/Appwrite/Models/BackupRestorationList.cs index e2041667..a4eb0687 100644 --- a/Appwrite/Models/BackupRestorationList.cs +++ b/Appwrite/Models/BackupRestorationList.cs @@ -27,7 +27,7 @@ List restorations } public static BackupRestorationList From(Dictionary map) => new BackupRestorationList( - total: Convert.ToInt64(map["total"]), + total: Convert.ToInt64((map.ContainsKey("total") ? map["total"] : 0)), restorations: map["restorations"].ConvertToList>().Select(it => Appwrite.Models.BackupRestoration.From(map: it)).ToList() ); diff --git a/Appwrite/Models/BillingPlan.cs b/Appwrite/Models/BillingPlan.cs index 5733c6a5..db09f787 100644 --- a/Appwrite/Models/BillingPlan.cs +++ b/Appwrite/Models/BillingPlan.cs @@ -132,7 +132,7 @@ public class BillingPlan public long AlertLimit { get; private set; } [JsonPropertyName("usage")] - public UsageBillingPlan Usage { get; private set; } + public UsageBillingPlan? Usage { get; private set; } [JsonPropertyName("addons")] public BillingPlanAddon Addons { get; private set; } @@ -152,6 +152,9 @@ public class BillingPlan [JsonPropertyName("requiresBillingAddress")] public bool RequiresBillingAddress { get; private set; } + [JsonPropertyName("eligibleCountries")] + public List? EligibleCountries { get; private set; } + [JsonPropertyName("isAvailable")] public bool IsAvailable { get; private set; } @@ -271,13 +274,14 @@ public BillingPlan( List? usageAggregateOnlyMetrics, long projectInactivityDays, long alertLimit, - UsageBillingPlan usage, + UsageBillingPlan? usage, BillingPlanAddon addons, bool budgetCapEnabled, bool customSmtp, bool emailBranding, bool requiresPaymentMethod, bool requiresBillingAddress, + List? eligibleCountries, bool isAvailable, bool selfService, bool premiumSupport, @@ -353,6 +357,7 @@ public BillingPlan( EmailBranding = emailBranding; RequiresPaymentMethod = requiresPaymentMethod; RequiresBillingAddress = requiresBillingAddress; + EligibleCountries = eligibleCountries; IsAvailable = isAvailable; SelfService = selfService; PremiumSupport = premiumSupport; @@ -382,96 +387,101 @@ public BillingPlan( } public static BillingPlan From(Dictionary map) => new BillingPlan( - id: map["$id"].ToString(), - name: map["name"].ToString(), - desc: map["desc"].ToString(), - order: Convert.ToInt64(map["order"]), - price: Convert.ToDouble(map["price"]), - trial: Convert.ToInt64(map["trial"]), - bandwidth: Convert.ToInt64(map["bandwidth"]), - storage: Convert.ToInt64(map["storage"]), - imageTransformations: Convert.ToInt64(map["imageTransformations"]), - screenshotsGenerated: Convert.ToInt64(map["screenshotsGenerated"]), + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + name: (map.ContainsKey("name") ? map["name"] : "").ToString(), + desc: (map.ContainsKey("desc") ? map["desc"] : "").ToString(), + order: Convert.ToInt64((map.ContainsKey("order") ? map["order"] : 0)), + price: Convert.ToDouble((map.ContainsKey("price") ? map["price"] : 0)), + trial: Convert.ToInt64((map.ContainsKey("trial") ? map["trial"] : 0)), + bandwidth: Convert.ToInt64((map.ContainsKey("bandwidth") ? map["bandwidth"] : 0)), + storage: Convert.ToInt64((map.ContainsKey("storage") ? map["storage"] : 0)), + imageTransformations: Convert.ToInt64((map.ContainsKey("imageTransformations") ? map["imageTransformations"] : 0)), + screenshotsGenerated: Convert.ToInt64((map.ContainsKey("screenshotsGenerated") ? map["screenshotsGenerated"] : 0)), members: map.TryGetValue("members", out var numberRaw11) && numberRaw11 != null ? Convert.ToInt64(numberRaw11) : null, - webhooks: Convert.ToInt64(map["webhooks"]), - wafRules: Convert.ToInt64(map["wafRules"]), - projects: Convert.ToInt64(map["projects"]), - platforms: Convert.ToInt64(map["platforms"]), - users: Convert.ToInt64(map["users"]), - teams: Convert.ToInt64(map["teams"]), - databases: Convert.ToInt64(map["databases"]), - databasesReads: Convert.ToInt64(map["databasesReads"]), - databasesWrites: Convert.ToInt64(map["databasesWrites"]), - databasesBatchSize: Convert.ToInt64(map["databasesBatchSize"]), - buckets: Convert.ToInt64(map["buckets"]), - fileSize: Convert.ToInt64(map["fileSize"]), - functions: Convert.ToInt64(map["functions"]), - sites: Convert.ToInt64(map["sites"]), - executions: Convert.ToInt64(map["executions"]), - executionsRetentionCount: Convert.ToInt64(map["executionsRetentionCount"]), - gBHours: Convert.ToInt64(map["GBHours"]), - realtime: Convert.ToInt64(map["realtime"]), - realtimeMessages: Convert.ToInt64(map["realtimeMessages"]), - messages: Convert.ToInt64(map["messages"]), - topics: Convert.ToInt64(map["topics"]), - authPhone: Convert.ToInt64(map["authPhone"]), - domains: Convert.ToInt64(map["domains"]), + webhooks: Convert.ToInt64((map.ContainsKey("webhooks") ? map["webhooks"] : 0)), + wafRules: Convert.ToInt64((map.ContainsKey("wafRules") ? map["wafRules"] : 0)), + projects: Convert.ToInt64((map.ContainsKey("projects") ? map["projects"] : 0)), + platforms: Convert.ToInt64((map.ContainsKey("platforms") ? map["platforms"] : 0)), + users: Convert.ToInt64((map.ContainsKey("users") ? map["users"] : 0)), + teams: Convert.ToInt64((map.ContainsKey("teams") ? map["teams"] : 0)), + databases: Convert.ToInt64((map.ContainsKey("databases") ? map["databases"] : 0)), + databasesReads: Convert.ToInt64((map.ContainsKey("databasesReads") ? map["databasesReads"] : 0)), + databasesWrites: Convert.ToInt64((map.ContainsKey("databasesWrites") ? map["databasesWrites"] : 0)), + databasesBatchSize: Convert.ToInt64((map.ContainsKey("databasesBatchSize") ? map["databasesBatchSize"] : 0)), + buckets: Convert.ToInt64((map.ContainsKey("buckets") ? map["buckets"] : 0)), + fileSize: Convert.ToInt64((map.ContainsKey("fileSize") ? map["fileSize"] : 0)), + functions: Convert.ToInt64((map.ContainsKey("functions") ? map["functions"] : 0)), + sites: Convert.ToInt64((map.ContainsKey("sites") ? map["sites"] : 0)), + executions: Convert.ToInt64((map.ContainsKey("executions") ? map["executions"] : 0)), + executionsRetentionCount: Convert.ToInt64((map.ContainsKey("executionsRetentionCount") ? map["executionsRetentionCount"] : 1000)), + gBHours: Convert.ToInt64((map.ContainsKey("GBHours") ? map["GBHours"] : 0)), + realtime: Convert.ToInt64((map.ContainsKey("realtime") ? map["realtime"] : 0)), + realtimeMessages: Convert.ToInt64((map.ContainsKey("realtimeMessages") ? map["realtimeMessages"] : 0)), + messages: Convert.ToInt64((map.ContainsKey("messages") ? map["messages"] : 0)), + topics: Convert.ToInt64((map.ContainsKey("topics") ? map["topics"] : 0)), + authPhone: Convert.ToInt64((map.ContainsKey("authPhone") ? map["authPhone"] : 0)), + domains: Convert.ToInt64((map.ContainsKey("domains") ? map["domains"] : 0)), activityLogs: map.TryGetValue("activityLogs", out var numberRaw35) && numberRaw35 != null ? Convert.ToInt64(numberRaw35) : null, - usageLogs: Convert.ToInt64(map["usageLogs"]), + usageLogs: Convert.ToInt64((map.ContainsKey("usageLogs") ? map["usageLogs"] : 0)), usageLogsIntervals: map.TryGetValue("usageLogsIntervals", out var arrayRaw37) && arrayRaw37 != null ? arrayRaw37.ConvertToList() : null, usageAggregateOnlyMetrics: map.TryGetValue("usageAggregateOnlyMetrics", out var arrayRaw38) && arrayRaw38 != null ? arrayRaw38.ConvertToList() : null, - projectInactivityDays: Convert.ToInt64(map["projectInactivityDays"]), - alertLimit: Convert.ToInt64(map["alertLimit"]), - usage: Appwrite.Models.UsageBillingPlan.From(map: map["usage"] is JsonElement jsonObj41 ? jsonObj41.Deserialize>()! : (Dictionary)map["usage"]), + projectInactivityDays: Convert.ToInt64((map.ContainsKey("projectInactivityDays") ? map["projectInactivityDays"] : 0)), + alertLimit: Convert.ToInt64((map.ContainsKey("alertLimit") ? map["alertLimit"] : 80)), + usage: map.TryGetValue("usage", out var objectRaw41) && objectRaw41 != null + ? Appwrite.Models.UsageBillingPlan.From(map: objectRaw41 is JsonElement jsonObj41 ? jsonObj41.Deserialize>()! : (Dictionary)objectRaw41) + : null, addons: Appwrite.Models.BillingPlanAddon.From(map: map["addons"] is JsonElement jsonObj42 ? jsonObj42.Deserialize>()! : (Dictionary)map["addons"]), - budgetCapEnabled: (bool)map["budgetCapEnabled"], - customSmtp: (bool)map["customSmtp"], - emailBranding: (bool)map["emailBranding"], - requiresPaymentMethod: (bool)map["requiresPaymentMethod"], - requiresBillingAddress: (bool)map["requiresBillingAddress"], - isAvailable: (bool)map["isAvailable"], - selfService: (bool)map["selfService"], - premiumSupport: (bool)map["premiumSupport"], - budgeting: (bool)map["budgeting"], - supportsMockNumbers: (bool)map["supportsMockNumbers"], - supportsOrganizationRoles: (bool)map["supportsOrganizationRoles"], - supportsCredits: (bool)map["supportsCredits"], - supportsDedicatedDatabases: (bool)map["supportsDedicatedDatabases"], - supportsDisposableEmailValidation: (bool)map["supportsDisposableEmailValidation"], - supportsCanonicalEmailValidation: (bool)map["supportsCanonicalEmailValidation"], - supportsFreeEmailValidation: (bool)map["supportsFreeEmailValidation"], - supportsCorporateEmailValidation: (bool)map["supportsCorporateEmailValidation"], - supportsProjectSpecificRoles: (bool)map["supportsProjectSpecificRoles"], - backupsEnabled: map.TryGetValue("backupsEnabled", out var boolRaw61) && boolRaw61 != null - ? (bool?)boolRaw61 + budgetCapEnabled: (bool)(map.ContainsKey("budgetCapEnabled") ? map["budgetCapEnabled"] : false), + customSmtp: (bool)(map.ContainsKey("customSmtp") ? map["customSmtp"] : false), + emailBranding: (bool)(map.ContainsKey("emailBranding") ? map["emailBranding"] : false), + requiresPaymentMethod: (bool)(map.ContainsKey("requiresPaymentMethod") ? map["requiresPaymentMethod"] : true), + requiresBillingAddress: (bool)(map.ContainsKey("requiresBillingAddress") ? map["requiresBillingAddress"] : false), + eligibleCountries: map.TryGetValue("eligibleCountries", out var arrayRaw48) && arrayRaw48 != null + ? arrayRaw48.ConvertToList() + : null, + isAvailable: (bool)(map.ContainsKey("isAvailable") ? map["isAvailable"] : true), + selfService: (bool)(map.ContainsKey("selfService") ? map["selfService"] : true), + premiumSupport: (bool)(map.ContainsKey("premiumSupport") ? map["premiumSupport"] : true), + budgeting: (bool)(map.ContainsKey("budgeting") ? map["budgeting"] : true), + supportsMockNumbers: (bool)(map.ContainsKey("supportsMockNumbers") ? map["supportsMockNumbers"] : true), + supportsOrganizationRoles: (bool)(map.ContainsKey("supportsOrganizationRoles") ? map["supportsOrganizationRoles"] : true), + supportsCredits: (bool)(map.ContainsKey("supportsCredits") ? map["supportsCredits"] : false), + supportsDedicatedDatabases: (bool)(map.ContainsKey("supportsDedicatedDatabases") ? map["supportsDedicatedDatabases"] : false), + supportsDisposableEmailValidation: (bool)(map.ContainsKey("supportsDisposableEmailValidation") ? map["supportsDisposableEmailValidation"] : false), + supportsCanonicalEmailValidation: (bool)(map.ContainsKey("supportsCanonicalEmailValidation") ? map["supportsCanonicalEmailValidation"] : false), + supportsFreeEmailValidation: (bool)(map.ContainsKey("supportsFreeEmailValidation") ? map["supportsFreeEmailValidation"] : false), + supportsCorporateEmailValidation: (bool)(map.ContainsKey("supportsCorporateEmailValidation") ? map["supportsCorporateEmailValidation"] : false), + supportsProjectSpecificRoles: (bool)(map.ContainsKey("supportsProjectSpecificRoles") ? map["supportsProjectSpecificRoles"] : false), + backupsEnabled: map.TryGetValue("backupsEnabled", out var boolRaw62) && boolRaw62 != null + ? (bool?)boolRaw62 : null, - usagePerProject: (bool)map["usagePerProject"], - supportedAddons: Appwrite.Models.BillingPlanSupportedAddons.From(map: map["supportedAddons"] is JsonElement jsonObj63 ? jsonObj63.Deserialize>()! : (Dictionary)map["supportedAddons"]), - backupPolicies: map.TryGetValue("backupPolicies", out var numberRaw64) && numberRaw64 != null - ? Convert.ToInt64(numberRaw64) + usagePerProject: (bool)(map.ContainsKey("usagePerProject") ? map["usagePerProject"] : true), + supportedAddons: Appwrite.Models.BillingPlanSupportedAddons.From(map: map["supportedAddons"] is JsonElement jsonObj64 ? jsonObj64.Deserialize>()! : (Dictionary)map["supportedAddons"]), + backupPolicies: map.TryGetValue("backupPolicies", out var numberRaw65) && numberRaw65 != null + ? Convert.ToInt64(numberRaw65) : null, - deploymentSize: Convert.ToInt64(map["deploymentSize"]), - buildSize: Convert.ToInt64(map["buildSize"]), - functionsIntervalMinimum: Convert.ToInt64(map["functionsIntervalMinimum"]), - databasesAllowEncrypt: (bool)map["databasesAllowEncrypt"], - limits: map.TryGetValue("limits", out var objectRaw69) && objectRaw69 != null - ? Appwrite.Models.BillingPlanLimits.From(map: objectRaw69 is JsonElement jsonObj69 ? jsonObj69.Deserialize>()! : (Dictionary)objectRaw69) + deploymentSize: Convert.ToInt64((map.ContainsKey("deploymentSize") ? map["deploymentSize"] : 0)), + buildSize: Convert.ToInt64((map.ContainsKey("buildSize") ? map["buildSize"] : 0)), + functionsIntervalMinimum: Convert.ToInt64((map.ContainsKey("functionsIntervalMinimum") ? map["functionsIntervalMinimum"] : 0)), + databasesAllowEncrypt: (bool)(map.ContainsKey("databasesAllowEncrypt") ? map["databasesAllowEncrypt"] : false), + limits: map.TryGetValue("limits", out var objectRaw70) && objectRaw70 != null + ? Appwrite.Models.BillingPlanLimits.From(map: objectRaw70 is JsonElement jsonObj70 ? jsonObj70.Deserialize>()! : (Dictionary)objectRaw70) : null, @group: new Appwrite.Enums.BillingPlanGroup(map["group"].ToString()!), - program: map.TryGetValue("program", out var objectRaw71) && objectRaw71 != null - ? Appwrite.Models.Program.From(map: objectRaw71 is JsonElement jsonObj71 ? jsonObj71.Deserialize>()! : (Dictionary)objectRaw71) + program: map.TryGetValue("program", out var objectRaw72) && objectRaw72 != null + ? Appwrite.Models.Program.From(map: objectRaw72 is JsonElement jsonObj72 ? jsonObj72.Deserialize>()! : (Dictionary)objectRaw72) : null, - databaseComputeCredit: Convert.ToDouble(map["databaseComputeCredit"]), - dedicatedDatabases: map.TryGetValue("dedicatedDatabases", out var objectRaw73) && objectRaw73 != null - ? Appwrite.Models.BillingPlanDedicatedDatabaseLimits.From(map: objectRaw73 is JsonElement jsonObj73 ? jsonObj73.Deserialize>()! : (Dictionary)objectRaw73) + databaseComputeCredit: Convert.ToDouble((map.ContainsKey("databaseComputeCredit") ? map["databaseComputeCredit"] : 0)), + dedicatedDatabases: map.TryGetValue("dedicatedDatabases", out var objectRaw74) && objectRaw74 != null + ? Appwrite.Models.BillingPlanDedicatedDatabaseLimits.From(map: objectRaw74 is JsonElement jsonObj74 ? jsonObj74.Deserialize>()! : (Dictionary)objectRaw74) : null ); @@ -524,6 +534,7 @@ public BillingPlan( { "emailBranding", EmailBranding }, { "requiresPaymentMethod", RequiresPaymentMethod }, { "requiresBillingAddress", RequiresBillingAddress }, + { "eligibleCountries", EligibleCountries }, { "isAvailable", IsAvailable }, { "selfService", SelfService }, { "premiumSupport", PremiumSupport }, diff --git a/Appwrite/Models/BillingPlanAddonDetails.cs b/Appwrite/Models/BillingPlanAddonDetails.cs index 4f39803d..23edeeb1 100644 --- a/Appwrite/Models/BillingPlanAddonDetails.cs +++ b/Appwrite/Models/BillingPlanAddonDetails.cs @@ -57,14 +57,14 @@ string invoiceDesc } public static BillingPlanAddonDetails From(Dictionary map) => new BillingPlanAddonDetails( - supported: (bool)map["supported"], - planIncluded: Convert.ToInt64(map["planIncluded"]), - limit: Convert.ToInt64(map["limit"]), - type: map["type"].ToString(), + supported: (bool)(map.ContainsKey("supported") ? map["supported"] : false), + planIncluded: Convert.ToInt64((map.ContainsKey("planIncluded") ? map["planIncluded"] : 0)), + limit: Convert.ToInt64((map.ContainsKey("limit") ? map["limit"] : 0)), + type: (map.ContainsKey("type") ? map["type"] : "numeric").ToString(), currency: map.TryGetValue("currency", out var currency) ? currency?.ToString() : null, - price: Convert.ToDouble(map["price"]), - @value: Convert.ToInt64(map["value"]), - invoiceDesc: map["invoiceDesc"].ToString() + price: Convert.ToDouble((map.ContainsKey("price") ? map["price"] : 0)), + @value: Convert.ToInt64((map.ContainsKey("value") ? map["value"] : 0)), + invoiceDesc: (map.ContainsKey("invoiceDesc") ? map["invoiceDesc"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/BillingPlanSupportedAddons.cs b/Appwrite/Models/BillingPlanSupportedAddons.cs index a4b47abe..5da1d600 100644 --- a/Appwrite/Models/BillingPlanSupportedAddons.cs +++ b/Appwrite/Models/BillingPlanSupportedAddons.cs @@ -32,9 +32,9 @@ bool premiumGeoDBOrg } public static BillingPlanSupportedAddons From(Dictionary map) => new BillingPlanSupportedAddons( - baa: (bool)map["baa"], - premiumGeoDB: (bool)map["premiumGeoDB"], - premiumGeoDBOrg: (bool)map["premiumGeoDBOrg"] + baa: (bool)(map.ContainsKey("baa") ? map["baa"] : false), + premiumGeoDB: (bool)(map.ContainsKey("premiumGeoDB") ? map["premiumGeoDB"] : false), + premiumGeoDBOrg: (bool)(map.ContainsKey("premiumGeoDBOrg") ? map["premiumGeoDBOrg"] : false) ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/Block.cs b/Appwrite/Models/Block.cs index 27280fcb..f5fe12e6 100644 --- a/Appwrite/Models/Block.cs +++ b/Appwrite/Models/Block.cs @@ -23,66 +23,30 @@ public class Block [JsonPropertyName("mode")] public string Mode { get; private set; } - [JsonPropertyName("reason")] - public string? Reason { get; private set; } - [JsonPropertyName("expiredAt")] public string? ExpiredAt { get; private set; } - [JsonPropertyName("projectName")] - public string ProjectName { get; private set; } - - [JsonPropertyName("region")] - public string Region { get; private set; } - - [JsonPropertyName("organizationName")] - public string OrganizationName { get; private set; } - - [JsonPropertyName("organizationId")] - public string OrganizationId { get; private set; } - - [JsonPropertyName("billingPlan")] - public string BillingPlan { get; private set; } - public Block( string createdAt, string resourceType, string resourceId, string mode, - string? reason, - string? expiredAt, - string projectName, - string region, - string organizationName, - string organizationId, - string billingPlan + string? expiredAt ) { CreatedAt = createdAt; ResourceType = resourceType; ResourceId = resourceId; Mode = mode; - Reason = reason; ExpiredAt = expiredAt; - ProjectName = projectName; - Region = region; - OrganizationName = organizationName; - OrganizationId = organizationId; - BillingPlan = billingPlan; } public static Block From(Dictionary map) => new Block( - createdAt: map["$createdAt"].ToString(), - resourceType: map["resourceType"].ToString(), - resourceId: map["resourceId"].ToString(), - mode: map["mode"].ToString(), - reason: map.TryGetValue("reason", out var reason) ? reason?.ToString() : null, - expiredAt: map.TryGetValue("expiredAt", out var expiredAt) ? expiredAt?.ToString() : null, - projectName: map["projectName"].ToString(), - region: map["region"].ToString(), - organizationName: map["organizationName"].ToString(), - organizationId: map["organizationId"].ToString(), - billingPlan: map["billingPlan"].ToString() + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + resourceType: (map.ContainsKey("resourceType") ? map["resourceType"] : "").ToString(), + resourceId: (map.ContainsKey("resourceId") ? map["resourceId"] : "").ToString(), + mode: (map.ContainsKey("mode") ? map["mode"] : "full").ToString(), + expiredAt: map.TryGetValue("expiredAt", out var expiredAt) ? expiredAt?.ToString() : null ); public Dictionary ToMap() => new Dictionary() @@ -91,13 +55,7 @@ string billingPlan { "resourceType", ResourceType }, { "resourceId", ResourceId }, { "mode", Mode }, - { "reason", Reason }, - { "expiredAt", ExpiredAt }, - { "projectName", ProjectName }, - { "region", Region }, - { "organizationName", OrganizationName }, - { "organizationId", OrganizationId }, - { "billingPlan", BillingPlan } + { "expiredAt", ExpiredAt } }; } } diff --git a/Appwrite/Models/Bucket.cs b/Appwrite/Models/Bucket.cs index 5536bd98..d7276f34 100644 --- a/Appwrite/Models/Bucket.cs +++ b/Appwrite/Models/Bucket.cs @@ -87,20 +87,20 @@ long totalSize } public static Bucket From(Dictionary map) => new Bucket( - id: map["$id"].ToString(), - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), - permissions: map["$permissions"].ConvertToList(), - fileSecurity: (bool)map["fileSecurity"], - name: map["name"].ToString(), - enabled: (bool)map["enabled"], - maximumFileSize: Convert.ToInt64(map["maximumFileSize"]), - allowedFileExtensions: map["allowedFileExtensions"].ConvertToList(), - compression: map["compression"].ToString(), - encryption: (bool)map["encryption"], - antivirus: (bool)map["antivirus"], - transformations: (bool)map["transformations"], - totalSize: Convert.ToInt64(map["totalSize"]) + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), + permissions: (map.ContainsKey("$permissions") ? map["$permissions"] : new List()).ConvertToList(), + fileSecurity: (bool)(map.ContainsKey("fileSecurity") ? map["fileSecurity"] : false), + name: (map.ContainsKey("name") ? map["name"] : "").ToString(), + enabled: (bool)(map.ContainsKey("enabled") ? map["enabled"] : true), + maximumFileSize: Convert.ToInt64((map.ContainsKey("maximumFileSize") ? map["maximumFileSize"] : 0)), + allowedFileExtensions: (map.ContainsKey("allowedFileExtensions") ? map["allowedFileExtensions"] : new List()).ConvertToList(), + compression: (map.ContainsKey("compression") ? map["compression"] : "").ToString(), + encryption: (bool)(map.ContainsKey("encryption") ? map["encryption"] : true), + antivirus: (bool)(map.ContainsKey("antivirus") ? map["antivirus"] : true), + transformations: (bool)(map.ContainsKey("transformations") ? map["transformations"] : true), + totalSize: Convert.ToInt64((map.ContainsKey("totalSize") ? map["totalSize"] : 0)) ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/BucketList.cs b/Appwrite/Models/BucketList.cs index 194dea04..7a514210 100644 --- a/Appwrite/Models/BucketList.cs +++ b/Appwrite/Models/BucketList.cs @@ -27,7 +27,7 @@ List buckets } public static BucketList From(Dictionary map) => new BucketList( - total: Convert.ToInt64(map["total"]), + total: Convert.ToInt64((map.ContainsKey("total") ? map["total"] : 0)), buckets: map["buckets"].ConvertToList>().Select(it => Appwrite.Models.Bucket.From(map: it)).ToList() ); diff --git a/Appwrite/Models/Collection.cs b/Appwrite/Models/Collection.cs index 018c2136..d9d10b77 100644 --- a/Appwrite/Models/Collection.cs +++ b/Appwrite/Models/Collection.cs @@ -77,18 +77,18 @@ long bytesUsed } public static Collection From(Dictionary map) => new Collection( - id: map["$id"].ToString(), - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), permissions: map["$permissions"].ConvertToList(), - databaseId: map["databaseId"].ToString(), - name: map["name"].ToString(), - enabled: (bool)map["enabled"], - documentSecurity: (bool)map["documentSecurity"], + databaseId: (map.ContainsKey("databaseId") ? map["databaseId"] : "").ToString(), + name: (map.ContainsKey("name") ? map["name"] : "").ToString(), + enabled: (bool)(map.ContainsKey("enabled") ? map["enabled"] : true), + documentSecurity: (bool)(map.ContainsKey("documentSecurity") ? map["documentSecurity"] : false), attributes: map["attributes"].ConvertToList(), indexes: map["indexes"].ConvertToList>().Select(it => Appwrite.Models.Index.From(map: it)).ToList(), - bytesMax: Convert.ToInt64(map["bytesMax"]), - bytesUsed: Convert.ToInt64(map["bytesUsed"]) + bytesMax: Convert.ToInt64((map.ContainsKey("bytesMax") ? map["bytesMax"] : 0)), + bytesUsed: Convert.ToInt64((map.ContainsKey("bytesUsed") ? map["bytesUsed"] : 0)) ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/CollectionList.cs b/Appwrite/Models/CollectionList.cs index 646ddb5c..0d40c3c3 100644 --- a/Appwrite/Models/CollectionList.cs +++ b/Appwrite/Models/CollectionList.cs @@ -27,7 +27,7 @@ List collections } public static CollectionList From(Dictionary map) => new CollectionList( - total: Convert.ToInt64(map["total"]), + total: Convert.ToInt64((map.ContainsKey("total") ? map["total"] : 0)), collections: map["collections"].ConvertToList>().Select(it => Appwrite.Models.Collection.From(map: it)).ToList() ); diff --git a/Appwrite/Models/ColumnBigint.cs b/Appwrite/Models/ColumnBigint.cs index 22b344bd..3bc86a43 100644 --- a/Appwrite/Models/ColumnBigint.cs +++ b/Appwrite/Models/ColumnBigint.cs @@ -72,16 +72,16 @@ public ColumnBigint( } public static ColumnBigint From(Dictionary map) => new ColumnBigint( - key: map["key"].ToString(), - type: map["type"].ToString(), + key: (map.ContainsKey("key") ? map["key"] : "").ToString(), + type: (map.ContainsKey("type") ? map["type"] : "").ToString(), status: new Appwrite.Enums.ColumnStatus(map["status"].ToString()!), - error: map["error"].ToString(), - required: (bool)map["required"], + error: (map.ContainsKey("error") ? map["error"] : "").ToString(), + required: (bool)(map.ContainsKey("required") ? map["required"] : false), array: map.TryGetValue("array", out var boolRaw6) && boolRaw6 != null ? (bool?)boolRaw6 : null, - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), min: map.TryGetValue("min", out var numberRaw9) && numberRaw9 != null ? Convert.ToInt64(numberRaw9) : null, diff --git a/Appwrite/Models/ColumnBoolean.cs b/Appwrite/Models/ColumnBoolean.cs index f6fb093a..d6ee9675 100644 --- a/Appwrite/Models/ColumnBoolean.cs +++ b/Appwrite/Models/ColumnBoolean.cs @@ -62,16 +62,16 @@ public ColumnBoolean( } public static ColumnBoolean From(Dictionary map) => new ColumnBoolean( - key: map["key"].ToString(), - type: map["type"].ToString(), + key: (map.ContainsKey("key") ? map["key"] : "").ToString(), + type: (map.ContainsKey("type") ? map["type"] : "").ToString(), status: new Appwrite.Enums.ColumnStatus(map["status"].ToString()!), - error: map["error"].ToString(), - required: (bool)map["required"], + error: (map.ContainsKey("error") ? map["error"] : "").ToString(), + required: (bool)(map.ContainsKey("required") ? map["required"] : false), array: map.TryGetValue("array", out var boolRaw6) && boolRaw6 != null ? (bool?)boolRaw6 : null, - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), @default: map.TryGetValue("default", out var boolRaw9) && boolRaw9 != null ? (bool?)boolRaw9 : null diff --git a/Appwrite/Models/ColumnDatetime.cs b/Appwrite/Models/ColumnDatetime.cs index 3eb55e51..481e47b8 100644 --- a/Appwrite/Models/ColumnDatetime.cs +++ b/Appwrite/Models/ColumnDatetime.cs @@ -67,16 +67,16 @@ public ColumnDatetime( } public static ColumnDatetime From(Dictionary map) => new ColumnDatetime( - key: map["key"].ToString(), - type: map["type"].ToString(), + key: (map.ContainsKey("key") ? map["key"] : "").ToString(), + type: (map.ContainsKey("type") ? map["type"] : "").ToString(), status: new Appwrite.Enums.ColumnStatus(map["status"].ToString()!), - error: map["error"].ToString(), - required: (bool)map["required"], + error: (map.ContainsKey("error") ? map["error"] : "").ToString(), + required: (bool)(map.ContainsKey("required") ? map["required"] : false), array: map.TryGetValue("array", out var boolRaw6) && boolRaw6 != null ? (bool?)boolRaw6 : null, - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), format: map["format"].ToString(), @default: map.TryGetValue("default", out var @default) ? @default?.ToString() : null ); diff --git a/Appwrite/Models/ColumnEmail.cs b/Appwrite/Models/ColumnEmail.cs index 96a5a952..86c8476e 100644 --- a/Appwrite/Models/ColumnEmail.cs +++ b/Appwrite/Models/ColumnEmail.cs @@ -67,17 +67,17 @@ public ColumnEmail( } public static ColumnEmail From(Dictionary map) => new ColumnEmail( - key: map["key"].ToString(), - type: map["type"].ToString(), + key: (map.ContainsKey("key") ? map["key"] : "").ToString(), + type: (map.ContainsKey("type") ? map["type"] : "").ToString(), status: new Appwrite.Enums.ColumnStatus(map["status"].ToString()!), - error: map["error"].ToString(), - required: (bool)map["required"], + error: (map.ContainsKey("error") ? map["error"] : "").ToString(), + required: (bool)(map.ContainsKey("required") ? map["required"] : false), array: map.TryGetValue("array", out var boolRaw6) && boolRaw6 != null ? (bool?)boolRaw6 : null, - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), - format: map["format"].ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), + format: (map.ContainsKey("format") ? map["format"] : "email").ToString(), @default: map.TryGetValue("default", out var @default) ? @default?.ToString() : null ); diff --git a/Appwrite/Models/ColumnEnum.cs b/Appwrite/Models/ColumnEnum.cs index 9686f6f8..9cf9d361 100644 --- a/Appwrite/Models/ColumnEnum.cs +++ b/Appwrite/Models/ColumnEnum.cs @@ -72,18 +72,18 @@ public ColumnEnum( } public static ColumnEnum From(Dictionary map) => new ColumnEnum( - key: map["key"].ToString(), - type: map["type"].ToString(), + key: (map.ContainsKey("key") ? map["key"] : "").ToString(), + type: (map.ContainsKey("type") ? map["type"] : "").ToString(), status: new Appwrite.Enums.ColumnStatus(map["status"].ToString()!), - error: map["error"].ToString(), - required: (bool)map["required"], + error: (map.ContainsKey("error") ? map["error"] : "").ToString(), + required: (bool)(map.ContainsKey("required") ? map["required"] : false), array: map.TryGetValue("array", out var boolRaw6) && boolRaw6 != null ? (bool?)boolRaw6 : null, - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), elements: map["elements"].ConvertToList(), - format: map["format"].ToString(), + format: (map.ContainsKey("format") ? map["format"] : "enum").ToString(), @default: map.TryGetValue("default", out var @default) ? @default?.ToString() : null ); diff --git a/Appwrite/Models/ColumnFloat.cs b/Appwrite/Models/ColumnFloat.cs index 98636303..efac3854 100644 --- a/Appwrite/Models/ColumnFloat.cs +++ b/Appwrite/Models/ColumnFloat.cs @@ -72,16 +72,16 @@ public ColumnFloat( } public static ColumnFloat From(Dictionary map) => new ColumnFloat( - key: map["key"].ToString(), - type: map["type"].ToString(), + key: (map.ContainsKey("key") ? map["key"] : "").ToString(), + type: (map.ContainsKey("type") ? map["type"] : "").ToString(), status: new Appwrite.Enums.ColumnStatus(map["status"].ToString()!), - error: map["error"].ToString(), - required: (bool)map["required"], + error: (map.ContainsKey("error") ? map["error"] : "").ToString(), + required: (bool)(map.ContainsKey("required") ? map["required"] : false), array: map.TryGetValue("array", out var boolRaw6) && boolRaw6 != null ? (bool?)boolRaw6 : null, - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), min: map.TryGetValue("min", out var numberRaw9) && numberRaw9 != null ? Convert.ToDouble(numberRaw9) : null, diff --git a/Appwrite/Models/ColumnIndex.cs b/Appwrite/Models/ColumnIndex.cs index 531ec4af..a670f6ed 100644 --- a/Appwrite/Models/ColumnIndex.cs +++ b/Appwrite/Models/ColumnIndex.cs @@ -67,15 +67,15 @@ public ColumnIndex( } public static ColumnIndex From(Dictionary map) => new ColumnIndex( - id: map["$id"].ToString(), - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), - key: map["key"].ToString(), - type: map["type"].ToString(), - status: map["status"].ToString(), - error: map["error"].ToString(), - columns: map["columns"].ConvertToList(), - lengths: map["lengths"].ConvertToList(), + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), + key: (map.ContainsKey("key") ? map["key"] : "").ToString(), + type: (map.ContainsKey("type") ? map["type"] : "").ToString(), + status: (map.ContainsKey("status") ? map["status"] : "").ToString(), + error: (map.ContainsKey("error") ? map["error"] : "").ToString(), + columns: (map.ContainsKey("columns") ? map["columns"] : new List()).ConvertToList(), + lengths: (map.ContainsKey("lengths") ? map["lengths"] : new List()).ConvertToList(), orders: map.TryGetValue("orders", out var arrayRaw10) && arrayRaw10 != null ? arrayRaw10.ConvertToList() : null diff --git a/Appwrite/Models/ColumnIndexList.cs b/Appwrite/Models/ColumnIndexList.cs index 40c90198..ad1320fd 100644 --- a/Appwrite/Models/ColumnIndexList.cs +++ b/Appwrite/Models/ColumnIndexList.cs @@ -27,7 +27,7 @@ List indexes } public static ColumnIndexList From(Dictionary map) => new ColumnIndexList( - total: Convert.ToInt64(map["total"]), + total: Convert.ToInt64((map.ContainsKey("total") ? map["total"] : 0)), indexes: map["indexes"].ConvertToList>().Select(it => Appwrite.Models.ColumnIndex.From(map: it)).ToList() ); diff --git a/Appwrite/Models/ColumnInteger.cs b/Appwrite/Models/ColumnInteger.cs index 21b6d927..2cc42521 100644 --- a/Appwrite/Models/ColumnInteger.cs +++ b/Appwrite/Models/ColumnInteger.cs @@ -72,16 +72,16 @@ public ColumnInteger( } public static ColumnInteger From(Dictionary map) => new ColumnInteger( - key: map["key"].ToString(), - type: map["type"].ToString(), + key: (map.ContainsKey("key") ? map["key"] : "").ToString(), + type: (map.ContainsKey("type") ? map["type"] : "").ToString(), status: new Appwrite.Enums.ColumnStatus(map["status"].ToString()!), - error: map["error"].ToString(), - required: (bool)map["required"], + error: (map.ContainsKey("error") ? map["error"] : "").ToString(), + required: (bool)(map.ContainsKey("required") ? map["required"] : false), array: map.TryGetValue("array", out var boolRaw6) && boolRaw6 != null ? (bool?)boolRaw6 : null, - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), min: map.TryGetValue("min", out var numberRaw9) && numberRaw9 != null ? Convert.ToInt64(numberRaw9) : null, diff --git a/Appwrite/Models/ColumnIp.cs b/Appwrite/Models/ColumnIp.cs index ce1e4675..7b76fb24 100644 --- a/Appwrite/Models/ColumnIp.cs +++ b/Appwrite/Models/ColumnIp.cs @@ -67,17 +67,17 @@ public ColumnIp( } public static ColumnIp From(Dictionary map) => new ColumnIp( - key: map["key"].ToString(), - type: map["type"].ToString(), + key: (map.ContainsKey("key") ? map["key"] : "").ToString(), + type: (map.ContainsKey("type") ? map["type"] : "").ToString(), status: new Appwrite.Enums.ColumnStatus(map["status"].ToString()!), - error: map["error"].ToString(), - required: (bool)map["required"], + error: (map.ContainsKey("error") ? map["error"] : "").ToString(), + required: (bool)(map.ContainsKey("required") ? map["required"] : false), array: map.TryGetValue("array", out var boolRaw6) && boolRaw6 != null ? (bool?)boolRaw6 : null, - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), - format: map["format"].ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), + format: (map.ContainsKey("format") ? map["format"] : "ip").ToString(), @default: map.TryGetValue("default", out var @default) ? @default?.ToString() : null ); diff --git a/Appwrite/Models/ColumnLine.cs b/Appwrite/Models/ColumnLine.cs index 2f22e9d2..8e19bff0 100644 --- a/Appwrite/Models/ColumnLine.cs +++ b/Appwrite/Models/ColumnLine.cs @@ -62,16 +62,16 @@ public ColumnLine( } public static ColumnLine From(Dictionary map) => new ColumnLine( - key: map["key"].ToString(), - type: map["type"].ToString(), + key: (map.ContainsKey("key") ? map["key"] : "").ToString(), + type: (map.ContainsKey("type") ? map["type"] : "").ToString(), status: new Appwrite.Enums.ColumnStatus(map["status"].ToString()!), - error: map["error"].ToString(), - required: (bool)map["required"], + error: (map.ContainsKey("error") ? map["error"] : "").ToString(), + required: (bool)(map.ContainsKey("required") ? map["required"] : false), array: map.TryGetValue("array", out var boolRaw6) && boolRaw6 != null ? (bool?)boolRaw6 : null, - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), @default: map.TryGetValue("default", out var arrayRaw9) && arrayRaw9 != null ? arrayRaw9.ConvertToList>() : null diff --git a/Appwrite/Models/ColumnList.cs b/Appwrite/Models/ColumnList.cs index a1ca46da..fa25f52b 100644 --- a/Appwrite/Models/ColumnList.cs +++ b/Appwrite/Models/ColumnList.cs @@ -27,7 +27,7 @@ List columns } public static ColumnList From(Dictionary map) => new ColumnList( - total: Convert.ToInt64(map["total"]), + total: Convert.ToInt64((map.ContainsKey("total") ? map["total"] : 0)), columns: map["columns"].ConvertToList() ); diff --git a/Appwrite/Models/ColumnLongtext.cs b/Appwrite/Models/ColumnLongtext.cs index 68bad03d..326bd28a 100644 --- a/Appwrite/Models/ColumnLongtext.cs +++ b/Appwrite/Models/ColumnLongtext.cs @@ -67,16 +67,16 @@ public ColumnLongtext( } public static ColumnLongtext From(Dictionary map) => new ColumnLongtext( - key: map["key"].ToString(), - type: map["type"].ToString(), + key: (map.ContainsKey("key") ? map["key"] : "").ToString(), + type: (map.ContainsKey("type") ? map["type"] : "").ToString(), status: new Appwrite.Enums.ColumnStatus(map["status"].ToString()!), - error: map["error"].ToString(), - required: (bool)map["required"], + error: (map.ContainsKey("error") ? map["error"] : "").ToString(), + required: (bool)(map.ContainsKey("required") ? map["required"] : false), array: map.TryGetValue("array", out var boolRaw6) && boolRaw6 != null ? (bool?)boolRaw6 : null, - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), @default: map.TryGetValue("default", out var @default) ? @default?.ToString() : null, encrypt: map.TryGetValue("encrypt", out var boolRaw10) && boolRaw10 != null ? (bool?)boolRaw10 diff --git a/Appwrite/Models/ColumnMediumtext.cs b/Appwrite/Models/ColumnMediumtext.cs index 6a16f369..3af38532 100644 --- a/Appwrite/Models/ColumnMediumtext.cs +++ b/Appwrite/Models/ColumnMediumtext.cs @@ -67,16 +67,16 @@ public ColumnMediumtext( } public static ColumnMediumtext From(Dictionary map) => new ColumnMediumtext( - key: map["key"].ToString(), - type: map["type"].ToString(), + key: (map.ContainsKey("key") ? map["key"] : "").ToString(), + type: (map.ContainsKey("type") ? map["type"] : "").ToString(), status: new Appwrite.Enums.ColumnStatus(map["status"].ToString()!), - error: map["error"].ToString(), - required: (bool)map["required"], + error: (map.ContainsKey("error") ? map["error"] : "").ToString(), + required: (bool)(map.ContainsKey("required") ? map["required"] : false), array: map.TryGetValue("array", out var boolRaw6) && boolRaw6 != null ? (bool?)boolRaw6 : null, - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), @default: map.TryGetValue("default", out var @default) ? @default?.ToString() : null, encrypt: map.TryGetValue("encrypt", out var boolRaw10) && boolRaw10 != null ? (bool?)boolRaw10 diff --git a/Appwrite/Models/ColumnPoint.cs b/Appwrite/Models/ColumnPoint.cs index 77450962..59199b74 100644 --- a/Appwrite/Models/ColumnPoint.cs +++ b/Appwrite/Models/ColumnPoint.cs @@ -62,16 +62,16 @@ public ColumnPoint( } public static ColumnPoint From(Dictionary map) => new ColumnPoint( - key: map["key"].ToString(), - type: map["type"].ToString(), + key: (map.ContainsKey("key") ? map["key"] : "").ToString(), + type: (map.ContainsKey("type") ? map["type"] : "").ToString(), status: new Appwrite.Enums.ColumnStatus(map["status"].ToString()!), - error: map["error"].ToString(), - required: (bool)map["required"], + error: (map.ContainsKey("error") ? map["error"] : "").ToString(), + required: (bool)(map.ContainsKey("required") ? map["required"] : false), array: map.TryGetValue("array", out var boolRaw6) && boolRaw6 != null ? (bool?)boolRaw6 : null, - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), @default: map.TryGetValue("default", out var arrayRaw9) && arrayRaw9 != null ? arrayRaw9.ConvertToList() : null diff --git a/Appwrite/Models/ColumnPolygon.cs b/Appwrite/Models/ColumnPolygon.cs index 8d5c7256..5e47278c 100644 --- a/Appwrite/Models/ColumnPolygon.cs +++ b/Appwrite/Models/ColumnPolygon.cs @@ -62,16 +62,16 @@ public ColumnPolygon( } public static ColumnPolygon From(Dictionary map) => new ColumnPolygon( - key: map["key"].ToString(), - type: map["type"].ToString(), + key: (map.ContainsKey("key") ? map["key"] : "").ToString(), + type: (map.ContainsKey("type") ? map["type"] : "").ToString(), status: new Appwrite.Enums.ColumnStatus(map["status"].ToString()!), - error: map["error"].ToString(), - required: (bool)map["required"], + error: (map.ContainsKey("error") ? map["error"] : "").ToString(), + required: (bool)(map.ContainsKey("required") ? map["required"] : false), array: map.TryGetValue("array", out var boolRaw6) && boolRaw6 != null ? (bool?)boolRaw6 : null, - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), @default: map.TryGetValue("default", out var arrayRaw9) && arrayRaw9 != null ? arrayRaw9.ConvertToList>>() : null diff --git a/Appwrite/Models/ColumnRelationship.cs b/Appwrite/Models/ColumnRelationship.cs index fb9d77a2..46d7bf70 100644 --- a/Appwrite/Models/ColumnRelationship.cs +++ b/Appwrite/Models/ColumnRelationship.cs @@ -87,22 +87,22 @@ string side } public static ColumnRelationship From(Dictionary map) => new ColumnRelationship( - key: map["key"].ToString(), - type: map["type"].ToString(), + key: (map.ContainsKey("key") ? map["key"] : "").ToString(), + type: (map.ContainsKey("type") ? map["type"] : "").ToString(), status: new Appwrite.Enums.ColumnStatus(map["status"].ToString()!), - error: map["error"].ToString(), - required: (bool)map["required"], + error: (map.ContainsKey("error") ? map["error"] : "").ToString(), + required: (bool)(map.ContainsKey("required") ? map["required"] : false), array: map.TryGetValue("array", out var boolRaw6) && boolRaw6 != null ? (bool?)boolRaw6 : null, - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), relatedTable: map["relatedTable"].ToString(), - relationType: map["relationType"].ToString(), - twoWay: (bool)map["twoWay"], - twoWayKey: map["twoWayKey"].ToString(), - onDelete: map["onDelete"].ToString(), - side: map["side"].ToString() + relationType: (map.ContainsKey("relationType") ? map["relationType"] : "").ToString(), + twoWay: (bool)(map.ContainsKey("twoWay") ? map["twoWay"] : false), + twoWayKey: (map.ContainsKey("twoWayKey") ? map["twoWayKey"] : "").ToString(), + onDelete: (map.ContainsKey("onDelete") ? map["onDelete"] : "restrict").ToString(), + side: (map.ContainsKey("side") ? map["side"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/ColumnString.cs b/Appwrite/Models/ColumnString.cs index 974ff69a..6d29c1b5 100644 --- a/Appwrite/Models/ColumnString.cs +++ b/Appwrite/Models/ColumnString.cs @@ -72,17 +72,17 @@ public ColumnString( } public static ColumnString From(Dictionary map) => new ColumnString( - key: map["key"].ToString(), - type: map["type"].ToString(), + key: (map.ContainsKey("key") ? map["key"] : "").ToString(), + type: (map.ContainsKey("type") ? map["type"] : "").ToString(), status: new Appwrite.Enums.ColumnStatus(map["status"].ToString()!), - error: map["error"].ToString(), - required: (bool)map["required"], + error: (map.ContainsKey("error") ? map["error"] : "").ToString(), + required: (bool)(map.ContainsKey("required") ? map["required"] : false), array: map.TryGetValue("array", out var boolRaw6) && boolRaw6 != null ? (bool?)boolRaw6 : null, - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), - size: Convert.ToInt64(map["size"]), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), + size: Convert.ToInt64((map.ContainsKey("size") ? map["size"] : 0)), @default: map.TryGetValue("default", out var @default) ? @default?.ToString() : null, encrypt: map.TryGetValue("encrypt", out var boolRaw11) && boolRaw11 != null ? (bool?)boolRaw11 diff --git a/Appwrite/Models/ColumnText.cs b/Appwrite/Models/ColumnText.cs index da4d9806..7bd14c97 100644 --- a/Appwrite/Models/ColumnText.cs +++ b/Appwrite/Models/ColumnText.cs @@ -67,16 +67,16 @@ public ColumnText( } public static ColumnText From(Dictionary map) => new ColumnText( - key: map["key"].ToString(), - type: map["type"].ToString(), + key: (map.ContainsKey("key") ? map["key"] : "").ToString(), + type: (map.ContainsKey("type") ? map["type"] : "").ToString(), status: new Appwrite.Enums.ColumnStatus(map["status"].ToString()!), - error: map["error"].ToString(), - required: (bool)map["required"], + error: (map.ContainsKey("error") ? map["error"] : "").ToString(), + required: (bool)(map.ContainsKey("required") ? map["required"] : false), array: map.TryGetValue("array", out var boolRaw6) && boolRaw6 != null ? (bool?)boolRaw6 : null, - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), @default: map.TryGetValue("default", out var @default) ? @default?.ToString() : null, encrypt: map.TryGetValue("encrypt", out var boolRaw10) && boolRaw10 != null ? (bool?)boolRaw10 diff --git a/Appwrite/Models/ColumnUrl.cs b/Appwrite/Models/ColumnUrl.cs index 7250ade6..7ae932ae 100644 --- a/Appwrite/Models/ColumnUrl.cs +++ b/Appwrite/Models/ColumnUrl.cs @@ -67,17 +67,17 @@ public ColumnUrl( } public static ColumnUrl From(Dictionary map) => new ColumnUrl( - key: map["key"].ToString(), - type: map["type"].ToString(), + key: (map.ContainsKey("key") ? map["key"] : "").ToString(), + type: (map.ContainsKey("type") ? map["type"] : "").ToString(), status: new Appwrite.Enums.ColumnStatus(map["status"].ToString()!), - error: map["error"].ToString(), - required: (bool)map["required"], + error: (map.ContainsKey("error") ? map["error"] : "").ToString(), + required: (bool)(map.ContainsKey("required") ? map["required"] : false), array: map.TryGetValue("array", out var boolRaw6) && boolRaw6 != null ? (bool?)boolRaw6 : null, - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), - format: map["format"].ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), + format: (map.ContainsKey("format") ? map["format"] : "url").ToString(), @default: map.TryGetValue("default", out var @default) ? @default?.ToString() : null ); diff --git a/Appwrite/Models/ColumnVarchar.cs b/Appwrite/Models/ColumnVarchar.cs index 7659a677..562ae3f4 100644 --- a/Appwrite/Models/ColumnVarchar.cs +++ b/Appwrite/Models/ColumnVarchar.cs @@ -72,17 +72,17 @@ public ColumnVarchar( } public static ColumnVarchar From(Dictionary map) => new ColumnVarchar( - key: map["key"].ToString(), - type: map["type"].ToString(), + key: (map.ContainsKey("key") ? map["key"] : "").ToString(), + type: (map.ContainsKey("type") ? map["type"] : "").ToString(), status: new Appwrite.Enums.ColumnStatus(map["status"].ToString()!), - error: map["error"].ToString(), - required: (bool)map["required"], + error: (map.ContainsKey("error") ? map["error"] : "").ToString(), + required: (bool)(map.ContainsKey("required") ? map["required"] : false), array: map.TryGetValue("array", out var boolRaw6) && boolRaw6 != null ? (bool?)boolRaw6 : null, - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), - size: Convert.ToInt64(map["size"]), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), + size: Convert.ToInt64((map.ContainsKey("size") ? map["size"] : 0)), @default: map.TryGetValue("default", out var @default) ? @default?.ToString() : null, encrypt: map.TryGetValue("encrypt", out var boolRaw11) && boolRaw11 != null ? (bool?)boolRaw11 diff --git a/Appwrite/Models/Continent.cs b/Appwrite/Models/Continent.cs index 8bfa8b1a..09af0b5a 100644 --- a/Appwrite/Models/Continent.cs +++ b/Appwrite/Models/Continent.cs @@ -27,8 +27,8 @@ string code } public static Continent From(Dictionary map) => new Continent( - name: map["name"].ToString(), - code: map["code"].ToString() + name: (map.ContainsKey("name") ? map["name"] : "").ToString(), + code: (map.ContainsKey("code") ? map["code"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/ContinentList.cs b/Appwrite/Models/ContinentList.cs index 8b5ea8b1..534d6a61 100644 --- a/Appwrite/Models/ContinentList.cs +++ b/Appwrite/Models/ContinentList.cs @@ -27,7 +27,7 @@ List continents } public static ContinentList From(Dictionary map) => new ContinentList( - total: Convert.ToInt64(map["total"]), + total: Convert.ToInt64((map.ContainsKey("total") ? map["total"] : 0)), continents: map["continents"].ConvertToList>().Select(it => Appwrite.Models.Continent.From(map: it)).ToList() ); diff --git a/Appwrite/Models/Country.cs b/Appwrite/Models/Country.cs index 30ebb428..9230d606 100644 --- a/Appwrite/Models/Country.cs +++ b/Appwrite/Models/Country.cs @@ -27,8 +27,8 @@ string code } public static Country From(Dictionary map) => new Country( - name: map["name"].ToString(), - code: map["code"].ToString() + name: (map.ContainsKey("name") ? map["name"] : "").ToString(), + code: (map.ContainsKey("code") ? map["code"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/CountryList.cs b/Appwrite/Models/CountryList.cs index 9478a37a..670ac202 100644 --- a/Appwrite/Models/CountryList.cs +++ b/Appwrite/Models/CountryList.cs @@ -27,7 +27,7 @@ List countries } public static CountryList From(Dictionary map) => new CountryList( - total: Convert.ToInt64(map["total"]), + total: Convert.ToInt64((map.ContainsKey("total") ? map["total"] : 0)), countries: map["countries"].ConvertToList>().Select(it => Appwrite.Models.Country.From(map: it)).ToList() ); diff --git a/Appwrite/Models/Currency.cs b/Appwrite/Models/Currency.cs index 22724f8e..02203fc5 100644 --- a/Appwrite/Models/Currency.cs +++ b/Appwrite/Models/Currency.cs @@ -52,13 +52,13 @@ string namePlural } public static Currency From(Dictionary map) => new Currency( - symbol: map["symbol"].ToString(), - name: map["name"].ToString(), - symbolNative: map["symbolNative"].ToString(), - decimalDigits: Convert.ToInt64(map["decimalDigits"]), - rounding: Convert.ToDouble(map["rounding"]), - code: map["code"].ToString(), - namePlural: map["namePlural"].ToString() + symbol: (map.ContainsKey("symbol") ? map["symbol"] : "").ToString(), + name: (map.ContainsKey("name") ? map["name"] : "").ToString(), + symbolNative: (map.ContainsKey("symbolNative") ? map["symbolNative"] : "").ToString(), + decimalDigits: Convert.ToInt64((map.ContainsKey("decimalDigits") ? map["decimalDigits"] : 0)), + rounding: Convert.ToDouble((map.ContainsKey("rounding") ? map["rounding"] : 0)), + code: (map.ContainsKey("code") ? map["code"] : "").ToString(), + namePlural: (map.ContainsKey("namePlural") ? map["namePlural"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/CurrencyList.cs b/Appwrite/Models/CurrencyList.cs index ce71e185..e3ee3864 100644 --- a/Appwrite/Models/CurrencyList.cs +++ b/Appwrite/Models/CurrencyList.cs @@ -27,7 +27,7 @@ List currencies } public static CurrencyList From(Dictionary map) => new CurrencyList( - total: Convert.ToInt64(map["total"]), + total: Convert.ToInt64((map.ContainsKey("total") ? map["total"] : 0)), currencies: map["currencies"].ConvertToList>().Select(it => Appwrite.Models.Currency.From(map: it)).ToList() ); diff --git a/Appwrite/Models/Database.cs b/Appwrite/Models/Database.cs index 419a1e6a..ad902425 100644 --- a/Appwrite/Models/Database.cs +++ b/Appwrite/Models/Database.cs @@ -92,12 +92,12 @@ public Database( } public static Database From(Dictionary map) => new Database( - id: map["$id"].ToString(), - name: map["name"].ToString(), - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), - enabled: (bool)map["enabled"], - type: new Appwrite.Enums.DatabaseType(map["type"].ToString()!), + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + name: (map.ContainsKey("name") ? map["name"] : "").ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), + enabled: (bool)(map.ContainsKey("enabled") ? map["enabled"] : true), + type: new Appwrite.Enums.DatabaseType((map.ContainsKey("type") ? map["type"] : "legacy").ToString()!), status: map.TryGetValue("status", out var enumRaw7) ? enumRaw7 == null ? null diff --git a/Appwrite/Models/DatabaseList.cs b/Appwrite/Models/DatabaseList.cs index 28d782e3..f306a07d 100644 --- a/Appwrite/Models/DatabaseList.cs +++ b/Appwrite/Models/DatabaseList.cs @@ -27,7 +27,7 @@ List databases } public static DatabaseList From(Dictionary map) => new DatabaseList( - total: Convert.ToInt64(map["total"]), + total: Convert.ToInt64((map.ContainsKey("total") ? map["total"] : 0)), databases: map["databases"].ConvertToList>().Select(it => Appwrite.Models.Database.From(map: it)).ToList() ); diff --git a/Appwrite/Models/DatabaseMigration.cs b/Appwrite/Models/DatabaseMigration.cs index 200e2bab..c919a180 100644 --- a/Appwrite/Models/DatabaseMigration.cs +++ b/Appwrite/Models/DatabaseMigration.cs @@ -102,23 +102,23 @@ bool paused } public static DatabaseMigration From(Dictionary map) => new DatabaseMigration( - id: map["$id"].ToString(), - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), - projectId: map["projectId"].ToString(), - databaseId: map["databaseId"].ToString(), - specification: map["specification"].ToString(), - phase: map["phase"].ToString(), - attempt: Convert.ToInt64(map["attempt"]), - lastError: map["lastError"].ToString(), - lagDocuments: Convert.ToInt64(map["lagDocuments"]), - changelogWatermark: Convert.ToInt64(map["changelogWatermark"]), - verifiedAt: map["verifiedAt"].ToString(), - cutoverAt: map["cutoverAt"].ToString(), - soakUntil: map["soakUntil"].ToString(), - autoCutover: (bool)map["autoCutover"], - cutoverRequested: (bool)map["cutoverRequested"], - paused: (bool)map["paused"] + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), + projectId: (map.ContainsKey("projectId") ? map["projectId"] : "").ToString(), + databaseId: (map.ContainsKey("databaseId") ? map["databaseId"] : "").ToString(), + specification: (map.ContainsKey("specification") ? map["specification"] : "").ToString(), + phase: (map.ContainsKey("phase") ? map["phase"] : "pending").ToString(), + attempt: Convert.ToInt64((map.ContainsKey("attempt") ? map["attempt"] : 0)), + lastError: (map.ContainsKey("lastError") ? map["lastError"] : "").ToString(), + lagDocuments: Convert.ToInt64((map.ContainsKey("lagDocuments") ? map["lagDocuments"] : 0)), + changelogWatermark: Convert.ToInt64((map.ContainsKey("changelogWatermark") ? map["changelogWatermark"] : 0)), + verifiedAt: (map.ContainsKey("verifiedAt") ? map["verifiedAt"] : "").ToString(), + cutoverAt: (map.ContainsKey("cutoverAt") ? map["cutoverAt"] : "").ToString(), + soakUntil: (map.ContainsKey("soakUntil") ? map["soakUntil"] : "").ToString(), + autoCutover: (bool)(map.ContainsKey("autoCutover") ? map["autoCutover"] : true), + cutoverRequested: (bool)(map.ContainsKey("cutoverRequested") ? map["cutoverRequested"] : false), + paused: (bool)(map.ContainsKey("paused") ? map["paused"] : false) ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/DatabaseMigrationList.cs b/Appwrite/Models/DatabaseMigrationList.cs index e7634bff..80213d07 100644 --- a/Appwrite/Models/DatabaseMigrationList.cs +++ b/Appwrite/Models/DatabaseMigrationList.cs @@ -27,7 +27,7 @@ List migrations } public static DatabaseMigrationList From(Dictionary map) => new DatabaseMigrationList( - total: Convert.ToInt64(map["total"]), + total: Convert.ToInt64((map.ContainsKey("total") ? map["total"] : 0)), migrations: map["migrations"].ConvertToList>().Select(it => Appwrite.Models.DatabaseMigration.From(map: it)).ToList() ); diff --git a/Appwrite/Models/DatabaseStatus.cs b/Appwrite/Models/DatabaseStatus.cs index ab6fb06e..28c2832e 100644 --- a/Appwrite/Models/DatabaseStatus.cs +++ b/Appwrite/Models/DatabaseStatus.cs @@ -27,7 +27,7 @@ public class DatabaseStatus public long Uptime { get; private set; } [JsonPropertyName("connections")] - public DatabaseStatusConnections Connections { get; private set; } + public DatabaseStatusConnections? Connections { get; private set; } [JsonPropertyName("syncMode")] public string SyncMode { get; private set; } @@ -59,7 +59,7 @@ public DatabaseStatus( string engine, string version, long uptime, - DatabaseStatusConnections connections, + DatabaseStatusConnections? connections, string syncMode, string? effectiveSyncMode, bool syncDegraded, @@ -87,17 +87,19 @@ List volumes } public static DatabaseStatus From(Dictionary map) => new DatabaseStatus( - health: map["health"].ToString(), - ready: (bool)map["ready"], - engine: map["engine"].ToString(), - version: map["version"].ToString(), - uptime: Convert.ToInt64(map["uptime"]), - connections: Appwrite.Models.DatabaseStatusConnections.From(map: map["connections"] is JsonElement jsonObj6 ? jsonObj6.Deserialize>()! : (Dictionary)map["connections"]), - syncMode: map["syncMode"].ToString(), + health: (map.ContainsKey("health") ? map["health"] : "unknown").ToString(), + ready: (bool)(map.ContainsKey("ready") ? map["ready"] : false), + engine: (map.ContainsKey("engine") ? map["engine"] : "postgresql").ToString(), + version: (map.ContainsKey("version") ? map["version"] : "").ToString(), + uptime: Convert.ToInt64((map.ContainsKey("uptime") ? map["uptime"] : 0)), + connections: map.TryGetValue("connections", out var objectRaw6) && objectRaw6 != null + ? Appwrite.Models.DatabaseStatusConnections.From(map: objectRaw6 is JsonElement jsonObj6 ? jsonObj6.Deserialize>()! : (Dictionary)objectRaw6) + : null, + syncMode: (map.ContainsKey("syncMode") ? map["syncMode"] : "async").ToString(), effectiveSyncMode: map.TryGetValue("effectiveSyncMode", out var effectiveSyncMode) ? effectiveSyncMode?.ToString() : null, - syncDegraded: (bool)map["syncDegraded"], - syncAcknowledgements: Convert.ToInt64(map["syncAcknowledgements"]), - syncStandbyCount: Convert.ToInt64(map["syncStandbyCount"]), + syncDegraded: (bool)(map.ContainsKey("syncDegraded") ? map["syncDegraded"] : false), + syncAcknowledgements: Convert.ToInt64((map.ContainsKey("syncAcknowledgements") ? map["syncAcknowledgements"] : 0)), + syncStandbyCount: Convert.ToInt64((map.ContainsKey("syncStandbyCount") ? map["syncStandbyCount"] : 0)), syncStateConfirmed: map.TryGetValue("syncStateConfirmed", out var boolRaw12) && boolRaw12 != null ? (bool?)boolRaw12 : null, diff --git a/Appwrite/Models/DatabaseStatusConnections.cs b/Appwrite/Models/DatabaseStatusConnections.cs index 4a1de49a..5ede5727 100644 --- a/Appwrite/Models/DatabaseStatusConnections.cs +++ b/Appwrite/Models/DatabaseStatusConnections.cs @@ -27,8 +27,8 @@ long max } public static DatabaseStatusConnections From(Dictionary map) => new DatabaseStatusConnections( - current: Convert.ToInt64(map["current"]), - max: Convert.ToInt64(map["max"]) + current: Convert.ToInt64((map.ContainsKey("current") ? map["current"] : 0)), + max: Convert.ToInt64((map.ContainsKey("max") ? map["max"] : 100)) ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/DatabaseStatusReplica.cs b/Appwrite/Models/DatabaseStatusReplica.cs index c197c82f..d56d81dc 100644 --- a/Appwrite/Models/DatabaseStatusReplica.cs +++ b/Appwrite/Models/DatabaseStatusReplica.cs @@ -42,9 +42,9 @@ public DatabaseStatusReplica( } public static DatabaseStatusReplica From(Dictionary map) => new DatabaseStatusReplica( - index: Convert.ToInt64(map["index"]), - role: map["role"].ToString(), - healthy: (bool)map["healthy"], + index: Convert.ToInt64((map.ContainsKey("index") ? map["index"] : 0)), + role: (map.ContainsKey("role") ? map["role"] : "unknown").ToString(), + healthy: (bool)(map.ContainsKey("healthy") ? map["healthy"] : false), replicating: map.TryGetValue("replicating", out var boolRaw4) && boolRaw4 != null ? (bool?)boolRaw4 : null, diff --git a/Appwrite/Models/DatabaseStatusVolume.cs b/Appwrite/Models/DatabaseStatusVolume.cs index 8fe63d8a..b6ca5ffb 100644 --- a/Appwrite/Models/DatabaseStatusVolume.cs +++ b/Appwrite/Models/DatabaseStatusVolume.cs @@ -37,10 +37,10 @@ bool mounted } public static DatabaseStatusVolume From(Dictionary map) => new DatabaseStatusVolume( - @path: map["path"].ToString(), - usedPercent: map["usedPercent"].ToString(), - available: map["available"].ToString(), - mounted: (bool)map["mounted"] + @path: (map.ContainsKey("path") ? map["path"] : "").ToString(), + usedPercent: (map.ContainsKey("usedPercent") ? map["usedPercent"] : "0%").ToString(), + available: (map.ContainsKey("available") ? map["available"] : "0GB").ToString(), + mounted: (bool)(map.ContainsKey("mounted") ? map["mounted"] : false) ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/DedicatedDatabase.cs b/Appwrite/Models/DedicatedDatabase.cs index 132340b4..190cbc09 100644 --- a/Appwrite/Models/DedicatedDatabase.cs +++ b/Appwrite/Models/DedicatedDatabase.cs @@ -27,10 +27,10 @@ public class DedicatedDatabase public string Name { get; private set; } [JsonPropertyName("api")] - public string Api { get; private set; } + public string? Api { get; private set; } [JsonPropertyName("engine")] - public string Engine { get; private set; } + public string? Engine { get; private set; } [JsonPropertyName("version")] public string Version { get; private set; } @@ -45,7 +45,7 @@ public class DedicatedDatabase public string Hostname { get; private set; } [JsonPropertyName("connectionPort")] - public long ConnectionPort { get; private set; } + public long? ConnectionPort { get; private set; } [JsonPropertyName("connectionUser")] public string ConnectionUser { get; private set; } @@ -54,7 +54,7 @@ public class DedicatedDatabase public string ConnectionPassword { get; private set; } [JsonPropertyName("credentialGeneration")] - public long CredentialGeneration { get; private set; } + public long? CredentialGeneration { get; private set; } [JsonPropertyName("connectionString")] public string ConnectionString { get; private set; } @@ -89,6 +89,15 @@ public class DedicatedDatabase [JsonPropertyName("storage")] public long Storage { get; private set; } + [JsonPropertyName("storageStatus")] + public string StorageStatus { get; private set; } + + [JsonPropertyName("storageTargetGb")] + public long StorageTargetGb { get; private set; } + + [JsonPropertyName("storageResizeStartedAt")] + public string? StorageResizeStartedAt { get; private set; } + [JsonPropertyName("storageClass")] public string StorageClass { get; private set; } @@ -164,16 +173,16 @@ public DedicatedDatabase( string updatedAt, string projectId, string name, - string api, - string engine, + string? api, + string? engine, string version, string specification, string backend, string hostname, - long connectionPort, + long? connectionPort, string connectionUser, string connectionPassword, - long credentialGeneration, + long? credentialGeneration, string connectionString, bool ssl, string status, @@ -185,6 +194,9 @@ public DedicatedDatabase( long cpu, long memory, long storage, + string storageStatus, + long storageTargetGb, + string? storageResizeStartedAt, string storageClass, long storageMaxGb, string nodePool, @@ -236,6 +248,9 @@ string error Cpu = cpu; Memory = memory; Storage = storage; + StorageStatus = storageStatus; + StorageTargetGb = storageTargetGb; + StorageResizeStartedAt = storageResizeStartedAt; StorageClass = storageClass; StorageMaxGb = storageMaxGb; NodePool = nodePool; @@ -262,55 +277,62 @@ string error } public static DedicatedDatabase From(Dictionary map) => new DedicatedDatabase( - id: map["$id"].ToString(), - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), - projectId: map["projectId"].ToString(), - name: map["name"].ToString(), - api: map["api"].ToString(), - engine: map["engine"].ToString(), - version: map["version"].ToString(), - specification: map["specification"].ToString(), - backend: map["backend"].ToString(), - hostname: map["hostname"].ToString(), - connectionPort: Convert.ToInt64(map["connectionPort"]), - connectionUser: map["connectionUser"].ToString(), - connectionPassword: map["connectionPassword"].ToString(), - credentialGeneration: Convert.ToInt64(map["credentialGeneration"]), - connectionString: map["connectionString"].ToString(), - ssl: (bool)map["ssl"], - status: map["status"].ToString(), - containerStatus: map["containerStatus"].ToString(), + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), + projectId: (map.ContainsKey("projectId") ? map["projectId"] : "").ToString(), + name: (map.ContainsKey("name") ? map["name"] : "").ToString(), + api: map.TryGetValue("api", out var api) ? api?.ToString() : null, + engine: map.TryGetValue("engine", out var engine) ? engine?.ToString() : null, + version: (map.ContainsKey("version") ? map["version"] : "").ToString(), + specification: (map.ContainsKey("specification") ? map["specification"] : "").ToString(), + backend: (map.ContainsKey("backend") ? map["backend"] : "").ToString(), + hostname: (map.ContainsKey("hostname") ? map["hostname"] : "").ToString(), + connectionPort: map.TryGetValue("connectionPort", out var numberRaw12) && numberRaw12 != null + ? Convert.ToInt64(numberRaw12) + : null, + connectionUser: (map.ContainsKey("connectionUser") ? map["connectionUser"] : "").ToString(), + connectionPassword: (map.ContainsKey("connectionPassword") ? map["connectionPassword"] : "").ToString(), + credentialGeneration: map.TryGetValue("credentialGeneration", out var numberRaw15) && numberRaw15 != null + ? Convert.ToInt64(numberRaw15) + : null, + connectionString: (map.ContainsKey("connectionString") ? map["connectionString"] : "").ToString(), + ssl: (bool)(map.ContainsKey("ssl") ? map["ssl"] : false), + status: (map.ContainsKey("status") ? map["status"] : "provisioning").ToString(), + containerStatus: (map.ContainsKey("containerStatus") ? map["containerStatus"] : "").ToString(), lastAccessedAt: map.TryGetValue("lastAccessedAt", out var lastAccessedAt) ? lastAccessedAt?.ToString() : null, idleUntil: map.TryGetValue("idleUntil", out var idleUntil) ? idleUntil?.ToString() : null, - lifecycleState: map["lifecycleState"].ToString(), - idleTimeoutMinutes: Convert.ToInt64(map["idleTimeoutMinutes"]), - cpu: Convert.ToInt64(map["cpu"]), - memory: Convert.ToInt64(map["memory"]), - storage: Convert.ToInt64(map["storage"]), - storageClass: map["storageClass"].ToString(), - storageMaxGb: Convert.ToInt64(map["storageMaxGb"]), - nodePool: map["nodePool"].ToString(), - replicas: Convert.ToInt64(map["replicas"]), - syncMode: map["syncMode"].ToString(), - networkMaxConnections: Convert.ToInt64(map["networkMaxConnections"]), - networkIdleTimeoutSeconds: Convert.ToInt64(map["networkIdleTimeoutSeconds"]), - networkIPAllowlist: map["networkIPAllowlist"].ConvertToList(), - backupEnabled: (bool)map["backupEnabled"], - pitr: (bool)map["pitr"], - pitrRetentionDays: Convert.ToInt64(map["pitrRetentionDays"]), - storageAutoscaling: (bool)map["storageAutoscaling"], - storageAutoscalingThresholdPercent: Convert.ToInt64(map["storageAutoscalingThresholdPercent"]), - storageAutoscalingMaxGb: Convert.ToInt64(map["storageAutoscalingMaxGb"]), - maintenanceWindowDay: map["maintenanceWindowDay"].ToString(), - maintenanceWindowHourUtc: Convert.ToInt64(map["maintenanceWindowHourUtc"]), - metricsEnabled: (bool)map["metricsEnabled"], - sqlApiEnabled: (bool)map["sqlApiEnabled"], - sqlApiAllowedStatements: map["sqlApiAllowedStatements"].ConvertToList(), - sqlApiMaxRows: Convert.ToInt64(map["sqlApiMaxRows"]), - sqlApiMaxBytes: Convert.ToInt64(map["sqlApiMaxBytes"]), - sqlApiTimeoutSeconds: Convert.ToInt64(map["sqlApiTimeoutSeconds"]), - error: map["error"].ToString() + lifecycleState: (map.ContainsKey("lifecycleState") ? map["lifecycleState"] : "").ToString(), + idleTimeoutMinutes: Convert.ToInt64((map.ContainsKey("idleTimeoutMinutes") ? map["idleTimeoutMinutes"] : 15)), + cpu: Convert.ToInt64((map.ContainsKey("cpu") ? map["cpu"] : 500)), + memory: Convert.ToInt64((map.ContainsKey("memory") ? map["memory"] : 512)), + storage: Convert.ToInt64((map.ContainsKey("storage") ? map["storage"] : 10)), + storageStatus: (map.ContainsKey("storageStatus") ? map["storageStatus"] : "idle").ToString(), + storageTargetGb: Convert.ToInt64((map.ContainsKey("storageTargetGb") ? map["storageTargetGb"] : 0)), + storageResizeStartedAt: map.TryGetValue("storageResizeStartedAt", out var storageResizeStartedAt) ? storageResizeStartedAt?.ToString() : null, + storageClass: (map.ContainsKey("storageClass") ? map["storageClass"] : "ssd").ToString(), + storageMaxGb: Convert.ToInt64((map.ContainsKey("storageMaxGb") ? map["storageMaxGb"] : 0)), + nodePool: (map.ContainsKey("nodePool") ? map["nodePool"] : "").ToString(), + replicas: Convert.ToInt64((map.ContainsKey("replicas") ? map["replicas"] : 0)), + syncMode: (map.ContainsKey("syncMode") ? map["syncMode"] : "").ToString(), + networkMaxConnections: Convert.ToInt64((map.ContainsKey("networkMaxConnections") ? map["networkMaxConnections"] : 100)), + networkIdleTimeoutSeconds: Convert.ToInt64((map.ContainsKey("networkIdleTimeoutSeconds") ? map["networkIdleTimeoutSeconds"] : 900)), + networkIPAllowlist: (map.ContainsKey("networkIPAllowlist") ? map["networkIPAllowlist"] : new List()).ConvertToList(), + backupEnabled: (bool)(map.ContainsKey("backupEnabled") ? map["backupEnabled"] : true), + pitr: (bool)(map.ContainsKey("pitr") ? map["pitr"] : true), + pitrRetentionDays: Convert.ToInt64((map.ContainsKey("pitrRetentionDays") ? map["pitrRetentionDays"] : 7)), + storageAutoscaling: (bool)(map.ContainsKey("storageAutoscaling") ? map["storageAutoscaling"] : true), + storageAutoscalingThresholdPercent: Convert.ToInt64((map.ContainsKey("storageAutoscalingThresholdPercent") ? map["storageAutoscalingThresholdPercent"] : 85)), + storageAutoscalingMaxGb: Convert.ToInt64((map.ContainsKey("storageAutoscalingMaxGb") ? map["storageAutoscalingMaxGb"] : 0)), + maintenanceWindowDay: (map.ContainsKey("maintenanceWindowDay") ? map["maintenanceWindowDay"] : "sun").ToString(), + maintenanceWindowHourUtc: Convert.ToInt64((map.ContainsKey("maintenanceWindowHourUtc") ? map["maintenanceWindowHourUtc"] : 3)), + metricsEnabled: (bool)(map.ContainsKey("metricsEnabled") ? map["metricsEnabled"] : false), + sqlApiEnabled: (bool)(map.ContainsKey("sqlApiEnabled") ? map["sqlApiEnabled"] : true), + sqlApiAllowedStatements: (map.ContainsKey("sqlApiAllowedStatements") ? map["sqlApiAllowedStatements"] : new List { "SELECT", "INSERT", "UPDATE", "DELETE" }).ConvertToList(), + sqlApiMaxRows: Convert.ToInt64((map.ContainsKey("sqlApiMaxRows") ? map["sqlApiMaxRows"] : 10000)), + sqlApiMaxBytes: Convert.ToInt64((map.ContainsKey("sqlApiMaxBytes") ? map["sqlApiMaxBytes"] : 10485760)), + sqlApiTimeoutSeconds: Convert.ToInt64((map.ContainsKey("sqlApiTimeoutSeconds") ? map["sqlApiTimeoutSeconds"] : 30)), + error: (map.ContainsKey("error") ? map["error"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() @@ -341,6 +363,9 @@ string error { "cpu", Cpu }, { "memory", Memory }, { "storage", Storage }, + { "storageStatus", StorageStatus }, + { "storageTargetGb", StorageTargetGb }, + { "storageResizeStartedAt", StorageResizeStartedAt }, { "storageClass", StorageClass }, { "storageMaxGb", StorageMaxGb }, { "nodePool", NodePool }, diff --git a/Appwrite/Models/DedicatedDatabaseBackup.cs b/Appwrite/Models/DedicatedDatabaseBackup.cs index ab7cb2af..a90e56da 100644 --- a/Appwrite/Models/DedicatedDatabaseBackup.cs +++ b/Appwrite/Models/DedicatedDatabaseBackup.cs @@ -102,23 +102,23 @@ string error } public static DedicatedDatabaseBackup From(Dictionary map) => new DedicatedDatabaseBackup( - id: map["$id"].ToString(), - createdAt: map["$createdAt"].ToString(), - databaseId: map["databaseId"].ToString(), - projectId: map["projectId"].ToString(), - policyId: map["policyId"].ToString(), - trigger: map["trigger"].ToString(), - type: map["type"].ToString(), - requestedType: map["requestedType"].ToString(), - fallbackReason: map["fallbackReason"].ToString(), - status: map["status"].ToString(), - sizeBytes: Convert.ToInt64(map["sizeBytes"]), + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + databaseId: (map.ContainsKey("databaseId") ? map["databaseId"] : "").ToString(), + projectId: (map.ContainsKey("projectId") ? map["projectId"] : "").ToString(), + policyId: (map.ContainsKey("policyId") ? map["policyId"] : "").ToString(), + trigger: (map.ContainsKey("trigger") ? map["trigger"] : "manual").ToString(), + type: (map.ContainsKey("type") ? map["type"] : "full").ToString(), + requestedType: (map.ContainsKey("requestedType") ? map["requestedType"] : "").ToString(), + fallbackReason: (map.ContainsKey("fallbackReason") ? map["fallbackReason"] : "").ToString(), + status: (map.ContainsKey("status") ? map["status"] : "pending").ToString(), + sizeBytes: Convert.ToInt64((map.ContainsKey("sizeBytes") ? map["sizeBytes"] : 0)), startedAt: map.TryGetValue("startedAt", out var startedAt) ? startedAt?.ToString() : null, completedAt: map.TryGetValue("completedAt", out var completedAt) ? completedAt?.ToString() : null, verifiedAt: map.TryGetValue("verifiedAt", out var verifiedAt) ? verifiedAt?.ToString() : null, expiresAt: map.TryGetValue("expiresAt", out var expiresAt) ? expiresAt?.ToString() : null, logPosition: map.TryGetValue("logPosition", out var logPosition) ? logPosition?.ToString() : null, - error: map["error"].ToString() + error: (map.ContainsKey("error") ? map["error"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/DedicatedDatabaseBackupList.cs b/Appwrite/Models/DedicatedDatabaseBackupList.cs index 8793bbe5..786007c3 100644 --- a/Appwrite/Models/DedicatedDatabaseBackupList.cs +++ b/Appwrite/Models/DedicatedDatabaseBackupList.cs @@ -27,7 +27,7 @@ List backups } public static DedicatedDatabaseBackupList From(Dictionary map) => new DedicatedDatabaseBackupList( - total: Convert.ToInt64(map["total"]), + total: Convert.ToInt64((map.ContainsKey("total") ? map["total"] : 0)), backups: map["backups"].ConvertToList>().Select(it => Appwrite.Models.DedicatedDatabaseBackup.From(map: it)).ToList() ); diff --git a/Appwrite/Models/DedicatedDatabaseBackupStorage.cs b/Appwrite/Models/DedicatedDatabaseBackupStorage.cs index 57b73f2f..25117512 100644 --- a/Appwrite/Models/DedicatedDatabaseBackupStorage.cs +++ b/Appwrite/Models/DedicatedDatabaseBackupStorage.cs @@ -42,11 +42,11 @@ string endpoint } public static DedicatedDatabaseBackupStorage From(Dictionary map) => new DedicatedDatabaseBackupStorage( - provider: map["provider"].ToString(), - bucket: map["bucket"].ToString(), - region: map["region"].ToString(), - prefix: map["prefix"].ToString(), - endpoint: map["endpoint"].ToString() + provider: (map.ContainsKey("provider") ? map["provider"] : "").ToString(), + bucket: (map.ContainsKey("bucket") ? map["bucket"] : "").ToString(), + region: (map.ContainsKey("region") ? map["region"] : "").ToString(), + prefix: (map.ContainsKey("prefix") ? map["prefix"] : "backups/").ToString(), + endpoint: (map.ContainsKey("endpoint") ? map["endpoint"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/DedicatedDatabaseBranch.cs b/Appwrite/Models/DedicatedDatabaseBranch.cs index 9b52b6e0..6620dd8c 100644 --- a/Appwrite/Models/DedicatedDatabaseBranch.cs +++ b/Appwrite/Models/DedicatedDatabaseBranch.cs @@ -27,7 +27,7 @@ public class DedicatedDatabaseBranch public string Host { get; private set; } [JsonPropertyName("port")] - public long Port { get; private set; } + public long? Port { get; private set; } [JsonPropertyName("database")] public string Database { get; private set; } @@ -53,7 +53,7 @@ public DedicatedDatabaseBranch( string @namespace, long expiresAt, string host, - long port, + long? port, string database, string username, string password, @@ -77,18 +77,20 @@ string connectionString } public static DedicatedDatabaseBranch From(Dictionary map) => new DedicatedDatabaseBranch( - branchId: map["branchId"].ToString(), - branchName: map["branchName"].ToString(), - @namespace: map["namespace"].ToString(), - expiresAt: Convert.ToInt64(map["expiresAt"]), - host: map["host"].ToString(), - port: Convert.ToInt64(map["port"]), - database: map["database"].ToString(), - username: map["username"].ToString(), - password: map["password"].ToString(), - ssl: (bool)map["ssl"], - engine: map["engine"].ToString(), - connectionString: map["connectionString"].ToString() + branchId: (map.ContainsKey("branchId") ? map["branchId"] : "").ToString(), + branchName: (map.ContainsKey("branchName") ? map["branchName"] : "").ToString(), + @namespace: (map.ContainsKey("namespace") ? map["namespace"] : "").ToString(), + expiresAt: Convert.ToInt64((map.ContainsKey("expiresAt") ? map["expiresAt"] : 0)), + host: (map.ContainsKey("host") ? map["host"] : "").ToString(), + port: map.TryGetValue("port", out var numberRaw6) && numberRaw6 != null + ? Convert.ToInt64(numberRaw6) + : null, + database: (map.ContainsKey("database") ? map["database"] : "").ToString(), + username: (map.ContainsKey("username") ? map["username"] : "").ToString(), + password: (map.ContainsKey("password") ? map["password"] : "").ToString(), + ssl: (bool)(map.ContainsKey("ssl") ? map["ssl"] : false), + engine: (map.ContainsKey("engine") ? map["engine"] : "").ToString(), + connectionString: (map.ContainsKey("connectionString") ? map["connectionString"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/DedicatedDatabaseBranchList.cs b/Appwrite/Models/DedicatedDatabaseBranchList.cs index 353f68a6..8b9f1f80 100644 --- a/Appwrite/Models/DedicatedDatabaseBranchList.cs +++ b/Appwrite/Models/DedicatedDatabaseBranchList.cs @@ -27,7 +27,7 @@ List branches } public static DedicatedDatabaseBranchList From(Dictionary map) => new DedicatedDatabaseBranchList( - total: Convert.ToInt64(map["total"]), + total: Convert.ToInt64((map.ContainsKey("total") ? map["total"] : 0)), branches: map["branches"].ConvertToList>().Select(it => Appwrite.Models.DedicatedDatabaseBranch.From(map: it)).ToList() ); diff --git a/Appwrite/Models/DedicatedDatabaseExecution.cs b/Appwrite/Models/DedicatedDatabaseExecution.cs index 295d9800..07cdb669 100644 --- a/Appwrite/Models/DedicatedDatabaseExecution.cs +++ b/Appwrite/Models/DedicatedDatabaseExecution.cs @@ -47,12 +47,12 @@ long bytes } public static DedicatedDatabaseExecution From(Dictionary map) => new DedicatedDatabaseExecution( - rows: map["rows"].ConvertToList(), - rowCount: Convert.ToInt64(map["rowCount"]), + rows: (map.ContainsKey("rows") ? map["rows"] : new List()).ConvertToList(), + rowCount: Convert.ToInt64((map.ContainsKey("rowCount") ? map["rowCount"] : 0)), columns: map["columns"].ConvertToList>().Select(it => Appwrite.Models.DedicatedDatabaseExecutionColumn.From(map: it)).ToList(), - durationMs: Convert.ToInt64(map["durationMs"]), - truncated: (bool)map["truncated"], - bytes: Convert.ToInt64(map["bytes"]) + durationMs: Convert.ToInt64((map.ContainsKey("durationMs") ? map["durationMs"] : 0)), + truncated: (bool)(map.ContainsKey("truncated") ? map["truncated"] : false), + bytes: Convert.ToInt64((map.ContainsKey("bytes") ? map["bytes"] : 0)) ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/DedicatedDatabaseExecutionColumn.cs b/Appwrite/Models/DedicatedDatabaseExecutionColumn.cs index 14af6ade..8923359d 100644 --- a/Appwrite/Models/DedicatedDatabaseExecutionColumn.cs +++ b/Appwrite/Models/DedicatedDatabaseExecutionColumn.cs @@ -27,8 +27,8 @@ string type } public static DedicatedDatabaseExecutionColumn From(Dictionary map) => new DedicatedDatabaseExecutionColumn( - name: map["name"].ToString(), - type: map["type"].ToString() + name: (map.ContainsKey("name") ? map["name"] : "").ToString(), + type: (map.ContainsKey("type") ? map["type"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/DedicatedDatabaseExtensions.cs b/Appwrite/Models/DedicatedDatabaseExtensions.cs index 3a7fb94c..676fbea4 100644 --- a/Appwrite/Models/DedicatedDatabaseExtensions.cs +++ b/Appwrite/Models/DedicatedDatabaseExtensions.cs @@ -32,8 +32,8 @@ List metadata } public static DedicatedDatabaseExtensions From(Dictionary map) => new DedicatedDatabaseExtensions( - installed: map["installed"].ConvertToList(), - available: map["available"].ConvertToList(), + installed: (map.ContainsKey("installed") ? map["installed"] : new List()).ConvertToList(), + available: (map.ContainsKey("available") ? map["available"] : new List()).ConvertToList(), metadata: map["metadata"].ConvertToList>().Select(it => Appwrite.Models.PostgresExtension.From(map: it)).ToList() ); diff --git a/Appwrite/Models/DedicatedDatabaseList.cs b/Appwrite/Models/DedicatedDatabaseList.cs index 95c02b4f..3e68d9c9 100644 --- a/Appwrite/Models/DedicatedDatabaseList.cs +++ b/Appwrite/Models/DedicatedDatabaseList.cs @@ -27,7 +27,7 @@ List databases } public static DedicatedDatabaseList From(Dictionary map) => new DedicatedDatabaseList( - total: Convert.ToInt64(map["total"]), + total: Convert.ToInt64((map.ContainsKey("total") ? map["total"] : 0)), databases: map["databases"].ConvertToList>().Select(it => Appwrite.Models.DedicatedDatabase.From(map: it)).ToList() ); diff --git a/Appwrite/Models/DedicatedDatabaseMember.cs b/Appwrite/Models/DedicatedDatabaseMember.cs index 527633e3..f364da69 100644 --- a/Appwrite/Models/DedicatedDatabaseMember.cs +++ b/Appwrite/Models/DedicatedDatabaseMember.cs @@ -42,9 +42,9 @@ public DedicatedDatabaseMember( } public static DedicatedDatabaseMember From(Dictionary map) => new DedicatedDatabaseMember( - id: map["$id"].ToString(), - role: map["role"].ToString(), - status: map["status"].ToString(), + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + role: (map.ContainsKey("role") ? map["role"] : "unknown").ToString(), + status: (map.ContainsKey("status") ? map["status"] : "").ToString(), replicating: map.TryGetValue("replicating", out var boolRaw4) && boolRaw4 != null ? (bool?)boolRaw4 : null, diff --git a/Appwrite/Models/DedicatedDatabaseOperation.cs b/Appwrite/Models/DedicatedDatabaseOperation.cs index 9828e6e5..e8ae1e94 100644 --- a/Appwrite/Models/DedicatedDatabaseOperation.cs +++ b/Appwrite/Models/DedicatedDatabaseOperation.cs @@ -72,17 +72,17 @@ string errorMessage } public static DedicatedDatabaseOperation From(Dictionary map) => new DedicatedDatabaseOperation( - id: map["$id"].ToString(), - createdAt: map["$createdAt"].ToString(), - databaseId: map["databaseId"].ToString(), - type: map["type"].ToString(), - status: map["status"].ToString(), - attempts: Convert.ToInt64(map["attempts"]), + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + databaseId: (map.ContainsKey("databaseId") ? map["databaseId"] : "").ToString(), + type: (map.ContainsKey("type") ? map["type"] : "").ToString(), + status: (map.ContainsKey("status") ? map["status"] : "").ToString(), + attempts: Convert.ToInt64((map.ContainsKey("attempts") ? map["attempts"] : 0)), requestedAt: map.TryGetValue("requestedAt", out var requestedAt) ? requestedAt?.ToString() : null, startedAt: map.TryGetValue("startedAt", out var startedAt) ? startedAt?.ToString() : null, completedAt: map.TryGetValue("completedAt", out var completedAt) ? completedAt?.ToString() : null, - errorCode: map["errorCode"].ToString(), - errorMessage: map["errorMessage"].ToString() + errorCode: (map.ContainsKey("errorCode") ? map["errorCode"] : "").ToString(), + errorMessage: (map.ContainsKey("errorMessage") ? map["errorMessage"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/DedicatedDatabaseOperationList.cs b/Appwrite/Models/DedicatedDatabaseOperationList.cs index bc99f453..7baa30c6 100644 --- a/Appwrite/Models/DedicatedDatabaseOperationList.cs +++ b/Appwrite/Models/DedicatedDatabaseOperationList.cs @@ -27,7 +27,7 @@ List operations } public static DedicatedDatabaseOperationList From(Dictionary map) => new DedicatedDatabaseOperationList( - total: Convert.ToInt64(map["total"]), + total: Convert.ToInt64((map.ContainsKey("total") ? map["total"] : 0)), operations: map["operations"].ConvertToList>().Select(it => Appwrite.Models.DedicatedDatabaseOperation.From(map: it)).ToList() ); diff --git a/Appwrite/Models/DedicatedDatabasePITRWindows.cs b/Appwrite/Models/DedicatedDatabasePITRWindows.cs index c28ecb80..91d90576 100644 --- a/Appwrite/Models/DedicatedDatabasePITRWindows.cs +++ b/Appwrite/Models/DedicatedDatabasePITRWindows.cs @@ -27,8 +27,8 @@ string latest } public static DedicatedDatabasePITRWindows From(Dictionary map) => new DedicatedDatabasePITRWindows( - earliest: map["earliest"].ToString(), - latest: map["latest"].ToString() + earliest: (map.ContainsKey("earliest") ? map["earliest"] : "").ToString(), + latest: (map.ContainsKey("latest") ? map["latest"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/DedicatedDatabasePooler.cs b/Appwrite/Models/DedicatedDatabasePooler.cs index f68c0fd9..50675f85 100644 --- a/Appwrite/Models/DedicatedDatabasePooler.cs +++ b/Appwrite/Models/DedicatedDatabasePooler.cs @@ -67,16 +67,16 @@ string poolerMemoryLimit } public static DedicatedDatabasePooler From(Dictionary map) => new DedicatedDatabasePooler( - enabled: (bool)map["enabled"], - mode: map["mode"].ToString(), - maxConnections: Convert.ToInt64(map["maxConnections"]), - defaultPoolSize: Convert.ToInt64(map["defaultPoolSize"]), - port: Convert.ToInt64(map["port"]), - readWriteSplitting: (bool)map["readWriteSplitting"], - poolerCpuRequest: map["poolerCpuRequest"].ToString(), - poolerCpuLimit: map["poolerCpuLimit"].ToString(), - poolerMemoryRequest: map["poolerMemoryRequest"].ToString(), - poolerMemoryLimit: map["poolerMemoryLimit"].ToString() + enabled: (bool)(map.ContainsKey("enabled") ? map["enabled"] : false), + mode: (map.ContainsKey("mode") ? map["mode"] : "transaction").ToString(), + maxConnections: Convert.ToInt64((map.ContainsKey("maxConnections") ? map["maxConnections"] : 100)), + defaultPoolSize: Convert.ToInt64((map.ContainsKey("defaultPoolSize") ? map["defaultPoolSize"] : 20)), + port: Convert.ToInt64((map.ContainsKey("port") ? map["port"] : 6432)), + readWriteSplitting: (bool)(map.ContainsKey("readWriteSplitting") ? map["readWriteSplitting"] : false), + poolerCpuRequest: (map.ContainsKey("poolerCpuRequest") ? map["poolerCpuRequest"] : "").ToString(), + poolerCpuLimit: (map.ContainsKey("poolerCpuLimit") ? map["poolerCpuLimit"] : "").ToString(), + poolerMemoryRequest: (map.ContainsKey("poolerMemoryRequest") ? map["poolerMemoryRequest"] : "").ToString(), + poolerMemoryLimit: (map.ContainsKey("poolerMemoryLimit") ? map["poolerMemoryLimit"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/DedicatedDatabaseReplicas.cs b/Appwrite/Models/DedicatedDatabaseReplicas.cs index f4a81a8f..27adaf57 100644 --- a/Appwrite/Models/DedicatedDatabaseReplicas.cs +++ b/Appwrite/Models/DedicatedDatabaseReplicas.cs @@ -57,12 +57,12 @@ List members } public static DedicatedDatabaseReplicas From(Dictionary map) => new DedicatedDatabaseReplicas( - replicas: Convert.ToInt64(map["replicas"]), - syncMode: map["syncMode"].ToString(), + replicas: Convert.ToInt64((map.ContainsKey("replicas") ? map["replicas"] : 0)), + syncMode: (map.ContainsKey("syncMode") ? map["syncMode"] : "async").ToString(), effectiveSyncMode: map.TryGetValue("effectiveSyncMode", out var effectiveSyncMode) ? effectiveSyncMode?.ToString() : null, - syncDegraded: (bool)map["syncDegraded"], - syncAcknowledgements: Convert.ToInt64(map["syncAcknowledgements"]), - syncStandbyCount: Convert.ToInt64(map["syncStandbyCount"]), + syncDegraded: (bool)(map.ContainsKey("syncDegraded") ? map["syncDegraded"] : false), + syncAcknowledgements: Convert.ToInt64((map.ContainsKey("syncAcknowledgements") ? map["syncAcknowledgements"] : 0)), + syncStandbyCount: Convert.ToInt64((map.ContainsKey("syncStandbyCount") ? map["syncStandbyCount"] : 0)), syncStateConfirmed: map.TryGetValue("syncStateConfirmed", out var boolRaw7) && boolRaw7 != null ? (bool?)boolRaw7 : null, diff --git a/Appwrite/Models/DedicatedDatabaseRestoration.cs b/Appwrite/Models/DedicatedDatabaseRestoration.cs index 6ade83fb..eea77426 100644 --- a/Appwrite/Models/DedicatedDatabaseRestoration.cs +++ b/Appwrite/Models/DedicatedDatabaseRestoration.cs @@ -21,13 +21,13 @@ public class DedicatedDatabaseRestoration public string DatabaseId { get; private set; } [JsonPropertyName("sourceDatabaseId")] - public string SourceDatabaseId { get; private set; } + public string? SourceDatabaseId { get; private set; } [JsonPropertyName("projectId")] public string ProjectId { get; private set; } [JsonPropertyName("backupId")] - public string BackupId { get; private set; } + public string? BackupId { get; private set; } [JsonPropertyName("type")] public string Type { get; private set; } @@ -36,13 +36,13 @@ public class DedicatedDatabaseRestoration public string Status { get; private set; } [JsonPropertyName("targetTime")] - public string TargetTime { get; private set; } + public string? TargetTime { get; private set; } [JsonPropertyName("startedAt")] - public string StartedAt { get; private set; } + public string? StartedAt { get; private set; } [JsonPropertyName("completedAt")] - public string CompletedAt { get; private set; } + public string? CompletedAt { get; private set; } [JsonPropertyName("error")] public string Error { get; private set; } @@ -51,14 +51,14 @@ public DedicatedDatabaseRestoration( string id, string createdAt, string databaseId, - string sourceDatabaseId, + string? sourceDatabaseId, string projectId, - string backupId, + string? backupId, string type, string status, - string targetTime, - string startedAt, - string completedAt, + string? targetTime, + string? startedAt, + string? completedAt, string error ) { @@ -77,18 +77,18 @@ string error } public static DedicatedDatabaseRestoration From(Dictionary map) => new DedicatedDatabaseRestoration( - id: map["$id"].ToString(), - createdAt: map["$createdAt"].ToString(), - databaseId: map["databaseId"].ToString(), - sourceDatabaseId: map["sourceDatabaseId"].ToString(), - projectId: map["projectId"].ToString(), - backupId: map["backupId"].ToString(), - type: map["type"].ToString(), - status: map["status"].ToString(), - targetTime: map["targetTime"].ToString(), - startedAt: map["startedAt"].ToString(), - completedAt: map["completedAt"].ToString(), - error: map["error"].ToString() + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + databaseId: (map.ContainsKey("databaseId") ? map["databaseId"] : "").ToString(), + sourceDatabaseId: map.TryGetValue("sourceDatabaseId", out var sourceDatabaseId) ? sourceDatabaseId?.ToString() : null, + projectId: (map.ContainsKey("projectId") ? map["projectId"] : "").ToString(), + backupId: map.TryGetValue("backupId", out var backupId) ? backupId?.ToString() : null, + type: (map.ContainsKey("type") ? map["type"] : "backup").ToString(), + status: (map.ContainsKey("status") ? map["status"] : "pending").ToString(), + targetTime: map.TryGetValue("targetTime", out var targetTime) ? targetTime?.ToString() : null, + startedAt: map.TryGetValue("startedAt", out var startedAt) ? startedAt?.ToString() : null, + completedAt: map.TryGetValue("completedAt", out var completedAt) ? completedAt?.ToString() : null, + error: (map.ContainsKey("error") ? map["error"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/DedicatedDatabaseRestorationList.cs b/Appwrite/Models/DedicatedDatabaseRestorationList.cs index fc23597c..9c737ac3 100644 --- a/Appwrite/Models/DedicatedDatabaseRestorationList.cs +++ b/Appwrite/Models/DedicatedDatabaseRestorationList.cs @@ -27,7 +27,7 @@ List restorations } public static DedicatedDatabaseRestorationList From(Dictionary map) => new DedicatedDatabaseRestorationList( - total: Convert.ToInt64(map["total"]), + total: Convert.ToInt64((map.ContainsKey("total") ? map["total"] : 0)), restorations: map["restorations"].ConvertToList>().Select(it => Appwrite.Models.DedicatedDatabaseRestoration.From(map: it)).ToList() ); diff --git a/Appwrite/Models/DedicatedDatabaseSpecification.cs b/Appwrite/Models/DedicatedDatabaseSpecification.cs index 0b815194..23fb7611 100644 --- a/Appwrite/Models/DedicatedDatabaseSpecification.cs +++ b/Appwrite/Models/DedicatedDatabaseSpecification.cs @@ -20,6 +20,18 @@ public class DedicatedDatabaseSpecification [JsonPropertyName("price")] public double Price { get; private set; } + [JsonPropertyName("storageOverageRate")] + public double StorageOverageRate { get; private set; } + + [JsonPropertyName("bandwidthOverageRate")] + public double BandwidthOverageRate { get; private set; } + + [JsonPropertyName("replicaRate")] + public double ReplicaRate { get; private set; } + + [JsonPropertyName("pitrRate")] + public double PitrRate { get; private set; } + [JsonPropertyName("cpu")] public long Cpu { get; private set; } @@ -42,6 +54,10 @@ public DedicatedDatabaseSpecification( string slug, string name, double price, + double storageOverageRate, + double bandwidthOverageRate, + double replicaRate, + double pitrRate, long cpu, long memory, long maxConnections, @@ -53,6 +69,10 @@ bool enabled Slug = slug; Name = name; Price = price; + StorageOverageRate = storageOverageRate; + BandwidthOverageRate = bandwidthOverageRate; + ReplicaRate = replicaRate; + PitrRate = pitrRate; Cpu = cpu; Memory = memory; MaxConnections = maxConnections; @@ -62,15 +82,19 @@ bool enabled } public static DedicatedDatabaseSpecification From(Dictionary map) => new DedicatedDatabaseSpecification( - slug: map["slug"].ToString(), - name: map["name"].ToString(), - price: Convert.ToDouble(map["price"]), - cpu: Convert.ToInt64(map["cpu"]), - memory: Convert.ToInt64(map["memory"]), - maxConnections: Convert.ToInt64(map["maxConnections"]), - includedStorage: Convert.ToInt64(map["includedStorage"]), - includedBandwidth: Convert.ToInt64(map["includedBandwidth"]), - enabled: (bool)map["enabled"] + slug: (map.ContainsKey("slug") ? map["slug"] : "").ToString(), + name: (map.ContainsKey("name") ? map["name"] : "").ToString(), + price: Convert.ToDouble((map.ContainsKey("price") ? map["price"] : 0)), + storageOverageRate: Convert.ToDouble((map.ContainsKey("storageOverageRate") ? map["storageOverageRate"] : 0)), + bandwidthOverageRate: Convert.ToDouble((map.ContainsKey("bandwidthOverageRate") ? map["bandwidthOverageRate"] : 0)), + replicaRate: Convert.ToDouble((map.ContainsKey("replicaRate") ? map["replicaRate"] : 0)), + pitrRate: Convert.ToDouble((map.ContainsKey("pitrRate") ? map["pitrRate"] : 0)), + cpu: Convert.ToInt64((map.ContainsKey("cpu") ? map["cpu"] : 0)), + memory: Convert.ToInt64((map.ContainsKey("memory") ? map["memory"] : 0)), + maxConnections: Convert.ToInt64((map.ContainsKey("maxConnections") ? map["maxConnections"] : 0)), + includedStorage: Convert.ToInt64((map.ContainsKey("includedStorage") ? map["includedStorage"] : 0)), + includedBandwidth: Convert.ToInt64((map.ContainsKey("includedBandwidth") ? map["includedBandwidth"] : 0)), + enabled: (bool)(map.ContainsKey("enabled") ? map["enabled"] : false) ); public Dictionary ToMap() => new Dictionary() @@ -78,6 +102,10 @@ bool enabled { "slug", Slug }, { "name", Name }, { "price", Price }, + { "storageOverageRate", StorageOverageRate }, + { "bandwidthOverageRate", BandwidthOverageRate }, + { "replicaRate", ReplicaRate }, + { "pitrRate", PitrRate }, { "cpu", Cpu }, { "memory", Memory }, { "maxConnections", MaxConnections }, diff --git a/Appwrite/Models/DedicatedDatabaseSpecificationList.cs b/Appwrite/Models/DedicatedDatabaseSpecificationList.cs index 59c0336b..4c952287 100644 --- a/Appwrite/Models/DedicatedDatabaseSpecificationList.cs +++ b/Appwrite/Models/DedicatedDatabaseSpecificationList.cs @@ -17,31 +17,24 @@ public class DedicatedDatabaseSpecificationList [JsonPropertyName("total")] public long Total { get; private set; } - [JsonPropertyName("pricing")] - public DedicatedDatabaseSpecificationPricing Pricing { get; private set; } - public DedicatedDatabaseSpecificationList( List specifications, - long total, - DedicatedDatabaseSpecificationPricing pricing + long total ) { Specifications = specifications; Total = total; - Pricing = pricing; } public static DedicatedDatabaseSpecificationList From(Dictionary map) => new DedicatedDatabaseSpecificationList( specifications: map["specifications"].ConvertToList>().Select(it => Appwrite.Models.DedicatedDatabaseSpecification.From(map: it)).ToList(), - total: Convert.ToInt64(map["total"]), - pricing: Appwrite.Models.DedicatedDatabaseSpecificationPricing.From(map: map["pricing"] is JsonElement jsonObj3 ? jsonObj3.Deserialize>()! : (Dictionary)map["pricing"]) + total: Convert.ToInt64((map.ContainsKey("total") ? map["total"] : 0)) ); public Dictionary ToMap() => new Dictionary() { { "specifications", Specifications?.Select(it => it.ToMap()).ToList() }, - { "total", Total }, - { "pricing", Pricing?.ToMap() } + { "total", Total } }; } } diff --git a/Appwrite/Models/DedicatedDatabaseSpecificationPricing.cs b/Appwrite/Models/DedicatedDatabaseSpecificationPricing.cs deleted file mode 100644 index 80948c58..00000000 --- a/Appwrite/Models/DedicatedDatabaseSpecificationPricing.cs +++ /dev/null @@ -1,54 +0,0 @@ - -using System; -using System.Linq; -using System.Collections.Generic; -using System.Text.Json; -using System.Text.Json.Serialization; -using Appwrite.Enums; -using Appwrite.Extensions; - -namespace Appwrite.Models -{ - public class DedicatedDatabaseSpecificationPricing - { - [JsonPropertyName("storageOverageRate")] - public double StorageOverageRate { get; private set; } - - [JsonPropertyName("bandwidthOverageRate")] - public double BandwidthOverageRate { get; private set; } - - [JsonPropertyName("replicaRate")] - public double ReplicaRate { get; private set; } - - [JsonPropertyName("pitrRate")] - public double PitrRate { get; private set; } - - public DedicatedDatabaseSpecificationPricing( - double storageOverageRate, - double bandwidthOverageRate, - double replicaRate, - double pitrRate - ) - { - StorageOverageRate = storageOverageRate; - BandwidthOverageRate = bandwidthOverageRate; - ReplicaRate = replicaRate; - PitrRate = pitrRate; - } - - public static DedicatedDatabaseSpecificationPricing From(Dictionary map) => new DedicatedDatabaseSpecificationPricing( - storageOverageRate: Convert.ToDouble(map["storageOverageRate"]), - bandwidthOverageRate: Convert.ToDouble(map["bandwidthOverageRate"]), - replicaRate: Convert.ToDouble(map["replicaRate"]), - pitrRate: Convert.ToDouble(map["pitrRate"]) - ); - - public Dictionary ToMap() => new Dictionary() - { - { "storageOverageRate", StorageOverageRate }, - { "bandwidthOverageRate", BandwidthOverageRate }, - { "replicaRate", ReplicaRate }, - { "pitrRate", PitrRate } - }; - } -} diff --git a/Appwrite/Models/Deployment.cs b/Appwrite/Models/Deployment.cs index 79f43f76..5a340c94 100644 --- a/Appwrite/Models/Deployment.cs +++ b/Appwrite/Models/Deployment.cs @@ -152,33 +152,33 @@ string providerBranchUrl } public static Deployment From(Dictionary map) => new Deployment( - id: map["$id"].ToString(), - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), - type: map["type"].ToString(), - resourceId: map["resourceId"].ToString(), - resourceType: map["resourceType"].ToString(), - entrypoint: map["entrypoint"].ToString(), - sourceSize: Convert.ToInt64(map["sourceSize"]), - buildSize: Convert.ToInt64(map["buildSize"]), - totalSize: Convert.ToInt64(map["totalSize"]), - buildId: map["buildId"].ToString(), - activate: (bool)map["activate"], - screenshotLight: map["screenshotLight"].ToString(), - screenshotDark: map["screenshotDark"].ToString(), + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), + type: (map.ContainsKey("type") ? map["type"] : "").ToString(), + resourceId: (map.ContainsKey("resourceId") ? map["resourceId"] : "").ToString(), + resourceType: (map.ContainsKey("resourceType") ? map["resourceType"] : "").ToString(), + entrypoint: (map.ContainsKey("entrypoint") ? map["entrypoint"] : "").ToString(), + sourceSize: Convert.ToInt64((map.ContainsKey("sourceSize") ? map["sourceSize"] : 0)), + buildSize: Convert.ToInt64((map.ContainsKey("buildSize") ? map["buildSize"] : 0)), + totalSize: Convert.ToInt64((map.ContainsKey("totalSize") ? map["totalSize"] : 0)), + buildId: (map.ContainsKey("buildId") ? map["buildId"] : "").ToString(), + activate: (bool)(map.ContainsKey("activate") ? map["activate"] : false), + screenshotLight: (map.ContainsKey("screenshotLight") ? map["screenshotLight"] : "").ToString(), + screenshotDark: (map.ContainsKey("screenshotDark") ? map["screenshotDark"] : "").ToString(), status: new Appwrite.Enums.DeploymentStatus(map["status"].ToString()!), - buildLogs: map["buildLogs"].ToString(), - buildDuration: Convert.ToInt64(map["buildDuration"]), - providerRepositoryName: map["providerRepositoryName"].ToString(), - providerRepositoryOwner: map["providerRepositoryOwner"].ToString(), - providerRepositoryUrl: map["providerRepositoryUrl"].ToString(), - providerCommitHash: map["providerCommitHash"].ToString(), - providerCommitAuthorUrl: map["providerCommitAuthorUrl"].ToString(), - providerCommitAuthor: map["providerCommitAuthor"].ToString(), - providerCommitMessage: map["providerCommitMessage"].ToString(), - providerCommitUrl: map["providerCommitUrl"].ToString(), - providerBranch: map["providerBranch"].ToString(), - providerBranchUrl: map["providerBranchUrl"].ToString() + buildLogs: (map.ContainsKey("buildLogs") ? map["buildLogs"] : "").ToString(), + buildDuration: Convert.ToInt64((map.ContainsKey("buildDuration") ? map["buildDuration"] : 0)), + providerRepositoryName: (map.ContainsKey("providerRepositoryName") ? map["providerRepositoryName"] : "").ToString(), + providerRepositoryOwner: (map.ContainsKey("providerRepositoryOwner") ? map["providerRepositoryOwner"] : "").ToString(), + providerRepositoryUrl: (map.ContainsKey("providerRepositoryUrl") ? map["providerRepositoryUrl"] : "").ToString(), + providerCommitHash: (map.ContainsKey("providerCommitHash") ? map["providerCommitHash"] : "").ToString(), + providerCommitAuthorUrl: (map.ContainsKey("providerCommitAuthorUrl") ? map["providerCommitAuthorUrl"] : "").ToString(), + providerCommitAuthor: (map.ContainsKey("providerCommitAuthor") ? map["providerCommitAuthor"] : "").ToString(), + providerCommitMessage: (map.ContainsKey("providerCommitMessage") ? map["providerCommitMessage"] : "").ToString(), + providerCommitUrl: (map.ContainsKey("providerCommitUrl") ? map["providerCommitUrl"] : "").ToString(), + providerBranch: (map.ContainsKey("providerBranch") ? map["providerBranch"] : "").ToString(), + providerBranchUrl: (map.ContainsKey("providerBranchUrl") ? map["providerBranchUrl"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/DeploymentList.cs b/Appwrite/Models/DeploymentList.cs index 45c56994..0ce50fb3 100644 --- a/Appwrite/Models/DeploymentList.cs +++ b/Appwrite/Models/DeploymentList.cs @@ -27,7 +27,7 @@ List deployments } public static DeploymentList From(Dictionary map) => new DeploymentList( - total: Convert.ToInt64(map["total"]), + total: Convert.ToInt64((map.ContainsKey("total") ? map["total"] : 0)), deployments: map["deployments"].ConvertToList>().Select(it => Appwrite.Models.Deployment.From(map: it)).ToList() ); diff --git a/Appwrite/Models/DnsRecord.cs b/Appwrite/Models/DnsRecord.cs new file mode 100644 index 00000000..db2768dc --- /dev/null +++ b/Appwrite/Models/DnsRecord.cs @@ -0,0 +1,110 @@ + +using System; +using System.Linq; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; +using Appwrite.Enums; +using Appwrite.Extensions; + +namespace Appwrite.Models +{ + public class DnsRecord + { + [JsonPropertyName("$id")] + public string Id { get; private set; } + + [JsonPropertyName("$createdAt")] + public string CreatedAt { get; private set; } + + [JsonPropertyName("$updatedAt")] + public string UpdatedAt { get; private set; } + + [JsonPropertyName("type")] + public string Type { get; private set; } + + [JsonPropertyName("name")] + public string Name { get; private set; } + + [JsonPropertyName("value")] + public string Value { get; private set; } + + [JsonPropertyName("ttl")] + public long Ttl { get; private set; } + + [JsonPropertyName("priority")] + public long Priority { get; private set; } + + [JsonPropertyName("lock")] + public bool Lock { get; private set; } + + [JsonPropertyName("weight")] + public long Weight { get; private set; } + + [JsonPropertyName("port")] + public long Port { get; private set; } + + [JsonPropertyName("comment")] + public string Comment { get; private set; } + + public DnsRecord( + string id, + string createdAt, + string updatedAt, + string type, + string name, + string @value, + long ttl, + long priority, + bool @lock, + long weight, + long port, + string comment + ) + { + Id = id; + CreatedAt = createdAt; + UpdatedAt = updatedAt; + Type = type; + Name = name; + Value = @value; + Ttl = ttl; + Priority = priority; + Lock = @lock; + Weight = weight; + Port = port; + Comment = comment; + } + + public static DnsRecord From(Dictionary map) => new DnsRecord( + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), + type: (map.ContainsKey("type") ? map["type"] : "").ToString(), + name: (map.ContainsKey("name") ? map["name"] : "").ToString(), + @value: (map.ContainsKey("value") ? map["value"] : "").ToString(), + ttl: Convert.ToInt64((map.ContainsKey("ttl") ? map["ttl"] : 3600)), + priority: Convert.ToInt64((map.ContainsKey("priority") ? map["priority"] : 0)), + @lock: (bool)(map.ContainsKey("lock") ? map["lock"] : false), + weight: Convert.ToInt64((map.ContainsKey("weight") ? map["weight"] : 0)), + port: Convert.ToInt64((map.ContainsKey("port") ? map["port"] : 0)), + comment: (map.ContainsKey("comment") ? map["comment"] : "").ToString() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "$id", Id }, + { "$createdAt", CreatedAt }, + { "$updatedAt", UpdatedAt }, + { "type", Type }, + { "name", Name }, + { "value", Value }, + { "ttl", Ttl }, + { "priority", Priority }, + { "lock", Lock }, + { "weight", Weight }, + { "port", Port }, + { "comment", Comment } + }; + } +} diff --git a/Appwrite/Models/DnsRecordsList.cs b/Appwrite/Models/DnsRecordsList.cs new file mode 100644 index 00000000..43816335 --- /dev/null +++ b/Appwrite/Models/DnsRecordsList.cs @@ -0,0 +1,40 @@ + +using System; +using System.Linq; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; +using Appwrite.Enums; +using Appwrite.Extensions; + +namespace Appwrite.Models +{ + public class DnsRecordsList + { + [JsonPropertyName("total")] + public long Total { get; private set; } + + [JsonPropertyName("dnsRecords")] + public List DnsRecords { get; private set; } + + public DnsRecordsList( + long total, + List dnsRecords + ) + { + Total = total; + DnsRecords = dnsRecords; + } + + public static DnsRecordsList From(Dictionary map) => new DnsRecordsList( + total: Convert.ToInt64((map.ContainsKey("total") ? map["total"] : 0)), + dnsRecords: map["dnsRecords"].ConvertToList>().Select(it => Appwrite.Models.DnsRecord.From(map: it)).ToList() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "total", Total }, + { "dnsRecords", DnsRecords?.Select(it => it.ToMap()).ToList() } + }; + } +} diff --git a/Appwrite/Models/Document.cs b/Appwrite/Models/Document.cs index f74f4f23..3909ae47 100644 --- a/Appwrite/Models/Document.cs +++ b/Appwrite/Models/Document.cs @@ -56,12 +56,12 @@ Dictionary data } public static Document From(Dictionary map) => new Document( - id: map["$id"].ToString(), - sequence: map["$sequence"].ToString(), - collectionId: map["$collectionId"].ToString(), - databaseId: map["$databaseId"].ToString(), - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + sequence: (map.ContainsKey("$sequence") ? map["$sequence"] : "").ToString(), + collectionId: (map.ContainsKey("$collectionId") ? map["$collectionId"] : "").ToString(), + databaseId: (map.ContainsKey("$databaseId") ? map["$databaseId"] : "").ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), permissions: map["$permissions"].ConvertToList(), data: map.TryGetValue("data", out var additionalPropsValue) ? (Dictionary)additionalPropsValue diff --git a/Appwrite/Models/DocumentList.cs b/Appwrite/Models/DocumentList.cs index 77c02b71..b92937a0 100644 --- a/Appwrite/Models/DocumentList.cs +++ b/Appwrite/Models/DocumentList.cs @@ -27,7 +27,7 @@ List documents } public static DocumentList From(Dictionary map) => new DocumentList( - total: Convert.ToInt64(map["total"]), + total: Convert.ToInt64((map.ContainsKey("total") ? map["total"] : 0)), documents: map["documents"].ConvertToList>().Select(it => Appwrite.Models.Document.From(map: it)).ToList() ); diff --git a/Appwrite/Models/DomainPrice.cs b/Appwrite/Models/DomainPrice.cs new file mode 100644 index 00000000..ad9d3251 --- /dev/null +++ b/Appwrite/Models/DomainPrice.cs @@ -0,0 +1,86 @@ + +using System; +using System.Linq; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; +using Appwrite.Enums; +using Appwrite.Extensions; + +namespace Appwrite.Models +{ + public class DomainPrice + { + [JsonPropertyName("domain")] + public string Domain { get; private set; } + + [JsonPropertyName("tld")] + public string Tld { get; private set; } + + [JsonPropertyName("available")] + public bool Available { get; private set; } + + [JsonPropertyName("price")] + public double? Price { get; private set; } + + [JsonPropertyName("periodYears")] + public long PeriodYears { get; private set; } + + [JsonPropertyName("premium")] + public bool Premium { get; private set; } + + [JsonPropertyName("renewalPrice")] + public double? RenewalPrice { get; private set; } + + [JsonPropertyName("renewalPeriodYears")] + public long RenewalPeriodYears { get; private set; } + + public DomainPrice( + string domain, + string tld, + bool available, + double? price, + long periodYears, + bool premium, + double? renewalPrice, + long renewalPeriodYears + ) + { + Domain = domain; + Tld = tld; + Available = available; + Price = price; + PeriodYears = periodYears; + Premium = premium; + RenewalPrice = renewalPrice; + RenewalPeriodYears = renewalPeriodYears; + } + + public static DomainPrice From(Dictionary map) => new DomainPrice( + domain: (map.ContainsKey("domain") ? map["domain"] : "").ToString(), + tld: (map.ContainsKey("tld") ? map["tld"] : "").ToString(), + available: (bool)(map.ContainsKey("available") ? map["available"] : false), + price: map.TryGetValue("price", out var numberRaw4) && numberRaw4 != null + ? Convert.ToDouble(numberRaw4) + : null, + periodYears: Convert.ToInt64((map.ContainsKey("periodYears") ? map["periodYears"] : 1)), + premium: (bool)(map.ContainsKey("premium") ? map["premium"] : false), + renewalPrice: map.TryGetValue("renewalPrice", out var numberRaw7) && numberRaw7 != null + ? Convert.ToDouble(numberRaw7) + : null, + renewalPeriodYears: Convert.ToInt64((map.ContainsKey("renewalPeriodYears") ? map["renewalPeriodYears"] : 1)) + ); + + public Dictionary ToMap() => new Dictionary() + { + { "domain", Domain }, + { "tld", Tld }, + { "available", Available }, + { "price", Price }, + { "periodYears", PeriodYears }, + { "premium", Premium }, + { "renewalPrice", RenewalPrice }, + { "renewalPeriodYears", RenewalPeriodYears } + }; + } +} diff --git a/Appwrite/Models/DomainPricesList.cs b/Appwrite/Models/DomainPricesList.cs new file mode 100644 index 00000000..3176a7f7 --- /dev/null +++ b/Appwrite/Models/DomainPricesList.cs @@ -0,0 +1,40 @@ + +using System; +using System.Linq; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; +using Appwrite.Enums; +using Appwrite.Extensions; + +namespace Appwrite.Models +{ + public class DomainPricesList + { + [JsonPropertyName("total")] + public long Total { get; private set; } + + [JsonPropertyName("prices")] + public List Prices { get; private set; } + + public DomainPricesList( + long total, + List prices + ) + { + Total = total; + Prices = prices; + } + + public static DomainPricesList From(Dictionary map) => new DomainPricesList( + total: Convert.ToInt64((map.ContainsKey("total") ? map["total"] : 0)), + prices: map["prices"].ConvertToList>().Select(it => Appwrite.Models.DomainPrice.From(map: it)).ToList() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "total", Total }, + { "prices", Prices?.Select(it => it.ToMap()).ToList() } + }; + } +} diff --git a/Appwrite/Models/DomainTransferStatus.cs b/Appwrite/Models/DomainTransferStatus.cs new file mode 100644 index 00000000..c3dae0f6 --- /dev/null +++ b/Appwrite/Models/DomainTransferStatus.cs @@ -0,0 +1,47 @@ + +using System; +using System.Linq; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; +using Appwrite.Enums; +using Appwrite.Extensions; + +namespace Appwrite.Models +{ + public class DomainTransferStatus + { + [JsonPropertyName("status")] + public Appwrite.Enums.DomainTransferStatusEnum Status { get; private set; } + + [JsonPropertyName("reason")] + public string Reason { get; private set; } + + [JsonPropertyName("timestamp")] + public string Timestamp { get; private set; } + + public DomainTransferStatus( + Appwrite.Enums.DomainTransferStatusEnum status, + string reason, + string timestamp + ) + { + Status = status; + Reason = reason; + Timestamp = timestamp; + } + + public static DomainTransferStatus From(Dictionary map) => new DomainTransferStatus( + status: new Appwrite.Enums.DomainTransferStatusEnum((map.ContainsKey("status") ? map["status"] : "pending_registry").ToString()!), + reason: (map.ContainsKey("reason") ? map["reason"] : "").ToString(), + timestamp: (map.ContainsKey("timestamp") ? map["timestamp"] : "").ToString() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "status", Status.Value }, + { "reason", Reason }, + { "timestamp", Timestamp } + }; + } +} diff --git a/Appwrite/Models/DomainsList.cs b/Appwrite/Models/DomainsList.cs new file mode 100644 index 00000000..8cc0e7ea --- /dev/null +++ b/Appwrite/Models/DomainsList.cs @@ -0,0 +1,40 @@ + +using System; +using System.Linq; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; +using Appwrite.Enums; +using Appwrite.Extensions; + +namespace Appwrite.Models +{ + public class DomainsList + { + [JsonPropertyName("total")] + public long Total { get; private set; } + + [JsonPropertyName("domains")] + public List Domains { get; private set; } + + public DomainsList( + long total, + List domains + ) + { + Total = total; + Domains = domains; + } + + public static DomainsList From(Dictionary map) => new DomainsList( + total: Convert.ToInt64((map.ContainsKey("total") ? map["total"] : 0)), + domains: map["domains"].ConvertToList>().Select(it => Appwrite.Models.XDomain.From(map: it)).ToList() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "total", Total }, + { "domains", Domains?.Select(it => it.ToMap()).ToList() } + }; + } +} diff --git a/Appwrite/Models/EmailTemplate.cs b/Appwrite/Models/EmailTemplate.cs index 815b1982..8a9ce7e0 100644 --- a/Appwrite/Models/EmailTemplate.cs +++ b/Appwrite/Models/EmailTemplate.cs @@ -57,14 +57,14 @@ string subject } public static EmailTemplate From(Dictionary map) => new EmailTemplate( - templateId: map["templateId"].ToString(), - locale: map["locale"].ToString(), - message: map["message"].ToString(), - senderName: map["senderName"].ToString(), - senderEmail: map["senderEmail"].ToString(), - replyToEmail: map["replyToEmail"].ToString(), - replyToName: map["replyToName"].ToString(), - subject: map["subject"].ToString() + templateId: (map.ContainsKey("templateId") ? map["templateId"] : "").ToString(), + locale: (map.ContainsKey("locale") ? map["locale"] : "").ToString(), + message: (map.ContainsKey("message") ? map["message"] : "").ToString(), + senderName: (map.ContainsKey("senderName") ? map["senderName"] : "").ToString(), + senderEmail: (map.ContainsKey("senderEmail") ? map["senderEmail"] : "").ToString(), + replyToEmail: (map.ContainsKey("replyToEmail") ? map["replyToEmail"] : "").ToString(), + replyToName: (map.ContainsKey("replyToName") ? map["replyToName"] : "").ToString(), + subject: (map.ContainsKey("subject") ? map["subject"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/EmailTemplateList.cs b/Appwrite/Models/EmailTemplateList.cs index 59cd2ce8..94717425 100644 --- a/Appwrite/Models/EmailTemplateList.cs +++ b/Appwrite/Models/EmailTemplateList.cs @@ -27,7 +27,7 @@ List templates } public static EmailTemplateList From(Dictionary map) => new EmailTemplateList( - total: Convert.ToInt64(map["total"]), + total: Convert.ToInt64((map.ContainsKey("total") ? map["total"] : 0)), templates: map["templates"].ConvertToList>().Select(it => Appwrite.Models.EmailTemplate.From(map: it)).ToList() ); diff --git a/Appwrite/Models/Embedding.cs b/Appwrite/Models/Embedding.cs index e4490112..8753b6ad 100644 --- a/Appwrite/Models/Embedding.cs +++ b/Appwrite/Models/Embedding.cs @@ -37,10 +37,10 @@ string error } public static Embedding From(Dictionary map) => new Embedding( - model: map["model"].ToString(), - dimension: Convert.ToInt64(map["dimension"]), - embedding: map["embedding"].ConvertToList(), - error: map["error"].ToString() + model: (map.ContainsKey("model") ? map["model"] : "").ToString(), + dimension: Convert.ToInt64((map.ContainsKey("dimension") ? map["dimension"] : 0)), + embedding: (map.ContainsKey("embedding") ? map["embedding"] : new List()).ConvertToList(), + error: (map.ContainsKey("error") ? map["error"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/EmbeddingList.cs b/Appwrite/Models/EmbeddingList.cs index 98dc63b6..41ff094f 100644 --- a/Appwrite/Models/EmbeddingList.cs +++ b/Appwrite/Models/EmbeddingList.cs @@ -27,7 +27,7 @@ List embeddings } public static EmbeddingList From(Dictionary map) => new EmbeddingList( - total: Convert.ToInt64(map["total"]), + total: Convert.ToInt64((map.ContainsKey("total") ? map["total"] : 0)), embeddings: map["embeddings"].ConvertToList>().Select(it => Appwrite.Models.Embedding.From(map: it)).ToList() ); diff --git a/Appwrite/Models/EphemeralKey.cs b/Appwrite/Models/EphemeralKey.cs index a26a3f97..d3bcd512 100644 --- a/Appwrite/Models/EphemeralKey.cs +++ b/Appwrite/Models/EphemeralKey.cs @@ -62,14 +62,14 @@ List sdks } public static EphemeralKey From(Dictionary map) => new EphemeralKey( - id: map["$id"].ToString(), - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), - name: map["name"].ToString(), - expire: map["expire"].ToString(), - scopes: map["scopes"].ConvertToList(), - secret: map["secret"].ToString(), - accessedAt: map["accessedAt"].ToString(), + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), + name: (map.ContainsKey("name") ? map["name"] : "").ToString(), + expire: (map.ContainsKey("expire") ? map["expire"] : "").ToString(), + scopes: (map.ContainsKey("scopes") ? map["scopes"] : new List()).ConvertToList(), + secret: (map.ContainsKey("secret") ? map["secret"] : "").ToString(), + accessedAt: (map.ContainsKey("accessedAt") ? map["accessedAt"] : "").ToString(), sdks: map["sdks"].ConvertToList() ); diff --git a/Appwrite/Models/Execution.cs b/Appwrite/Models/Execution.cs index fb131efd..3507b28b 100644 --- a/Appwrite/Models/Execution.cs +++ b/Appwrite/Models/Execution.cs @@ -112,24 +112,24 @@ public Execution( } public static Execution From(Dictionary map) => new Execution( - id: map["$id"].ToString(), - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), permissions: map["$permissions"].ConvertToList(), - resourceId: map["resourceId"].ToString(), - resourceType: new Appwrite.Enums.ExecutionResourceType(map["resourceType"].ToString()!), - deploymentId: map["deploymentId"].ToString(), + resourceId: (map.ContainsKey("resourceId") ? map["resourceId"] : "").ToString(), + resourceType: new Appwrite.Enums.ExecutionResourceType((map.ContainsKey("resourceType") ? map["resourceType"] : "functions").ToString()!), + deploymentId: (map.ContainsKey("deploymentId") ? map["deploymentId"] : "").ToString(), trigger: new Appwrite.Enums.ExecutionTrigger(map["trigger"].ToString()!), status: new Appwrite.Enums.ExecutionStatus(map["status"].ToString()!), - requestMethod: map["requestMethod"].ToString(), - requestPath: map["requestPath"].ToString(), + requestMethod: (map.ContainsKey("requestMethod") ? map["requestMethod"] : "").ToString(), + requestPath: (map.ContainsKey("requestPath") ? map["requestPath"] : "").ToString(), requestHeaders: map["requestHeaders"].ConvertToList>().Select(it => Appwrite.Models.Headers.From(map: it)).ToList(), - responseStatusCode: Convert.ToInt64(map["responseStatusCode"]), - responseBody: map["responseBody"].ToString(), + responseStatusCode: Convert.ToInt64((map.ContainsKey("responseStatusCode") ? map["responseStatusCode"] : 0)), + responseBody: (map.ContainsKey("responseBody") ? map["responseBody"] : "").ToString(), responseHeaders: map["responseHeaders"].ConvertToList>().Select(it => Appwrite.Models.Headers.From(map: it)).ToList(), - logs: map["logs"].ToString(), - errors: map["errors"].ToString(), - duration: Convert.ToDouble(map["duration"]), + logs: (map.ContainsKey("logs") ? map["logs"] : "").ToString(), + errors: (map.ContainsKey("errors") ? map["errors"] : "").ToString(), + duration: Convert.ToDouble((map.ContainsKey("duration") ? map["duration"] : 0)), scheduledAt: map.TryGetValue("scheduledAt", out var scheduledAt) ? scheduledAt?.ToString() : null ); diff --git a/Appwrite/Models/ExecutionList.cs b/Appwrite/Models/ExecutionList.cs index 413253f2..b66c7cce 100644 --- a/Appwrite/Models/ExecutionList.cs +++ b/Appwrite/Models/ExecutionList.cs @@ -27,7 +27,7 @@ List executions } public static ExecutionList From(Dictionary map) => new ExecutionList( - total: Convert.ToInt64(map["total"]), + total: Convert.ToInt64((map.ContainsKey("total") ? map["total"] : 0)), executions: map["executions"].ConvertToList>().Select(it => Appwrite.Models.Execution.From(map: it)).ToList() ); diff --git a/Appwrite/Models/File.cs b/Appwrite/Models/File.cs index 12b6ca3c..bd9a8c27 100644 --- a/Appwrite/Models/File.cs +++ b/Appwrite/Models/File.cs @@ -97,22 +97,22 @@ string compression } public static File From(Dictionary map) => new File( - id: map["$id"].ToString(), - bucketId: map["bucketId"].ToString(), - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), - permissions: map["$permissions"].ConvertToList(), - name: map["name"].ToString(), - folder: map["folder"].ToString(), - key: map["key"].ToString(), - signature: map["signature"].ToString(), - mimeType: map["mimeType"].ToString(), - sizeOriginal: Convert.ToInt64(map["sizeOriginal"]), - sizeActual: Convert.ToInt64(map["sizeActual"]), - chunksTotal: Convert.ToInt64(map["chunksTotal"]), - chunksUploaded: Convert.ToInt64(map["chunksUploaded"]), - encryption: (bool)map["encryption"], - compression: map["compression"].ToString() + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + bucketId: (map.ContainsKey("bucketId") ? map["bucketId"] : "").ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), + permissions: (map.ContainsKey("$permissions") ? map["$permissions"] : new List()).ConvertToList(), + name: (map.ContainsKey("name") ? map["name"] : "").ToString(), + folder: (map.ContainsKey("folder") ? map["folder"] : "").ToString(), + key: (map.ContainsKey("key") ? map["key"] : "").ToString(), + signature: (map.ContainsKey("signature") ? map["signature"] : "").ToString(), + mimeType: (map.ContainsKey("mimeType") ? map["mimeType"] : "").ToString(), + sizeOriginal: Convert.ToInt64((map.ContainsKey("sizeOriginal") ? map["sizeOriginal"] : 0)), + sizeActual: Convert.ToInt64((map.ContainsKey("sizeActual") ? map["sizeActual"] : 0)), + chunksTotal: Convert.ToInt64((map.ContainsKey("chunksTotal") ? map["chunksTotal"] : 0)), + chunksUploaded: Convert.ToInt64((map.ContainsKey("chunksUploaded") ? map["chunksUploaded"] : 0)), + encryption: (bool)(map.ContainsKey("encryption") ? map["encryption"] : false), + compression: (map.ContainsKey("compression") ? map["compression"] : "none").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/FileList.cs b/Appwrite/Models/FileList.cs index aed1cb81..22fbc573 100644 --- a/Appwrite/Models/FileList.cs +++ b/Appwrite/Models/FileList.cs @@ -27,7 +27,7 @@ List files } public static FileList From(Dictionary map) => new FileList( - total: Convert.ToInt64(map["total"]), + total: Convert.ToInt64((map.ContainsKey("total") ? map["total"] : 0)), files: map["files"].ConvertToList>().Select(it => Appwrite.Models.File.From(map: it)).ToList() ); diff --git a/Appwrite/Models/Framework.cs b/Appwrite/Models/Framework.cs index 9486fee5..d16cbbe0 100644 --- a/Appwrite/Models/Framework.cs +++ b/Appwrite/Models/Framework.cs @@ -42,9 +42,9 @@ List adapters } public static Framework From(Dictionary map) => new Framework( - key: map["key"].ToString(), - name: map["name"].ToString(), - buildRuntime: map["buildRuntime"].ToString(), + key: (map.ContainsKey("key") ? map["key"] : "").ToString(), + name: (map.ContainsKey("name") ? map["name"] : "").ToString(), + buildRuntime: (map.ContainsKey("buildRuntime") ? map["buildRuntime"] : "").ToString(), runtimes: map["runtimes"].ConvertToList(), adapters: map["adapters"].ConvertToList>().Select(it => Appwrite.Models.FrameworkAdapter.From(map: it)).ToList() ); diff --git a/Appwrite/Models/FrameworkAdapter.cs b/Appwrite/Models/FrameworkAdapter.cs index f78852fc..4c82af17 100644 --- a/Appwrite/Models/FrameworkAdapter.cs +++ b/Appwrite/Models/FrameworkAdapter.cs @@ -42,10 +42,10 @@ public FrameworkAdapter( } public static FrameworkAdapter From(Dictionary map) => new FrameworkAdapter( - key: map["key"].ToString(), - installCommand: map["installCommand"].ToString(), - buildCommand: map["buildCommand"].ToString(), - outputDirectory: map["outputDirectory"].ToString(), + key: (map.ContainsKey("key") ? map["key"] : "").ToString(), + installCommand: (map.ContainsKey("installCommand") ? map["installCommand"] : "").ToString(), + buildCommand: (map.ContainsKey("buildCommand") ? map["buildCommand"] : "").ToString(), + outputDirectory: (map.ContainsKey("outputDirectory") ? map["outputDirectory"] : "").ToString(), fallbackFile: map.TryGetValue("fallbackFile", out var fallbackFile) ? fallbackFile?.ToString() : null ); diff --git a/Appwrite/Models/FrameworkList.cs b/Appwrite/Models/FrameworkList.cs index 6b652bae..c5fad8c5 100644 --- a/Appwrite/Models/FrameworkList.cs +++ b/Appwrite/Models/FrameworkList.cs @@ -27,7 +27,7 @@ List frameworks } public static FrameworkList From(Dictionary map) => new FrameworkList( - total: Convert.ToInt64(map["total"]), + total: Convert.ToInt64((map.ContainsKey("total") ? map["total"] : 0)), frameworks: map["frameworks"].ConvertToList>().Select(it => Appwrite.Models.Framework.From(map: it)).ToList() ); diff --git a/Appwrite/Models/Function.cs b/Appwrite/Models/Function.cs index f104739e..358a541e 100644 --- a/Appwrite/Models/Function.cs +++ b/Appwrite/Models/Function.cs @@ -182,41 +182,41 @@ string runtimeSpecification } public static Function From(Dictionary map) => new Function( - id: map["$id"].ToString(), - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), - execute: map["execute"].ConvertToList(), - name: map["name"].ToString(), - enabled: (bool)map["enabled"], - live: (bool)map["live"], - logging: (bool)map["logging"], - runtime: map["runtime"].ToString(), - deploymentRetention: Convert.ToInt64(map["deploymentRetention"]), - deploymentId: map["deploymentId"].ToString(), - deploymentCreatedAt: map["deploymentCreatedAt"].ToString(), - latestDeploymentId: map["latestDeploymentId"].ToString(), - latestDeploymentCreatedAt: map["latestDeploymentCreatedAt"].ToString(), - latestDeploymentStatus: map["latestDeploymentStatus"].ToString(), - scopes: map["scopes"].ConvertToList(), + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), + execute: (map.ContainsKey("execute") ? map["execute"] : new List()).ConvertToList(), + name: (map.ContainsKey("name") ? map["name"] : "").ToString(), + enabled: (bool)(map.ContainsKey("enabled") ? map["enabled"] : true), + live: (bool)(map.ContainsKey("live") ? map["live"] : true), + logging: (bool)(map.ContainsKey("logging") ? map["logging"] : true), + runtime: (map.ContainsKey("runtime") ? map["runtime"] : "").ToString(), + deploymentRetention: Convert.ToInt64((map.ContainsKey("deploymentRetention") ? map["deploymentRetention"] : 0)), + deploymentId: (map.ContainsKey("deploymentId") ? map["deploymentId"] : "").ToString(), + deploymentCreatedAt: (map.ContainsKey("deploymentCreatedAt") ? map["deploymentCreatedAt"] : "").ToString(), + latestDeploymentId: (map.ContainsKey("latestDeploymentId") ? map["latestDeploymentId"] : "").ToString(), + latestDeploymentCreatedAt: (map.ContainsKey("latestDeploymentCreatedAt") ? map["latestDeploymentCreatedAt"] : "").ToString(), + latestDeploymentStatus: (map.ContainsKey("latestDeploymentStatus") ? map["latestDeploymentStatus"] : "").ToString(), + scopes: (map.ContainsKey("scopes") ? map["scopes"] : new List()).ConvertToList(), vars: map["vars"].ConvertToList>().Select(it => Appwrite.Models.Variable.From(map: it)).ToList(), - events: map["events"].ConvertToList(), - schedule: map["schedule"].ToString(), + events: (map.ContainsKey("events") ? map["events"] : new List()).ConvertToList(), + schedule: (map.ContainsKey("schedule") ? map["schedule"] : "").ToString(), interval: map.TryGetValue("interval", out var numberRaw20) && numberRaw20 != null ? Convert.ToInt64(numberRaw20) : null, - timeout: Convert.ToInt64(map["timeout"]), - entrypoint: map["entrypoint"].ToString(), - commands: map["commands"].ToString(), - version: map["version"].ToString(), - installationId: map["installationId"].ToString(), - providerRepositoryId: map["providerRepositoryId"].ToString(), - providerBranch: map["providerBranch"].ToString(), - providerRootDirectory: map["providerRootDirectory"].ToString(), - providerSilentMode: (bool)map["providerSilentMode"], - providerBranches: map["providerBranches"].ConvertToList(), - providerPaths: map["providerPaths"].ConvertToList(), - buildSpecification: map["buildSpecification"].ToString(), - runtimeSpecification: map["runtimeSpecification"].ToString() + timeout: Convert.ToInt64((map.ContainsKey("timeout") ? map["timeout"] : 15)), + entrypoint: (map.ContainsKey("entrypoint") ? map["entrypoint"] : "").ToString(), + commands: (map.ContainsKey("commands") ? map["commands"] : "").ToString(), + version: (map.ContainsKey("version") ? map["version"] : "v5").ToString(), + installationId: (map.ContainsKey("installationId") ? map["installationId"] : "").ToString(), + providerRepositoryId: (map.ContainsKey("providerRepositoryId") ? map["providerRepositoryId"] : "").ToString(), + providerBranch: (map.ContainsKey("providerBranch") ? map["providerBranch"] : "").ToString(), + providerRootDirectory: (map.ContainsKey("providerRootDirectory") ? map["providerRootDirectory"] : "").ToString(), + providerSilentMode: (bool)(map.ContainsKey("providerSilentMode") ? map["providerSilentMode"] : false), + providerBranches: (map.ContainsKey("providerBranches") ? map["providerBranches"] : new List()).ConvertToList(), + providerPaths: (map.ContainsKey("providerPaths") ? map["providerPaths"] : new List()).ConvertToList(), + buildSpecification: (map.ContainsKey("buildSpecification") ? map["buildSpecification"] : "s-1vcpu-512mb").ToString(), + runtimeSpecification: (map.ContainsKey("runtimeSpecification") ? map["runtimeSpecification"] : "s-1vcpu-512mb").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/FunctionList.cs b/Appwrite/Models/FunctionList.cs index 0fd99836..d8122cc4 100644 --- a/Appwrite/Models/FunctionList.cs +++ b/Appwrite/Models/FunctionList.cs @@ -27,7 +27,7 @@ List functions } public static FunctionList From(Dictionary map) => new FunctionList( - total: Convert.ToInt64(map["total"]), + total: Convert.ToInt64((map.ContainsKey("total") ? map["total"] : 0)), functions: map["functions"].ConvertToList>().Select(it => Appwrite.Models.Function.From(map: it)).ToList() ); diff --git a/Appwrite/Models/Headers.cs b/Appwrite/Models/Headers.cs index c1429470..e313d034 100644 --- a/Appwrite/Models/Headers.cs +++ b/Appwrite/Models/Headers.cs @@ -27,8 +27,8 @@ string @value } public static Headers From(Dictionary map) => new Headers( - name: map["name"].ToString(), - @value: map["value"].ToString() + name: (map.ContainsKey("name") ? map["name"] : "").ToString(), + @value: (map.ContainsKey("value") ? map["value"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/Identity.cs b/Appwrite/Models/Identity.cs index 60851107..16e372ae 100644 --- a/Appwrite/Models/Identity.cs +++ b/Appwrite/Models/Identity.cs @@ -41,6 +41,9 @@ public class Identity [JsonPropertyName("providerRefreshToken")] public string ProviderRefreshToken { get; private set; } + [JsonPropertyName("providerIdToken")] + public string ProviderIdToken { get; private set; } + public Identity( string id, string createdAt, @@ -51,7 +54,8 @@ public Identity( string providerEmail, string providerAccessToken, string providerAccessTokenExpiry, - string providerRefreshToken + string providerRefreshToken, + string providerIdToken ) { Id = id; @@ -64,19 +68,21 @@ string providerRefreshToken ProviderAccessToken = providerAccessToken; ProviderAccessTokenExpiry = providerAccessTokenExpiry; ProviderRefreshToken = providerRefreshToken; + ProviderIdToken = providerIdToken; } public static Identity From(Dictionary map) => new Identity( - id: map["$id"].ToString(), - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), - userId: map["userId"].ToString(), - provider: map["provider"].ToString(), - providerUid: map["providerUid"].ToString(), - providerEmail: map["providerEmail"].ToString(), - providerAccessToken: map["providerAccessToken"].ToString(), - providerAccessTokenExpiry: map["providerAccessTokenExpiry"].ToString(), - providerRefreshToken: map["providerRefreshToken"].ToString() + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), + userId: (map.ContainsKey("userId") ? map["userId"] : "").ToString(), + provider: (map.ContainsKey("provider") ? map["provider"] : "").ToString(), + providerUid: (map.ContainsKey("providerUid") ? map["providerUid"] : "").ToString(), + providerEmail: (map.ContainsKey("providerEmail") ? map["providerEmail"] : "").ToString(), + providerAccessToken: (map.ContainsKey("providerAccessToken") ? map["providerAccessToken"] : "").ToString(), + providerAccessTokenExpiry: (map.ContainsKey("providerAccessTokenExpiry") ? map["providerAccessTokenExpiry"] : "").ToString(), + providerRefreshToken: (map.ContainsKey("providerRefreshToken") ? map["providerRefreshToken"] : "").ToString(), + providerIdToken: (map.ContainsKey("providerIdToken") ? map["providerIdToken"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() @@ -90,7 +96,8 @@ string providerRefreshToken { "providerEmail", ProviderEmail }, { "providerAccessToken", ProviderAccessToken }, { "providerAccessTokenExpiry", ProviderAccessTokenExpiry }, - { "providerRefreshToken", ProviderRefreshToken } + { "providerRefreshToken", ProviderRefreshToken }, + { "providerIdToken", ProviderIdToken } }; } } diff --git a/Appwrite/Models/IdentityList.cs b/Appwrite/Models/IdentityList.cs index e4b93420..65acfdcf 100644 --- a/Appwrite/Models/IdentityList.cs +++ b/Appwrite/Models/IdentityList.cs @@ -27,7 +27,7 @@ List identities } public static IdentityList From(Dictionary map) => new IdentityList( - total: Convert.ToInt64(map["total"]), + total: Convert.ToInt64((map.ContainsKey("total") ? map["total"] : 0)), identities: map["identities"].ConvertToList>().Select(it => Appwrite.Models.Identity.From(map: it)).ToList() ); diff --git a/Appwrite/Models/Index.cs b/Appwrite/Models/Index.cs index ddebe855..2039bc16 100644 --- a/Appwrite/Models/Index.cs +++ b/Appwrite/Models/Index.cs @@ -67,15 +67,15 @@ public Index( } public static Index From(Dictionary map) => new Index( - id: map["$id"].ToString(), - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), - key: map["key"].ToString(), - type: map["type"].ToString(), + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), + key: (map.ContainsKey("key") ? map["key"] : "").ToString(), + type: (map.ContainsKey("type") ? map["type"] : "").ToString(), status: new Appwrite.Enums.IndexStatus(map["status"].ToString()!), - error: map["error"].ToString(), - attributes: map["attributes"].ConvertToList(), - lengths: map["lengths"].ConvertToList(), + error: (map.ContainsKey("error") ? map["error"] : "").ToString(), + attributes: (map.ContainsKey("attributes") ? map["attributes"] : new List()).ConvertToList(), + lengths: (map.ContainsKey("lengths") ? map["lengths"] : new List()).ConvertToList(), orders: map.TryGetValue("orders", out var arrayRaw10) && arrayRaw10 != null ? arrayRaw10.ConvertToList() : null diff --git a/Appwrite/Models/IndexList.cs b/Appwrite/Models/IndexList.cs index 844cd16b..1835bf55 100644 --- a/Appwrite/Models/IndexList.cs +++ b/Appwrite/Models/IndexList.cs @@ -27,7 +27,7 @@ List indexes } public static IndexList From(Dictionary map) => new IndexList( - total: Convert.ToInt64(map["total"]), + total: Convert.ToInt64((map.ContainsKey("total") ? map["total"] : 0)), indexes: map["indexes"].ConvertToList>().Select(it => Appwrite.Models.Index.From(map: it)).ToList() ); diff --git a/Appwrite/Models/Insight.cs b/Appwrite/Models/Insight.cs index 0676bf17..0a565814 100644 --- a/Appwrite/Models/Insight.cs +++ b/Appwrite/Models/Insight.cs @@ -102,19 +102,19 @@ public Insight( } public static Insight From(Dictionary map) => new Insight( - id: map["$id"].ToString(), - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), - reportId: map["reportId"].ToString(), - type: map["type"].ToString(), - severity: map["severity"].ToString(), - status: map["status"].ToString(), - resourceType: map["resourceType"].ToString(), - resourceId: map["resourceId"].ToString(), - parentResourceType: map["parentResourceType"].ToString(), - parentResourceId: map["parentResourceId"].ToString(), - title: map["title"].ToString(), - summary: map["summary"].ToString(), + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), + reportId: (map.ContainsKey("reportId") ? map["reportId"] : "").ToString(), + type: (map.ContainsKey("type") ? map["type"] : "").ToString(), + severity: (map.ContainsKey("severity") ? map["severity"] : "info").ToString(), + status: (map.ContainsKey("status") ? map["status"] : "active").ToString(), + resourceType: (map.ContainsKey("resourceType") ? map["resourceType"] : "").ToString(), + resourceId: (map.ContainsKey("resourceId") ? map["resourceId"] : "").ToString(), + parentResourceType: (map.ContainsKey("parentResourceType") ? map["parentResourceType"] : "").ToString(), + parentResourceId: (map.ContainsKey("parentResourceId") ? map["parentResourceId"] : "").ToString(), + title: (map.ContainsKey("title") ? map["title"] : "").ToString(), + summary: (map.ContainsKey("summary") ? map["summary"] : "").ToString(), ctas: map["ctas"].ConvertToList>().Select(it => Appwrite.Models.InsightCTA.From(map: it)).ToList(), analyzedAt: map.TryGetValue("analyzedAt", out var analyzedAt) ? analyzedAt?.ToString() : null, dismissedAt: map.TryGetValue("dismissedAt", out var dismissedAt) ? dismissedAt?.ToString() : null, diff --git a/Appwrite/Models/InsightCTA.cs b/Appwrite/Models/InsightCTA.cs index 3fa87ddf..52c16f27 100644 --- a/Appwrite/Models/InsightCTA.cs +++ b/Appwrite/Models/InsightCTA.cs @@ -37,10 +37,10 @@ object @params } public static InsightCTA From(Dictionary map) => new InsightCTA( - label: map["label"].ToString(), - service: map["service"].ToString(), - method: map["method"].ToString(), - @params: map["params"] + label: (map.ContainsKey("label") ? map["label"] : "").ToString(), + service: (map.ContainsKey("service") ? map["service"] : "").ToString(), + method: (map.ContainsKey("method") ? map["method"] : "").ToString(), + @params: (map.ContainsKey("params") ? map["params"] : new Dictionary()) ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/InsightList.cs b/Appwrite/Models/InsightList.cs index a7a12f50..20701184 100644 --- a/Appwrite/Models/InsightList.cs +++ b/Appwrite/Models/InsightList.cs @@ -27,7 +27,7 @@ List insights } public static InsightList From(Dictionary map) => new InsightList( - total: Convert.ToInt64(map["total"]), + total: Convert.ToInt64((map.ContainsKey("total") ? map["total"] : 0)), insights: map["insights"].ConvertToList>().Select(it => Appwrite.Models.Insight.From(map: it)).ToList() ); diff --git a/Appwrite/Models/JWT.cs b/Appwrite/Models/JWT.cs index da8e550f..0935e784 100644 --- a/Appwrite/Models/JWT.cs +++ b/Appwrite/Models/JWT.cs @@ -22,7 +22,7 @@ string jwt } public static JWT From(Dictionary map) => new JWT( - jwt: map["jwt"].ToString() + jwt: (map.ContainsKey("jwt") ? map["jwt"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/Key.cs b/Appwrite/Models/Key.cs index 1dbd398b..5550f524 100644 --- a/Appwrite/Models/Key.cs +++ b/Appwrite/Models/Key.cs @@ -62,14 +62,14 @@ List sdks } public static Key From(Dictionary map) => new Key( - id: map["$id"].ToString(), - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), - name: map["name"].ToString(), - expire: map["expire"].ToString(), - scopes: map["scopes"].ConvertToList(), - secret: map["secret"].ToString(), - accessedAt: map["accessedAt"].ToString(), + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), + name: (map.ContainsKey("name") ? map["name"] : "").ToString(), + expire: (map.ContainsKey("expire") ? map["expire"] : "").ToString(), + scopes: (map.ContainsKey("scopes") ? map["scopes"] : new List()).ConvertToList(), + secret: (map.ContainsKey("secret") ? map["secret"] : "").ToString(), + accessedAt: (map.ContainsKey("accessedAt") ? map["accessedAt"] : "").ToString(), sdks: map["sdks"].ConvertToList() ); diff --git a/Appwrite/Models/KeyList.cs b/Appwrite/Models/KeyList.cs index c7dfdfb5..2e9b9d3e 100644 --- a/Appwrite/Models/KeyList.cs +++ b/Appwrite/Models/KeyList.cs @@ -27,7 +27,7 @@ List keys } public static KeyList From(Dictionary map) => new KeyList( - total: Convert.ToInt64(map["total"]), + total: Convert.ToInt64((map.ContainsKey("total") ? map["total"] : 0)), keys: map["keys"].ConvertToList>().Select(it => Appwrite.Models.Key.From(map: it)).ToList() ); diff --git a/Appwrite/Models/Language.cs b/Appwrite/Models/Language.cs index 1eb05c9d..ae254243 100644 --- a/Appwrite/Models/Language.cs +++ b/Appwrite/Models/Language.cs @@ -32,9 +32,9 @@ string nativeName } public static Language From(Dictionary map) => new Language( - name: map["name"].ToString(), - code: map["code"].ToString(), - nativeName: map["nativeName"].ToString() + name: (map.ContainsKey("name") ? map["name"] : "").ToString(), + code: (map.ContainsKey("code") ? map["code"] : "").ToString(), + nativeName: (map.ContainsKey("nativeName") ? map["nativeName"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/LanguageList.cs b/Appwrite/Models/LanguageList.cs index cd57fa8f..cae62d7c 100644 --- a/Appwrite/Models/LanguageList.cs +++ b/Appwrite/Models/LanguageList.cs @@ -27,7 +27,7 @@ List languages } public static LanguageList From(Dictionary map) => new LanguageList( - total: Convert.ToInt64(map["total"]), + total: Convert.ToInt64((map.ContainsKey("total") ? map["total"] : 0)), languages: map["languages"].ConvertToList>().Select(it => Appwrite.Models.Language.From(map: it)).ToList() ); diff --git a/Appwrite/Models/Locale.cs b/Appwrite/Models/Locale.cs index 6208de4a..56d87955 100644 --- a/Appwrite/Models/Locale.cs +++ b/Appwrite/Models/Locale.cs @@ -107,13 +107,13 @@ public Locale( } public static Locale From(Dictionary map) => new Locale( - ip: map["ip"].ToString(), - countryCode: map["countryCode"].ToString(), - country: map["country"].ToString(), - continentCode: map["continentCode"].ToString(), - continent: map["continent"].ToString(), - eu: (bool)map["eu"], - currency: map["currency"].ToString(), + ip: (map.ContainsKey("ip") ? map["ip"] : "").ToString(), + countryCode: (map.ContainsKey("countryCode") ? map["countryCode"] : "").ToString(), + country: (map.ContainsKey("country") ? map["country"] : "").ToString(), + continentCode: (map.ContainsKey("continentCode") ? map["continentCode"] : "").ToString(), + continent: (map.ContainsKey("continent") ? map["continent"] : "").ToString(), + eu: (bool)(map.ContainsKey("eu") ? map["eu"] : false), + currency: (map.ContainsKey("currency") ? map["currency"] : "").ToString(), city: map.TryGetValue("city", out var city) ? city?.ToString() : null, timeZone: map.TryGetValue("timeZone", out var timeZone) ? timeZone?.ToString() : null, postalCode: map.TryGetValue("postalCode", out var postalCode) ? postalCode?.ToString() : null, diff --git a/Appwrite/Models/LocaleCode.cs b/Appwrite/Models/LocaleCode.cs index e52ccb92..1ab736e3 100644 --- a/Appwrite/Models/LocaleCode.cs +++ b/Appwrite/Models/LocaleCode.cs @@ -27,8 +27,8 @@ string name } public static LocaleCode From(Dictionary map) => new LocaleCode( - code: map["code"].ToString(), - name: map["name"].ToString() + code: (map.ContainsKey("code") ? map["code"] : "").ToString(), + name: (map.ContainsKey("name") ? map["name"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/LocaleCodeList.cs b/Appwrite/Models/LocaleCodeList.cs index 98f712ea..a54572ec 100644 --- a/Appwrite/Models/LocaleCodeList.cs +++ b/Appwrite/Models/LocaleCodeList.cs @@ -27,7 +27,7 @@ List localeCodes } public static LocaleCodeList From(Dictionary map) => new LocaleCodeList( - total: Convert.ToInt64(map["total"]), + total: Convert.ToInt64((map.ContainsKey("total") ? map["total"] : 0)), localeCodes: map["localeCodes"].ConvertToList>().Select(it => Appwrite.Models.LocaleCode.From(map: it)).ToList() ); diff --git a/Appwrite/Models/Log.cs b/Appwrite/Models/Log.cs deleted file mode 100644 index 5ff3b420..00000000 --- a/Appwrite/Models/Log.cs +++ /dev/null @@ -1,180 +0,0 @@ - -using System; -using System.Linq; -using System.Collections.Generic; -using System.Text.Json; -using System.Text.Json.Serialization; -using Appwrite.Enums; -using Appwrite.Extensions; - -namespace Appwrite.Models -{ - public class Log - { - [JsonPropertyName("event")] - public string Event { get; private set; } - - [JsonPropertyName("userId")] - public string UserId { get; private set; } - - [JsonPropertyName("userEmail")] - public string UserEmail { get; private set; } - - [JsonPropertyName("userName")] - public string UserName { get; private set; } - - [JsonPropertyName("mode")] - public string Mode { get; private set; } - - [JsonPropertyName("userType")] - public string UserType { get; private set; } - - [JsonPropertyName("ip")] - public string Ip { get; private set; } - - [JsonPropertyName("time")] - public string Time { get; private set; } - - [JsonPropertyName("osCode")] - public string OsCode { get; private set; } - - [JsonPropertyName("osName")] - public string OsName { get; private set; } - - [JsonPropertyName("osVersion")] - public string OsVersion { get; private set; } - - [JsonPropertyName("clientType")] - public string ClientType { get; private set; } - - [JsonPropertyName("clientCode")] - public string ClientCode { get; private set; } - - [JsonPropertyName("clientName")] - public string ClientName { get; private set; } - - [JsonPropertyName("clientVersion")] - public string ClientVersion { get; private set; } - - [JsonPropertyName("clientEngine")] - public string ClientEngine { get; private set; } - - [JsonPropertyName("clientEngineVersion")] - public string ClientEngineVersion { get; private set; } - - [JsonPropertyName("deviceName")] - public string DeviceName { get; private set; } - - [JsonPropertyName("deviceBrand")] - public string DeviceBrand { get; private set; } - - [JsonPropertyName("deviceModel")] - public string DeviceModel { get; private set; } - - [JsonPropertyName("countryCode")] - public string CountryCode { get; private set; } - - [JsonPropertyName("countryName")] - public string CountryName { get; private set; } - - public Log( - string @event, - string userId, - string userEmail, - string userName, - string mode, - string userType, - string ip, - string time, - string osCode, - string osName, - string osVersion, - string clientType, - string clientCode, - string clientName, - string clientVersion, - string clientEngine, - string clientEngineVersion, - string deviceName, - string deviceBrand, - string deviceModel, - string countryCode, - string countryName - ) - { - Event = @event; - UserId = userId; - UserEmail = userEmail; - UserName = userName; - Mode = mode; - UserType = userType; - Ip = ip; - Time = time; - OsCode = osCode; - OsName = osName; - OsVersion = osVersion; - ClientType = clientType; - ClientCode = clientCode; - ClientName = clientName; - ClientVersion = clientVersion; - ClientEngine = clientEngine; - ClientEngineVersion = clientEngineVersion; - DeviceName = deviceName; - DeviceBrand = deviceBrand; - DeviceModel = deviceModel; - CountryCode = countryCode; - CountryName = countryName; - } - - public static Log From(Dictionary map) => new Log( - @event: map["event"].ToString(), - userId: map["userId"].ToString(), - userEmail: map["userEmail"].ToString(), - userName: map["userName"].ToString(), - mode: map["mode"].ToString(), - userType: map["userType"].ToString(), - ip: map["ip"].ToString(), - time: map["time"].ToString(), - osCode: map["osCode"].ToString(), - osName: map["osName"].ToString(), - osVersion: map["osVersion"].ToString(), - clientType: map["clientType"].ToString(), - clientCode: map["clientCode"].ToString(), - clientName: map["clientName"].ToString(), - clientVersion: map["clientVersion"].ToString(), - clientEngine: map["clientEngine"].ToString(), - clientEngineVersion: map["clientEngineVersion"].ToString(), - deviceName: map["deviceName"].ToString(), - deviceBrand: map["deviceBrand"].ToString(), - deviceModel: map["deviceModel"].ToString(), - countryCode: map["countryCode"].ToString(), - countryName: map["countryName"].ToString() - ); - - public Dictionary ToMap() => new Dictionary() - { - { "event", Event }, - { "userId", UserId }, - { "userEmail", UserEmail }, - { "userName", UserName }, - { "mode", Mode }, - { "userType", UserType }, - { "ip", Ip }, - { "time", Time }, - { "osCode", OsCode }, - { "osName", OsName }, - { "osVersion", OsVersion }, - { "clientType", ClientType }, - { "clientCode", ClientCode }, - { "clientName", ClientName }, - { "clientVersion", ClientVersion }, - { "clientEngine", ClientEngine }, - { "clientEngineVersion", ClientEngineVersion }, - { "deviceName", DeviceName }, - { "deviceBrand", DeviceBrand }, - { "deviceModel", DeviceModel }, - { "countryCode", CountryCode }, - { "countryName", CountryName } - }; - } -} diff --git a/Appwrite/Models/Membership.cs b/Appwrite/Models/Membership.cs index a72a6fbf..8c3e58b2 100644 --- a/Appwrite/Models/Membership.cs +++ b/Appwrite/Models/Membership.cs @@ -92,21 +92,21 @@ List roles } public static Membership From(Dictionary map) => new Membership( - id: map["$id"].ToString(), - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), - userId: map["userId"].ToString(), - userName: map["userName"].ToString(), - userEmail: map["userEmail"].ToString(), - userPhone: map["userPhone"].ToString(), - teamId: map["teamId"].ToString(), - teamName: map["teamName"].ToString(), - invited: map["invited"].ToString(), - joined: map["joined"].ToString(), - confirm: (bool)map["confirm"], - mfa: (bool)map["mfa"], - userAccessedAt: map["userAccessedAt"].ToString(), - roles: map["roles"].ConvertToList() + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), + userId: (map.ContainsKey("userId") ? map["userId"] : "").ToString(), + userName: (map.ContainsKey("userName") ? map["userName"] : "").ToString(), + userEmail: (map.ContainsKey("userEmail") ? map["userEmail"] : "").ToString(), + userPhone: (map.ContainsKey("userPhone") ? map["userPhone"] : "").ToString(), + teamId: (map.ContainsKey("teamId") ? map["teamId"] : "").ToString(), + teamName: (map.ContainsKey("teamName") ? map["teamName"] : "").ToString(), + invited: (map.ContainsKey("invited") ? map["invited"] : "").ToString(), + joined: (map.ContainsKey("joined") ? map["joined"] : "").ToString(), + confirm: (bool)(map.ContainsKey("confirm") ? map["confirm"] : false), + mfa: (bool)(map.ContainsKey("mfa") ? map["mfa"] : false), + userAccessedAt: (map.ContainsKey("userAccessedAt") ? map["userAccessedAt"] : "").ToString(), + roles: (map.ContainsKey("roles") ? map["roles"] : new List()).ConvertToList() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/MembershipList.cs b/Appwrite/Models/MembershipList.cs index 5bc5acbe..2bcedc74 100644 --- a/Appwrite/Models/MembershipList.cs +++ b/Appwrite/Models/MembershipList.cs @@ -27,7 +27,7 @@ List memberships } public static MembershipList From(Dictionary map) => new MembershipList( - total: Convert.ToInt64(map["total"]), + total: Convert.ToInt64((map.ContainsKey("total") ? map["total"] : 0)), memberships: map["memberships"].ConvertToList>().Select(it => Appwrite.Models.Membership.From(map: it)).ToList() ); diff --git a/Appwrite/Models/Message.cs b/Appwrite/Models/Message.cs index 7ef49fca..5fef4f3f 100644 --- a/Appwrite/Models/Message.cs +++ b/Appwrite/Models/Message.cs @@ -82,10 +82,10 @@ Appwrite.Enums.MessageStatus status } public static Message From(Dictionary map) => new Message( - id: map["$id"].ToString(), - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), - providerType: map["providerType"].ToString(), + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), + providerType: (map.ContainsKey("providerType") ? map["providerType"] : "").ToString(), topics: map["topics"].ConvertToList(), users: map["users"].ConvertToList(), targets: map["targets"].ConvertToList(), @@ -94,9 +94,9 @@ Appwrite.Enums.MessageStatus status deliveryErrors: map.TryGetValue("deliveryErrors", out var arrayRaw10) && arrayRaw10 != null ? arrayRaw10.ConvertToList() : null, - deliveredTotal: Convert.ToInt64(map["deliveredTotal"]), - data: map["data"], - status: new Appwrite.Enums.MessageStatus(map["status"].ToString()!) + deliveredTotal: Convert.ToInt64((map.ContainsKey("deliveredTotal") ? map["deliveredTotal"] : 0)), + data: (map.ContainsKey("data") ? map["data"] : new Dictionary()), + status: new Appwrite.Enums.MessageStatus((map.ContainsKey("status") ? map["status"] : "draft").ToString()!) ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/MessageList.cs b/Appwrite/Models/MessageList.cs index 0cbc300c..225fd7fe 100644 --- a/Appwrite/Models/MessageList.cs +++ b/Appwrite/Models/MessageList.cs @@ -27,7 +27,7 @@ List messages } public static MessageList From(Dictionary map) => new MessageList( - total: Convert.ToInt64(map["total"]), + total: Convert.ToInt64((map.ContainsKey("total") ? map["total"] : 0)), messages: map["messages"].ConvertToList>().Select(it => Appwrite.Models.Message.From(map: it)).ToList() ); diff --git a/Appwrite/Models/MfaChallenge.cs b/Appwrite/Models/MfaChallenge.cs index f66377ee..021cc980 100644 --- a/Appwrite/Models/MfaChallenge.cs +++ b/Appwrite/Models/MfaChallenge.cs @@ -37,10 +37,10 @@ string expire } public static MfaChallenge From(Dictionary map) => new MfaChallenge( - id: map["$id"].ToString(), - createdAt: map["$createdAt"].ToString(), - userId: map["userId"].ToString(), - expire: map["expire"].ToString() + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + userId: (map.ContainsKey("userId") ? map["userId"] : "").ToString(), + expire: (map.ContainsKey("expire") ? map["expire"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/MfaChallengeSecret.cs b/Appwrite/Models/MfaChallengeSecret.cs index 67570421..774e7008 100644 --- a/Appwrite/Models/MfaChallengeSecret.cs +++ b/Appwrite/Models/MfaChallengeSecret.cs @@ -42,11 +42,11 @@ string code } public static MfaChallengeSecret From(Dictionary map) => new MfaChallengeSecret( - id: map["$id"].ToString(), - createdAt: map["$createdAt"].ToString(), - userId: map["userId"].ToString(), - expire: map["expire"].ToString(), - code: map["code"].ToString() + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + userId: (map.ContainsKey("userId") ? map["userId"] : "").ToString(), + expire: (map.ContainsKey("expire") ? map["expire"] : "").ToString(), + code: (map.ContainsKey("code") ? map["code"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/MfaFactors.cs b/Appwrite/Models/MfaFactors.cs index 91685829..2b32e2d5 100644 --- a/Appwrite/Models/MfaFactors.cs +++ b/Appwrite/Models/MfaFactors.cs @@ -42,11 +42,11 @@ bool custom } public static MfaFactors From(Dictionary map) => new MfaFactors( - totp: (bool)map["totp"], - phone: (bool)map["phone"], - email: (bool)map["email"], - recoveryCode: (bool)map["recoveryCode"], - custom: (bool)map["custom"] + totp: (bool)(map.ContainsKey("totp") ? map["totp"] : false), + phone: (bool)(map.ContainsKey("phone") ? map["phone"] : false), + email: (bool)(map.ContainsKey("email") ? map["email"] : false), + recoveryCode: (bool)(map.ContainsKey("recoveryCode") ? map["recoveryCode"] : false), + custom: (bool)(map.ContainsKey("custom") ? map["custom"] : false) ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/MfaRecoveryCodes.cs b/Appwrite/Models/MfaRecoveryCodes.cs index 1bd3cc2a..3f15c0a3 100644 --- a/Appwrite/Models/MfaRecoveryCodes.cs +++ b/Appwrite/Models/MfaRecoveryCodes.cs @@ -22,7 +22,7 @@ List recoveryCodes } public static MfaRecoveryCodes From(Dictionary map) => new MfaRecoveryCodes( - recoveryCodes: map["recoveryCodes"].ConvertToList() + recoveryCodes: (map.ContainsKey("recoveryCodes") ? map["recoveryCodes"] : new List()).ConvertToList() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/MfaType.cs b/Appwrite/Models/MfaType.cs index a5502326..a4751995 100644 --- a/Appwrite/Models/MfaType.cs +++ b/Appwrite/Models/MfaType.cs @@ -27,8 +27,8 @@ string uri } public static MfaType From(Dictionary map) => new MfaType( - secret: map["secret"].ToString(), - uri: map["uri"].ToString() + secret: (map.ContainsKey("secret") ? map["secret"] : "").ToString(), + uri: (map.ContainsKey("uri") ? map["uri"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/MockNumber.cs b/Appwrite/Models/MockNumber.cs index e9c0ce53..2aa13fc7 100644 --- a/Appwrite/Models/MockNumber.cs +++ b/Appwrite/Models/MockNumber.cs @@ -37,10 +37,10 @@ string updatedAt } public static MockNumber From(Dictionary map) => new MockNumber( - number: map["number"].ToString(), - otp: map["otp"].ToString(), - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString() + number: (map.ContainsKey("number") ? map["number"] : "").ToString(), + otp: (map.ContainsKey("otp") ? map["otp"] : "").ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/MockNumberList.cs b/Appwrite/Models/MockNumberList.cs index b89caed0..a3ddde71 100644 --- a/Appwrite/Models/MockNumberList.cs +++ b/Appwrite/Models/MockNumberList.cs @@ -27,7 +27,7 @@ List mockNumbers } public static MockNumberList From(Dictionary map) => new MockNumberList( - total: Convert.ToInt64(map["total"]), + total: Convert.ToInt64((map.ContainsKey("total") ? map["total"] : 0)), mockNumbers: map["mockNumbers"].ConvertToList>().Select(it => Appwrite.Models.MockNumber.From(map: it)).ToList() ); diff --git a/Appwrite/Models/OAuth2Amazon.cs b/Appwrite/Models/OAuth2Amazon.cs index e5555d2e..7f65837b 100644 --- a/Appwrite/Models/OAuth2Amazon.cs +++ b/Appwrite/Models/OAuth2Amazon.cs @@ -37,10 +37,10 @@ string clientSecret } public static OAuth2Amazon From(Dictionary map) => new OAuth2Amazon( - id: map["$id"].ToString(), - enabled: (bool)map["enabled"], - clientId: map["clientId"].ToString(), - clientSecret: map["clientSecret"].ToString() + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + enabled: (bool)(map.ContainsKey("enabled") ? map["enabled"] : false), + clientId: (map.ContainsKey("clientId") ? map["clientId"] : "").ToString(), + clientSecret: (map.ContainsKey("clientSecret") ? map["clientSecret"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/OAuth2Apple.cs b/Appwrite/Models/OAuth2Apple.cs index 45e51372..174d7d6a 100644 --- a/Appwrite/Models/OAuth2Apple.cs +++ b/Appwrite/Models/OAuth2Apple.cs @@ -29,13 +29,21 @@ public class OAuth2Apple [JsonPropertyName("p8File")] public string P8File { get; private set; } + [JsonPropertyName("nativeEnabled")] + public bool NativeEnabled { get; private set; } + + [JsonPropertyName("nativeClientIds")] + public List NativeClientIds { get; private set; } + public OAuth2Apple( string id, bool enabled, string serviceId, string keyId, string teamId, - string p8File + string p8File, + bool nativeEnabled, + List nativeClientIds ) { Id = id; @@ -44,15 +52,19 @@ string p8File KeyId = keyId; TeamId = teamId; P8File = p8File; + NativeEnabled = nativeEnabled; + NativeClientIds = nativeClientIds; } public static OAuth2Apple From(Dictionary map) => new OAuth2Apple( - id: map["$id"].ToString(), - enabled: (bool)map["enabled"], - serviceId: map["serviceId"].ToString(), - keyId: map["keyId"].ToString(), - teamId: map["teamId"].ToString(), - p8File: map["p8File"].ToString() + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + enabled: (bool)(map.ContainsKey("enabled") ? map["enabled"] : false), + serviceId: (map.ContainsKey("serviceId") ? map["serviceId"] : "").ToString(), + keyId: (map.ContainsKey("keyId") ? map["keyId"] : "").ToString(), + teamId: (map.ContainsKey("teamId") ? map["teamId"] : "").ToString(), + p8File: (map.ContainsKey("p8File") ? map["p8File"] : "").ToString(), + nativeEnabled: (bool)(map.ContainsKey("nativeEnabled") ? map["nativeEnabled"] : false), + nativeClientIds: (map.ContainsKey("nativeClientIds") ? map["nativeClientIds"] : new List()).ConvertToList() ); public Dictionary ToMap() => new Dictionary() @@ -62,7 +74,9 @@ string p8File { "serviceId", ServiceId }, { "keyId", KeyId }, { "teamId", TeamId }, - { "p8File", P8File } + { "p8File", P8File }, + { "nativeEnabled", NativeEnabled }, + { "nativeClientIds", NativeClientIds } }; } } diff --git a/Appwrite/Models/OAuth2Appwrite.cs b/Appwrite/Models/OAuth2Appwrite.cs index 33fa2c01..d0c8f985 100644 --- a/Appwrite/Models/OAuth2Appwrite.cs +++ b/Appwrite/Models/OAuth2Appwrite.cs @@ -37,10 +37,10 @@ string clientSecret } public static OAuth2Appwrite From(Dictionary map) => new OAuth2Appwrite( - id: map["$id"].ToString(), - enabled: (bool)map["enabled"], - clientId: map["clientId"].ToString(), - clientSecret: map["clientSecret"].ToString() + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + enabled: (bool)(map.ContainsKey("enabled") ? map["enabled"] : false), + clientId: (map.ContainsKey("clientId") ? map["clientId"] : "").ToString(), + clientSecret: (map.ContainsKey("clientSecret") ? map["clientSecret"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/OAuth2Auth0.cs b/Appwrite/Models/OAuth2Auth0.cs index 47a28a1a..479e599f 100644 --- a/Appwrite/Models/OAuth2Auth0.cs +++ b/Appwrite/Models/OAuth2Auth0.cs @@ -23,6 +23,9 @@ public class OAuth2Auth0 [JsonPropertyName("clientSecret")] public string ClientSecret { get; private set; } + [JsonPropertyName("prompt")] + public List Prompt { get; private set; } + [JsonPropertyName("endpoint")] public string Endpoint { get; private set; } @@ -31,6 +34,7 @@ public OAuth2Auth0( bool enabled, string clientId, string clientSecret, + List prompt, string endpoint ) { @@ -38,15 +42,17 @@ string endpoint Enabled = enabled; ClientId = clientId; ClientSecret = clientSecret; + Prompt = prompt; Endpoint = endpoint; } public static OAuth2Auth0 From(Dictionary map) => new OAuth2Auth0( - id: map["$id"].ToString(), - enabled: (bool)map["enabled"], - clientId: map["clientId"].ToString(), - clientSecret: map["clientSecret"].ToString(), - endpoint: map["endpoint"].ToString() + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + enabled: (bool)(map.ContainsKey("enabled") ? map["enabled"] : false), + clientId: (map.ContainsKey("clientId") ? map["clientId"] : "").ToString(), + clientSecret: (map.ContainsKey("clientSecret") ? map["clientSecret"] : "").ToString(), + prompt: (map.ContainsKey("prompt") ? map["prompt"] : new List()).ConvertToList(), + endpoint: (map.ContainsKey("endpoint") ? map["endpoint"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() @@ -55,6 +61,7 @@ string endpoint { "enabled", Enabled }, { "clientId", ClientId }, { "clientSecret", ClientSecret }, + { "prompt", Prompt.Select(it => it.Value).ToList() }, { "endpoint", Endpoint } }; } diff --git a/Appwrite/Models/OAuth2Authentik.cs b/Appwrite/Models/OAuth2Authentik.cs index 74d854fb..10671345 100644 --- a/Appwrite/Models/OAuth2Authentik.cs +++ b/Appwrite/Models/OAuth2Authentik.cs @@ -42,11 +42,11 @@ string endpoint } public static OAuth2Authentik From(Dictionary map) => new OAuth2Authentik( - id: map["$id"].ToString(), - enabled: (bool)map["enabled"], - clientId: map["clientId"].ToString(), - clientSecret: map["clientSecret"].ToString(), - endpoint: map["endpoint"].ToString() + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + enabled: (bool)(map.ContainsKey("enabled") ? map["enabled"] : false), + clientId: (map.ContainsKey("clientId") ? map["clientId"] : "").ToString(), + clientSecret: (map.ContainsKey("clientSecret") ? map["clientSecret"] : "").ToString(), + endpoint: (map.ContainsKey("endpoint") ? map["endpoint"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/OAuth2Autodesk.cs b/Appwrite/Models/OAuth2Autodesk.cs index 46b4fc83..c3d24323 100644 --- a/Appwrite/Models/OAuth2Autodesk.cs +++ b/Appwrite/Models/OAuth2Autodesk.cs @@ -37,10 +37,10 @@ string clientSecret } public static OAuth2Autodesk From(Dictionary map) => new OAuth2Autodesk( - id: map["$id"].ToString(), - enabled: (bool)map["enabled"], - clientId: map["clientId"].ToString(), - clientSecret: map["clientSecret"].ToString() + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + enabled: (bool)(map.ContainsKey("enabled") ? map["enabled"] : false), + clientId: (map.ContainsKey("clientId") ? map["clientId"] : "").ToString(), + clientSecret: (map.ContainsKey("clientSecret") ? map["clientSecret"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/OAuth2Bitbucket.cs b/Appwrite/Models/OAuth2Bitbucket.cs index 323d58bc..784165ea 100644 --- a/Appwrite/Models/OAuth2Bitbucket.cs +++ b/Appwrite/Models/OAuth2Bitbucket.cs @@ -37,10 +37,10 @@ string secret } public static OAuth2Bitbucket From(Dictionary map) => new OAuth2Bitbucket( - id: map["$id"].ToString(), - enabled: (bool)map["enabled"], - key: map["key"].ToString(), - secret: map["secret"].ToString() + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + enabled: (bool)(map.ContainsKey("enabled") ? map["enabled"] : false), + key: (map.ContainsKey("key") ? map["key"] : "").ToString(), + secret: (map.ContainsKey("secret") ? map["secret"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/OAuth2Bitly.cs b/Appwrite/Models/OAuth2Bitly.cs index 03ad5989..c550d00d 100644 --- a/Appwrite/Models/OAuth2Bitly.cs +++ b/Appwrite/Models/OAuth2Bitly.cs @@ -37,10 +37,10 @@ string clientSecret } public static OAuth2Bitly From(Dictionary map) => new OAuth2Bitly( - id: map["$id"].ToString(), - enabled: (bool)map["enabled"], - clientId: map["clientId"].ToString(), - clientSecret: map["clientSecret"].ToString() + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + enabled: (bool)(map.ContainsKey("enabled") ? map["enabled"] : false), + clientId: (map.ContainsKey("clientId") ? map["clientId"] : "").ToString(), + clientSecret: (map.ContainsKey("clientSecret") ? map["clientSecret"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/OAuth2Box.cs b/Appwrite/Models/OAuth2Box.cs index 1a9ecd22..165b5fdb 100644 --- a/Appwrite/Models/OAuth2Box.cs +++ b/Appwrite/Models/OAuth2Box.cs @@ -37,10 +37,10 @@ string clientSecret } public static OAuth2Box From(Dictionary map) => new OAuth2Box( - id: map["$id"].ToString(), - enabled: (bool)map["enabled"], - clientId: map["clientId"].ToString(), - clientSecret: map["clientSecret"].ToString() + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + enabled: (bool)(map.ContainsKey("enabled") ? map["enabled"] : false), + clientId: (map.ContainsKey("clientId") ? map["clientId"] : "").ToString(), + clientSecret: (map.ContainsKey("clientSecret") ? map["clientSecret"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/OAuth2Cloudflare.cs b/Appwrite/Models/OAuth2Cloudflare.cs index fe7435f1..63cd34c8 100644 --- a/Appwrite/Models/OAuth2Cloudflare.cs +++ b/Appwrite/Models/OAuth2Cloudflare.cs @@ -37,10 +37,10 @@ string clientSecret } public static OAuth2Cloudflare From(Dictionary map) => new OAuth2Cloudflare( - id: map["$id"].ToString(), - enabled: (bool)map["enabled"], - clientId: map["clientId"].ToString(), - clientSecret: map["clientSecret"].ToString() + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + enabled: (bool)(map.ContainsKey("enabled") ? map["enabled"] : false), + clientId: (map.ContainsKey("clientId") ? map["clientId"] : "").ToString(), + clientSecret: (map.ContainsKey("clientSecret") ? map["clientSecret"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/OAuth2Dailymotion.cs b/Appwrite/Models/OAuth2Dailymotion.cs index 7ac5a641..7afff78f 100644 --- a/Appwrite/Models/OAuth2Dailymotion.cs +++ b/Appwrite/Models/OAuth2Dailymotion.cs @@ -37,10 +37,10 @@ string apiSecret } public static OAuth2Dailymotion From(Dictionary map) => new OAuth2Dailymotion( - id: map["$id"].ToString(), - enabled: (bool)map["enabled"], - apiKey: map["apiKey"].ToString(), - apiSecret: map["apiSecret"].ToString() + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + enabled: (bool)(map.ContainsKey("enabled") ? map["enabled"] : false), + apiKey: (map.ContainsKey("apiKey") ? map["apiKey"] : "").ToString(), + apiSecret: (map.ContainsKey("apiSecret") ? map["apiSecret"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/OAuth2Discord.cs b/Appwrite/Models/OAuth2Discord.cs index d0794d96..29b9c0f5 100644 --- a/Appwrite/Models/OAuth2Discord.cs +++ b/Appwrite/Models/OAuth2Discord.cs @@ -23,24 +23,30 @@ public class OAuth2Discord [JsonPropertyName("clientSecret")] public string ClientSecret { get; private set; } + [JsonPropertyName("prompt")] + public List Prompt { get; private set; } + public OAuth2Discord( string id, bool enabled, string clientId, - string clientSecret + string clientSecret, + List prompt ) { Id = id; Enabled = enabled; ClientId = clientId; ClientSecret = clientSecret; + Prompt = prompt; } public static OAuth2Discord From(Dictionary map) => new OAuth2Discord( - id: map["$id"].ToString(), - enabled: (bool)map["enabled"], - clientId: map["clientId"].ToString(), - clientSecret: map["clientSecret"].ToString() + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + enabled: (bool)(map.ContainsKey("enabled") ? map["enabled"] : false), + clientId: (map.ContainsKey("clientId") ? map["clientId"] : "").ToString(), + clientSecret: (map.ContainsKey("clientSecret") ? map["clientSecret"] : "").ToString(), + prompt: (map.ContainsKey("prompt") ? map["prompt"] : new List()).ConvertToList() ); public Dictionary ToMap() => new Dictionary() @@ -48,7 +54,8 @@ string clientSecret { "$id", Id }, { "enabled", Enabled }, { "clientId", ClientId }, - { "clientSecret", ClientSecret } + { "clientSecret", ClientSecret }, + { "prompt", Prompt.Select(it => it.Value).ToList() } }; } } diff --git a/Appwrite/Models/OAuth2Disqus.cs b/Appwrite/Models/OAuth2Disqus.cs index 582050dc..9604b46e 100644 --- a/Appwrite/Models/OAuth2Disqus.cs +++ b/Appwrite/Models/OAuth2Disqus.cs @@ -37,10 +37,10 @@ string secretKey } public static OAuth2Disqus From(Dictionary map) => new OAuth2Disqus( - id: map["$id"].ToString(), - enabled: (bool)map["enabled"], - publicKey: map["publicKey"].ToString(), - secretKey: map["secretKey"].ToString() + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + enabled: (bool)(map.ContainsKey("enabled") ? map["enabled"] : false), + publicKey: (map.ContainsKey("publicKey") ? map["publicKey"] : "").ToString(), + secretKey: (map.ContainsKey("secretKey") ? map["secretKey"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/OAuth2Dropbox.cs b/Appwrite/Models/OAuth2Dropbox.cs index 53723ad5..ab003000 100644 --- a/Appwrite/Models/OAuth2Dropbox.cs +++ b/Appwrite/Models/OAuth2Dropbox.cs @@ -37,10 +37,10 @@ string appSecret } public static OAuth2Dropbox From(Dictionary map) => new OAuth2Dropbox( - id: map["$id"].ToString(), - enabled: (bool)map["enabled"], - appKey: map["appKey"].ToString(), - appSecret: map["appSecret"].ToString() + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + enabled: (bool)(map.ContainsKey("enabled") ? map["enabled"] : false), + appKey: (map.ContainsKey("appKey") ? map["appKey"] : "").ToString(), + appSecret: (map.ContainsKey("appSecret") ? map["appSecret"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/OAuth2Etsy.cs b/Appwrite/Models/OAuth2Etsy.cs index 8d50cd6a..4ca4c56a 100644 --- a/Appwrite/Models/OAuth2Etsy.cs +++ b/Appwrite/Models/OAuth2Etsy.cs @@ -37,10 +37,10 @@ string sharedSecret } public static OAuth2Etsy From(Dictionary map) => new OAuth2Etsy( - id: map["$id"].ToString(), - enabled: (bool)map["enabled"], - keyString: map["keyString"].ToString(), - sharedSecret: map["sharedSecret"].ToString() + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + enabled: (bool)(map.ContainsKey("enabled") ? map["enabled"] : false), + keyString: (map.ContainsKey("keyString") ? map["keyString"] : "").ToString(), + sharedSecret: (map.ContainsKey("sharedSecret") ? map["sharedSecret"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/OAuth2Facebook.cs b/Appwrite/Models/OAuth2Facebook.cs index a770bcb1..964e0a10 100644 --- a/Appwrite/Models/OAuth2Facebook.cs +++ b/Appwrite/Models/OAuth2Facebook.cs @@ -37,10 +37,10 @@ string appSecret } public static OAuth2Facebook From(Dictionary map) => new OAuth2Facebook( - id: map["$id"].ToString(), - enabled: (bool)map["enabled"], - appId: map["appId"].ToString(), - appSecret: map["appSecret"].ToString() + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + enabled: (bool)(map.ContainsKey("enabled") ? map["enabled"] : false), + appId: (map.ContainsKey("appId") ? map["appId"] : "").ToString(), + appSecret: (map.ContainsKey("appSecret") ? map["appSecret"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/OAuth2Figma.cs b/Appwrite/Models/OAuth2Figma.cs index 3e549dd8..a66ce666 100644 --- a/Appwrite/Models/OAuth2Figma.cs +++ b/Appwrite/Models/OAuth2Figma.cs @@ -37,10 +37,10 @@ string clientSecret } public static OAuth2Figma From(Dictionary map) => new OAuth2Figma( - id: map["$id"].ToString(), - enabled: (bool)map["enabled"], - clientId: map["clientId"].ToString(), - clientSecret: map["clientSecret"].ToString() + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + enabled: (bool)(map.ContainsKey("enabled") ? map["enabled"] : false), + clientId: (map.ContainsKey("clientId") ? map["clientId"] : "").ToString(), + clientSecret: (map.ContainsKey("clientSecret") ? map["clientSecret"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/OAuth2FusionAuth.cs b/Appwrite/Models/OAuth2FusionAuth.cs index 1548395b..9258a4c0 100644 --- a/Appwrite/Models/OAuth2FusionAuth.cs +++ b/Appwrite/Models/OAuth2FusionAuth.cs @@ -42,11 +42,11 @@ string endpoint } public static OAuth2FusionAuth From(Dictionary map) => new OAuth2FusionAuth( - id: map["$id"].ToString(), - enabled: (bool)map["enabled"], - clientId: map["clientId"].ToString(), - clientSecret: map["clientSecret"].ToString(), - endpoint: map["endpoint"].ToString() + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + enabled: (bool)(map.ContainsKey("enabled") ? map["enabled"] : false), + clientId: (map.ContainsKey("clientId") ? map["clientId"] : "").ToString(), + clientSecret: (map.ContainsKey("clientSecret") ? map["clientSecret"] : "").ToString(), + endpoint: (map.ContainsKey("endpoint") ? map["endpoint"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/OAuth2Github.cs b/Appwrite/Models/OAuth2Github.cs index 0b050e1e..cb213750 100644 --- a/Appwrite/Models/OAuth2Github.cs +++ b/Appwrite/Models/OAuth2Github.cs @@ -23,24 +23,30 @@ public class OAuth2Github [JsonPropertyName("clientSecret")] public string ClientSecret { get; private set; } + [JsonPropertyName("prompt")] + public List Prompt { get; private set; } + public OAuth2Github( string id, bool enabled, string clientId, - string clientSecret + string clientSecret, + List prompt ) { Id = id; Enabled = enabled; ClientId = clientId; ClientSecret = clientSecret; + Prompt = prompt; } public static OAuth2Github From(Dictionary map) => new OAuth2Github( - id: map["$id"].ToString(), - enabled: (bool)map["enabled"], - clientId: map["clientId"].ToString(), - clientSecret: map["clientSecret"].ToString() + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + enabled: (bool)(map.ContainsKey("enabled") ? map["enabled"] : false), + clientId: (map.ContainsKey("clientId") ? map["clientId"] : "").ToString(), + clientSecret: (map.ContainsKey("clientSecret") ? map["clientSecret"] : "").ToString(), + prompt: (map.ContainsKey("prompt") ? map["prompt"] : new List()).ConvertToList() ); public Dictionary ToMap() => new Dictionary() @@ -48,7 +54,8 @@ string clientSecret { "$id", Id }, { "enabled", Enabled }, { "clientId", ClientId }, - { "clientSecret", ClientSecret } + { "clientSecret", ClientSecret }, + { "prompt", Prompt.Select(it => it.Value).ToList() } }; } } diff --git a/Appwrite/Models/OAuth2Gitlab.cs b/Appwrite/Models/OAuth2Gitlab.cs index c97f99c7..efdc8595 100644 --- a/Appwrite/Models/OAuth2Gitlab.cs +++ b/Appwrite/Models/OAuth2Gitlab.cs @@ -42,11 +42,11 @@ string endpoint } public static OAuth2Gitlab From(Dictionary map) => new OAuth2Gitlab( - id: map["$id"].ToString(), - enabled: (bool)map["enabled"], - applicationId: map["applicationId"].ToString(), - secret: map["secret"].ToString(), - endpoint: map["endpoint"].ToString() + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + enabled: (bool)(map.ContainsKey("enabled") ? map["enabled"] : false), + applicationId: (map.ContainsKey("applicationId") ? map["applicationId"] : "").ToString(), + secret: (map.ContainsKey("secret") ? map["secret"] : "").ToString(), + endpoint: (map.ContainsKey("endpoint") ? map["endpoint"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/OAuth2Google.cs b/Appwrite/Models/OAuth2Google.cs index cb8118da..5160acd3 100644 --- a/Appwrite/Models/OAuth2Google.cs +++ b/Appwrite/Models/OAuth2Google.cs @@ -26,12 +26,20 @@ public class OAuth2Google [JsonPropertyName("prompt")] public List Prompt { get; private set; } + [JsonPropertyName("nativeEnabled")] + public bool NativeEnabled { get; private set; } + + [JsonPropertyName("nativeClientIds")] + public List NativeClientIds { get; private set; } + public OAuth2Google( string id, bool enabled, string clientId, string clientSecret, - List prompt + List prompt, + bool nativeEnabled, + List nativeClientIds ) { Id = id; @@ -39,14 +47,18 @@ public OAuth2Google( ClientId = clientId; ClientSecret = clientSecret; Prompt = prompt; + NativeEnabled = nativeEnabled; + NativeClientIds = nativeClientIds; } public static OAuth2Google From(Dictionary map) => new OAuth2Google( - id: map["$id"].ToString(), - enabled: (bool)map["enabled"], - clientId: map["clientId"].ToString(), - clientSecret: map["clientSecret"].ToString(), - prompt: map["prompt"].ConvertToList() + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + enabled: (bool)(map.ContainsKey("enabled") ? map["enabled"] : false), + clientId: (map.ContainsKey("clientId") ? map["clientId"] : "").ToString(), + clientSecret: (map.ContainsKey("clientSecret") ? map["clientSecret"] : "").ToString(), + prompt: (map.ContainsKey("prompt") ? map["prompt"] : new List { "consent" }).ConvertToList(), + nativeEnabled: (bool)(map.ContainsKey("nativeEnabled") ? map["nativeEnabled"] : false), + nativeClientIds: (map.ContainsKey("nativeClientIds") ? map["nativeClientIds"] : new List()).ConvertToList() ); public Dictionary ToMap() => new Dictionary() @@ -55,7 +67,9 @@ public OAuth2Google( { "enabled", Enabled }, { "clientId", ClientId }, { "clientSecret", ClientSecret }, - { "prompt", Prompt.Select(it => it.Value).ToList() } + { "prompt", Prompt.Select(it => it.Value).ToList() }, + { "nativeEnabled", NativeEnabled }, + { "nativeClientIds", NativeClientIds } }; } } diff --git a/Appwrite/Models/OAuth2HuggingFace.cs b/Appwrite/Models/OAuth2HuggingFace.cs index a74c9546..ce27db7e 100644 --- a/Appwrite/Models/OAuth2HuggingFace.cs +++ b/Appwrite/Models/OAuth2HuggingFace.cs @@ -37,10 +37,10 @@ string clientSecret } public static OAuth2HuggingFace From(Dictionary map) => new OAuth2HuggingFace( - id: map["$id"].ToString(), - enabled: (bool)map["enabled"], - clientId: map["clientId"].ToString(), - clientSecret: map["clientSecret"].ToString() + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + enabled: (bool)(map.ContainsKey("enabled") ? map["enabled"] : false), + clientId: (map.ContainsKey("clientId") ? map["clientId"] : "").ToString(), + clientSecret: (map.ContainsKey("clientSecret") ? map["clientSecret"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/OAuth2Kakao.cs b/Appwrite/Models/OAuth2Kakao.cs new file mode 100644 index 00000000..6500b984 --- /dev/null +++ b/Appwrite/Models/OAuth2Kakao.cs @@ -0,0 +1,61 @@ + +using System; +using System.Linq; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; +using Appwrite.Enums; +using Appwrite.Extensions; + +namespace Appwrite.Models +{ + public class OAuth2Kakao + { + [JsonPropertyName("$id")] + public string Id { get; private set; } + + [JsonPropertyName("enabled")] + public bool Enabled { get; private set; } + + [JsonPropertyName("clientId")] + public string ClientId { get; private set; } + + [JsonPropertyName("clientSecret")] + public string ClientSecret { get; private set; } + + [JsonPropertyName("prompt")] + public List Prompt { get; private set; } + + public OAuth2Kakao( + string id, + bool enabled, + string clientId, + string clientSecret, + List prompt + ) + { + Id = id; + Enabled = enabled; + ClientId = clientId; + ClientSecret = clientSecret; + Prompt = prompt; + } + + public static OAuth2Kakao From(Dictionary map) => new OAuth2Kakao( + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + enabled: (bool)(map.ContainsKey("enabled") ? map["enabled"] : false), + clientId: (map.ContainsKey("clientId") ? map["clientId"] : "").ToString(), + clientSecret: (map.ContainsKey("clientSecret") ? map["clientSecret"] : "").ToString(), + prompt: (map.ContainsKey("prompt") ? map["prompt"] : new List()).ConvertToList() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "$id", Id }, + { "enabled", Enabled }, + { "clientId", ClientId }, + { "clientSecret", ClientSecret }, + { "prompt", Prompt.Select(it => it.Value).ToList() } + }; + } +} diff --git a/Appwrite/Models/OAuth2Keycloak.cs b/Appwrite/Models/OAuth2Keycloak.cs index 4906e138..a16716a5 100644 --- a/Appwrite/Models/OAuth2Keycloak.cs +++ b/Appwrite/Models/OAuth2Keycloak.cs @@ -47,12 +47,12 @@ string realmName } public static OAuth2Keycloak From(Dictionary map) => new OAuth2Keycloak( - id: map["$id"].ToString(), - enabled: (bool)map["enabled"], - clientId: map["clientId"].ToString(), - clientSecret: map["clientSecret"].ToString(), - endpoint: map["endpoint"].ToString(), - realmName: map["realmName"].ToString() + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + enabled: (bool)(map.ContainsKey("enabled") ? map["enabled"] : false), + clientId: (map.ContainsKey("clientId") ? map["clientId"] : "").ToString(), + clientSecret: (map.ContainsKey("clientSecret") ? map["clientSecret"] : "").ToString(), + endpoint: (map.ContainsKey("endpoint") ? map["endpoint"] : "").ToString(), + realmName: (map.ContainsKey("realmName") ? map["realmName"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/OAuth2Kick.cs b/Appwrite/Models/OAuth2Kick.cs index ff3b1253..dcc15657 100644 --- a/Appwrite/Models/OAuth2Kick.cs +++ b/Appwrite/Models/OAuth2Kick.cs @@ -37,10 +37,10 @@ string clientSecret } public static OAuth2Kick From(Dictionary map) => new OAuth2Kick( - id: map["$id"].ToString(), - enabled: (bool)map["enabled"], - clientId: map["clientId"].ToString(), - clientSecret: map["clientSecret"].ToString() + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + enabled: (bool)(map.ContainsKey("enabled") ? map["enabled"] : false), + clientId: (map.ContainsKey("clientId") ? map["clientId"] : "").ToString(), + clientSecret: (map.ContainsKey("clientSecret") ? map["clientSecret"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/OAuth2Linkedin.cs b/Appwrite/Models/OAuth2Linkedin.cs index dc0e01c9..94b302b1 100644 --- a/Appwrite/Models/OAuth2Linkedin.cs +++ b/Appwrite/Models/OAuth2Linkedin.cs @@ -37,10 +37,10 @@ string primaryClientSecret } public static OAuth2Linkedin From(Dictionary map) => new OAuth2Linkedin( - id: map["$id"].ToString(), - enabled: (bool)map["enabled"], - clientId: map["clientId"].ToString(), - primaryClientSecret: map["primaryClientSecret"].ToString() + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + enabled: (bool)(map.ContainsKey("enabled") ? map["enabled"] : false), + clientId: (map.ContainsKey("clientId") ? map["clientId"] : "").ToString(), + primaryClientSecret: (map.ContainsKey("primaryClientSecret") ? map["primaryClientSecret"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/OAuth2Microsoft.cs b/Appwrite/Models/OAuth2Microsoft.cs index e550e046..a83de764 100644 --- a/Appwrite/Models/OAuth2Microsoft.cs +++ b/Appwrite/Models/OAuth2Microsoft.cs @@ -23,6 +23,9 @@ public class OAuth2Microsoft [JsonPropertyName("applicationSecret")] public string ApplicationSecret { get; private set; } + [JsonPropertyName("prompt")] + public List Prompt { get; private set; } + [JsonPropertyName("tenant")] public string Tenant { get; private set; } @@ -31,6 +34,7 @@ public OAuth2Microsoft( bool enabled, string applicationId, string applicationSecret, + List prompt, string tenant ) { @@ -38,15 +42,17 @@ string tenant Enabled = enabled; ApplicationId = applicationId; ApplicationSecret = applicationSecret; + Prompt = prompt; Tenant = tenant; } public static OAuth2Microsoft From(Dictionary map) => new OAuth2Microsoft( - id: map["$id"].ToString(), - enabled: (bool)map["enabled"], - applicationId: map["applicationId"].ToString(), - applicationSecret: map["applicationSecret"].ToString(), - tenant: map["tenant"].ToString() + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + enabled: (bool)(map.ContainsKey("enabled") ? map["enabled"] : false), + applicationId: (map.ContainsKey("applicationId") ? map["applicationId"] : "").ToString(), + applicationSecret: (map.ContainsKey("applicationSecret") ? map["applicationSecret"] : "").ToString(), + prompt: (map.ContainsKey("prompt") ? map["prompt"] : new List()).ConvertToList(), + tenant: (map.ContainsKey("tenant") ? map["tenant"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() @@ -55,6 +61,7 @@ string tenant { "enabled", Enabled }, { "applicationId", ApplicationId }, { "applicationSecret", ApplicationSecret }, + { "prompt", Prompt.Select(it => it.Value).ToList() }, { "tenant", Tenant } }; } diff --git a/Appwrite/Models/OAuth2Notion.cs b/Appwrite/Models/OAuth2Notion.cs index 63121b8f..40ca4e63 100644 --- a/Appwrite/Models/OAuth2Notion.cs +++ b/Appwrite/Models/OAuth2Notion.cs @@ -37,10 +37,10 @@ string oauthClientSecret } public static OAuth2Notion From(Dictionary map) => new OAuth2Notion( - id: map["$id"].ToString(), - enabled: (bool)map["enabled"], - oauthClientId: map["oauthClientId"].ToString(), - oauthClientSecret: map["oauthClientSecret"].ToString() + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + enabled: (bool)(map.ContainsKey("enabled") ? map["enabled"] : false), + oauthClientId: (map.ContainsKey("oauthClientId") ? map["oauthClientId"] : "").ToString(), + oauthClientSecret: (map.ContainsKey("oauthClientSecret") ? map["oauthClientSecret"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/OAuth2Oidc.cs b/Appwrite/Models/OAuth2Oidc.cs index 4422ce6c..417e7c01 100644 --- a/Appwrite/Models/OAuth2Oidc.cs +++ b/Appwrite/Models/OAuth2Oidc.cs @@ -23,6 +23,9 @@ public class OAuth2Oidc [JsonPropertyName("clientSecret")] public string ClientSecret { get; private set; } + [JsonPropertyName("prompt")] + public List Prompt { get; private set; } + [JsonPropertyName("wellKnownURL")] public string WellKnownURL { get; private set; } @@ -35,9 +38,6 @@ public class OAuth2Oidc [JsonPropertyName("userInfoURL")] public string UserInfoURL { get; private set; } - [JsonPropertyName("prompt")] - public List Prompt { get; private set; } - [JsonPropertyName("maxAge")] public long? MaxAge { get; private set; } @@ -46,11 +46,11 @@ public OAuth2Oidc( bool enabled, string clientId, string clientSecret, + List prompt, string wellKnownURL, string authorizationURL, string tokenURL, string userInfoURL, - List prompt, long? maxAge ) { @@ -58,24 +58,24 @@ public OAuth2Oidc( Enabled = enabled; ClientId = clientId; ClientSecret = clientSecret; + Prompt = prompt; WellKnownURL = wellKnownURL; AuthorizationURL = authorizationURL; TokenURL = tokenURL; UserInfoURL = userInfoURL; - Prompt = prompt; MaxAge = maxAge; } public static OAuth2Oidc From(Dictionary map) => new OAuth2Oidc( - id: map["$id"].ToString(), - enabled: (bool)map["enabled"], - clientId: map["clientId"].ToString(), - clientSecret: map["clientSecret"].ToString(), - wellKnownURL: map["wellKnownURL"].ToString(), - authorizationURL: map["authorizationURL"].ToString(), - tokenURL: map["tokenURL"].ToString(), - userInfoURL: map["userInfoURL"].ToString(), - prompt: map["prompt"].ConvertToList(), + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + enabled: (bool)(map.ContainsKey("enabled") ? map["enabled"] : false), + clientId: (map.ContainsKey("clientId") ? map["clientId"] : "").ToString(), + clientSecret: (map.ContainsKey("clientSecret") ? map["clientSecret"] : "").ToString(), + prompt: (map.ContainsKey("prompt") ? map["prompt"] : new List()).ConvertToList(), + wellKnownURL: (map.ContainsKey("wellKnownURL") ? map["wellKnownURL"] : "").ToString(), + authorizationURL: (map.ContainsKey("authorizationURL") ? map["authorizationURL"] : "").ToString(), + tokenURL: (map.ContainsKey("tokenURL") ? map["tokenURL"] : "").ToString(), + userInfoURL: (map.ContainsKey("userInfoURL") ? map["userInfoURL"] : "").ToString(), maxAge: map.TryGetValue("maxAge", out var numberRaw10) && numberRaw10 != null ? Convert.ToInt64(numberRaw10) : null @@ -87,11 +87,11 @@ public OAuth2Oidc( { "enabled", Enabled }, { "clientId", ClientId }, { "clientSecret", ClientSecret }, + { "prompt", Prompt.Select(it => it.Value).ToList() }, { "wellKnownURL", WellKnownURL }, { "authorizationURL", AuthorizationURL }, { "tokenURL", TokenURL }, { "userInfoURL", UserInfoURL }, - { "prompt", Prompt.Select(it => it.Value).ToList() }, { "maxAge", MaxAge } }; } diff --git a/Appwrite/Models/OAuth2Okta.cs b/Appwrite/Models/OAuth2Okta.cs index 97f4b3b1..5dc64066 100644 --- a/Appwrite/Models/OAuth2Okta.cs +++ b/Appwrite/Models/OAuth2Okta.cs @@ -23,6 +23,9 @@ public class OAuth2Okta [JsonPropertyName("clientSecret")] public string ClientSecret { get; private set; } + [JsonPropertyName("prompt")] + public List Prompt { get; private set; } + [JsonPropertyName("domain")] public string Domain { get; private set; } @@ -34,6 +37,7 @@ public OAuth2Okta( bool enabled, string clientId, string clientSecret, + List prompt, string domain, string authorizationServerId ) @@ -42,17 +46,19 @@ string authorizationServerId Enabled = enabled; ClientId = clientId; ClientSecret = clientSecret; + Prompt = prompt; Domain = domain; AuthorizationServerId = authorizationServerId; } public static OAuth2Okta From(Dictionary map) => new OAuth2Okta( - id: map["$id"].ToString(), - enabled: (bool)map["enabled"], - clientId: map["clientId"].ToString(), - clientSecret: map["clientSecret"].ToString(), - domain: map["domain"].ToString(), - authorizationServerId: map["authorizationServerId"].ToString() + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + enabled: (bool)(map.ContainsKey("enabled") ? map["enabled"] : false), + clientId: (map.ContainsKey("clientId") ? map["clientId"] : "").ToString(), + clientSecret: (map.ContainsKey("clientSecret") ? map["clientSecret"] : "").ToString(), + prompt: (map.ContainsKey("prompt") ? map["prompt"] : new List()).ConvertToList(), + domain: (map.ContainsKey("domain") ? map["domain"] : "").ToString(), + authorizationServerId: (map.ContainsKey("authorizationServerId") ? map["authorizationServerId"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() @@ -61,6 +67,7 @@ string authorizationServerId { "enabled", Enabled }, { "clientId", ClientId }, { "clientSecret", ClientSecret }, + { "prompt", Prompt.Select(it => it.Value).ToList() }, { "domain", Domain }, { "authorizationServerId", AuthorizationServerId } }; diff --git a/Appwrite/Models/OAuth2Paypal.cs b/Appwrite/Models/OAuth2Paypal.cs index 72f55e5c..dfbd57c6 100644 --- a/Appwrite/Models/OAuth2Paypal.cs +++ b/Appwrite/Models/OAuth2Paypal.cs @@ -37,10 +37,10 @@ string secretKey } public static OAuth2Paypal From(Dictionary map) => new OAuth2Paypal( - id: map["$id"].ToString(), - enabled: (bool)map["enabled"], - clientId: map["clientId"].ToString(), - secretKey: map["secretKey"].ToString() + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + enabled: (bool)(map.ContainsKey("enabled") ? map["enabled"] : false), + clientId: (map.ContainsKey("clientId") ? map["clientId"] : "").ToString(), + secretKey: (map.ContainsKey("secretKey") ? map["secretKey"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/OAuth2Podio.cs b/Appwrite/Models/OAuth2Podio.cs index b7b8d918..1e165d9f 100644 --- a/Appwrite/Models/OAuth2Podio.cs +++ b/Appwrite/Models/OAuth2Podio.cs @@ -37,10 +37,10 @@ string clientSecret } public static OAuth2Podio From(Dictionary map) => new OAuth2Podio( - id: map["$id"].ToString(), - enabled: (bool)map["enabled"], - clientId: map["clientId"].ToString(), - clientSecret: map["clientSecret"].ToString() + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + enabled: (bool)(map.ContainsKey("enabled") ? map["enabled"] : false), + clientId: (map.ContainsKey("clientId") ? map["clientId"] : "").ToString(), + clientSecret: (map.ContainsKey("clientSecret") ? map["clientSecret"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/OAuth2ProviderList.cs b/Appwrite/Models/OAuth2ProviderList.cs index 583ba5cc..b6b1d35c 100644 --- a/Appwrite/Models/OAuth2ProviderList.cs +++ b/Appwrite/Models/OAuth2ProviderList.cs @@ -27,7 +27,7 @@ List providers } public static OAuth2ProviderList From(Dictionary map) => new OAuth2ProviderList( - total: Convert.ToInt64(map["total"]), + total: Convert.ToInt64((map.ContainsKey("total") ? map["total"] : 0)), providers: map["providers"].ConvertToList() ); diff --git a/Appwrite/Models/OAuth2Resend.cs b/Appwrite/Models/OAuth2Resend.cs index 8192e277..9048d3e6 100644 --- a/Appwrite/Models/OAuth2Resend.cs +++ b/Appwrite/Models/OAuth2Resend.cs @@ -37,10 +37,10 @@ string clientSecret } public static OAuth2Resend From(Dictionary map) => new OAuth2Resend( - id: map["$id"].ToString(), - enabled: (bool)map["enabled"], - clientId: map["clientId"].ToString(), - clientSecret: map["clientSecret"].ToString() + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + enabled: (bool)(map.ContainsKey("enabled") ? map["enabled"] : false), + clientId: (map.ContainsKey("clientId") ? map["clientId"] : "").ToString(), + clientSecret: (map.ContainsKey("clientSecret") ? map["clientSecret"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/OAuth2Salesforce.cs b/Appwrite/Models/OAuth2Salesforce.cs index f7e87976..9a49dcd2 100644 --- a/Appwrite/Models/OAuth2Salesforce.cs +++ b/Appwrite/Models/OAuth2Salesforce.cs @@ -23,24 +23,30 @@ public class OAuth2Salesforce [JsonPropertyName("customerSecret")] public string CustomerSecret { get; private set; } + [JsonPropertyName("prompt")] + public List Prompt { get; private set; } + public OAuth2Salesforce( string id, bool enabled, string customerKey, - string customerSecret + string customerSecret, + List prompt ) { Id = id; Enabled = enabled; CustomerKey = customerKey; CustomerSecret = customerSecret; + Prompt = prompt; } public static OAuth2Salesforce From(Dictionary map) => new OAuth2Salesforce( - id: map["$id"].ToString(), - enabled: (bool)map["enabled"], - customerKey: map["customerKey"].ToString(), - customerSecret: map["customerSecret"].ToString() + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + enabled: (bool)(map.ContainsKey("enabled") ? map["enabled"] : false), + customerKey: (map.ContainsKey("customerKey") ? map["customerKey"] : "").ToString(), + customerSecret: (map.ContainsKey("customerSecret") ? map["customerSecret"] : "").ToString(), + prompt: (map.ContainsKey("prompt") ? map["prompt"] : new List()).ConvertToList() ); public Dictionary ToMap() => new Dictionary() @@ -48,7 +54,8 @@ string customerSecret { "$id", Id }, { "enabled", Enabled }, { "customerKey", CustomerKey }, - { "customerSecret", CustomerSecret } + { "customerSecret", CustomerSecret }, + { "prompt", Prompt.Select(it => it.Value).ToList() } }; } } diff --git a/Appwrite/Models/OAuth2Slack.cs b/Appwrite/Models/OAuth2Slack.cs index 7c331b6d..6b840dc5 100644 --- a/Appwrite/Models/OAuth2Slack.cs +++ b/Appwrite/Models/OAuth2Slack.cs @@ -37,10 +37,10 @@ string clientSecret } public static OAuth2Slack From(Dictionary map) => new OAuth2Slack( - id: map["$id"].ToString(), - enabled: (bool)map["enabled"], - clientId: map["clientId"].ToString(), - clientSecret: map["clientSecret"].ToString() + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + enabled: (bool)(map.ContainsKey("enabled") ? map["enabled"] : false), + clientId: (map.ContainsKey("clientId") ? map["clientId"] : "").ToString(), + clientSecret: (map.ContainsKey("clientSecret") ? map["clientSecret"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/OAuth2Spotify.cs b/Appwrite/Models/OAuth2Spotify.cs index 113d4d62..069b5270 100644 --- a/Appwrite/Models/OAuth2Spotify.cs +++ b/Appwrite/Models/OAuth2Spotify.cs @@ -37,10 +37,10 @@ string clientSecret } public static OAuth2Spotify From(Dictionary map) => new OAuth2Spotify( - id: map["$id"].ToString(), - enabled: (bool)map["enabled"], - clientId: map["clientId"].ToString(), - clientSecret: map["clientSecret"].ToString() + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + enabled: (bool)(map.ContainsKey("enabled") ? map["enabled"] : false), + clientId: (map.ContainsKey("clientId") ? map["clientId"] : "").ToString(), + clientSecret: (map.ContainsKey("clientSecret") ? map["clientSecret"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/OAuth2Stripe.cs b/Appwrite/Models/OAuth2Stripe.cs index d8d16587..e72bb313 100644 --- a/Appwrite/Models/OAuth2Stripe.cs +++ b/Appwrite/Models/OAuth2Stripe.cs @@ -37,10 +37,10 @@ string apiSecretKey } public static OAuth2Stripe From(Dictionary map) => new OAuth2Stripe( - id: map["$id"].ToString(), - enabled: (bool)map["enabled"], - clientId: map["clientId"].ToString(), - apiSecretKey: map["apiSecretKey"].ToString() + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + enabled: (bool)(map.ContainsKey("enabled") ? map["enabled"] : false), + clientId: (map.ContainsKey("clientId") ? map["clientId"] : "").ToString(), + apiSecretKey: (map.ContainsKey("apiSecretKey") ? map["apiSecretKey"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/OAuth2TikTok.cs b/Appwrite/Models/OAuth2TikTok.cs new file mode 100644 index 00000000..5a48c0f8 --- /dev/null +++ b/Appwrite/Models/OAuth2TikTok.cs @@ -0,0 +1,54 @@ + +using System; +using System.Linq; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; +using Appwrite.Enums; +using Appwrite.Extensions; + +namespace Appwrite.Models +{ + public class OAuth2TikTok + { + [JsonPropertyName("$id")] + public string Id { get; private set; } + + [JsonPropertyName("enabled")] + public bool Enabled { get; private set; } + + [JsonPropertyName("clientId")] + public string ClientId { get; private set; } + + [JsonPropertyName("clientSecret")] + public string ClientSecret { get; private set; } + + public OAuth2TikTok( + string id, + bool enabled, + string clientId, + string clientSecret + ) + { + Id = id; + Enabled = enabled; + ClientId = clientId; + ClientSecret = clientSecret; + } + + public static OAuth2TikTok From(Dictionary map) => new OAuth2TikTok( + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + enabled: (bool)(map.ContainsKey("enabled") ? map["enabled"] : false), + clientId: (map.ContainsKey("clientId") ? map["clientId"] : "").ToString(), + clientSecret: (map.ContainsKey("clientSecret") ? map["clientSecret"] : "").ToString() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "$id", Id }, + { "enabled", Enabled }, + { "clientId", ClientId }, + { "clientSecret", ClientSecret } + }; + } +} diff --git a/Appwrite/Models/OAuth2Tradeshift.cs b/Appwrite/Models/OAuth2Tradeshift.cs index 73a54297..6047a088 100644 --- a/Appwrite/Models/OAuth2Tradeshift.cs +++ b/Appwrite/Models/OAuth2Tradeshift.cs @@ -37,10 +37,10 @@ string oauth2ClientSecret } public static OAuth2Tradeshift From(Dictionary map) => new OAuth2Tradeshift( - id: map["$id"].ToString(), - enabled: (bool)map["enabled"], - oauth2ClientId: map["oauth2ClientId"].ToString(), - oauth2ClientSecret: map["oauth2ClientSecret"].ToString() + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + enabled: (bool)(map.ContainsKey("enabled") ? map["enabled"] : false), + oauth2ClientId: (map.ContainsKey("oauth2ClientId") ? map["oauth2ClientId"] : "").ToString(), + oauth2ClientSecret: (map.ContainsKey("oauth2ClientSecret") ? map["oauth2ClientSecret"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/OAuth2Twitch.cs b/Appwrite/Models/OAuth2Twitch.cs index 73534fa3..ce80ce3c 100644 --- a/Appwrite/Models/OAuth2Twitch.cs +++ b/Appwrite/Models/OAuth2Twitch.cs @@ -37,10 +37,10 @@ string clientSecret } public static OAuth2Twitch From(Dictionary map) => new OAuth2Twitch( - id: map["$id"].ToString(), - enabled: (bool)map["enabled"], - clientId: map["clientId"].ToString(), - clientSecret: map["clientSecret"].ToString() + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + enabled: (bool)(map.ContainsKey("enabled") ? map["enabled"] : false), + clientId: (map.ContainsKey("clientId") ? map["clientId"] : "").ToString(), + clientSecret: (map.ContainsKey("clientSecret") ? map["clientSecret"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/OAuth2Webflow.cs b/Appwrite/Models/OAuth2Webflow.cs new file mode 100644 index 00000000..2d3c689b --- /dev/null +++ b/Appwrite/Models/OAuth2Webflow.cs @@ -0,0 +1,54 @@ + +using System; +using System.Linq; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; +using Appwrite.Enums; +using Appwrite.Extensions; + +namespace Appwrite.Models +{ + public class OAuth2Webflow + { + [JsonPropertyName("$id")] + public string Id { get; private set; } + + [JsonPropertyName("enabled")] + public bool Enabled { get; private set; } + + [JsonPropertyName("clientId")] + public string ClientId { get; private set; } + + [JsonPropertyName("clientSecret")] + public string ClientSecret { get; private set; } + + public OAuth2Webflow( + string id, + bool enabled, + string clientId, + string clientSecret + ) + { + Id = id; + Enabled = enabled; + ClientId = clientId; + ClientSecret = clientSecret; + } + + public static OAuth2Webflow From(Dictionary map) => new OAuth2Webflow( + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + enabled: (bool)(map.ContainsKey("enabled") ? map["enabled"] : false), + clientId: (map.ContainsKey("clientId") ? map["clientId"] : "").ToString(), + clientSecret: (map.ContainsKey("clientSecret") ? map["clientSecret"] : "").ToString() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "$id", Id }, + { "enabled", Enabled }, + { "clientId", ClientId }, + { "clientSecret", ClientSecret } + }; + } +} diff --git a/Appwrite/Models/OAuth2WordPress.cs b/Appwrite/Models/OAuth2WordPress.cs index c9c11063..efc42818 100644 --- a/Appwrite/Models/OAuth2WordPress.cs +++ b/Appwrite/Models/OAuth2WordPress.cs @@ -37,10 +37,10 @@ string clientSecret } public static OAuth2WordPress From(Dictionary map) => new OAuth2WordPress( - id: map["$id"].ToString(), - enabled: (bool)map["enabled"], - clientId: map["clientId"].ToString(), - clientSecret: map["clientSecret"].ToString() + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + enabled: (bool)(map.ContainsKey("enabled") ? map["enabled"] : false), + clientId: (map.ContainsKey("clientId") ? map["clientId"] : "").ToString(), + clientSecret: (map.ContainsKey("clientSecret") ? map["clientSecret"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/OAuth2X.cs b/Appwrite/Models/OAuth2X.cs index a8381565..242ff41f 100644 --- a/Appwrite/Models/OAuth2X.cs +++ b/Appwrite/Models/OAuth2X.cs @@ -37,10 +37,10 @@ string secretKey } public static OAuth2X From(Dictionary map) => new OAuth2X( - id: map["$id"].ToString(), - enabled: (bool)map["enabled"], - customerKey: map["customerKey"].ToString(), - secretKey: map["secretKey"].ToString() + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + enabled: (bool)(map.ContainsKey("enabled") ? map["enabled"] : false), + customerKey: (map.ContainsKey("customerKey") ? map["customerKey"] : "").ToString(), + secretKey: (map.ContainsKey("secretKey") ? map["secretKey"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/OAuth2Yahoo.cs b/Appwrite/Models/OAuth2Yahoo.cs index ba262544..5fdd9e43 100644 --- a/Appwrite/Models/OAuth2Yahoo.cs +++ b/Appwrite/Models/OAuth2Yahoo.cs @@ -37,10 +37,10 @@ string clientSecret } public static OAuth2Yahoo From(Dictionary map) => new OAuth2Yahoo( - id: map["$id"].ToString(), - enabled: (bool)map["enabled"], - clientId: map["clientId"].ToString(), - clientSecret: map["clientSecret"].ToString() + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + enabled: (bool)(map.ContainsKey("enabled") ? map["enabled"] : false), + clientId: (map.ContainsKey("clientId") ? map["clientId"] : "").ToString(), + clientSecret: (map.ContainsKey("clientSecret") ? map["clientSecret"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/OAuth2Yandex.cs b/Appwrite/Models/OAuth2Yandex.cs index fc73115a..505df499 100644 --- a/Appwrite/Models/OAuth2Yandex.cs +++ b/Appwrite/Models/OAuth2Yandex.cs @@ -37,10 +37,10 @@ string clientSecret } public static OAuth2Yandex From(Dictionary map) => new OAuth2Yandex( - id: map["$id"].ToString(), - enabled: (bool)map["enabled"], - clientId: map["clientId"].ToString(), - clientSecret: map["clientSecret"].ToString() + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + enabled: (bool)(map.ContainsKey("enabled") ? map["enabled"] : false), + clientId: (map.ContainsKey("clientId") ? map["clientId"] : "").ToString(), + clientSecret: (map.ContainsKey("clientSecret") ? map["clientSecret"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/OAuth2Zoho.cs b/Appwrite/Models/OAuth2Zoho.cs index 97f981ba..ea6bfaff 100644 --- a/Appwrite/Models/OAuth2Zoho.cs +++ b/Appwrite/Models/OAuth2Zoho.cs @@ -23,24 +23,30 @@ public class OAuth2Zoho [JsonPropertyName("clientSecret")] public string ClientSecret { get; private set; } + [JsonPropertyName("prompt")] + public List Prompt { get; private set; } + public OAuth2Zoho( string id, bool enabled, string clientId, - string clientSecret + string clientSecret, + List prompt ) { Id = id; Enabled = enabled; ClientId = clientId; ClientSecret = clientSecret; + Prompt = prompt; } public static OAuth2Zoho From(Dictionary map) => new OAuth2Zoho( - id: map["$id"].ToString(), - enabled: (bool)map["enabled"], - clientId: map["clientId"].ToString(), - clientSecret: map["clientSecret"].ToString() + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + enabled: (bool)(map.ContainsKey("enabled") ? map["enabled"] : false), + clientId: (map.ContainsKey("clientId") ? map["clientId"] : "").ToString(), + clientSecret: (map.ContainsKey("clientSecret") ? map["clientSecret"] : "").ToString(), + prompt: (map.ContainsKey("prompt") ? map["prompt"] : new List()).ConvertToList() ); public Dictionary ToMap() => new Dictionary() @@ -48,7 +54,8 @@ string clientSecret { "$id", Id }, { "enabled", Enabled }, { "clientId", ClientId }, - { "clientSecret", ClientSecret } + { "clientSecret", ClientSecret }, + { "prompt", Prompt.Select(it => it.Value).ToList() } }; } } diff --git a/Appwrite/Models/OAuth2Zoom.cs b/Appwrite/Models/OAuth2Zoom.cs index 578db8cf..ecf51be1 100644 --- a/Appwrite/Models/OAuth2Zoom.cs +++ b/Appwrite/Models/OAuth2Zoom.cs @@ -37,10 +37,10 @@ string clientSecret } public static OAuth2Zoom From(Dictionary map) => new OAuth2Zoom( - id: map["$id"].ToString(), - enabled: (bool)map["enabled"], - clientId: map["clientId"].ToString(), - clientSecret: map["clientSecret"].ToString() + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + enabled: (bool)(map.ContainsKey("enabled") ? map["enabled"] : false), + clientId: (map.ContainsKey("clientId") ? map["clientId"] : "").ToString(), + clientSecret: (map.ContainsKey("clientSecret") ? map["clientSecret"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/Oauth2Approve.cs b/Appwrite/Models/Oauth2Approve.cs index cbcd97db..16716984 100644 --- a/Appwrite/Models/Oauth2Approve.cs +++ b/Appwrite/Models/Oauth2Approve.cs @@ -22,7 +22,7 @@ string redirectUrl } public static Oauth2Approve From(Dictionary map) => new Oauth2Approve( - redirectUrl: map["redirectUrl"].ToString() + redirectUrl: (map.ContainsKey("redirectUrl") ? map["redirectUrl"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/Oauth2Authorize.cs b/Appwrite/Models/Oauth2Authorize.cs index 6ce3913c..ba8e9a58 100644 --- a/Appwrite/Models/Oauth2Authorize.cs +++ b/Appwrite/Models/Oauth2Authorize.cs @@ -27,8 +27,8 @@ string redirectUrl } public static Oauth2Authorize From(Dictionary map) => new Oauth2Authorize( - grantId: map["grantId"].ToString(), - redirectUrl: map["redirectUrl"].ToString() + grantId: (map.ContainsKey("grantId") ? map["grantId"] : "").ToString(), + redirectUrl: (map.ContainsKey("redirectUrl") ? map["redirectUrl"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/Oauth2Consent.cs b/Appwrite/Models/Oauth2Consent.cs index 86c338b4..913c114c 100644 --- a/Appwrite/Models/Oauth2Consent.cs +++ b/Appwrite/Models/Oauth2Consent.cs @@ -67,16 +67,16 @@ string expire } public static Oauth2Consent From(Dictionary map) => new Oauth2Consent( - id: map["$id"].ToString(), - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), - userId: map["userId"].ToString(), - appId: map["appId"].ToString(), - cimdUrl: map["cimdUrl"].ToString(), - scopes: map["scopes"].ConvertToList(), - resources: map["resources"].ConvertToList(), - authorizationDetails: map["authorizationDetails"].ToString(), - expire: map["expire"].ToString() + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), + userId: (map.ContainsKey("userId") ? map["userId"] : "").ToString(), + appId: (map.ContainsKey("appId") ? map["appId"] : "").ToString(), + cimdUrl: (map.ContainsKey("cimdUrl") ? map["cimdUrl"] : "").ToString(), + scopes: (map.ContainsKey("scopes") ? map["scopes"] : new List()).ConvertToList(), + resources: (map.ContainsKey("resources") ? map["resources"] : new List()).ConvertToList(), + authorizationDetails: (map.ContainsKey("authorizationDetails") ? map["authorizationDetails"] : "[]").ToString(), + expire: (map.ContainsKey("expire") ? map["expire"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/Oauth2ConsentList.cs b/Appwrite/Models/Oauth2ConsentList.cs index cdeef9ff..6d39df93 100644 --- a/Appwrite/Models/Oauth2ConsentList.cs +++ b/Appwrite/Models/Oauth2ConsentList.cs @@ -27,7 +27,7 @@ List consents } public static Oauth2ConsentList From(Dictionary map) => new Oauth2ConsentList( - total: Convert.ToInt64(map["total"]), + total: Convert.ToInt64((map.ContainsKey("total") ? map["total"] : 0)), consents: map["consents"].ConvertToList>().Select(it => Appwrite.Models.Oauth2Consent.From(map: it)).ToList() ); diff --git a/Appwrite/Models/Oauth2ConsentToken.cs b/Appwrite/Models/Oauth2ConsentToken.cs index 40abe8da..8f7e7438 100644 --- a/Appwrite/Models/Oauth2ConsentToken.cs +++ b/Appwrite/Models/Oauth2ConsentToken.cs @@ -72,17 +72,17 @@ string expire } public static Oauth2ConsentToken From(Dictionary map) => new Oauth2ConsentToken( - id: map["$id"].ToString(), - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), - consentId: map["consentId"].ToString(), - userId: map["userId"].ToString(), - appId: map["appId"].ToString(), - cimdUrl: map["cimdUrl"].ToString(), - scopes: map["scopes"].ConvertToList(), - resources: map["resources"].ConvertToList(), - authorizationDetails: map["authorizationDetails"].ToString(), - expire: map["expire"].ToString() + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), + consentId: (map.ContainsKey("consentId") ? map["consentId"] : "").ToString(), + userId: (map.ContainsKey("userId") ? map["userId"] : "").ToString(), + appId: (map.ContainsKey("appId") ? map["appId"] : "").ToString(), + cimdUrl: (map.ContainsKey("cimdUrl") ? map["cimdUrl"] : "").ToString(), + scopes: (map.ContainsKey("scopes") ? map["scopes"] : new List()).ConvertToList(), + resources: (map.ContainsKey("resources") ? map["resources"] : new List()).ConvertToList(), + authorizationDetails: (map.ContainsKey("authorizationDetails") ? map["authorizationDetails"] : "[]").ToString(), + expire: (map.ContainsKey("expire") ? map["expire"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/Oauth2ConsentTokenList.cs b/Appwrite/Models/Oauth2ConsentTokenList.cs index 87703e57..8010d4b3 100644 --- a/Appwrite/Models/Oauth2ConsentTokenList.cs +++ b/Appwrite/Models/Oauth2ConsentTokenList.cs @@ -27,7 +27,7 @@ List tokens } public static Oauth2ConsentTokenList From(Dictionary map) => new Oauth2ConsentTokenList( - total: Convert.ToInt64(map["total"]), + total: Convert.ToInt64((map.ContainsKey("total") ? map["total"] : 0)), tokens: map["tokens"].ConvertToList>().Select(it => Appwrite.Models.Oauth2ConsentToken.From(map: it)).ToList() ); diff --git a/Appwrite/Models/Oauth2DeviceAuthorization.cs b/Appwrite/Models/Oauth2DeviceAuthorization.cs index 78c9631f..c6c79b4d 100644 --- a/Appwrite/Models/Oauth2DeviceAuthorization.cs +++ b/Appwrite/Models/Oauth2DeviceAuthorization.cs @@ -47,12 +47,12 @@ long interval } public static Oauth2DeviceAuthorization From(Dictionary map) => new Oauth2DeviceAuthorization( - deviceCode: map["device_code"].ToString(), - userCode: map["user_code"].ToString(), - verificationUri: map["verification_uri"].ToString(), - verificationUriComplete: map["verification_uri_complete"].ToString(), - expiresIn: Convert.ToInt64(map["expires_in"]), - interval: Convert.ToInt64(map["interval"]) + deviceCode: (map.ContainsKey("device_code") ? map["device_code"] : "").ToString(), + userCode: (map.ContainsKey("user_code") ? map["user_code"] : "").ToString(), + verificationUri: (map.ContainsKey("verification_uri") ? map["verification_uri"] : "").ToString(), + verificationUriComplete: (map.ContainsKey("verification_uri_complete") ? map["verification_uri_complete"] : "").ToString(), + expiresIn: Convert.ToInt64((map.ContainsKey("expires_in") ? map["expires_in"] : 0)), + interval: Convert.ToInt64((map.ContainsKey("interval") ? map["interval"] : 0)) ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/Oauth2Grant.cs b/Appwrite/Models/Oauth2Grant.cs index 8b3e074e..fc55d471 100644 --- a/Appwrite/Models/Oauth2Grant.cs +++ b/Appwrite/Models/Oauth2Grant.cs @@ -77,18 +77,18 @@ string expire } public static Oauth2Grant From(Dictionary map) => new Oauth2Grant( - id: map["$id"].ToString(), - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), - userId: map["userId"].ToString(), - appId: map["appId"].ToString(), - scopes: map["scopes"].ConvertToList(), - resources: map["resources"].ConvertToList(), - authorizationDetails: map["authorizationDetails"].ToString(), - prompt: map["prompt"].ToString(), - redirectUri: map["redirectUri"].ToString(), - authTime: Convert.ToInt64(map["authTime"]), - expire: map["expire"].ToString() + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), + userId: (map.ContainsKey("userId") ? map["userId"] : "").ToString(), + appId: (map.ContainsKey("appId") ? map["appId"] : "").ToString(), + scopes: (map.ContainsKey("scopes") ? map["scopes"] : new List()).ConvertToList(), + resources: (map.ContainsKey("resources") ? map["resources"] : new List()).ConvertToList(), + authorizationDetails: (map.ContainsKey("authorizationDetails") ? map["authorizationDetails"] : "[]").ToString(), + prompt: (map.ContainsKey("prompt") ? map["prompt"] : "").ToString(), + redirectUri: (map.ContainsKey("redirectUri") ? map["redirectUri"] : "").ToString(), + authTime: Convert.ToInt64((map.ContainsKey("authTime") ? map["authTime"] : 0)), + expire: (map.ContainsKey("expire") ? map["expire"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/Oauth2Introspection.cs b/Appwrite/Models/Oauth2Introspection.cs new file mode 100644 index 00000000..fe40478a --- /dev/null +++ b/Appwrite/Models/Oauth2Introspection.cs @@ -0,0 +1,118 @@ + +using System; +using System.Linq; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; +using Appwrite.Enums; +using Appwrite.Extensions; + +namespace Appwrite.Models +{ + public class Oauth2Introspection + { + [JsonPropertyName("active")] + public bool Active { get; private set; } + + [JsonPropertyName("token_use")] + public string? TokenUse { get; private set; } + + [JsonPropertyName("token_type")] + public string? TokenType { get; private set; } + + [JsonPropertyName("scope")] + public string? Scope { get; private set; } + + [JsonPropertyName("client_id")] + public string? ClientId { get; private set; } + + [JsonPropertyName("sub")] + public string? Sub { get; private set; } + + [JsonPropertyName("aud")] + public List? Aud { get; private set; } + + [JsonPropertyName("iss")] + public string? Iss { get; private set; } + + [JsonPropertyName("exp")] + public long? Exp { get; private set; } + + [JsonPropertyName("iat")] + public long? Iat { get; private set; } + + [JsonPropertyName("jti")] + public string? Jti { get; private set; } + + [JsonPropertyName("authorization_details")] + public List? AuthorizationDetails { get; private set; } + + public Oauth2Introspection( + bool active, + string? tokenUse, + string? tokenType, + string? scope, + string? clientId, + string? sub, + List? aud, + string? iss, + long? exp, + long? iat, + string? jti, + List? authorizationDetails + ) + { + Active = active; + TokenUse = tokenUse; + TokenType = tokenType; + Scope = scope; + ClientId = clientId; + Sub = sub; + Aud = aud; + Iss = iss; + Exp = exp; + Iat = iat; + Jti = jti; + AuthorizationDetails = authorizationDetails; + } + + public static Oauth2Introspection From(Dictionary map) => new Oauth2Introspection( + active: (bool)(map.ContainsKey("active") ? map["active"] : false), + tokenUse: map.TryGetValue("token_use", out var tokenUse) ? tokenUse?.ToString() : null, + tokenType: map.TryGetValue("token_type", out var tokenType) ? tokenType?.ToString() : null, + scope: map.TryGetValue("scope", out var scope) ? scope?.ToString() : null, + clientId: map.TryGetValue("client_id", out var clientId) ? clientId?.ToString() : null, + sub: map.TryGetValue("sub", out var sub) ? sub?.ToString() : null, + aud: map.TryGetValue("aud", out var arrayRaw7) && arrayRaw7 != null + ? arrayRaw7.ConvertToList() + : null, + iss: map.TryGetValue("iss", out var iss) ? iss?.ToString() : null, + exp: map.TryGetValue("exp", out var numberRaw9) && numberRaw9 != null + ? Convert.ToInt64(numberRaw9) + : null, + iat: map.TryGetValue("iat", out var numberRaw10) && numberRaw10 != null + ? Convert.ToInt64(numberRaw10) + : null, + jti: map.TryGetValue("jti", out var jti) ? jti?.ToString() : null, + authorizationDetails: map.TryGetValue("authorization_details", out var arrayRaw12) && arrayRaw12 != null + ? arrayRaw12.ConvertToList() + : null + ); + + public Dictionary ToMap() => new Dictionary() + { + { "active", Active }, + { "token_use", TokenUse }, + { "token_type", TokenType }, + { "scope", Scope }, + { "client_id", ClientId }, + { "sub", Sub }, + { "aud", Aud }, + { "iss", Iss }, + { "exp", Exp }, + { "iat", Iat }, + { "jti", Jti }, + { "authorization_details", AuthorizationDetails } + }; + } +} diff --git a/Appwrite/Models/Oauth2Organization.cs b/Appwrite/Models/Oauth2Organization.cs index 60c5e10f..cf2acca1 100644 --- a/Appwrite/Models/Oauth2Organization.cs +++ b/Appwrite/Models/Oauth2Organization.cs @@ -22,7 +22,7 @@ string id } public static Oauth2Organization From(Dictionary map) => new Oauth2Organization( - id: map["$id"].ToString() + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/Oauth2OrganizationList.cs b/Appwrite/Models/Oauth2OrganizationList.cs index d2db18c1..68458a56 100644 --- a/Appwrite/Models/Oauth2OrganizationList.cs +++ b/Appwrite/Models/Oauth2OrganizationList.cs @@ -27,7 +27,7 @@ List organizations } public static Oauth2OrganizationList From(Dictionary map) => new Oauth2OrganizationList( - total: Convert.ToInt64(map["total"]), + total: Convert.ToInt64((map.ContainsKey("total") ? map["total"] : 0)), organizations: map["organizations"].ConvertToList>().Select(it => Appwrite.Models.Oauth2Organization.From(map: it)).ToList() ); diff --git a/Appwrite/Models/Oauth2PAR.cs b/Appwrite/Models/Oauth2PAR.cs index 08e630c3..98388370 100644 --- a/Appwrite/Models/Oauth2PAR.cs +++ b/Appwrite/Models/Oauth2PAR.cs @@ -27,8 +27,8 @@ long expiresIn } public static Oauth2PAR From(Dictionary map) => new Oauth2PAR( - requestUri: map["request_uri"].ToString(), - expiresIn: Convert.ToInt64(map["expires_in"]) + requestUri: (map.ContainsKey("request_uri") ? map["request_uri"] : "").ToString(), + expiresIn: Convert.ToInt64((map.ContainsKey("expires_in") ? map["expires_in"] : 0)) ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/Oauth2Project.cs b/Appwrite/Models/Oauth2Project.cs index 7378f28f..9b7e9a14 100644 --- a/Appwrite/Models/Oauth2Project.cs +++ b/Appwrite/Models/Oauth2Project.cs @@ -32,9 +32,9 @@ string endpoint } public static Oauth2Project From(Dictionary map) => new Oauth2Project( - id: map["$id"].ToString(), - region: map["region"].ToString(), - endpoint: map["endpoint"].ToString() + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + region: (map.ContainsKey("region") ? map["region"] : "").ToString(), + endpoint: (map.ContainsKey("endpoint") ? map["endpoint"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/Oauth2ProjectList.cs b/Appwrite/Models/Oauth2ProjectList.cs index 91c24435..75de021f 100644 --- a/Appwrite/Models/Oauth2ProjectList.cs +++ b/Appwrite/Models/Oauth2ProjectList.cs @@ -27,7 +27,7 @@ List projects } public static Oauth2ProjectList From(Dictionary map) => new Oauth2ProjectList( - total: Convert.ToInt64(map["total"]), + total: Convert.ToInt64((map.ContainsKey("total") ? map["total"] : 0)), projects: map["projects"].ConvertToList>().Select(it => Appwrite.Models.Oauth2Project.From(map: it)).ToList() ); diff --git a/Appwrite/Models/Oauth2Reject.cs b/Appwrite/Models/Oauth2Reject.cs index edc64a6e..f204a4dc 100644 --- a/Appwrite/Models/Oauth2Reject.cs +++ b/Appwrite/Models/Oauth2Reject.cs @@ -22,7 +22,7 @@ string redirectUrl } public static Oauth2Reject From(Dictionary map) => new Oauth2Reject( - redirectUrl: map["redirectUrl"].ToString() + redirectUrl: (map.ContainsKey("redirectUrl") ? map["redirectUrl"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/Oauth2Token.cs b/Appwrite/Models/Oauth2Token.cs index 3d18e113..108a6f39 100644 --- a/Appwrite/Models/Oauth2Token.cs +++ b/Appwrite/Models/Oauth2Token.cs @@ -52,11 +52,11 @@ public Oauth2Token( } public static Oauth2Token From(Dictionary map) => new Oauth2Token( - accessToken: map["access_token"].ToString(), - tokenType: map["token_type"].ToString(), - expiresIn: Convert.ToInt64(map["expires_in"]), - refreshToken: map["refresh_token"].ToString(), - scope: map["scope"].ToString(), + accessToken: (map.ContainsKey("access_token") ? map["access_token"] : "").ToString(), + tokenType: (map.ContainsKey("token_type") ? map["token_type"] : "Bearer").ToString(), + expiresIn: Convert.ToInt64((map.ContainsKey("expires_in") ? map["expires_in"] : 0)), + refreshToken: (map.ContainsKey("refresh_token") ? map["refresh_token"] : "").ToString(), + scope: (map.ContainsKey("scope") ? map["scope"] : "").ToString(), authorizationDetails: map.TryGetValue("authorization_details", out var authorizationDetails) ? authorizationDetails?.ToString() : null, idToken: map.TryGetValue("id_token", out var idToken) ? idToken?.ToString() : null ); diff --git a/Appwrite/Models/Organization.cs b/Appwrite/Models/Organization.cs index 41ecc876..1727fc71 100644 --- a/Appwrite/Models/Organization.cs +++ b/Appwrite/Models/Organization.cs @@ -48,28 +48,28 @@ public class Organization public string BillingEmail { get; private set; } [JsonPropertyName("billingStartDate")] - public string BillingStartDate { get; private set; } + public string? BillingStartDate { get; private set; } [JsonPropertyName("billingCurrentInvoiceDate")] - public string BillingCurrentInvoiceDate { get; private set; } + public string? BillingCurrentInvoiceDate { get; private set; } [JsonPropertyName("billingNextInvoiceDate")] - public string BillingNextInvoiceDate { get; private set; } + public string? BillingNextInvoiceDate { get; private set; } [JsonPropertyName("billingTrialStartDate")] public string? BillingTrialStartDate { get; private set; } [JsonPropertyName("billingTrialDays")] - public long BillingTrialDays { get; private set; } + public long? BillingTrialDays { get; private set; } [JsonPropertyName("billingAggregationId")] - public string BillingAggregationId { get; private set; } + public string? BillingAggregationId { get; private set; } [JsonPropertyName("billingInvoiceId")] - public string BillingInvoiceId { get; private set; } + public string? BillingInvoiceId { get; private set; } [JsonPropertyName("paymentMethodId")] - public string PaymentMethodId { get; private set; } + public string? PaymentMethodId { get; private set; } [JsonPropertyName("billingAddressId")] public string? BillingAddressId { get; private set; } @@ -129,14 +129,14 @@ public Organization( string billingPlanId, BillingPlan billingPlanDetails, string billingEmail, - string billingStartDate, - string billingCurrentInvoiceDate, - string billingNextInvoiceDate, + string? billingStartDate, + string? billingCurrentInvoiceDate, + string? billingNextInvoiceDate, string? billingTrialStartDate, - long billingTrialDays, - string billingAggregationId, - string billingInvoiceId, - string paymentMethodId, + long? billingTrialDays, + string? billingAggregationId, + string? billingInvoiceId, + string? paymentMethodId, string? billingAddressId, string? backupPaymentMethodId, string status, @@ -192,31 +192,33 @@ List projects } public static Organization From(Dictionary map) => new Organization( - id: map["$id"].ToString(), - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), - name: map["name"].ToString(), - total: Convert.ToInt64(map["total"]), + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), + name: (map.ContainsKey("name") ? map["name"] : "").ToString(), + total: Convert.ToInt64((map.ContainsKey("total") ? map["total"] : 0)), prefs: Appwrite.Models.Preferences.From(map: map["prefs"] is JsonElement jsonObj6 ? jsonObj6.Deserialize>()! : (Dictionary)map["prefs"]), billingBudget: map.TryGetValue("billingBudget", out var numberRaw7) && numberRaw7 != null ? Convert.ToInt64(numberRaw7) : null, - budgetAlerts: map["budgetAlerts"].ConvertToList(), - billingPlan: map["billingPlan"].ToString(), - billingPlanId: map["billingPlanId"].ToString(), + budgetAlerts: (map.ContainsKey("budgetAlerts") ? map["budgetAlerts"] : new List { 75 }).ConvertToList(), + billingPlan: (map.ContainsKey("billingPlan") ? map["billingPlan"] : "tier-0").ToString(), + billingPlanId: (map.ContainsKey("billingPlanId") ? map["billingPlanId"] : "tier-0").ToString(), billingPlanDetails: Appwrite.Models.BillingPlan.From(map: map["billingPlanDetails"] is JsonElement jsonObj11 ? jsonObj11.Deserialize>()! : (Dictionary)map["billingPlanDetails"]), - billingEmail: map["billingEmail"].ToString(), - billingStartDate: map["billingStartDate"].ToString(), - billingCurrentInvoiceDate: map["billingCurrentInvoiceDate"].ToString(), - billingNextInvoiceDate: map["billingNextInvoiceDate"].ToString(), + billingEmail: (map.ContainsKey("billingEmail") ? map["billingEmail"] : "").ToString(), + billingStartDate: map.TryGetValue("billingStartDate", out var billingStartDate) ? billingStartDate?.ToString() : null, + billingCurrentInvoiceDate: map.TryGetValue("billingCurrentInvoiceDate", out var billingCurrentInvoiceDate) ? billingCurrentInvoiceDate?.ToString() : null, + billingNextInvoiceDate: map.TryGetValue("billingNextInvoiceDate", out var billingNextInvoiceDate) ? billingNextInvoiceDate?.ToString() : null, billingTrialStartDate: map.TryGetValue("billingTrialStartDate", out var billingTrialStartDate) ? billingTrialStartDate?.ToString() : null, - billingTrialDays: Convert.ToInt64(map["billingTrialDays"]), - billingAggregationId: map["billingAggregationId"].ToString(), - billingInvoiceId: map["billingInvoiceId"].ToString(), - paymentMethodId: map["paymentMethodId"].ToString(), + billingTrialDays: map.TryGetValue("billingTrialDays", out var numberRaw17) && numberRaw17 != null + ? Convert.ToInt64(numberRaw17) + : null, + billingAggregationId: map.TryGetValue("billingAggregationId", out var billingAggregationId) ? billingAggregationId?.ToString() : null, + billingInvoiceId: map.TryGetValue("billingInvoiceId", out var billingInvoiceId) ? billingInvoiceId?.ToString() : null, + paymentMethodId: map.TryGetValue("paymentMethodId", out var paymentMethodId) ? paymentMethodId?.ToString() : null, billingAddressId: map.TryGetValue("billingAddressId", out var billingAddressId) ? billingAddressId?.ToString() : null, backupPaymentMethodId: map.TryGetValue("backupPaymentMethodId", out var backupPaymentMethodId) ? backupPaymentMethodId?.ToString() : null, - status: map["status"].ToString(), + status: (map.ContainsKey("status") ? map["status"] : "draft").ToString(), remarks: map.TryGetValue("remarks", out var remarks) ? remarks?.ToString() : null, agreementBAA: map.TryGetValue("agreementBAA", out var agreementBAA) ? agreementBAA?.ToString() : null, programManagerName: map.TryGetValue("programManagerName", out var programManagerName) ? programManagerName?.ToString() : null, @@ -228,9 +230,9 @@ List projects : null, billingPlanDowngrade: map.TryGetValue("billingPlanDowngrade", out var billingPlanDowngrade) ? billingPlanDowngrade?.ToString() : null, billingTaxId: map.TryGetValue("billingTaxId", out var billingTaxId) ? billingTaxId?.ToString() : null, - markedForDeletion: (bool)map["markedForDeletion"], - platform: map["platform"].ToString(), - projects: map["projects"].ConvertToList() + markedForDeletion: (bool)(map.ContainsKey("markedForDeletion") ? map["markedForDeletion"] : false), + platform: (map.ContainsKey("platform") ? map["platform"] : "appwrite").ToString(), + projects: (map.ContainsKey("projects") ? map["projects"] : new List()).ConvertToList() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/DevKey.cs b/Appwrite/Models/Passkey.cs similarity index 52% rename from Appwrite/Models/DevKey.cs rename to Appwrite/Models/Passkey.cs index 559a8b42..3eeea2dd 100644 --- a/Appwrite/Models/DevKey.cs +++ b/Appwrite/Models/Passkey.cs @@ -9,7 +9,7 @@ namespace Appwrite.Models { - public class DevKey + public class Passkey { [JsonPropertyName("$id")] public string Id { get; private set; } @@ -23,48 +23,30 @@ public class DevKey [JsonPropertyName("name")] public string Name { get; private set; } - [JsonPropertyName("expire")] - public string Expire { get; private set; } - - [JsonPropertyName("secret")] - public string Secret { get; private set; } - [JsonPropertyName("accessedAt")] public string AccessedAt { get; private set; } - [JsonPropertyName("sdks")] - public List Sdks { get; private set; } - - public DevKey( + public Passkey( string id, string createdAt, string updatedAt, string name, - string expire, - string secret, - string accessedAt, - List sdks + string accessedAt ) { Id = id; CreatedAt = createdAt; UpdatedAt = updatedAt; Name = name; - Expire = expire; - Secret = secret; AccessedAt = accessedAt; - Sdks = sdks; } - public static DevKey From(Dictionary map) => new DevKey( - id: map["$id"].ToString(), - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), - name: map["name"].ToString(), - expire: map["expire"].ToString(), - secret: map["secret"].ToString(), - accessedAt: map["accessedAt"].ToString(), - sdks: map["sdks"].ConvertToList() + public static Passkey From(Dictionary map) => new Passkey( + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), + name: (map.ContainsKey("name") ? map["name"] : "").ToString(), + accessedAt: (map.ContainsKey("accessedAt") ? map["accessedAt"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() @@ -73,10 +55,7 @@ List sdks { "$createdAt", CreatedAt }, { "$updatedAt", UpdatedAt }, { "name", Name }, - { "expire", Expire }, - { "secret", Secret }, - { "accessedAt", AccessedAt }, - { "sdks", Sdks } + { "accessedAt", AccessedAt } }; } } diff --git a/Appwrite/Models/PasskeyChallenge.cs b/Appwrite/Models/PasskeyChallenge.cs new file mode 100644 index 00000000..c6c61d35 --- /dev/null +++ b/Appwrite/Models/PasskeyChallenge.cs @@ -0,0 +1,61 @@ + +using System; +using System.Linq; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; +using Appwrite.Enums; +using Appwrite.Extensions; + +namespace Appwrite.Models +{ + public class PasskeyChallenge + { + [JsonPropertyName("$id")] + public string Id { get; private set; } + + [JsonPropertyName("$createdAt")] + public string CreatedAt { get; private set; } + + [JsonPropertyName("passkeyId")] + public string PasskeyId { get; private set; } + + [JsonPropertyName("expire")] + public string Expire { get; private set; } + + [JsonPropertyName("publicKey")] + public object PublicKey { get; private set; } + + public PasskeyChallenge( + string id, + string createdAt, + string passkeyId, + string expire, + object publicKey + ) + { + Id = id; + CreatedAt = createdAt; + PasskeyId = passkeyId; + Expire = expire; + PublicKey = publicKey; + } + + public static PasskeyChallenge From(Dictionary map) => new PasskeyChallenge( + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + passkeyId: (map.ContainsKey("passkeyId") ? map["passkeyId"] : "").ToString(), + expire: (map.ContainsKey("expire") ? map["expire"] : "").ToString(), + publicKey: (map.ContainsKey("publicKey") ? map["publicKey"] : new Dictionary()) + ); + + public Dictionary ToMap() => new Dictionary() + { + { "$id", Id }, + { "$createdAt", CreatedAt }, + { "passkeyId", PasskeyId }, + { "expire", Expire }, + { "publicKey", PublicKey } + }; + } +} diff --git a/Appwrite/Models/PasskeyList.cs b/Appwrite/Models/PasskeyList.cs new file mode 100644 index 00000000..d4bdced5 --- /dev/null +++ b/Appwrite/Models/PasskeyList.cs @@ -0,0 +1,40 @@ + +using System; +using System.Linq; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; +using Appwrite.Enums; +using Appwrite.Extensions; + +namespace Appwrite.Models +{ + public class PasskeyList + { + [JsonPropertyName("total")] + public long Total { get; private set; } + + [JsonPropertyName("passkeys")] + public List Passkeys { get; private set; } + + public PasskeyList( + long total, + List passkeys + ) + { + Total = total; + Passkeys = passkeys; + } + + public static PasskeyList From(Dictionary map) => new PasskeyList( + total: Convert.ToInt64((map.ContainsKey("total") ? map["total"] : 0)), + passkeys: map["passkeys"].ConvertToList>().Select(it => Appwrite.Models.Passkey.From(map: it)).ToList() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "total", Total }, + { "passkeys", Passkeys?.Select(it => it.ToMap()).ToList() } + }; + } +} diff --git a/Appwrite/Models/Phone.cs b/Appwrite/Models/Phone.cs index d0c327d3..5deacb80 100644 --- a/Appwrite/Models/Phone.cs +++ b/Appwrite/Models/Phone.cs @@ -32,9 +32,9 @@ string countryName } public static Phone From(Dictionary map) => new Phone( - code: map["code"].ToString(), - countryCode: map["countryCode"].ToString(), - countryName: map["countryName"].ToString() + code: (map.ContainsKey("code") ? map["code"] : "").ToString(), + countryCode: (map.ContainsKey("countryCode") ? map["countryCode"] : "").ToString(), + countryName: (map.ContainsKey("countryName") ? map["countryName"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/PhoneList.cs b/Appwrite/Models/PhoneList.cs index 44010bf8..75060342 100644 --- a/Appwrite/Models/PhoneList.cs +++ b/Appwrite/Models/PhoneList.cs @@ -27,7 +27,7 @@ List phones } public static PhoneList From(Dictionary map) => new PhoneList( - total: Convert.ToInt64(map["total"]), + total: Convert.ToInt64((map.ContainsKey("total") ? map["total"] : 0)), phones: map["phones"].ConvertToList>().Select(it => Appwrite.Models.Phone.From(map: it)).ToList() ); diff --git a/Appwrite/Models/PlatformAndroid.cs b/Appwrite/Models/PlatformAndroid.cs index e671a8c7..ecf67fa6 100644 --- a/Appwrite/Models/PlatformAndroid.cs +++ b/Appwrite/Models/PlatformAndroid.cs @@ -29,13 +29,17 @@ public class PlatformAndroid [JsonPropertyName("applicationId")] public string ApplicationId { get; private set; } + [JsonPropertyName("fingerprints")] + public List Fingerprints { get; private set; } + public PlatformAndroid( string id, string createdAt, string updatedAt, string name, Appwrite.Enums.PlatformType type, - string applicationId + string applicationId, + List fingerprints ) { Id = id; @@ -44,15 +48,17 @@ string applicationId Name = name; Type = type; ApplicationId = applicationId; + Fingerprints = fingerprints; } public static PlatformAndroid From(Dictionary map) => new PlatformAndroid( - id: map["$id"].ToString(), - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), - name: map["name"].ToString(), + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), + name: (map.ContainsKey("name") ? map["name"] : "").ToString(), type: new Appwrite.Enums.PlatformType(map["type"].ToString()!), - applicationId: map["applicationId"].ToString() + applicationId: (map.ContainsKey("applicationId") ? map["applicationId"] : "").ToString(), + fingerprints: (map.ContainsKey("fingerprints") ? map["fingerprints"] : new List()).ConvertToList() ); public Dictionary ToMap() => new Dictionary() @@ -62,7 +68,8 @@ string applicationId { "$updatedAt", UpdatedAt }, { "name", Name }, { "type", Type.Value }, - { "applicationId", ApplicationId } + { "applicationId", ApplicationId }, + { "fingerprints", Fingerprints } }; } } diff --git a/Appwrite/Models/PlatformApple.cs b/Appwrite/Models/PlatformApple.cs index 3e470808..c39d885b 100644 --- a/Appwrite/Models/PlatformApple.cs +++ b/Appwrite/Models/PlatformApple.cs @@ -47,12 +47,12 @@ string bundleIdentifier } public static PlatformApple From(Dictionary map) => new PlatformApple( - id: map["$id"].ToString(), - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), - name: map["name"].ToString(), + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), + name: (map.ContainsKey("name") ? map["name"] : "").ToString(), type: new Appwrite.Enums.PlatformType(map["type"].ToString()!), - bundleIdentifier: map["bundleIdentifier"].ToString() + bundleIdentifier: (map.ContainsKey("bundleIdentifier") ? map["bundleIdentifier"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/PlatformLinux.cs b/Appwrite/Models/PlatformLinux.cs index 7442840d..54f8e5c4 100644 --- a/Appwrite/Models/PlatformLinux.cs +++ b/Appwrite/Models/PlatformLinux.cs @@ -47,12 +47,12 @@ string packageName } public static PlatformLinux From(Dictionary map) => new PlatformLinux( - id: map["$id"].ToString(), - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), - name: map["name"].ToString(), + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), + name: (map.ContainsKey("name") ? map["name"] : "").ToString(), type: new Appwrite.Enums.PlatformType(map["type"].ToString()!), - packageName: map["packageName"].ToString() + packageName: (map.ContainsKey("packageName") ? map["packageName"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/PlatformList.cs b/Appwrite/Models/PlatformList.cs index 445e9d71..d3f69764 100644 --- a/Appwrite/Models/PlatformList.cs +++ b/Appwrite/Models/PlatformList.cs @@ -27,7 +27,7 @@ List platforms } public static PlatformList From(Dictionary map) => new PlatformList( - total: Convert.ToInt64(map["total"]), + total: Convert.ToInt64((map.ContainsKey("total") ? map["total"] : 0)), platforms: map["platforms"].ConvertToList() ); diff --git a/Appwrite/Models/PlatformWeb.cs b/Appwrite/Models/PlatformWeb.cs index 5d06a206..506c3e70 100644 --- a/Appwrite/Models/PlatformWeb.cs +++ b/Appwrite/Models/PlatformWeb.cs @@ -47,12 +47,12 @@ string hostname } public static PlatformWeb From(Dictionary map) => new PlatformWeb( - id: map["$id"].ToString(), - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), - name: map["name"].ToString(), + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), + name: (map.ContainsKey("name") ? map["name"] : "").ToString(), type: new Appwrite.Enums.PlatformType(map["type"].ToString()!), - hostname: map["hostname"].ToString() + hostname: (map.ContainsKey("hostname") ? map["hostname"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/PlatformWindows.cs b/Appwrite/Models/PlatformWindows.cs index 321f4d65..1bd4e632 100644 --- a/Appwrite/Models/PlatformWindows.cs +++ b/Appwrite/Models/PlatformWindows.cs @@ -47,12 +47,12 @@ string packageIdentifierName } public static PlatformWindows From(Dictionary map) => new PlatformWindows( - id: map["$id"].ToString(), - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), - name: map["name"].ToString(), + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), + name: (map.ContainsKey("name") ? map["name"] : "").ToString(), type: new Appwrite.Enums.PlatformType(map["type"].ToString()!), - packageIdentifierName: map["packageIdentifierName"].ToString() + packageIdentifierName: (map.ContainsKey("packageIdentifierName") ? map["packageIdentifierName"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/PolicyDenyAliasedEmail.cs b/Appwrite/Models/PolicyDenyAliasedEmail.cs index 4cd07ba8..ba1057e8 100644 --- a/Appwrite/Models/PolicyDenyAliasedEmail.cs +++ b/Appwrite/Models/PolicyDenyAliasedEmail.cs @@ -27,8 +27,8 @@ bool enabled } public static PolicyDenyAliasedEmail From(Dictionary map) => new PolicyDenyAliasedEmail( - id: map["$id"].ToString(), - enabled: (bool)map["enabled"] + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + enabled: (bool)(map.ContainsKey("enabled") ? map["enabled"] : false) ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/PolicyDenyCorporateEmail.cs b/Appwrite/Models/PolicyDenyCorporateEmail.cs index 1b0a257e..f22e5263 100644 --- a/Appwrite/Models/PolicyDenyCorporateEmail.cs +++ b/Appwrite/Models/PolicyDenyCorporateEmail.cs @@ -27,8 +27,8 @@ bool enabled } public static PolicyDenyCorporateEmail From(Dictionary map) => new PolicyDenyCorporateEmail( - id: map["$id"].ToString(), - enabled: (bool)map["enabled"] + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + enabled: (bool)(map.ContainsKey("enabled") ? map["enabled"] : false) ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/PolicyDenyDisposableEmail.cs b/Appwrite/Models/PolicyDenyDisposableEmail.cs index 20590725..03f4d477 100644 --- a/Appwrite/Models/PolicyDenyDisposableEmail.cs +++ b/Appwrite/Models/PolicyDenyDisposableEmail.cs @@ -27,8 +27,8 @@ bool enabled } public static PolicyDenyDisposableEmail From(Dictionary map) => new PolicyDenyDisposableEmail( - id: map["$id"].ToString(), - enabled: (bool)map["enabled"] + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + enabled: (bool)(map.ContainsKey("enabled") ? map["enabled"] : false) ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/PolicyDenyFreeEmail.cs b/Appwrite/Models/PolicyDenyFreeEmail.cs index 5be5e087..4d49f15f 100644 --- a/Appwrite/Models/PolicyDenyFreeEmail.cs +++ b/Appwrite/Models/PolicyDenyFreeEmail.cs @@ -27,8 +27,8 @@ bool enabled } public static PolicyDenyFreeEmail From(Dictionary map) => new PolicyDenyFreeEmail( - id: map["$id"].ToString(), - enabled: (bool)map["enabled"] + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + enabled: (bool)(map.ContainsKey("enabled") ? map["enabled"] : false) ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/PolicyList.cs b/Appwrite/Models/PolicyList.cs index 33445741..ad01acb8 100644 --- a/Appwrite/Models/PolicyList.cs +++ b/Appwrite/Models/PolicyList.cs @@ -27,7 +27,7 @@ List policies } public static PolicyList From(Dictionary map) => new PolicyList( - total: Convert.ToInt64(map["total"]), + total: Convert.ToInt64((map.ContainsKey("total") ? map["total"] : 0)), policies: map["policies"].ConvertToList() ); diff --git a/Appwrite/Models/PolicyMembershipPrivacy.cs b/Appwrite/Models/PolicyMembershipPrivacy.cs index 11eb044a..d4526852 100644 --- a/Appwrite/Models/PolicyMembershipPrivacy.cs +++ b/Appwrite/Models/PolicyMembershipPrivacy.cs @@ -52,13 +52,13 @@ bool userAccessedAt } public static PolicyMembershipPrivacy From(Dictionary map) => new PolicyMembershipPrivacy( - id: map["$id"].ToString(), - userId: (bool)map["userId"], - userEmail: (bool)map["userEmail"], - userPhone: (bool)map["userPhone"], - userName: (bool)map["userName"], - userMFA: (bool)map["userMFA"], - userAccessedAt: (bool)map["userAccessedAt"] + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + userId: (bool)(map.ContainsKey("userId") ? map["userId"] : false), + userEmail: (bool)(map.ContainsKey("userEmail") ? map["userEmail"] : false), + userPhone: (bool)(map.ContainsKey("userPhone") ? map["userPhone"] : false), + userName: (bool)(map.ContainsKey("userName") ? map["userName"] : false), + userMFA: (bool)(map.ContainsKey("userMFA") ? map["userMFA"] : false), + userAccessedAt: (bool)(map.ContainsKey("userAccessedAt") ? map["userAccessedAt"] : false) ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/PolicyMfaFactors.cs b/Appwrite/Models/PolicyMfaFactors.cs index 789e7c1b..9a92a3ef 100644 --- a/Appwrite/Models/PolicyMfaFactors.cs +++ b/Appwrite/Models/PolicyMfaFactors.cs @@ -42,11 +42,11 @@ bool custom } public static PolicyMfaFactors From(Dictionary map) => new PolicyMfaFactors( - id: map["$id"].ToString(), - totp: (bool)map["totp"], - email: (bool)map["email"], - phone: (bool)map["phone"], - custom: (bool)map["custom"] + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + totp: (bool)(map.ContainsKey("totp") ? map["totp"] : true), + email: (bool)(map.ContainsKey("email") ? map["email"] : true), + phone: (bool)(map.ContainsKey("phone") ? map["phone"] : true), + custom: (bool)(map.ContainsKey("custom") ? map["custom"] : false) ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/PolicyPasskey.cs b/Appwrite/Models/PolicyPasskey.cs new file mode 100644 index 00000000..919775c2 --- /dev/null +++ b/Appwrite/Models/PolicyPasskey.cs @@ -0,0 +1,47 @@ + +using System; +using System.Linq; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; +using Appwrite.Enums; +using Appwrite.Extensions; + +namespace Appwrite.Models +{ + public class PolicyPasskey + { + [JsonPropertyName("$id")] + public string Id { get; private set; } + + [JsonPropertyName("rpId")] + public string RpId { get; private set; } + + [JsonPropertyName("origins")] + public List Origins { get; private set; } + + public PolicyPasskey( + string id, + string rpId, + List origins + ) + { + Id = id; + RpId = rpId; + Origins = origins; + } + + public static PolicyPasskey From(Dictionary map) => new PolicyPasskey( + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + rpId: (map.ContainsKey("rpId") ? map["rpId"] : "").ToString(), + origins: (map.ContainsKey("origins") ? map["origins"] : new List()).ConvertToList() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "$id", Id }, + { "rpId", RpId }, + { "origins", Origins } + }; + } +} diff --git a/Appwrite/Models/PolicyPasswordDictionary.cs b/Appwrite/Models/PolicyPasswordDictionary.cs index 3b9a53ea..8c3eda1c 100644 --- a/Appwrite/Models/PolicyPasswordDictionary.cs +++ b/Appwrite/Models/PolicyPasswordDictionary.cs @@ -27,8 +27,8 @@ bool enabled } public static PolicyPasswordDictionary From(Dictionary map) => new PolicyPasswordDictionary( - id: map["$id"].ToString(), - enabled: (bool)map["enabled"] + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + enabled: (bool)(map.ContainsKey("enabled") ? map["enabled"] : false) ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/PolicyPasswordHistory.cs b/Appwrite/Models/PolicyPasswordHistory.cs index e0fb0d31..0655f9ca 100644 --- a/Appwrite/Models/PolicyPasswordHistory.cs +++ b/Appwrite/Models/PolicyPasswordHistory.cs @@ -27,8 +27,8 @@ long total } public static PolicyPasswordHistory From(Dictionary map) => new PolicyPasswordHistory( - id: map["$id"].ToString(), - total: Convert.ToInt64(map["total"]) + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + total: Convert.ToInt64((map.ContainsKey("total") ? map["total"] : 0)) ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/PolicyPasswordPersonalData.cs b/Appwrite/Models/PolicyPasswordPersonalData.cs index c4b50501..2cce441a 100644 --- a/Appwrite/Models/PolicyPasswordPersonalData.cs +++ b/Appwrite/Models/PolicyPasswordPersonalData.cs @@ -27,8 +27,8 @@ bool enabled } public static PolicyPasswordPersonalData From(Dictionary map) => new PolicyPasswordPersonalData( - id: map["$id"].ToString(), - enabled: (bool)map["enabled"] + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + enabled: (bool)(map.ContainsKey("enabled") ? map["enabled"] : false) ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/PolicyPasswordPwned.cs b/Appwrite/Models/PolicyPasswordPwned.cs new file mode 100644 index 00000000..205610fb --- /dev/null +++ b/Appwrite/Models/PolicyPasswordPwned.cs @@ -0,0 +1,54 @@ + +using System; +using System.Linq; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; +using Appwrite.Enums; +using Appwrite.Extensions; + +namespace Appwrite.Models +{ + public class PolicyPasswordPwned + { + [JsonPropertyName("$id")] + public string Id { get; private set; } + + [JsonPropertyName("enabled")] + public bool Enabled { get; private set; } + + [JsonPropertyName("sessions")] + public bool Sessions { get; private set; } + + [JsonPropertyName("users")] + public bool Users { get; private set; } + + public PolicyPasswordPwned( + string id, + bool enabled, + bool sessions, + bool users + ) + { + Id = id; + Enabled = enabled; + Sessions = sessions; + Users = users; + } + + public static PolicyPasswordPwned From(Dictionary map) => new PolicyPasswordPwned( + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + enabled: (bool)(map.ContainsKey("enabled") ? map["enabled"] : true), + sessions: (bool)(map.ContainsKey("sessions") ? map["sessions"] : false), + users: (bool)(map.ContainsKey("users") ? map["users"] : false) + ); + + public Dictionary ToMap() => new Dictionary() + { + { "$id", Id }, + { "enabled", Enabled }, + { "sessions", Sessions }, + { "users", Users } + }; + } +} diff --git a/Appwrite/Models/PolicyPasswordRotation.cs b/Appwrite/Models/PolicyPasswordRotation.cs new file mode 100644 index 00000000..42e07cfa --- /dev/null +++ b/Appwrite/Models/PolicyPasswordRotation.cs @@ -0,0 +1,47 @@ + +using System; +using System.Linq; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; +using Appwrite.Enums; +using Appwrite.Extensions; + +namespace Appwrite.Models +{ + public class PolicyPasswordRotation + { + [JsonPropertyName("$id")] + public string Id { get; private set; } + + [JsonPropertyName("enabled")] + public bool Enabled { get; private set; } + + [JsonPropertyName("maxAge")] + public long MaxAge { get; private set; } + + public PolicyPasswordRotation( + string id, + bool enabled, + long maxAge + ) + { + Id = id; + Enabled = enabled; + MaxAge = maxAge; + } + + public static PolicyPasswordRotation From(Dictionary map) => new PolicyPasswordRotation( + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + enabled: (bool)(map.ContainsKey("enabled") ? map["enabled"] : false), + maxAge: Convert.ToInt64((map.ContainsKey("maxAge") ? map["maxAge"] : 31536000)) + ); + + public Dictionary ToMap() => new Dictionary() + { + { "$id", Id }, + { "enabled", Enabled }, + { "maxAge", MaxAge } + }; + } +} diff --git a/Appwrite/Models/PolicyPasswordStrength.cs b/Appwrite/Models/PolicyPasswordStrength.cs index cec65dea..6a62622e 100644 --- a/Appwrite/Models/PolicyPasswordStrength.cs +++ b/Appwrite/Models/PolicyPasswordStrength.cs @@ -47,12 +47,12 @@ bool symbols } public static PolicyPasswordStrength From(Dictionary map) => new PolicyPasswordStrength( - id: map["$id"].ToString(), - min: Convert.ToInt64(map["min"]), - uppercase: (bool)map["uppercase"], - lowercase: (bool)map["lowercase"], - number: (bool)map["number"], - symbols: (bool)map["symbols"] + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + min: Convert.ToInt64((map.ContainsKey("min") ? map["min"] : 8)), + uppercase: (bool)(map.ContainsKey("uppercase") ? map["uppercase"] : false), + lowercase: (bool)(map.ContainsKey("lowercase") ? map["lowercase"] : false), + number: (bool)(map.ContainsKey("number") ? map["number"] : false), + symbols: (bool)(map.ContainsKey("symbols") ? map["symbols"] : false) ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/PolicySessionAlert.cs b/Appwrite/Models/PolicySessionAlert.cs index ba6891e7..3c76db02 100644 --- a/Appwrite/Models/PolicySessionAlert.cs +++ b/Appwrite/Models/PolicySessionAlert.cs @@ -27,8 +27,8 @@ bool enabled } public static PolicySessionAlert From(Dictionary map) => new PolicySessionAlert( - id: map["$id"].ToString(), - enabled: (bool)map["enabled"] + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + enabled: (bool)(map.ContainsKey("enabled") ? map["enabled"] : false) ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/PolicySessionDuration.cs b/Appwrite/Models/PolicySessionDuration.cs index b07a0740..73ceccd3 100644 --- a/Appwrite/Models/PolicySessionDuration.cs +++ b/Appwrite/Models/PolicySessionDuration.cs @@ -27,8 +27,8 @@ long duration } public static PolicySessionDuration From(Dictionary map) => new PolicySessionDuration( - id: map["$id"].ToString(), - duration: Convert.ToInt64(map["duration"]) + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + duration: Convert.ToInt64((map.ContainsKey("duration") ? map["duration"] : 31536000)) ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/PolicySessionInvalidation.cs b/Appwrite/Models/PolicySessionInvalidation.cs index 9d9951d8..d2bf12f6 100644 --- a/Appwrite/Models/PolicySessionInvalidation.cs +++ b/Appwrite/Models/PolicySessionInvalidation.cs @@ -27,8 +27,8 @@ bool enabled } public static PolicySessionInvalidation From(Dictionary map) => new PolicySessionInvalidation( - id: map["$id"].ToString(), - enabled: (bool)map["enabled"] + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + enabled: (bool)(map.ContainsKey("enabled") ? map["enabled"] : true) ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/PolicySessionLimit.cs b/Appwrite/Models/PolicySessionLimit.cs index 58510b6a..ca49baeb 100644 --- a/Appwrite/Models/PolicySessionLimit.cs +++ b/Appwrite/Models/PolicySessionLimit.cs @@ -27,8 +27,8 @@ long total } public static PolicySessionLimit From(Dictionary map) => new PolicySessionLimit( - id: map["$id"].ToString(), - total: Convert.ToInt64(map["total"]) + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + total: Convert.ToInt64((map.ContainsKey("total") ? map["total"] : 0)) ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/PolicyUserLimit.cs b/Appwrite/Models/PolicyUserLimit.cs index d5e165dc..da2646a1 100644 --- a/Appwrite/Models/PolicyUserLimit.cs +++ b/Appwrite/Models/PolicyUserLimit.cs @@ -27,8 +27,8 @@ long total } public static PolicyUserLimit From(Dictionary map) => new PolicyUserLimit( - id: map["$id"].ToString(), - total: Convert.ToInt64(map["total"]) + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + total: Convert.ToInt64((map.ContainsKey("total") ? map["total"] : 0)) ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/PostgresExtension.cs b/Appwrite/Models/PostgresExtension.cs index e3e7e02a..1f626748 100644 --- a/Appwrite/Models/PostgresExtension.cs +++ b/Appwrite/Models/PostgresExtension.cs @@ -37,10 +37,10 @@ string category } public static PostgresExtension From(Dictionary map) => new PostgresExtension( - key: map["key"].ToString(), - name: map["name"].ToString(), - description: map["description"].ToString(), - category: map["category"].ToString() + key: (map.ContainsKey("key") ? map["key"] : "").ToString(), + name: (map.ContainsKey("name") ? map["name"] : "").ToString(), + description: (map.ContainsKey("description") ? map["description"] : "").ToString(), + category: (map.ContainsKey("category") ? map["category"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/Presence.cs b/Appwrite/Models/Presence.cs index c9ee35fa..4a3f93ab 100644 --- a/Appwrite/Models/Presence.cs +++ b/Appwrite/Models/Presence.cs @@ -62,13 +62,13 @@ public Presence( } public static Presence From(Dictionary map) => new Presence( - id: map["$id"].ToString(), - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), permissions: map["$permissions"].ConvertToList(), - userId: map["userId"].ToString(), + userId: (map.ContainsKey("userId") ? map["userId"] : "").ToString(), status: map.TryGetValue("status", out var status) ? status?.ToString() : null, - source: map["source"].ToString(), + source: (map.ContainsKey("source") ? map["source"] : "").ToString(), expiresAt: map.TryGetValue("expiresAt", out var expiresAt) ? expiresAt?.ToString() : null, metadata: map.TryGetValue("metadata", out var objectRaw9) ? objectRaw9 : null ); diff --git a/Appwrite/Models/PresenceList.cs b/Appwrite/Models/PresenceList.cs index 0eea5827..695c7629 100644 --- a/Appwrite/Models/PresenceList.cs +++ b/Appwrite/Models/PresenceList.cs @@ -27,7 +27,7 @@ List presences } public static PresenceList From(Dictionary map) => new PresenceList( - total: Convert.ToInt64(map["total"]), + total: Convert.ToInt64((map.ContainsKey("total") ? map["total"] : 0)), presences: map["presences"].ConvertToList>().Select(it => Appwrite.Models.Presence.From(map: it)).ToList() ); diff --git a/Appwrite/Models/Program.cs b/Appwrite/Models/Program.cs index acd068f1..a964c484 100644 --- a/Appwrite/Models/Program.cs +++ b/Appwrite/Models/Program.cs @@ -62,15 +62,15 @@ string billingPlanId } public static Program From(Dictionary map) => new Program( - id: map["$id"].ToString(), - title: map["title"].ToString(), - description: map["description"].ToString(), - tag: map["tag"].ToString(), - icon: map["icon"].ToString(), - url: map["url"].ToString(), - active: (bool)map["active"], - external: (bool)map["external"], - billingPlanId: map["billingPlanId"].ToString() + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + title: (map.ContainsKey("title") ? map["title"] : "").ToString(), + description: (map.ContainsKey("description") ? map["description"] : "").ToString(), + tag: (map.ContainsKey("tag") ? map["tag"] : "").ToString(), + icon: (map.ContainsKey("icon") ? map["icon"] : "").ToString(), + url: (map.ContainsKey("url") ? map["url"] : "").ToString(), + active: (bool)(map.ContainsKey("active") ? map["active"] : true), + external: (bool)(map.ContainsKey("external") ? map["external"] : true), + billingPlanId: (map.ContainsKey("billingPlanId") ? map["billingPlanId"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/Project.cs b/Appwrite/Models/Project.cs index 302fde8f..c6bd2df4 100644 --- a/Appwrite/Models/Project.cs +++ b/Appwrite/Models/Project.cs @@ -29,9 +29,6 @@ public class Project [JsonPropertyName("region")] public string Region { get; private set; } - [JsonPropertyName("devKeys")] - public List DevKeys { get; private set; } - [JsonPropertyName("smtpEnabled")] public bool SmtpEnabled { get; private set; } @@ -98,6 +95,12 @@ public class Project [JsonPropertyName("billingLimits")] public BillingLimits? BillingLimits { get; private set; } + [JsonPropertyName("firstAccessedAt")] + public string? FirstAccessedAt { get; private set; } + + [JsonPropertyName("mcpAccessedAt")] + public string? McpAccessedAt { get; private set; } + [JsonPropertyName("oAuth2ServerEnabled")] public bool? OAuth2ServerEnabled { get; private set; } @@ -156,7 +159,6 @@ public Project( string name, string teamId, string region, - List devKeys, bool smtpEnabled, string smtpSenderName, string smtpSenderEmail, @@ -179,6 +181,8 @@ public Project( string consoleAccessedAt, bool? wafEnabled, BillingLimits? billingLimits, + string? firstAccessedAt, + string? mcpAccessedAt, bool? oAuth2ServerEnabled, string? oAuth2ServerAuthorizationUrl, List? oAuth2ServerScopes, @@ -204,7 +208,6 @@ public Project( Name = name; TeamId = teamId; Region = region; - DevKeys = devKeys; SmtpEnabled = smtpEnabled; SmtpSenderName = smtpSenderName; SmtpSenderEmail = smtpSenderEmail; @@ -227,6 +230,8 @@ public Project( ConsoleAccessedAt = consoleAccessedAt; WafEnabled = wafEnabled; BillingLimits = billingLimits; + FirstAccessedAt = firstAccessedAt; + McpAccessedAt = mcpAccessedAt; OAuth2ServerEnabled = oAuth2ServerEnabled; OAuth2ServerAuthorizationUrl = oAuth2ServerAuthorizationUrl; OAuth2ServerScopes = oAuth2ServerScopes; @@ -247,80 +252,81 @@ public Project( } public static Project From(Dictionary map) => new Project( - id: map["$id"].ToString(), - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), - name: map["name"].ToString(), - teamId: map["teamId"].ToString(), - region: map["region"].ToString(), - devKeys: map["devKeys"].ConvertToList>().Select(it => Appwrite.Models.DevKey.From(map: it)).ToList(), - smtpEnabled: (bool)map["smtpEnabled"], - smtpSenderName: map["smtpSenderName"].ToString(), - smtpSenderEmail: map["smtpSenderEmail"].ToString(), - smtpReplyToName: map["smtpReplyToName"].ToString(), - smtpReplyToEmail: map["smtpReplyToEmail"].ToString(), - smtpHost: map["smtpHost"].ToString(), - smtpPort: Convert.ToInt64(map["smtpPort"]), - smtpUsername: map["smtpUsername"].ToString(), - smtpPassword: map["smtpPassword"].ToString(), - smtpSecure: map["smtpSecure"].ToString(), - pingCount: Convert.ToInt64(map["pingCount"]), - pingedAt: map["pingedAt"].ToString(), - labels: map["labels"].ConvertToList(), - status: map["status"].ToString(), - onboarding: map["onboarding"], + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), + name: (map.ContainsKey("name") ? map["name"] : "").ToString(), + teamId: (map.ContainsKey("teamId") ? map["teamId"] : "").ToString(), + region: (map.ContainsKey("region") ? map["region"] : "fra").ToString(), + smtpEnabled: (bool)(map.ContainsKey("smtpEnabled") ? map["smtpEnabled"] : false), + smtpSenderName: (map.ContainsKey("smtpSenderName") ? map["smtpSenderName"] : "").ToString(), + smtpSenderEmail: (map.ContainsKey("smtpSenderEmail") ? map["smtpSenderEmail"] : "").ToString(), + smtpReplyToName: (map.ContainsKey("smtpReplyToName") ? map["smtpReplyToName"] : "").ToString(), + smtpReplyToEmail: (map.ContainsKey("smtpReplyToEmail") ? map["smtpReplyToEmail"] : "").ToString(), + smtpHost: (map.ContainsKey("smtpHost") ? map["smtpHost"] : "").ToString(), + smtpPort: Convert.ToInt64((map.ContainsKey("smtpPort") ? map["smtpPort"] : 0)), + smtpUsername: (map.ContainsKey("smtpUsername") ? map["smtpUsername"] : "").ToString(), + smtpPassword: (map.ContainsKey("smtpPassword") ? map["smtpPassword"] : "").ToString(), + smtpSecure: (map.ContainsKey("smtpSecure") ? map["smtpSecure"] : "").ToString(), + pingCount: Convert.ToInt64((map.ContainsKey("pingCount") ? map["pingCount"] : 0)), + pingedAt: (map.ContainsKey("pingedAt") ? map["pingedAt"] : "").ToString(), + labels: (map.ContainsKey("labels") ? map["labels"] : new List()).ConvertToList(), + status: (map.ContainsKey("status") ? map["status"] : "active").ToString(), + onboarding: (map.ContainsKey("onboarding") ? map["onboarding"] : new Dictionary()), authMethods: map["authMethods"].ConvertToList>().Select(it => Appwrite.Models.ProjectAuthMethod.From(map: it)).ToList(), services: map["services"].ConvertToList>().Select(it => Appwrite.Models.ProjectService.From(map: it)).ToList(), protocols: map["protocols"].ConvertToList>().Select(it => Appwrite.Models.ProjectProtocol.From(map: it)).ToList(), blocks: map["blocks"].ConvertToList>().Select(it => Appwrite.Models.Block.From(map: it)).ToList(), - consoleAccessedAt: map["consoleAccessedAt"].ToString(), - wafEnabled: map.TryGetValue("wafEnabled", out var boolRaw28) && boolRaw28 != null - ? (bool?)boolRaw28 + consoleAccessedAt: (map.ContainsKey("consoleAccessedAt") ? map["consoleAccessedAt"] : "").ToString(), + wafEnabled: map.TryGetValue("wafEnabled", out var boolRaw27) && boolRaw27 != null + ? (bool?)boolRaw27 : null, - billingLimits: map.TryGetValue("billingLimits", out var objectRaw29) && objectRaw29 != null - ? Appwrite.Models.BillingLimits.From(map: objectRaw29 is JsonElement jsonObj29 ? jsonObj29.Deserialize>()! : (Dictionary)objectRaw29) + billingLimits: map.TryGetValue("billingLimits", out var objectRaw28) && objectRaw28 != null + ? Appwrite.Models.BillingLimits.From(map: objectRaw28 is JsonElement jsonObj28 ? jsonObj28.Deserialize>()! : (Dictionary)objectRaw28) : null, - oAuth2ServerEnabled: map.TryGetValue("oAuth2ServerEnabled", out var boolRaw30) && boolRaw30 != null - ? (bool?)boolRaw30 + firstAccessedAt: map.TryGetValue("firstAccessedAt", out var firstAccessedAt) ? firstAccessedAt?.ToString() : null, + mcpAccessedAt: map.TryGetValue("mcpAccessedAt", out var mcpAccessedAt) ? mcpAccessedAt?.ToString() : null, + oAuth2ServerEnabled: map.TryGetValue("oAuth2ServerEnabled", out var boolRaw31) && boolRaw31 != null + ? (bool?)boolRaw31 : null, oAuth2ServerAuthorizationUrl: map.TryGetValue("oAuth2ServerAuthorizationUrl", out var oAuth2ServerAuthorizationUrl) ? oAuth2ServerAuthorizationUrl?.ToString() : null, - oAuth2ServerScopes: map.TryGetValue("oAuth2ServerScopes", out var arrayRaw32) && arrayRaw32 != null - ? arrayRaw32.ConvertToList() - : null, - oAuth2ServerDefaultScopes: map.TryGetValue("oAuth2ServerDefaultScopes", out var arrayRaw33) && arrayRaw33 != null + oAuth2ServerScopes: map.TryGetValue("oAuth2ServerScopes", out var arrayRaw33) && arrayRaw33 != null ? arrayRaw33.ConvertToList() : null, - oAuth2ServerInstallationScopes: map.TryGetValue("oAuth2ServerInstallationScopes", out var arrayRaw34) && arrayRaw34 != null + oAuth2ServerDefaultScopes: map.TryGetValue("oAuth2ServerDefaultScopes", out var arrayRaw34) && arrayRaw34 != null ? arrayRaw34.ConvertToList() : null, - oAuth2ServerAuthorizationDetailsTypes: map.TryGetValue("oAuth2ServerAuthorizationDetailsTypes", out var arrayRaw35) && arrayRaw35 != null + oAuth2ServerInstallationScopes: map.TryGetValue("oAuth2ServerInstallationScopes", out var arrayRaw35) && arrayRaw35 != null ? arrayRaw35.ConvertToList() : null, - oAuth2ServerAccessTokenDuration: map.TryGetValue("oAuth2ServerAccessTokenDuration", out var numberRaw36) && numberRaw36 != null - ? Convert.ToInt64(numberRaw36) - : null, - oAuth2ServerRefreshTokenDuration: map.TryGetValue("oAuth2ServerRefreshTokenDuration", out var numberRaw37) && numberRaw37 != null + oAuth2ServerAuthorizationDetailsTypes: map.TryGetValue("oAuth2ServerAuthorizationDetailsTypes", out var arrayRaw36) && arrayRaw36 != null + ? arrayRaw36.ConvertToList() + : null, + oAuth2ServerAccessTokenDuration: map.TryGetValue("oAuth2ServerAccessTokenDuration", out var numberRaw37) && numberRaw37 != null ? Convert.ToInt64(numberRaw37) : null, - oAuth2ServerPublicAccessTokenDuration: map.TryGetValue("oAuth2ServerPublicAccessTokenDuration", out var numberRaw38) && numberRaw38 != null + oAuth2ServerRefreshTokenDuration: map.TryGetValue("oAuth2ServerRefreshTokenDuration", out var numberRaw38) && numberRaw38 != null ? Convert.ToInt64(numberRaw38) : null, - oAuth2ServerPublicRefreshTokenDuration: map.TryGetValue("oAuth2ServerPublicRefreshTokenDuration", out var numberRaw39) && numberRaw39 != null + oAuth2ServerPublicAccessTokenDuration: map.TryGetValue("oAuth2ServerPublicAccessTokenDuration", out var numberRaw39) && numberRaw39 != null ? Convert.ToInt64(numberRaw39) : null, - oAuth2ServerInstallationAccessTokenDuration: map.TryGetValue("oAuth2ServerInstallationAccessTokenDuration", out var numberRaw40) && numberRaw40 != null + oAuth2ServerPublicRefreshTokenDuration: map.TryGetValue("oAuth2ServerPublicRefreshTokenDuration", out var numberRaw40) && numberRaw40 != null ? Convert.ToInt64(numberRaw40) : null, - oAuth2ServerConfidentialPkce: map.TryGetValue("oAuth2ServerConfidentialPkce", out var boolRaw41) && boolRaw41 != null - ? (bool?)boolRaw41 + oAuth2ServerInstallationAccessTokenDuration: map.TryGetValue("oAuth2ServerInstallationAccessTokenDuration", out var numberRaw41) && numberRaw41 != null + ? Convert.ToInt64(numberRaw41) + : null, + oAuth2ServerConfidentialPkce: map.TryGetValue("oAuth2ServerConfidentialPkce", out var boolRaw42) && boolRaw42 != null + ? (bool?)boolRaw42 : null, oAuth2ServerVerificationUrl: map.TryGetValue("oAuth2ServerVerificationUrl", out var oAuth2ServerVerificationUrl) ? oAuth2ServerVerificationUrl?.ToString() : null, - oAuth2ServerUserCodeLength: map.TryGetValue("oAuth2ServerUserCodeLength", out var numberRaw43) && numberRaw43 != null - ? Convert.ToInt64(numberRaw43) + oAuth2ServerUserCodeLength: map.TryGetValue("oAuth2ServerUserCodeLength", out var numberRaw44) && numberRaw44 != null + ? Convert.ToInt64(numberRaw44) : null, oAuth2ServerUserCodeFormat: map.TryGetValue("oAuth2ServerUserCodeFormat", out var oAuth2ServerUserCodeFormat) ? oAuth2ServerUserCodeFormat?.ToString() : null, - oAuth2ServerDeviceCodeDuration: map.TryGetValue("oAuth2ServerDeviceCodeDuration", out var numberRaw45) && numberRaw45 != null - ? Convert.ToInt64(numberRaw45) + oAuth2ServerDeviceCodeDuration: map.TryGetValue("oAuth2ServerDeviceCodeDuration", out var numberRaw46) && numberRaw46 != null + ? Convert.ToInt64(numberRaw46) : null, oAuth2ServerDiscoveryUrl: map.TryGetValue("oAuth2ServerDiscoveryUrl", out var oAuth2ServerDiscoveryUrl) ? oAuth2ServerDiscoveryUrl?.ToString() : null ); @@ -333,7 +339,6 @@ public Project( { "name", Name }, { "teamId", TeamId }, { "region", Region }, - { "devKeys", DevKeys?.Select(it => it.ToMap()).ToList() }, { "smtpEnabled", SmtpEnabled }, { "smtpSenderName", SmtpSenderName }, { "smtpSenderEmail", SmtpSenderEmail }, @@ -356,6 +361,8 @@ public Project( { "consoleAccessedAt", ConsoleAccessedAt }, { "wafEnabled", WafEnabled }, { "billingLimits", BillingLimits?.ToMap() }, + { "firstAccessedAt", FirstAccessedAt }, + { "mcpAccessedAt", McpAccessedAt }, { "oAuth2ServerEnabled", OAuth2ServerEnabled }, { "oAuth2ServerAuthorizationUrl", OAuth2ServerAuthorizationUrl }, { "oAuth2ServerScopes", OAuth2ServerScopes }, diff --git a/Appwrite/Models/ProjectAuthMethod.cs b/Appwrite/Models/ProjectAuthMethod.cs index f2813c8c..dff59f3f 100644 --- a/Appwrite/Models/ProjectAuthMethod.cs +++ b/Appwrite/Models/ProjectAuthMethod.cs @@ -28,7 +28,7 @@ bool enabled public static ProjectAuthMethod From(Dictionary map) => new ProjectAuthMethod( id: new Appwrite.Enums.ProjectAuthMethodId(map["$id"].ToString()!), - enabled: (bool)map["enabled"] + enabled: (bool)(map.ContainsKey("enabled") ? map["enabled"] : true) ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/ProjectList.cs b/Appwrite/Models/ProjectList.cs index a7af4a1e..21b9397d 100644 --- a/Appwrite/Models/ProjectList.cs +++ b/Appwrite/Models/ProjectList.cs @@ -27,7 +27,7 @@ List projects } public static ProjectList From(Dictionary map) => new ProjectList( - total: Convert.ToInt64(map["total"]), + total: Convert.ToInt64((map.ContainsKey("total") ? map["total"] : 0)), projects: map["projects"].ConvertToList>().Select(it => Appwrite.Models.Project.From(map: it)).ToList() ); diff --git a/Appwrite/Models/ProjectProtocol.cs b/Appwrite/Models/ProjectProtocol.cs index 7f6782e5..e5f3cd3b 100644 --- a/Appwrite/Models/ProjectProtocol.cs +++ b/Appwrite/Models/ProjectProtocol.cs @@ -28,7 +28,7 @@ bool enabled public static ProjectProtocol From(Dictionary map) => new ProjectProtocol( id: new Appwrite.Enums.ProjectProtocolId(map["$id"].ToString()!), - enabled: (bool)map["enabled"] + enabled: (bool)(map.ContainsKey("enabled") ? map["enabled"] : true) ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/ProjectService.cs b/Appwrite/Models/ProjectService.cs index bd862e5f..df48bb54 100644 --- a/Appwrite/Models/ProjectService.cs +++ b/Appwrite/Models/ProjectService.cs @@ -28,7 +28,7 @@ bool enabled public static ProjectService From(Dictionary map) => new ProjectService( id: new Appwrite.Enums.ProjectServiceId(map["$id"].ToString()!), - enabled: (bool)map["enabled"] + enabled: (bool)(map.ContainsKey("enabled") ? map["enabled"] : true) ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/Provider.cs b/Appwrite/Models/Provider.cs index 55365349..6815bfd3 100644 --- a/Appwrite/Models/Provider.cs +++ b/Appwrite/Models/Provider.cs @@ -62,14 +62,14 @@ public Provider( } public static Provider From(Dictionary map) => new Provider( - id: map["$id"].ToString(), - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), - name: map["name"].ToString(), - provider: map["provider"].ToString(), - enabled: (bool)map["enabled"], - type: map["type"].ToString(), - credentials: map["credentials"], + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), + name: (map.ContainsKey("name") ? map["name"] : "").ToString(), + provider: (map.ContainsKey("provider") ? map["provider"] : "").ToString(), + enabled: (bool)(map.ContainsKey("enabled") ? map["enabled"] : true), + type: (map.ContainsKey("type") ? map["type"] : "").ToString(), + credentials: (map.ContainsKey("credentials") ? map["credentials"] : new Dictionary()), options: map.TryGetValue("options", out var objectRaw9) ? objectRaw9 : null ); diff --git a/Appwrite/Models/ProviderList.cs b/Appwrite/Models/ProviderList.cs index 82692000..21f91df0 100644 --- a/Appwrite/Models/ProviderList.cs +++ b/Appwrite/Models/ProviderList.cs @@ -27,7 +27,7 @@ List providers } public static ProviderList From(Dictionary map) => new ProviderList( - total: Convert.ToInt64(map["total"]), + total: Convert.ToInt64((map.ContainsKey("total") ? map["total"] : 0)), providers: map["providers"].ConvertToList>().Select(it => Appwrite.Models.Provider.From(map: it)).ToList() ); diff --git a/Appwrite/Models/ProxyInvalidation.cs b/Appwrite/Models/ProxyInvalidation.cs index 50c8d53b..c038504d 100644 --- a/Appwrite/Models/ProxyInvalidation.cs +++ b/Appwrite/Models/ProxyInvalidation.cs @@ -37,10 +37,10 @@ string status } public static ProxyInvalidation From(Dictionary map) => new ProxyInvalidation( - domain: map["domain"].ToString(), - type: map["type"].ToString(), - reference: map["reference"].ToString(), - status: map["status"].ToString() + domain: (map.ContainsKey("domain") ? map["domain"] : "").ToString(), + type: (map.ContainsKey("type") ? map["type"] : "").ToString(), + reference: (map.ContainsKey("reference") ? map["reference"] : "").ToString(), + status: (map.ContainsKey("status") ? map["status"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/ProxyRule.cs b/Appwrite/Models/ProxyRule.cs index 0043d6e0..53bc76fd 100644 --- a/Appwrite/Models/ProxyRule.cs +++ b/Appwrite/Models/ProxyRule.cs @@ -92,24 +92,24 @@ string renewAt } public static ProxyRule From(Dictionary map) => new ProxyRule( - id: map["$id"].ToString(), - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), - domain: map["domain"].ToString(), - type: map["type"].ToString(), - trigger: map["trigger"].ToString(), - redirectUrl: map["redirectUrl"].ToString(), - redirectStatusCode: Convert.ToInt64(map["redirectStatusCode"]), - deploymentId: map["deploymentId"].ToString(), + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), + domain: (map.ContainsKey("domain") ? map["domain"] : "").ToString(), + type: (map.ContainsKey("type") ? map["type"] : "").ToString(), + trigger: (map.ContainsKey("trigger") ? map["trigger"] : "").ToString(), + redirectUrl: (map.ContainsKey("redirectUrl") ? map["redirectUrl"] : "").ToString(), + redirectStatusCode: Convert.ToInt64((map.ContainsKey("redirectStatusCode") ? map["redirectStatusCode"] : 301)), + deploymentId: (map.ContainsKey("deploymentId") ? map["deploymentId"] : "").ToString(), deploymentResourceType: map.TryGetValue("deploymentResourceType", out var enumRaw10) ? enumRaw10 == null ? null : new Appwrite.Enums.ProxyRuleDeploymentResourceType(enumRaw10.ToString()!) : null, - deploymentResourceId: map["deploymentResourceId"].ToString(), - deploymentVcsProviderBranch: map["deploymentVcsProviderBranch"].ToString(), - status: new Appwrite.Enums.ProxyRuleStatus(map["status"].ToString()!), - logs: map["logs"].ToString(), + deploymentResourceId: (map.ContainsKey("deploymentResourceId") ? map["deploymentResourceId"] : "").ToString(), + deploymentVcsProviderBranch: (map.ContainsKey("deploymentVcsProviderBranch") ? map["deploymentVcsProviderBranch"] : "").ToString(), + status: new Appwrite.Enums.ProxyRuleStatus((map.ContainsKey("status") ? map["status"] : "unverified").ToString()!), + logs: (map.ContainsKey("logs") ? map["logs"] : "").ToString(), renewAt: map["renewAt"].ToString() ); diff --git a/Appwrite/Models/ProxyRuleList.cs b/Appwrite/Models/ProxyRuleList.cs index 3a828399..2c537c53 100644 --- a/Appwrite/Models/ProxyRuleList.cs +++ b/Appwrite/Models/ProxyRuleList.cs @@ -27,7 +27,7 @@ List rules } public static ProxyRuleList From(Dictionary map) => new ProxyRuleList( - total: Convert.ToInt64(map["total"]), + total: Convert.ToInt64((map.ContainsKey("total") ? map["total"] : 0)), rules: map["rules"].ConvertToList>().Select(it => Appwrite.Models.ProxyRule.From(map: it)).ToList() ); diff --git a/Appwrite/Models/Report.cs b/Appwrite/Models/Report.cs index d08b0c7c..11378ecd 100644 --- a/Appwrite/Models/Report.cs +++ b/Appwrite/Models/Report.cs @@ -77,16 +77,16 @@ public Report( } public static Report From(Dictionary map) => new Report( - id: map["$id"].ToString(), - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), - appId: map["appId"].ToString(), - type: map["type"].ToString(), - title: map["title"].ToString(), - summary: map["summary"].ToString(), - targetType: map["targetType"].ToString(), - target: map["target"].ToString(), - categories: map["categories"].ConvertToList(), + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), + appId: (map.ContainsKey("appId") ? map["appId"] : "").ToString(), + type: (map.ContainsKey("type") ? map["type"] : "").ToString(), + title: (map.ContainsKey("title") ? map["title"] : "").ToString(), + summary: (map.ContainsKey("summary") ? map["summary"] : "").ToString(), + targetType: (map.ContainsKey("targetType") ? map["targetType"] : "").ToString(), + target: (map.ContainsKey("target") ? map["target"] : "").ToString(), + categories: (map.ContainsKey("categories") ? map["categories"] : new List()).ConvertToList(), insights: map["insights"].ConvertToList>().Select(it => Appwrite.Models.Insight.From(map: it)).ToList(), analyzedAt: map.TryGetValue("analyzedAt", out var analyzedAt) ? analyzedAt?.ToString() : null ); diff --git a/Appwrite/Models/ReportList.cs b/Appwrite/Models/ReportList.cs index 5815d359..d5292be3 100644 --- a/Appwrite/Models/ReportList.cs +++ b/Appwrite/Models/ReportList.cs @@ -27,7 +27,7 @@ List reports } public static ReportList From(Dictionary map) => new ReportList( - total: Convert.ToInt64(map["total"]), + total: Convert.ToInt64((map.ContainsKey("total") ? map["total"] : 0)), reports: map["reports"].ConvertToList>().Select(it => Appwrite.Models.Report.From(map: it)).ToList() ); diff --git a/Appwrite/Models/ResourceToken.cs b/Appwrite/Models/ResourceToken.cs index 7fce3863..6dc36e55 100644 --- a/Appwrite/Models/ResourceToken.cs +++ b/Appwrite/Models/ResourceToken.cs @@ -52,13 +52,13 @@ string accessedAt } public static ResourceToken From(Dictionary map) => new ResourceToken( - id: map["$id"].ToString(), - createdAt: map["$createdAt"].ToString(), - resourceId: map["resourceId"].ToString(), - resourceType: map["resourceType"].ToString(), - expire: map["expire"].ToString(), - secret: map["secret"].ToString(), - accessedAt: map["accessedAt"].ToString() + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + resourceId: (map.ContainsKey("resourceId") ? map["resourceId"] : "").ToString(), + resourceType: (map.ContainsKey("resourceType") ? map["resourceType"] : "").ToString(), + expire: (map.ContainsKey("expire") ? map["expire"] : "").ToString(), + secret: (map.ContainsKey("secret") ? map["secret"] : "").ToString(), + accessedAt: (map.ContainsKey("accessedAt") ? map["accessedAt"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/ResourceTokenList.cs b/Appwrite/Models/ResourceTokenList.cs index c3df017c..cab836a2 100644 --- a/Appwrite/Models/ResourceTokenList.cs +++ b/Appwrite/Models/ResourceTokenList.cs @@ -27,7 +27,7 @@ List tokens } public static ResourceTokenList From(Dictionary map) => new ResourceTokenList( - total: Convert.ToInt64(map["total"]), + total: Convert.ToInt64((map.ContainsKey("total") ? map["total"] : 0)), tokens: map["tokens"].ConvertToList>().Select(it => Appwrite.Models.ResourceToken.From(map: it)).ToList() ); diff --git a/Appwrite/Models/Row.cs b/Appwrite/Models/Row.cs index a27c2b3a..8a3485d8 100644 --- a/Appwrite/Models/Row.cs +++ b/Appwrite/Models/Row.cs @@ -56,12 +56,12 @@ Dictionary data } public static Row From(Dictionary map) => new Row( - id: map["$id"].ToString(), - sequence: map["$sequence"].ToString(), - tableId: map["$tableId"].ToString(), - databaseId: map["$databaseId"].ToString(), - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + sequence: (map.ContainsKey("$sequence") ? map["$sequence"] : "").ToString(), + tableId: (map.ContainsKey("$tableId") ? map["$tableId"] : "").ToString(), + databaseId: (map.ContainsKey("$databaseId") ? map["$databaseId"] : "").ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), permissions: map["$permissions"].ConvertToList(), data: map.TryGetValue("data", out var additionalPropsValue) ? (Dictionary)additionalPropsValue diff --git a/Appwrite/Models/RowList.cs b/Appwrite/Models/RowList.cs index 40d9e5dd..69a220da 100644 --- a/Appwrite/Models/RowList.cs +++ b/Appwrite/Models/RowList.cs @@ -27,7 +27,7 @@ List rows } public static RowList From(Dictionary map) => new RowList( - total: Convert.ToInt64(map["total"]), + total: Convert.ToInt64((map.ContainsKey("total") ? map["total"] : 0)), rows: map["rows"].ConvertToList>().Select(it => Appwrite.Models.Row.From(map: it)).ToList() ); diff --git a/Appwrite/Models/Runtime.cs b/Appwrite/Models/Runtime.cs index d1f5617e..fda4b5d3 100644 --- a/Appwrite/Models/Runtime.cs +++ b/Appwrite/Models/Runtime.cs @@ -57,13 +57,13 @@ List supports } public static Runtime From(Dictionary map) => new Runtime( - id: map["$id"].ToString(), - key: map["key"].ToString(), - name: map["name"].ToString(), - version: map["version"].ToString(), - @base: map["base"].ToString(), - image: map["image"].ToString(), - logo: map["logo"].ToString(), + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + key: (map.ContainsKey("key") ? map["key"] : "").ToString(), + name: (map.ContainsKey("name") ? map["name"] : "").ToString(), + version: (map.ContainsKey("version") ? map["version"] : "").ToString(), + @base: (map.ContainsKey("base") ? map["base"] : "").ToString(), + image: (map.ContainsKey("image") ? map["image"] : "").ToString(), + logo: (map.ContainsKey("logo") ? map["logo"] : "").ToString(), supports: map["supports"].ConvertToList() ); diff --git a/Appwrite/Models/RuntimeList.cs b/Appwrite/Models/RuntimeList.cs index afee94f6..9049fbcf 100644 --- a/Appwrite/Models/RuntimeList.cs +++ b/Appwrite/Models/RuntimeList.cs @@ -27,7 +27,7 @@ List runtimes } public static RuntimeList From(Dictionary map) => new RuntimeList( - total: Convert.ToInt64(map["total"]), + total: Convert.ToInt64((map.ContainsKey("total") ? map["total"] : 0)), runtimes: map["runtimes"].ConvertToList>().Select(it => Appwrite.Models.Runtime.From(map: it)).ToList() ); diff --git a/Appwrite/Models/Session.cs b/Appwrite/Models/Session.cs index 39333d6f..c1d3cbcc 100644 --- a/Appwrite/Models/Session.cs +++ b/Appwrite/Models/Session.cs @@ -162,35 +162,35 @@ string mfaUpdatedAt } public static Session From(Dictionary map) => new Session( - id: map["$id"].ToString(), - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), - userId: map["userId"].ToString(), - expire: map["expire"].ToString(), - provider: map["provider"].ToString(), - providerUid: map["providerUid"].ToString(), - providerAccessToken: map["providerAccessToken"].ToString(), - providerAccessTokenExpiry: map["providerAccessTokenExpiry"].ToString(), - providerRefreshToken: map["providerRefreshToken"].ToString(), - ip: map["ip"].ToString(), - osCode: map["osCode"].ToString(), - osName: map["osName"].ToString(), - osVersion: map["osVersion"].ToString(), - clientType: map["clientType"].ToString(), - clientCode: map["clientCode"].ToString(), - clientName: map["clientName"].ToString(), - clientVersion: map["clientVersion"].ToString(), - clientEngine: map["clientEngine"].ToString(), - clientEngineVersion: map["clientEngineVersion"].ToString(), - deviceName: map["deviceName"].ToString(), - deviceBrand: map["deviceBrand"].ToString(), - deviceModel: map["deviceModel"].ToString(), - countryCode: map["countryCode"].ToString(), - countryName: map["countryName"].ToString(), - current: (bool)map["current"], - factors: map["factors"].ConvertToList(), - secret: map["secret"].ToString(), - mfaUpdatedAt: map["mfaUpdatedAt"].ToString() + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), + userId: (map.ContainsKey("userId") ? map["userId"] : "").ToString(), + expire: (map.ContainsKey("expire") ? map["expire"] : "").ToString(), + provider: (map.ContainsKey("provider") ? map["provider"] : "").ToString(), + providerUid: (map.ContainsKey("providerUid") ? map["providerUid"] : "").ToString(), + providerAccessToken: (map.ContainsKey("providerAccessToken") ? map["providerAccessToken"] : "").ToString(), + providerAccessTokenExpiry: (map.ContainsKey("providerAccessTokenExpiry") ? map["providerAccessTokenExpiry"] : "").ToString(), + providerRefreshToken: (map.ContainsKey("providerRefreshToken") ? map["providerRefreshToken"] : "").ToString(), + ip: (map.ContainsKey("ip") ? map["ip"] : "").ToString(), + osCode: (map.ContainsKey("osCode") ? map["osCode"] : "").ToString(), + osName: (map.ContainsKey("osName") ? map["osName"] : "").ToString(), + osVersion: (map.ContainsKey("osVersion") ? map["osVersion"] : "").ToString(), + clientType: (map.ContainsKey("clientType") ? map["clientType"] : "").ToString(), + clientCode: (map.ContainsKey("clientCode") ? map["clientCode"] : "").ToString(), + clientName: (map.ContainsKey("clientName") ? map["clientName"] : "").ToString(), + clientVersion: (map.ContainsKey("clientVersion") ? map["clientVersion"] : "").ToString(), + clientEngine: (map.ContainsKey("clientEngine") ? map["clientEngine"] : "").ToString(), + clientEngineVersion: (map.ContainsKey("clientEngineVersion") ? map["clientEngineVersion"] : "").ToString(), + deviceName: (map.ContainsKey("deviceName") ? map["deviceName"] : "").ToString(), + deviceBrand: (map.ContainsKey("deviceBrand") ? map["deviceBrand"] : "").ToString(), + deviceModel: (map.ContainsKey("deviceModel") ? map["deviceModel"] : "").ToString(), + countryCode: (map.ContainsKey("countryCode") ? map["countryCode"] : "").ToString(), + countryName: (map.ContainsKey("countryName") ? map["countryName"] : "").ToString(), + current: (bool)(map.ContainsKey("current") ? map["current"] : false), + factors: (map.ContainsKey("factors") ? map["factors"] : new List()).ConvertToList(), + secret: (map.ContainsKey("secret") ? map["secret"] : "").ToString(), + mfaUpdatedAt: (map.ContainsKey("mfaUpdatedAt") ? map["mfaUpdatedAt"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/SessionList.cs b/Appwrite/Models/SessionList.cs index 24cd303d..6e430ddf 100644 --- a/Appwrite/Models/SessionList.cs +++ b/Appwrite/Models/SessionList.cs @@ -27,7 +27,7 @@ List sessions } public static SessionList From(Dictionary map) => new SessionList( - total: Convert.ToInt64(map["total"]), + total: Convert.ToInt64((map.ContainsKey("total") ? map["total"] : 0)), sessions: map["sessions"].ConvertToList>().Select(it => Appwrite.Models.Session.From(map: it)).ToList() ); diff --git a/Appwrite/Models/Site.cs b/Appwrite/Models/Site.cs index 9ea61b3d..1651824c 100644 --- a/Appwrite/Models/Site.cs +++ b/Appwrite/Models/Site.cs @@ -192,39 +192,39 @@ string fallbackFile } public static Site From(Dictionary map) => new Site( - id: map["$id"].ToString(), - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), - name: map["name"].ToString(), - enabled: (bool)map["enabled"], - live: (bool)map["live"], - logging: (bool)map["logging"], - framework: map["framework"].ToString(), - deploymentRetention: Convert.ToInt64(map["deploymentRetention"]), - deploymentId: map["deploymentId"].ToString(), - deploymentCreatedAt: map["deploymentCreatedAt"].ToString(), - deploymentScreenshotLight: map["deploymentScreenshotLight"].ToString(), - deploymentScreenshotDark: map["deploymentScreenshotDark"].ToString(), - latestDeploymentId: map["latestDeploymentId"].ToString(), - latestDeploymentCreatedAt: map["latestDeploymentCreatedAt"].ToString(), - latestDeploymentStatus: map["latestDeploymentStatus"].ToString(), - scopes: map["scopes"].ConvertToList(), + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), + name: (map.ContainsKey("name") ? map["name"] : "").ToString(), + enabled: (bool)(map.ContainsKey("enabled") ? map["enabled"] : true), + live: (bool)(map.ContainsKey("live") ? map["live"] : true), + logging: (bool)(map.ContainsKey("logging") ? map["logging"] : true), + framework: (map.ContainsKey("framework") ? map["framework"] : "").ToString(), + deploymentRetention: Convert.ToInt64((map.ContainsKey("deploymentRetention") ? map["deploymentRetention"] : 0)), + deploymentId: (map.ContainsKey("deploymentId") ? map["deploymentId"] : "").ToString(), + deploymentCreatedAt: (map.ContainsKey("deploymentCreatedAt") ? map["deploymentCreatedAt"] : "").ToString(), + deploymentScreenshotLight: (map.ContainsKey("deploymentScreenshotLight") ? map["deploymentScreenshotLight"] : "").ToString(), + deploymentScreenshotDark: (map.ContainsKey("deploymentScreenshotDark") ? map["deploymentScreenshotDark"] : "").ToString(), + latestDeploymentId: (map.ContainsKey("latestDeploymentId") ? map["latestDeploymentId"] : "").ToString(), + latestDeploymentCreatedAt: (map.ContainsKey("latestDeploymentCreatedAt") ? map["latestDeploymentCreatedAt"] : "").ToString(), + latestDeploymentStatus: (map.ContainsKey("latestDeploymentStatus") ? map["latestDeploymentStatus"] : "").ToString(), + scopes: (map.ContainsKey("scopes") ? map["scopes"] : new List()).ConvertToList(), vars: map["vars"].ConvertToList>().Select(it => Appwrite.Models.Variable.From(map: it)).ToList(), - timeout: Convert.ToInt64(map["timeout"]), - installCommand: map["installCommand"].ToString(), - buildCommand: map["buildCommand"].ToString(), - startCommand: map["startCommand"].ToString(), - outputDirectory: map["outputDirectory"].ToString(), - installationId: map["installationId"].ToString(), - providerRepositoryId: map["providerRepositoryId"].ToString(), - providerBranch: map["providerBranch"].ToString(), - providerRootDirectory: map["providerRootDirectory"].ToString(), - providerSilentMode: (bool)map["providerSilentMode"], - providerBranches: map["providerBranches"].ConvertToList(), - providerPaths: map["providerPaths"].ConvertToList(), - buildSpecification: map["buildSpecification"].ToString(), - runtimeSpecification: map["runtimeSpecification"].ToString(), - buildRuntime: map["buildRuntime"].ToString(), + timeout: Convert.ToInt64((map.ContainsKey("timeout") ? map["timeout"] : 15)), + installCommand: (map.ContainsKey("installCommand") ? map["installCommand"] : "").ToString(), + buildCommand: (map.ContainsKey("buildCommand") ? map["buildCommand"] : "").ToString(), + startCommand: (map.ContainsKey("startCommand") ? map["startCommand"] : "").ToString(), + outputDirectory: (map.ContainsKey("outputDirectory") ? map["outputDirectory"] : "").ToString(), + installationId: (map.ContainsKey("installationId") ? map["installationId"] : "").ToString(), + providerRepositoryId: (map.ContainsKey("providerRepositoryId") ? map["providerRepositoryId"] : "").ToString(), + providerBranch: (map.ContainsKey("providerBranch") ? map["providerBranch"] : "").ToString(), + providerRootDirectory: (map.ContainsKey("providerRootDirectory") ? map["providerRootDirectory"] : "").ToString(), + providerSilentMode: (bool)(map.ContainsKey("providerSilentMode") ? map["providerSilentMode"] : false), + providerBranches: (map.ContainsKey("providerBranches") ? map["providerBranches"] : new List()).ConvertToList(), + providerPaths: (map.ContainsKey("providerPaths") ? map["providerPaths"] : new List()).ConvertToList(), + buildSpecification: (map.ContainsKey("buildSpecification") ? map["buildSpecification"] : "s-1vcpu-512mb").ToString(), + runtimeSpecification: (map.ContainsKey("runtimeSpecification") ? map["runtimeSpecification"] : "s-1vcpu-512mb").ToString(), + buildRuntime: (map.ContainsKey("buildRuntime") ? map["buildRuntime"] : "").ToString(), adapter: map["adapter"].ToString(), fallbackFile: map["fallbackFile"].ToString() ); diff --git a/Appwrite/Models/SiteList.cs b/Appwrite/Models/SiteList.cs index 87edfc43..7b5905f5 100644 --- a/Appwrite/Models/SiteList.cs +++ b/Appwrite/Models/SiteList.cs @@ -27,7 +27,7 @@ List sites } public static SiteList From(Dictionary map) => new SiteList( - total: Convert.ToInt64(map["total"]), + total: Convert.ToInt64((map.ContainsKey("total") ? map["total"] : 0)), sites: map["sites"].ConvertToList>().Select(it => Appwrite.Models.Site.From(map: it)).ToList() ); diff --git a/Appwrite/Models/Specification.cs b/Appwrite/Models/Specification.cs index ec8d28b9..f7ad90cf 100644 --- a/Appwrite/Models/Specification.cs +++ b/Appwrite/Models/Specification.cs @@ -37,10 +37,10 @@ string slug } public static Specification From(Dictionary map) => new Specification( - memory: Convert.ToInt64(map["memory"]), - cpus: Convert.ToDouble(map["cpus"]), - enabled: (bool)map["enabled"], - slug: map["slug"].ToString() + memory: Convert.ToInt64((map.ContainsKey("memory") ? map["memory"] : 0)), + cpus: Convert.ToDouble((map.ContainsKey("cpus") ? map["cpus"] : 0)), + enabled: (bool)(map.ContainsKey("enabled") ? map["enabled"] : false), + slug: (map.ContainsKey("slug") ? map["slug"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/SpecificationList.cs b/Appwrite/Models/SpecificationList.cs index de2cf105..0b228292 100644 --- a/Appwrite/Models/SpecificationList.cs +++ b/Appwrite/Models/SpecificationList.cs @@ -27,7 +27,7 @@ List specifications } public static SpecificationList From(Dictionary map) => new SpecificationList( - total: Convert.ToInt64(map["total"]), + total: Convert.ToInt64((map.ContainsKey("total") ? map["total"] : 0)), specifications: map["specifications"].ConvertToList>().Select(it => Appwrite.Models.Specification.From(map: it)).ToList() ); diff --git a/Appwrite/Models/Subscriber.cs b/Appwrite/Models/Subscriber.cs index c148c477..9f02cb7f 100644 --- a/Appwrite/Models/Subscriber.cs +++ b/Appwrite/Models/Subscriber.cs @@ -62,15 +62,15 @@ string providerType } public static Subscriber From(Dictionary map) => new Subscriber( - id: map["$id"].ToString(), - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), - targetId: map["targetId"].ToString(), + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), + targetId: (map.ContainsKey("targetId") ? map["targetId"] : "").ToString(), target: Appwrite.Models.Target.From(map: map["target"] is JsonElement jsonObj5 ? jsonObj5.Deserialize>()! : (Dictionary)map["target"]), - userId: map["userId"].ToString(), - userName: map["userName"].ToString(), - topicId: map["topicId"].ToString(), - providerType: map["providerType"].ToString() + userId: (map.ContainsKey("userId") ? map["userId"] : "").ToString(), + userName: (map.ContainsKey("userName") ? map["userName"] : "").ToString(), + topicId: (map.ContainsKey("topicId") ? map["topicId"] : "").ToString(), + providerType: (map.ContainsKey("providerType") ? map["providerType"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/SubscriberList.cs b/Appwrite/Models/SubscriberList.cs index 08174a95..a96b23e7 100644 --- a/Appwrite/Models/SubscriberList.cs +++ b/Appwrite/Models/SubscriberList.cs @@ -27,7 +27,7 @@ List subscribers } public static SubscriberList From(Dictionary map) => new SubscriberList( - total: Convert.ToInt64(map["total"]), + total: Convert.ToInt64((map.ContainsKey("total") ? map["total"] : 0)), subscribers: map["subscribers"].ConvertToList>().Select(it => Appwrite.Models.Subscriber.From(map: it)).ToList() ); diff --git a/Appwrite/Models/Table.cs b/Appwrite/Models/Table.cs index 915b914f..578f0d14 100644 --- a/Appwrite/Models/Table.cs +++ b/Appwrite/Models/Table.cs @@ -77,18 +77,18 @@ long bytesUsed } public static Table From(Dictionary map) => new Table( - id: map["$id"].ToString(), - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), permissions: map["$permissions"].ConvertToList(), - databaseId: map["databaseId"].ToString(), - name: map["name"].ToString(), - enabled: (bool)map["enabled"], - rowSecurity: (bool)map["rowSecurity"], + databaseId: (map.ContainsKey("databaseId") ? map["databaseId"] : "").ToString(), + name: (map.ContainsKey("name") ? map["name"] : "").ToString(), + enabled: (bool)(map.ContainsKey("enabled") ? map["enabled"] : true), + rowSecurity: (bool)(map.ContainsKey("rowSecurity") ? map["rowSecurity"] : false), columns: map["columns"].ConvertToList(), indexes: map["indexes"].ConvertToList>().Select(it => Appwrite.Models.ColumnIndex.From(map: it)).ToList(), - bytesMax: Convert.ToInt64(map["bytesMax"]), - bytesUsed: Convert.ToInt64(map["bytesUsed"]) + bytesMax: Convert.ToInt64((map.ContainsKey("bytesMax") ? map["bytesMax"] : 0)), + bytesUsed: Convert.ToInt64((map.ContainsKey("bytesUsed") ? map["bytesUsed"] : 0)) ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/TableList.cs b/Appwrite/Models/TableList.cs index 88475ca1..4051119c 100644 --- a/Appwrite/Models/TableList.cs +++ b/Appwrite/Models/TableList.cs @@ -27,7 +27,7 @@ List tables } public static TableList From(Dictionary map) => new TableList( - total: Convert.ToInt64(map["total"]), + total: Convert.ToInt64((map.ContainsKey("total") ? map["total"] : 0)), tables: map["tables"].ConvertToList>().Select(it => Appwrite.Models.Table.From(map: it)).ToList() ); diff --git a/Appwrite/Models/Target.cs b/Appwrite/Models/Target.cs index d4d7c3f4..f03e505e 100644 --- a/Appwrite/Models/Target.cs +++ b/Appwrite/Models/Target.cs @@ -62,15 +62,15 @@ bool expired } public static Target From(Dictionary map) => new Target( - id: map["$id"].ToString(), - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), - name: map["name"].ToString(), - userId: map["userId"].ToString(), + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), + name: (map.ContainsKey("name") ? map["name"] : "").ToString(), + userId: (map.ContainsKey("userId") ? map["userId"] : "").ToString(), providerId: map.TryGetValue("providerId", out var providerId) ? providerId?.ToString() : null, - providerType: map["providerType"].ToString(), - identifier: map["identifier"].ToString(), - expired: (bool)map["expired"] + providerType: (map.ContainsKey("providerType") ? map["providerType"] : "").ToString(), + identifier: (map.ContainsKey("identifier") ? map["identifier"] : "").ToString(), + expired: (bool)(map.ContainsKey("expired") ? map["expired"] : false) ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/TargetList.cs b/Appwrite/Models/TargetList.cs index 010c502b..2cc2fab1 100644 --- a/Appwrite/Models/TargetList.cs +++ b/Appwrite/Models/TargetList.cs @@ -27,7 +27,7 @@ List targets } public static TargetList From(Dictionary map) => new TargetList( - total: Convert.ToInt64(map["total"]), + total: Convert.ToInt64((map.ContainsKey("total") ? map["total"] : 0)), targets: map["targets"].ConvertToList>().Select(it => Appwrite.Models.Target.From(map: it)).ToList() ); diff --git a/Appwrite/Models/Team.cs b/Appwrite/Models/Team.cs index 49fac256..04c68ab9 100644 --- a/Appwrite/Models/Team.cs +++ b/Appwrite/Models/Team.cs @@ -47,11 +47,11 @@ Preferences prefs } public static Team From(Dictionary map) => new Team( - id: map["$id"].ToString(), - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), - name: map["name"].ToString(), - total: Convert.ToInt64(map["total"]), + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), + name: (map.ContainsKey("name") ? map["name"] : "").ToString(), + total: Convert.ToInt64((map.ContainsKey("total") ? map["total"] : 0)), prefs: Appwrite.Models.Preferences.From(map: map["prefs"] is JsonElement jsonObj6 ? jsonObj6.Deserialize>()! : (Dictionary)map["prefs"]) ); diff --git a/Appwrite/Models/TeamList.cs b/Appwrite/Models/TeamList.cs index dec7c3c7..c2445d46 100644 --- a/Appwrite/Models/TeamList.cs +++ b/Appwrite/Models/TeamList.cs @@ -27,7 +27,7 @@ List teams } public static TeamList From(Dictionary map) => new TeamList( - total: Convert.ToInt64(map["total"]), + total: Convert.ToInt64((map.ContainsKey("total") ? map["total"] : 0)), teams: map["teams"].ConvertToList>().Select(it => Appwrite.Models.Team.From(map: it)).ToList() ); diff --git a/Appwrite/Models/Token.cs b/Appwrite/Models/Token.cs index ac92c4e3..88c323c3 100644 --- a/Appwrite/Models/Token.cs +++ b/Appwrite/Models/Token.cs @@ -47,12 +47,12 @@ string phrase } public static Token From(Dictionary map) => new Token( - id: map["$id"].ToString(), - createdAt: map["$createdAt"].ToString(), - userId: map["userId"].ToString(), - secret: map["secret"].ToString(), - expire: map["expire"].ToString(), - phrase: map["phrase"].ToString() + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + userId: (map.ContainsKey("userId") ? map["userId"] : "").ToString(), + secret: (map.ContainsKey("secret") ? map["secret"] : "").ToString(), + expire: (map.ContainsKey("expire") ? map["expire"] : "").ToString(), + phrase: (map.ContainsKey("phrase") ? map["phrase"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/TokenSecret.cs b/Appwrite/Models/TokenSecret.cs new file mode 100644 index 00000000..139f5b76 --- /dev/null +++ b/Appwrite/Models/TokenSecret.cs @@ -0,0 +1,68 @@ + +using System; +using System.Linq; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; +using Appwrite.Enums; +using Appwrite.Extensions; + +namespace Appwrite.Models +{ + public class TokenSecret + { + [JsonPropertyName("$id")] + public string Id { get; private set; } + + [JsonPropertyName("$createdAt")] + public string CreatedAt { get; private set; } + + [JsonPropertyName("userId")] + public string UserId { get; private set; } + + [JsonPropertyName("secret")] + public string Secret { get; private set; } + + [JsonPropertyName("expire")] + public string Expire { get; private set; } + + [JsonPropertyName("phrase")] + public string Phrase { get; private set; } + + public TokenSecret( + string id, + string createdAt, + string userId, + string secret, + string expire, + string phrase + ) + { + Id = id; + CreatedAt = createdAt; + UserId = userId; + Secret = secret; + Expire = expire; + Phrase = phrase; + } + + public static TokenSecret From(Dictionary map) => new TokenSecret( + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + userId: (map.ContainsKey("userId") ? map["userId"] : "").ToString(), + secret: (map.ContainsKey("secret") ? map["secret"] : "").ToString(), + expire: (map.ContainsKey("expire") ? map["expire"] : "").ToString(), + phrase: (map.ContainsKey("phrase") ? map["phrase"] : "").ToString() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "$id", Id }, + { "$createdAt", CreatedAt }, + { "userId", UserId }, + { "secret", Secret }, + { "expire", Expire }, + { "phrase", Phrase } + }; + } +} diff --git a/Appwrite/Models/Topic.cs b/Appwrite/Models/Topic.cs index 11d39499..5f1e3a32 100644 --- a/Appwrite/Models/Topic.cs +++ b/Appwrite/Models/Topic.cs @@ -35,6 +35,12 @@ public class Topic [JsonPropertyName("subscribe")] public List Subscribe { get; private set; } + [JsonPropertyName("qos")] + public long? Qos { get; private set; } + + [JsonPropertyName("expiry")] + public long? Expiry { get; private set; } + public Topic( string id, string createdAt, @@ -43,7 +49,9 @@ public Topic( long emailTotal, long smsTotal, long pushTotal, - List subscribe + List subscribe, + long? qos, + long? expiry ) { Id = id; @@ -54,17 +62,25 @@ List subscribe SmsTotal = smsTotal; PushTotal = pushTotal; Subscribe = subscribe; + Qos = qos; + Expiry = expiry; } public static Topic From(Dictionary map) => new Topic( - id: map["$id"].ToString(), - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), - name: map["name"].ToString(), - emailTotal: Convert.ToInt64(map["emailTotal"]), - smsTotal: Convert.ToInt64(map["smsTotal"]), - pushTotal: Convert.ToInt64(map["pushTotal"]), - subscribe: map["subscribe"].ConvertToList() + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), + name: (map.ContainsKey("name") ? map["name"] : "").ToString(), + emailTotal: Convert.ToInt64((map.ContainsKey("emailTotal") ? map["emailTotal"] : 0)), + smsTotal: Convert.ToInt64((map.ContainsKey("smsTotal") ? map["smsTotal"] : 0)), + pushTotal: Convert.ToInt64((map.ContainsKey("pushTotal") ? map["pushTotal"] : 0)), + subscribe: (map.ContainsKey("subscribe") ? map["subscribe"] : new List { "users" }).ConvertToList(), + qos: map.TryGetValue("qos", out var numberRaw9) && numberRaw9 != null + ? Convert.ToInt64(numberRaw9) + : null, + expiry: map.TryGetValue("expiry", out var numberRaw10) && numberRaw10 != null + ? Convert.ToInt64(numberRaw10) + : null ); public Dictionary ToMap() => new Dictionary() @@ -76,7 +92,9 @@ List subscribe { "emailTotal", EmailTotal }, { "smsTotal", SmsTotal }, { "pushTotal", PushTotal }, - { "subscribe", Subscribe } + { "subscribe", Subscribe }, + { "qos", Qos }, + { "expiry", Expiry } }; } } diff --git a/Appwrite/Models/TopicList.cs b/Appwrite/Models/TopicList.cs index 607c7807..35c24246 100644 --- a/Appwrite/Models/TopicList.cs +++ b/Appwrite/Models/TopicList.cs @@ -27,7 +27,7 @@ List topics } public static TopicList From(Dictionary map) => new TopicList( - total: Convert.ToInt64(map["total"]), + total: Convert.ToInt64((map.ContainsKey("total") ? map["total"] : 0)), topics: map["topics"].ConvertToList>().Select(it => Appwrite.Models.Topic.From(map: it)).ToList() ); diff --git a/Appwrite/Models/Transaction.cs b/Appwrite/Models/Transaction.cs index 94505b64..0173c5ee 100644 --- a/Appwrite/Models/Transaction.cs +++ b/Appwrite/Models/Transaction.cs @@ -47,12 +47,12 @@ string expiresAt } public static Transaction From(Dictionary map) => new Transaction( - id: map["$id"].ToString(), - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), - status: map["status"].ToString(), - operations: Convert.ToInt64(map["operations"]), - expiresAt: map["expiresAt"].ToString() + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), + status: (map.ContainsKey("status") ? map["status"] : "pending").ToString(), + operations: Convert.ToInt64((map.ContainsKey("operations") ? map["operations"] : 0)), + expiresAt: (map.ContainsKey("expiresAt") ? map["expiresAt"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/TransactionList.cs b/Appwrite/Models/TransactionList.cs index 9c1df55a..d4be2576 100644 --- a/Appwrite/Models/TransactionList.cs +++ b/Appwrite/Models/TransactionList.cs @@ -27,7 +27,7 @@ List transactions } public static TransactionList From(Dictionary map) => new TransactionList( - total: Convert.ToInt64(map["total"]), + total: Convert.ToInt64((map.ContainsKey("total") ? map["total"] : 0)), transactions: map["transactions"].ConvertToList>().Select(it => Appwrite.Models.Transaction.From(map: it)).ToList() ); diff --git a/Appwrite/Models/UsageBillingPlan.cs b/Appwrite/Models/UsageBillingPlan.cs index f2007f1f..8c0eddf1 100644 --- a/Appwrite/Models/UsageBillingPlan.cs +++ b/Appwrite/Models/UsageBillingPlan.cs @@ -12,49 +12,49 @@ namespace Appwrite.Models public class UsageBillingPlan { [JsonPropertyName("bandwidth")] - public AdditionalResource Bandwidth { get; private set; } + public AdditionalResource? Bandwidth { get; private set; } [JsonPropertyName("executions")] - public AdditionalResource Executions { get; private set; } + public AdditionalResource? Executions { get; private set; } [JsonPropertyName("member")] public AdditionalResource? Member { get; private set; } [JsonPropertyName("realtime")] - public AdditionalResource Realtime { get; private set; } + public AdditionalResource? Realtime { get; private set; } [JsonPropertyName("realtimeMessages")] - public AdditionalResource RealtimeMessages { get; private set; } + public AdditionalResource? RealtimeMessages { get; private set; } [JsonPropertyName("realtimeBandwidth")] public AdditionalResource? RealtimeBandwidth { get; private set; } [JsonPropertyName("storage")] - public AdditionalResource Storage { get; private set; } + public AdditionalResource? Storage { get; private set; } [JsonPropertyName("users")] - public AdditionalResource Users { get; private set; } + public AdditionalResource? Users { get; private set; } [JsonPropertyName("GBHours")] - public AdditionalResource GBHours { get; private set; } + public AdditionalResource? GBHours { get; private set; } [JsonPropertyName("imageTransformations")] - public AdditionalResource ImageTransformations { get; private set; } + public AdditionalResource? ImageTransformations { get; private set; } [JsonPropertyName("credits")] public AdditionalResource? Credits { get; private set; } public UsageBillingPlan( - AdditionalResource bandwidth, - AdditionalResource executions, + AdditionalResource? bandwidth, + AdditionalResource? executions, AdditionalResource? member, - AdditionalResource realtime, - AdditionalResource realtimeMessages, + AdditionalResource? realtime, + AdditionalResource? realtimeMessages, AdditionalResource? realtimeBandwidth, - AdditionalResource storage, - AdditionalResource users, - AdditionalResource gBHours, - AdditionalResource imageTransformations, + AdditionalResource? storage, + AdditionalResource? users, + AdditionalResource? gBHours, + AdditionalResource? imageTransformations, AdditionalResource? credits ) { @@ -72,20 +72,36 @@ public UsageBillingPlan( } public static UsageBillingPlan From(Dictionary map) => new UsageBillingPlan( - bandwidth: Appwrite.Models.AdditionalResource.From(map: map["bandwidth"] is JsonElement jsonObj1 ? jsonObj1.Deserialize>()! : (Dictionary)map["bandwidth"]), - executions: Appwrite.Models.AdditionalResource.From(map: map["executions"] is JsonElement jsonObj2 ? jsonObj2.Deserialize>()! : (Dictionary)map["executions"]), + bandwidth: map.TryGetValue("bandwidth", out var objectRaw1) && objectRaw1 != null + ? Appwrite.Models.AdditionalResource.From(map: objectRaw1 is JsonElement jsonObj1 ? jsonObj1.Deserialize>()! : (Dictionary)objectRaw1) + : null, + executions: map.TryGetValue("executions", out var objectRaw2) && objectRaw2 != null + ? Appwrite.Models.AdditionalResource.From(map: objectRaw2 is JsonElement jsonObj2 ? jsonObj2.Deserialize>()! : (Dictionary)objectRaw2) + : null, member: map.TryGetValue("member", out var objectRaw3) && objectRaw3 != null ? Appwrite.Models.AdditionalResource.From(map: objectRaw3 is JsonElement jsonObj3 ? jsonObj3.Deserialize>()! : (Dictionary)objectRaw3) : null, - realtime: Appwrite.Models.AdditionalResource.From(map: map["realtime"] is JsonElement jsonObj4 ? jsonObj4.Deserialize>()! : (Dictionary)map["realtime"]), - realtimeMessages: Appwrite.Models.AdditionalResource.From(map: map["realtimeMessages"] is JsonElement jsonObj5 ? jsonObj5.Deserialize>()! : (Dictionary)map["realtimeMessages"]), + realtime: map.TryGetValue("realtime", out var objectRaw4) && objectRaw4 != null + ? Appwrite.Models.AdditionalResource.From(map: objectRaw4 is JsonElement jsonObj4 ? jsonObj4.Deserialize>()! : (Dictionary)objectRaw4) + : null, + realtimeMessages: map.TryGetValue("realtimeMessages", out var objectRaw5) && objectRaw5 != null + ? Appwrite.Models.AdditionalResource.From(map: objectRaw5 is JsonElement jsonObj5 ? jsonObj5.Deserialize>()! : (Dictionary)objectRaw5) + : null, realtimeBandwidth: map.TryGetValue("realtimeBandwidth", out var objectRaw6) && objectRaw6 != null ? Appwrite.Models.AdditionalResource.From(map: objectRaw6 is JsonElement jsonObj6 ? jsonObj6.Deserialize>()! : (Dictionary)objectRaw6) : null, - storage: Appwrite.Models.AdditionalResource.From(map: map["storage"] is JsonElement jsonObj7 ? jsonObj7.Deserialize>()! : (Dictionary)map["storage"]), - users: Appwrite.Models.AdditionalResource.From(map: map["users"] is JsonElement jsonObj8 ? jsonObj8.Deserialize>()! : (Dictionary)map["users"]), - gBHours: Appwrite.Models.AdditionalResource.From(map: map["GBHours"] is JsonElement jsonObj9 ? jsonObj9.Deserialize>()! : (Dictionary)map["GBHours"]), - imageTransformations: Appwrite.Models.AdditionalResource.From(map: map["imageTransformations"] is JsonElement jsonObj10 ? jsonObj10.Deserialize>()! : (Dictionary)map["imageTransformations"]), + storage: map.TryGetValue("storage", out var objectRaw7) && objectRaw7 != null + ? Appwrite.Models.AdditionalResource.From(map: objectRaw7 is JsonElement jsonObj7 ? jsonObj7.Deserialize>()! : (Dictionary)objectRaw7) + : null, + users: map.TryGetValue("users", out var objectRaw8) && objectRaw8 != null + ? Appwrite.Models.AdditionalResource.From(map: objectRaw8 is JsonElement jsonObj8 ? jsonObj8.Deserialize>()! : (Dictionary)objectRaw8) + : null, + gBHours: map.TryGetValue("GBHours", out var objectRaw9) && objectRaw9 != null + ? Appwrite.Models.AdditionalResource.From(map: objectRaw9 is JsonElement jsonObj9 ? jsonObj9.Deserialize>()! : (Dictionary)objectRaw9) + : null, + imageTransformations: map.TryGetValue("imageTransformations", out var objectRaw10) && objectRaw10 != null + ? Appwrite.Models.AdditionalResource.From(map: objectRaw10 is JsonElement jsonObj10 ? jsonObj10.Deserialize>()! : (Dictionary)objectRaw10) + : null, credits: map.TryGetValue("credits", out var objectRaw11) && objectRaw11 != null ? Appwrite.Models.AdditionalResource.From(map: objectRaw11 is JsonElement jsonObj11 ? jsonObj11.Deserialize>()! : (Dictionary)objectRaw11) : null diff --git a/Appwrite/Models/User.cs b/Appwrite/Models/User.cs index 0d52e34e..5f3a8506 100644 --- a/Appwrite/Models/User.cs +++ b/Appwrite/Models/User.cs @@ -68,6 +68,9 @@ public class User [JsonPropertyName("emailIsCanonical")] public bool? EmailIsCanonical { get; private set; } + [JsonPropertyName("passwordPwned")] + public bool? PasswordPwned { get; private set; } + [JsonPropertyName("phoneVerification")] public bool PhoneVerification { get; private set; } @@ -109,6 +112,7 @@ public User( bool? emailIsDisposable, bool? emailIsCorporate, bool? emailIsCanonical, + bool? passwordPwned, bool phoneVerification, bool mfa, Preferences prefs, @@ -137,6 +141,7 @@ public User( EmailIsDisposable = emailIsDisposable; EmailIsCorporate = emailIsCorporate; EmailIsCanonical = emailIsCanonical; + PasswordPwned = passwordPwned; PhoneVerification = phoneVerification; Mfa = mfa; Prefs = prefs; @@ -147,20 +152,20 @@ public User( } public static User From(Dictionary map) => new User( - id: map["$id"].ToString(), - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), - name: map["name"].ToString(), + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), + name: (map.ContainsKey("name") ? map["name"] : "").ToString(), password: map.TryGetValue("password", out var password) ? password?.ToString() : null, hash: map.TryGetValue("hash", out var hash) ? hash?.ToString() : null, hashOptions: map.TryGetValue("hashOptions", out var objectRaw7) ? objectRaw7 : null, - registration: map["registration"].ToString(), - status: (bool)map["status"], - labels: map["labels"].ConvertToList(), - passwordUpdate: map["passwordUpdate"].ToString(), - email: map["email"].ToString(), - phone: map["phone"].ToString(), - emailVerification: (bool)map["emailVerification"], + registration: (map.ContainsKey("registration") ? map["registration"] : "").ToString(), + status: (bool)(map.ContainsKey("status") ? map["status"] : true), + labels: (map.ContainsKey("labels") ? map["labels"] : new List()).ConvertToList(), + passwordUpdate: (map.ContainsKey("passwordUpdate") ? map["passwordUpdate"] : "").ToString(), + email: (map.ContainsKey("email") ? map["email"] : "").ToString(), + phone: (map.ContainsKey("phone") ? map["phone"] : "").ToString(), + emailVerification: (bool)(map.ContainsKey("emailVerification") ? map["emailVerification"] : false), emailCanonical: map.TryGetValue("emailCanonical", out var emailCanonical) ? emailCanonical?.ToString() : null, emailIsFree: map.TryGetValue("emailIsFree", out var boolRaw16) && boolRaw16 != null ? (bool?)boolRaw16 @@ -174,13 +179,16 @@ public User( emailIsCanonical: map.TryGetValue("emailIsCanonical", out var boolRaw19) && boolRaw19 != null ? (bool?)boolRaw19 : null, - phoneVerification: (bool)map["phoneVerification"], - mfa: (bool)map["mfa"], - prefs: Appwrite.Models.Preferences.From(map: map["prefs"] is JsonElement jsonObj22 ? jsonObj22.Deserialize>()! : (Dictionary)map["prefs"]), + passwordPwned: map.TryGetValue("passwordPwned", out var boolRaw20) && boolRaw20 != null + ? (bool?)boolRaw20 + : null, + phoneVerification: (bool)(map.ContainsKey("phoneVerification") ? map["phoneVerification"] : false), + mfa: (bool)(map.ContainsKey("mfa") ? map["mfa"] : false), + prefs: Appwrite.Models.Preferences.From(map: map["prefs"] is JsonElement jsonObj23 ? jsonObj23.Deserialize>()! : (Dictionary)map["prefs"]), targets: map["targets"].ConvertToList>().Select(it => Appwrite.Models.Target.From(map: it)).ToList(), - accessedAt: map["accessedAt"].ToString(), - impersonator: map.TryGetValue("impersonator", out var boolRaw25) && boolRaw25 != null - ? (bool?)boolRaw25 + accessedAt: (map.ContainsKey("accessedAt") ? map["accessedAt"] : "").ToString(), + impersonator: map.TryGetValue("impersonator", out var boolRaw26) && boolRaw26 != null + ? (bool?)boolRaw26 : null, impersonatorUserId: map.TryGetValue("impersonatorUserId", out var impersonatorUserId) ? impersonatorUserId?.ToString() : null ); @@ -206,6 +214,7 @@ public User( { "emailIsDisposable", EmailIsDisposable }, { "emailIsCorporate", EmailIsCorporate }, { "emailIsCanonical", EmailIsCanonical }, + { "passwordPwned", PasswordPwned }, { "phoneVerification", PhoneVerification }, { "mfa", Mfa }, { "prefs", Prefs?.ToMap() }, diff --git a/Appwrite/Models/UserList.cs b/Appwrite/Models/UserList.cs index 8b5683f5..5e5d44ef 100644 --- a/Appwrite/Models/UserList.cs +++ b/Appwrite/Models/UserList.cs @@ -27,7 +27,7 @@ List users } public static UserList From(Dictionary map) => new UserList( - total: Convert.ToInt64(map["total"]), + total: Convert.ToInt64((map.ContainsKey("total") ? map["total"] : 0)), users: map["users"].ConvertToList>().Select(it => Appwrite.Models.User.From(map: it)).ToList() ); diff --git a/Appwrite/Models/Variable.cs b/Appwrite/Models/Variable.cs index edcb5c90..1f838540 100644 --- a/Appwrite/Models/Variable.cs +++ b/Appwrite/Models/Variable.cs @@ -57,14 +57,14 @@ string resourceId } public static Variable From(Dictionary map) => new Variable( - id: map["$id"].ToString(), - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), - key: map["key"].ToString(), - @value: map["value"].ToString(), - secret: (bool)map["secret"], - resourceType: map["resourceType"].ToString(), - resourceId: map["resourceId"].ToString() + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), + key: (map.ContainsKey("key") ? map["key"] : "").ToString(), + @value: (map.ContainsKey("value") ? map["value"] : "").ToString(), + secret: (bool)(map.ContainsKey("secret") ? map["secret"] : false), + resourceType: (map.ContainsKey("resourceType") ? map["resourceType"] : "").ToString(), + resourceId: (map.ContainsKey("resourceId") ? map["resourceId"] : "").ToString() ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/VariableList.cs b/Appwrite/Models/VariableList.cs index ea107dad..182a0ba8 100644 --- a/Appwrite/Models/VariableList.cs +++ b/Appwrite/Models/VariableList.cs @@ -27,7 +27,7 @@ List variables } public static VariableList From(Dictionary map) => new VariableList( - total: Convert.ToInt64(map["total"]), + total: Convert.ToInt64((map.ContainsKey("total") ? map["total"] : 0)), variables: map["variables"].ConvertToList>().Select(it => Appwrite.Models.Variable.From(map: it)).ToList() ); diff --git a/Appwrite/Models/VectorsdbCollection.cs b/Appwrite/Models/VectorsdbCollection.cs index 0d54364b..93f91c14 100644 --- a/Appwrite/Models/VectorsdbCollection.cs +++ b/Appwrite/Models/VectorsdbCollection.cs @@ -82,19 +82,19 @@ long dimension } public static VectorsdbCollection From(Dictionary map) => new VectorsdbCollection( - id: map["$id"].ToString(), - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), permissions: map["$permissions"].ConvertToList(), - databaseId: map["databaseId"].ToString(), - name: map["name"].ToString(), - enabled: (bool)map["enabled"], - documentSecurity: (bool)map["documentSecurity"], + databaseId: (map.ContainsKey("databaseId") ? map["databaseId"] : "").ToString(), + name: (map.ContainsKey("name") ? map["name"] : "").ToString(), + enabled: (bool)(map.ContainsKey("enabled") ? map["enabled"] : true), + documentSecurity: (bool)(map.ContainsKey("documentSecurity") ? map["documentSecurity"] : false), attributes: map["attributes"].ConvertToList(), indexes: map["indexes"].ConvertToList>().Select(it => Appwrite.Models.Index.From(map: it)).ToList(), - bytesMax: Convert.ToInt64(map["bytesMax"]), - bytesUsed: Convert.ToInt64(map["bytesUsed"]), - dimension: Convert.ToInt64(map["dimension"]) + bytesMax: Convert.ToInt64((map.ContainsKey("bytesMax") ? map["bytesMax"] : 0)), + bytesUsed: Convert.ToInt64((map.ContainsKey("bytesUsed") ? map["bytesUsed"] : 0)), + dimension: Convert.ToInt64((map.ContainsKey("dimension") ? map["dimension"] : 0)) ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/VectorsdbCollectionList.cs b/Appwrite/Models/VectorsdbCollectionList.cs index 3536d571..3392dc88 100644 --- a/Appwrite/Models/VectorsdbCollectionList.cs +++ b/Appwrite/Models/VectorsdbCollectionList.cs @@ -27,7 +27,7 @@ List collections } public static VectorsdbCollectionList From(Dictionary map) => new VectorsdbCollectionList( - total: Convert.ToInt64(map["total"]), + total: Convert.ToInt64((map.ContainsKey("total") ? map["total"] : 0)), collections: map["collections"].ConvertToList>().Select(it => Appwrite.Models.VectorsdbCollection.From(map: it)).ToList() ); diff --git a/Appwrite/Models/WafRuleBypass.cs b/Appwrite/Models/WafRuleBypass.cs new file mode 100644 index 00000000..f0e3d7eb --- /dev/null +++ b/Appwrite/Models/WafRuleBypass.cs @@ -0,0 +1,124 @@ + +using System; +using System.Linq; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; +using Appwrite.Enums; +using Appwrite.Extensions; + +namespace Appwrite.Models +{ + public class WafRuleBypass + { + [JsonPropertyName("$id")] + public string Id { get; private set; } + + [JsonPropertyName("$createdAt")] + public string CreatedAt { get; private set; } + + [JsonPropertyName("$updatedAt")] + public string UpdatedAt { get; private set; } + + [JsonPropertyName("name")] + public string Name { get; private set; } + + [JsonPropertyName("description")] + public string Description { get; private set; } + + [JsonPropertyName("teamId")] + public string TeamId { get; private set; } + + [JsonPropertyName("projectId")] + public string ProjectId { get; private set; } + + [JsonPropertyName("resourceType")] + public string ResourceType { get; private set; } + + [JsonPropertyName("resourceId")] + public string ResourceId { get; private set; } + + [JsonPropertyName("action")] + public Appwrite.Enums.WafRuleAction Action { get; private set; } + + [JsonPropertyName("priority")] + public long Priority { get; private set; } + + [JsonPropertyName("enabled")] + public bool Enabled { get; private set; } + + [JsonPropertyName("conditions")] + public List Conditions { get; private set; } + + [JsonPropertyName("config")] + public object Config { get; private set; } + + public WafRuleBypass( + string id, + string createdAt, + string updatedAt, + string name, + string description, + string teamId, + string projectId, + string resourceType, + string resourceId, + Appwrite.Enums.WafRuleAction action, + long priority, + bool enabled, + List conditions, + object config + ) + { + Id = id; + CreatedAt = createdAt; + UpdatedAt = updatedAt; + Name = name; + Description = description; + TeamId = teamId; + ProjectId = projectId; + ResourceType = resourceType; + ResourceId = resourceId; + Action = action; + Priority = priority; + Enabled = enabled; + Conditions = conditions; + Config = config; + } + + public static WafRuleBypass From(Dictionary map) => new WafRuleBypass( + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), + name: (map.ContainsKey("name") ? map["name"] : "").ToString(), + description: (map.ContainsKey("description") ? map["description"] : "").ToString(), + teamId: (map.ContainsKey("teamId") ? map["teamId"] : "").ToString(), + projectId: (map.ContainsKey("projectId") ? map["projectId"] : "").ToString(), + resourceType: (map.ContainsKey("resourceType") ? map["resourceType"] : "api").ToString(), + resourceId: (map.ContainsKey("resourceId") ? map["resourceId"] : "").ToString(), + action: new Appwrite.Enums.WafRuleAction(map["action"].ToString()!), + priority: Convert.ToInt64((map.ContainsKey("priority") ? map["priority"] : 0)), + enabled: (bool)(map.ContainsKey("enabled") ? map["enabled"] : true), + conditions: (map.ContainsKey("conditions") ? map["conditions"] : new List()).ConvertToList(), + config: (map.ContainsKey("config") ? map["config"] : new Dictionary()) + ); + + public Dictionary ToMap() => new Dictionary() + { + { "$id", Id }, + { "$createdAt", CreatedAt }, + { "$updatedAt", UpdatedAt }, + { "name", Name }, + { "description", Description }, + { "teamId", TeamId }, + { "projectId", ProjectId }, + { "resourceType", ResourceType }, + { "resourceId", ResourceId }, + { "action", Action.Value }, + { "priority", Priority }, + { "enabled", Enabled }, + { "conditions", Conditions }, + { "config", Config } + }; + } +} diff --git a/Appwrite/Models/WafRuleChallenge.cs b/Appwrite/Models/WafRuleChallenge.cs new file mode 100644 index 00000000..65c2a6d1 --- /dev/null +++ b/Appwrite/Models/WafRuleChallenge.cs @@ -0,0 +1,145 @@ + +using System; +using System.Linq; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; +using Appwrite.Enums; +using Appwrite.Extensions; + +namespace Appwrite.Models +{ + public class WafRuleChallenge + { + [JsonPropertyName("$id")] + public string Id { get; private set; } + + [JsonPropertyName("$createdAt")] + public string CreatedAt { get; private set; } + + [JsonPropertyName("$updatedAt")] + public string UpdatedAt { get; private set; } + + [JsonPropertyName("name")] + public string Name { get; private set; } + + [JsonPropertyName("description")] + public string Description { get; private set; } + + [JsonPropertyName("teamId")] + public string TeamId { get; private set; } + + [JsonPropertyName("projectId")] + public string ProjectId { get; private set; } + + [JsonPropertyName("resourceType")] + public string ResourceType { get; private set; } + + [JsonPropertyName("resourceId")] + public string ResourceId { get; private set; } + + [JsonPropertyName("action")] + public Appwrite.Enums.WafRuleAction Action { get; private set; } + + [JsonPropertyName("priority")] + public long Priority { get; private set; } + + [JsonPropertyName("enabled")] + public bool Enabled { get; private set; } + + [JsonPropertyName("conditions")] + public List Conditions { get; private set; } + + [JsonPropertyName("config")] + public object Config { get; private set; } + + [JsonPropertyName("challengeType")] + public string ChallengeType { get; private set; } + + [JsonPropertyName("difficulty")] + public long Difficulty { get; private set; } + + [JsonPropertyName("ttl")] + public long Ttl { get; private set; } + + public WafRuleChallenge( + string id, + string createdAt, + string updatedAt, + string name, + string description, + string teamId, + string projectId, + string resourceType, + string resourceId, + Appwrite.Enums.WafRuleAction action, + long priority, + bool enabled, + List conditions, + object config, + string challengeType, + long difficulty, + long ttl + ) + { + Id = id; + CreatedAt = createdAt; + UpdatedAt = updatedAt; + Name = name; + Description = description; + TeamId = teamId; + ProjectId = projectId; + ResourceType = resourceType; + ResourceId = resourceId; + Action = action; + Priority = priority; + Enabled = enabled; + Conditions = conditions; + Config = config; + ChallengeType = challengeType; + Difficulty = difficulty; + Ttl = ttl; + } + + public static WafRuleChallenge From(Dictionary map) => new WafRuleChallenge( + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), + name: (map.ContainsKey("name") ? map["name"] : "").ToString(), + description: (map.ContainsKey("description") ? map["description"] : "").ToString(), + teamId: (map.ContainsKey("teamId") ? map["teamId"] : "").ToString(), + projectId: (map.ContainsKey("projectId") ? map["projectId"] : "").ToString(), + resourceType: (map.ContainsKey("resourceType") ? map["resourceType"] : "api").ToString(), + resourceId: (map.ContainsKey("resourceId") ? map["resourceId"] : "").ToString(), + action: new Appwrite.Enums.WafRuleAction(map["action"].ToString()!), + priority: Convert.ToInt64((map.ContainsKey("priority") ? map["priority"] : 0)), + enabled: (bool)(map.ContainsKey("enabled") ? map["enabled"] : true), + conditions: (map.ContainsKey("conditions") ? map["conditions"] : new List()).ConvertToList(), + config: (map.ContainsKey("config") ? map["config"] : new Dictionary()), + challengeType: (map.ContainsKey("challengeType") ? map["challengeType"] : "compute").ToString(), + difficulty: Convert.ToInt64((map.ContainsKey("difficulty") ? map["difficulty"] : 3)), + ttl: Convert.ToInt64((map.ContainsKey("ttl") ? map["ttl"] : 1800)) + ); + + public Dictionary ToMap() => new Dictionary() + { + { "$id", Id }, + { "$createdAt", CreatedAt }, + { "$updatedAt", UpdatedAt }, + { "name", Name }, + { "description", Description }, + { "teamId", TeamId }, + { "projectId", ProjectId }, + { "resourceType", ResourceType }, + { "resourceId", ResourceId }, + { "action", Action.Value }, + { "priority", Priority }, + { "enabled", Enabled }, + { "conditions", Conditions }, + { "config", Config }, + { "challengeType", ChallengeType }, + { "difficulty", Difficulty }, + { "ttl", Ttl } + }; + } +} diff --git a/Appwrite/Models/WafRuleDeny.cs b/Appwrite/Models/WafRuleDeny.cs new file mode 100644 index 00000000..34fddddb --- /dev/null +++ b/Appwrite/Models/WafRuleDeny.cs @@ -0,0 +1,124 @@ + +using System; +using System.Linq; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; +using Appwrite.Enums; +using Appwrite.Extensions; + +namespace Appwrite.Models +{ + public class WafRuleDeny + { + [JsonPropertyName("$id")] + public string Id { get; private set; } + + [JsonPropertyName("$createdAt")] + public string CreatedAt { get; private set; } + + [JsonPropertyName("$updatedAt")] + public string UpdatedAt { get; private set; } + + [JsonPropertyName("name")] + public string Name { get; private set; } + + [JsonPropertyName("description")] + public string Description { get; private set; } + + [JsonPropertyName("teamId")] + public string TeamId { get; private set; } + + [JsonPropertyName("projectId")] + public string ProjectId { get; private set; } + + [JsonPropertyName("resourceType")] + public string ResourceType { get; private set; } + + [JsonPropertyName("resourceId")] + public string ResourceId { get; private set; } + + [JsonPropertyName("action")] + public Appwrite.Enums.WafRuleAction Action { get; private set; } + + [JsonPropertyName("priority")] + public long Priority { get; private set; } + + [JsonPropertyName("enabled")] + public bool Enabled { get; private set; } + + [JsonPropertyName("conditions")] + public List Conditions { get; private set; } + + [JsonPropertyName("config")] + public object Config { get; private set; } + + public WafRuleDeny( + string id, + string createdAt, + string updatedAt, + string name, + string description, + string teamId, + string projectId, + string resourceType, + string resourceId, + Appwrite.Enums.WafRuleAction action, + long priority, + bool enabled, + List conditions, + object config + ) + { + Id = id; + CreatedAt = createdAt; + UpdatedAt = updatedAt; + Name = name; + Description = description; + TeamId = teamId; + ProjectId = projectId; + ResourceType = resourceType; + ResourceId = resourceId; + Action = action; + Priority = priority; + Enabled = enabled; + Conditions = conditions; + Config = config; + } + + public static WafRuleDeny From(Dictionary map) => new WafRuleDeny( + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), + name: (map.ContainsKey("name") ? map["name"] : "").ToString(), + description: (map.ContainsKey("description") ? map["description"] : "").ToString(), + teamId: (map.ContainsKey("teamId") ? map["teamId"] : "").ToString(), + projectId: (map.ContainsKey("projectId") ? map["projectId"] : "").ToString(), + resourceType: (map.ContainsKey("resourceType") ? map["resourceType"] : "api").ToString(), + resourceId: (map.ContainsKey("resourceId") ? map["resourceId"] : "").ToString(), + action: new Appwrite.Enums.WafRuleAction(map["action"].ToString()!), + priority: Convert.ToInt64((map.ContainsKey("priority") ? map["priority"] : 0)), + enabled: (bool)(map.ContainsKey("enabled") ? map["enabled"] : true), + conditions: (map.ContainsKey("conditions") ? map["conditions"] : new List()).ConvertToList(), + config: (map.ContainsKey("config") ? map["config"] : new Dictionary()) + ); + + public Dictionary ToMap() => new Dictionary() + { + { "$id", Id }, + { "$createdAt", CreatedAt }, + { "$updatedAt", UpdatedAt }, + { "name", Name }, + { "description", Description }, + { "teamId", TeamId }, + { "projectId", ProjectId }, + { "resourceType", ResourceType }, + { "resourceId", ResourceId }, + { "action", Action.Value }, + { "priority", Priority }, + { "enabled", Enabled }, + { "conditions", Conditions }, + { "config", Config } + }; + } +} diff --git a/Appwrite/Models/LogList.cs b/Appwrite/Models/WafRuleList.cs similarity index 51% rename from Appwrite/Models/LogList.cs rename to Appwrite/Models/WafRuleList.cs index e8c583fc..1813ca15 100644 --- a/Appwrite/Models/LogList.cs +++ b/Appwrite/Models/WafRuleList.cs @@ -9,32 +9,32 @@ namespace Appwrite.Models { - public class LogList + public class WafRuleList { [JsonPropertyName("total")] public long Total { get; private set; } - [JsonPropertyName("logs")] - public List Logs { get; private set; } + [JsonPropertyName("rules")] + public List Rules { get; private set; } - public LogList( + public WafRuleList( long total, - List logs + List rules ) { Total = total; - Logs = logs; + Rules = rules; } - public static LogList From(Dictionary map) => new LogList( - total: Convert.ToInt64(map["total"]), - logs: map["logs"].ConvertToList>().Select(it => Appwrite.Models.Log.From(map: it)).ToList() + public static WafRuleList From(Dictionary map) => new WafRuleList( + total: Convert.ToInt64((map.ContainsKey("total") ? map["total"] : 0)), + rules: map["rules"].ConvertToList() ); public Dictionary ToMap() => new Dictionary() { { "total", Total }, - { "logs", Logs?.Select(it => it.ToMap()).ToList() } + { "rules", Rules } }; } } diff --git a/Appwrite/Models/WafRuleRateLimit.cs b/Appwrite/Models/WafRuleRateLimit.cs new file mode 100644 index 00000000..9d84b78e --- /dev/null +++ b/Appwrite/Models/WafRuleRateLimit.cs @@ -0,0 +1,159 @@ + +using System; +using System.Linq; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; +using Appwrite.Enums; +using Appwrite.Extensions; + +namespace Appwrite.Models +{ + public class WafRuleRateLimit + { + [JsonPropertyName("$id")] + public string Id { get; private set; } + + [JsonPropertyName("$createdAt")] + public string CreatedAt { get; private set; } + + [JsonPropertyName("$updatedAt")] + public string UpdatedAt { get; private set; } + + [JsonPropertyName("name")] + public string Name { get; private set; } + + [JsonPropertyName("description")] + public string Description { get; private set; } + + [JsonPropertyName("teamId")] + public string TeamId { get; private set; } + + [JsonPropertyName("projectId")] + public string ProjectId { get; private set; } + + [JsonPropertyName("resourceType")] + public string ResourceType { get; private set; } + + [JsonPropertyName("resourceId")] + public string ResourceId { get; private set; } + + [JsonPropertyName("action")] + public Appwrite.Enums.WafRuleAction Action { get; private set; } + + [JsonPropertyName("priority")] + public long Priority { get; private set; } + + [JsonPropertyName("enabled")] + public bool Enabled { get; private set; } + + [JsonPropertyName("conditions")] + public List Conditions { get; private set; } + + [JsonPropertyName("config")] + public object Config { get; private set; } + + [JsonPropertyName("limit")] + public long Limit { get; private set; } + + [JsonPropertyName("interval")] + public long Interval { get; private set; } + + [JsonPropertyName("key")] + public string Key { get; private set; } + + [JsonPropertyName("strategy")] + public string Strategy { get; private set; } + + [JsonPropertyName("maxBucketSize")] + public long MaxBucketSize { get; private set; } + + public WafRuleRateLimit( + string id, + string createdAt, + string updatedAt, + string name, + string description, + string teamId, + string projectId, + string resourceType, + string resourceId, + Appwrite.Enums.WafRuleAction action, + long priority, + bool enabled, + List conditions, + object config, + long limit, + long interval, + string key, + string strategy, + long maxBucketSize + ) + { + Id = id; + CreatedAt = createdAt; + UpdatedAt = updatedAt; + Name = name; + Description = description; + TeamId = teamId; + ProjectId = projectId; + ResourceType = resourceType; + ResourceId = resourceId; + Action = action; + Priority = priority; + Enabled = enabled; + Conditions = conditions; + Config = config; + Limit = limit; + Interval = interval; + Key = key; + Strategy = strategy; + MaxBucketSize = maxBucketSize; + } + + public static WafRuleRateLimit From(Dictionary map) => new WafRuleRateLimit( + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), + name: (map.ContainsKey("name") ? map["name"] : "").ToString(), + description: (map.ContainsKey("description") ? map["description"] : "").ToString(), + teamId: (map.ContainsKey("teamId") ? map["teamId"] : "").ToString(), + projectId: (map.ContainsKey("projectId") ? map["projectId"] : "").ToString(), + resourceType: (map.ContainsKey("resourceType") ? map["resourceType"] : "api").ToString(), + resourceId: (map.ContainsKey("resourceId") ? map["resourceId"] : "").ToString(), + action: new Appwrite.Enums.WafRuleAction(map["action"].ToString()!), + priority: Convert.ToInt64((map.ContainsKey("priority") ? map["priority"] : 0)), + enabled: (bool)(map.ContainsKey("enabled") ? map["enabled"] : true), + conditions: (map.ContainsKey("conditions") ? map["conditions"] : new List()).ConvertToList(), + config: (map.ContainsKey("config") ? map["config"] : new Dictionary()), + limit: Convert.ToInt64((map.ContainsKey("limit") ? map["limit"] : 100)), + interval: Convert.ToInt64((map.ContainsKey("interval") ? map["interval"] : 3600)), + key: (map.ContainsKey("key") ? map["key"] : "ip").ToString(), + strategy: (map.ContainsKey("strategy") ? map["strategy"] : "fixedWindow").ToString(), + maxBucketSize: Convert.ToInt64((map.ContainsKey("maxBucketSize") ? map["maxBucketSize"] : 0)) + ); + + public Dictionary ToMap() => new Dictionary() + { + { "$id", Id }, + { "$createdAt", CreatedAt }, + { "$updatedAt", UpdatedAt }, + { "name", Name }, + { "description", Description }, + { "teamId", TeamId }, + { "projectId", ProjectId }, + { "resourceType", ResourceType }, + { "resourceId", ResourceId }, + { "action", Action.Value }, + { "priority", Priority }, + { "enabled", Enabled }, + { "conditions", Conditions }, + { "config", Config }, + { "limit", Limit }, + { "interval", Interval }, + { "key", Key }, + { "strategy", Strategy }, + { "maxBucketSize", MaxBucketSize } + }; + } +} diff --git a/Appwrite/Models/WafRuleRedirect.cs b/Appwrite/Models/WafRuleRedirect.cs new file mode 100644 index 00000000..82efe5ab --- /dev/null +++ b/Appwrite/Models/WafRuleRedirect.cs @@ -0,0 +1,138 @@ + +using System; +using System.Linq; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; +using Appwrite.Enums; +using Appwrite.Extensions; + +namespace Appwrite.Models +{ + public class WafRuleRedirect + { + [JsonPropertyName("$id")] + public string Id { get; private set; } + + [JsonPropertyName("$createdAt")] + public string CreatedAt { get; private set; } + + [JsonPropertyName("$updatedAt")] + public string UpdatedAt { get; private set; } + + [JsonPropertyName("name")] + public string Name { get; private set; } + + [JsonPropertyName("description")] + public string Description { get; private set; } + + [JsonPropertyName("teamId")] + public string TeamId { get; private set; } + + [JsonPropertyName("projectId")] + public string ProjectId { get; private set; } + + [JsonPropertyName("resourceType")] + public string ResourceType { get; private set; } + + [JsonPropertyName("resourceId")] + public string ResourceId { get; private set; } + + [JsonPropertyName("action")] + public Appwrite.Enums.WafRuleAction Action { get; private set; } + + [JsonPropertyName("priority")] + public long Priority { get; private set; } + + [JsonPropertyName("enabled")] + public bool Enabled { get; private set; } + + [JsonPropertyName("conditions")] + public List Conditions { get; private set; } + + [JsonPropertyName("config")] + public object Config { get; private set; } + + [JsonPropertyName("location")] + public string Location { get; private set; } + + [JsonPropertyName("statusCode")] + public long StatusCode { get; private set; } + + public WafRuleRedirect( + string id, + string createdAt, + string updatedAt, + string name, + string description, + string teamId, + string projectId, + string resourceType, + string resourceId, + Appwrite.Enums.WafRuleAction action, + long priority, + bool enabled, + List conditions, + object config, + string location, + long statusCode + ) + { + Id = id; + CreatedAt = createdAt; + UpdatedAt = updatedAt; + Name = name; + Description = description; + TeamId = teamId; + ProjectId = projectId; + ResourceType = resourceType; + ResourceId = resourceId; + Action = action; + Priority = priority; + Enabled = enabled; + Conditions = conditions; + Config = config; + Location = location; + StatusCode = statusCode; + } + + public static WafRuleRedirect From(Dictionary map) => new WafRuleRedirect( + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), + name: (map.ContainsKey("name") ? map["name"] : "").ToString(), + description: (map.ContainsKey("description") ? map["description"] : "").ToString(), + teamId: (map.ContainsKey("teamId") ? map["teamId"] : "").ToString(), + projectId: (map.ContainsKey("projectId") ? map["projectId"] : "").ToString(), + resourceType: (map.ContainsKey("resourceType") ? map["resourceType"] : "api").ToString(), + resourceId: (map.ContainsKey("resourceId") ? map["resourceId"] : "").ToString(), + action: new Appwrite.Enums.WafRuleAction(map["action"].ToString()!), + priority: Convert.ToInt64((map.ContainsKey("priority") ? map["priority"] : 0)), + enabled: (bool)(map.ContainsKey("enabled") ? map["enabled"] : true), + conditions: (map.ContainsKey("conditions") ? map["conditions"] : new List()).ConvertToList(), + config: (map.ContainsKey("config") ? map["config"] : new Dictionary()), + location: (map.ContainsKey("location") ? map["location"] : "/").ToString(), + statusCode: Convert.ToInt64((map.ContainsKey("statusCode") ? map["statusCode"] : 302)) + ); + + public Dictionary ToMap() => new Dictionary() + { + { "$id", Id }, + { "$createdAt", CreatedAt }, + { "$updatedAt", UpdatedAt }, + { "name", Name }, + { "description", Description }, + { "teamId", TeamId }, + { "projectId", ProjectId }, + { "resourceType", ResourceType }, + { "resourceId", ResourceId }, + { "action", Action.Value }, + { "priority", Priority }, + { "enabled", Enabled }, + { "conditions", Conditions }, + { "config", Config }, + { "location", Location }, + { "statusCode", StatusCode } + }; + } +} diff --git a/Appwrite/Models/Webhook.cs b/Appwrite/Models/Webhook.cs index 085d7272..7544a77f 100644 --- a/Appwrite/Models/Webhook.cs +++ b/Appwrite/Models/Webhook.cs @@ -82,19 +82,19 @@ long attempts } public static Webhook From(Dictionary map) => new Webhook( - id: map["$id"].ToString(), - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), - name: map["name"].ToString(), - url: map["url"].ToString(), - events: map["events"].ConvertToList(), - tls: (bool)map["tls"], - authUsername: map["authUsername"].ToString(), - authPassword: map["authPassword"].ToString(), - secret: map["secret"].ToString(), - enabled: (bool)map["enabled"], - logs: map["logs"].ToString(), - attempts: Convert.ToInt64(map["attempts"]) + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), + name: (map.ContainsKey("name") ? map["name"] : "").ToString(), + url: (map.ContainsKey("url") ? map["url"] : "").ToString(), + events: (map.ContainsKey("events") ? map["events"] : new List()).ConvertToList(), + tls: (bool)(map.ContainsKey("tls") ? map["tls"] : true), + authUsername: (map.ContainsKey("authUsername") ? map["authUsername"] : "").ToString(), + authPassword: (map.ContainsKey("authPassword") ? map["authPassword"] : "").ToString(), + secret: (map.ContainsKey("secret") ? map["secret"] : "").ToString(), + enabled: (bool)(map.ContainsKey("enabled") ? map["enabled"] : true), + logs: (map.ContainsKey("logs") ? map["logs"] : "").ToString(), + attempts: Convert.ToInt64((map.ContainsKey("attempts") ? map["attempts"] : 0)) ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/WebhookList.cs b/Appwrite/Models/WebhookList.cs index ece56990..7151e12b 100644 --- a/Appwrite/Models/WebhookList.cs +++ b/Appwrite/Models/WebhookList.cs @@ -27,7 +27,7 @@ List webhooks } public static WebhookList From(Dictionary map) => new WebhookList( - total: Convert.ToInt64(map["total"]), + total: Convert.ToInt64((map.ContainsKey("total") ? map["total"] : 0)), webhooks: map["webhooks"].ConvertToList>().Select(it => Appwrite.Models.Webhook.From(map: it)).ToList() ); diff --git a/Appwrite/Models/XDomain.cs b/Appwrite/Models/XDomain.cs new file mode 100644 index 00000000..c2d66bfe --- /dev/null +++ b/Appwrite/Models/XDomain.cs @@ -0,0 +1,121 @@ + +using System; +using System.Linq; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; +using Appwrite.Enums; +using Appwrite.Extensions; + +namespace Appwrite.Models +{ + public class XDomain + { + [JsonPropertyName("$id")] + public string Id { get; private set; } + + [JsonPropertyName("$createdAt")] + public string CreatedAt { get; private set; } + + [JsonPropertyName("$updatedAt")] + public string UpdatedAt { get; private set; } + + [JsonPropertyName("domain")] + public string Domain { get; private set; } + + [JsonPropertyName("registrar")] + public string Registrar { get; private set; } + + [JsonPropertyName("nameservers")] + public string Nameservers { get; private set; } + + [JsonPropertyName("expire")] + public string Expire { get; private set; } + + [JsonPropertyName("renewal")] + public string Renewal { get; private set; } + + [JsonPropertyName("autoRenewal")] + public bool AutoRenewal { get; private set; } + + [JsonPropertyName("renewalPrice")] + public long RenewalPrice { get; private set; } + + [JsonPropertyName("transferStatus")] + public Appwrite.Enums.DomainTransferStatusEnum? TransferStatus { get; private set; } + + [JsonPropertyName("teamId")] + public string TeamId { get; private set; } + + [JsonPropertyName("dnsRecords")] + public List DnsRecords { get; private set; } + + public XDomain( + string id, + string createdAt, + string updatedAt, + string domain, + string registrar, + string nameservers, + string expire, + string renewal, + bool autoRenewal, + long renewalPrice, + Appwrite.Enums.DomainTransferStatusEnum? transferStatus, + string teamId, + List dnsRecords + ) + { + Id = id; + CreatedAt = createdAt; + UpdatedAt = updatedAt; + Domain = domain; + Registrar = registrar; + Nameservers = nameservers; + Expire = expire; + Renewal = renewal; + AutoRenewal = autoRenewal; + RenewalPrice = renewalPrice; + TransferStatus = transferStatus; + TeamId = teamId; + DnsRecords = dnsRecords; + } + + public static XDomain From(Dictionary map) => new XDomain( + id: (map.ContainsKey("$id") ? map["$id"] : "").ToString(), + createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(), + updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(), + domain: (map.ContainsKey("domain") ? map["domain"] : "").ToString(), + registrar: (map.ContainsKey("registrar") ? map["registrar"] : "").ToString(), + nameservers: (map.ContainsKey("nameservers") ? map["nameservers"] : "").ToString(), + expire: (map.ContainsKey("expire") ? map["expire"] : "").ToString(), + renewal: (map.ContainsKey("renewal") ? map["renewal"] : "").ToString(), + autoRenewal: (bool)(map.ContainsKey("autoRenewal") ? map["autoRenewal"] : false), + renewalPrice: Convert.ToInt64((map.ContainsKey("renewalPrice") ? map["renewalPrice"] : 0)), + transferStatus: map.TryGetValue("transferStatus", out var enumRaw11) + ? enumRaw11 == null + ? null + : new Appwrite.Enums.DomainTransferStatusEnum(enumRaw11.ToString()!) + : null, + teamId: (map.ContainsKey("teamId") ? map["teamId"] : "").ToString(), + dnsRecords: map["dnsRecords"].ConvertToList>().Select(it => Appwrite.Models.DnsRecord.From(map: it)).ToList() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "$id", Id }, + { "$createdAt", CreatedAt }, + { "$updatedAt", UpdatedAt }, + { "domain", Domain }, + { "registrar", Registrar }, + { "nameservers", Nameservers }, + { "expire", Expire }, + { "renewal", Renewal }, + { "autoRenewal", AutoRenewal }, + { "renewalPrice", RenewalPrice }, + { "transferStatus", TransferStatus?.Value }, + { "teamId", TeamId }, + { "dnsRecords", DnsRecords?.Select(it => it.ToMap()).ToList() } + }; + } +} diff --git a/Appwrite/Services/Account.cs b/Appwrite/Services/Account.cs index a4800d1d..b3b89ab5 100644 --- a/Appwrite/Services/Account.cs +++ b/Appwrite/Services/Account.cs @@ -133,6 +133,11 @@ static Models.Oauth2ConsentList Convert(Dictionary it) /// public Task GetConsent(string consentId) { + if (consentId == "") + { + throw new AppwriteException("Missing required parameter: \"consentId\""); + } + var apiPath = "/account/consents/{consentId}" .Replace("{consentId}", consentId); @@ -169,6 +174,11 @@ static Models.Oauth2Consent Convert(Dictionary it) /// public Task DeleteConsent(string consentId) { + if (consentId == "") + { + throw new AppwriteException("Missing required parameter: \"consentId\""); + } + var apiPath = "/account/consents/{consentId}" .Replace("{consentId}", consentId); @@ -201,6 +211,11 @@ public Task DeleteConsent(string consentId) /// public Task ListConsentTokens(string consentId, List? queries = null, bool? total = null) { + if (consentId == "") + { + throw new AppwriteException("Missing required parameter: \"consentId\""); + } + var apiPath = "/account/consents/{consentId}/tokens" .Replace("{consentId}", consentId); @@ -238,6 +253,16 @@ static Models.Oauth2ConsentTokenList Convert(Dictionary it) /// public Task GetConsentToken(string consentId, string tokenId) { + if (consentId == "") + { + throw new AppwriteException("Missing required parameter: \"consentId\""); + } + + if (tokenId == "") + { + throw new AppwriteException("Missing required parameter: \"tokenId\""); + } + var apiPath = "/account/consents/{consentId}/tokens/{tokenId}" .Replace("{consentId}", consentId) .Replace("{tokenId}", tokenId); @@ -275,6 +300,16 @@ static Models.Oauth2ConsentToken Convert(Dictionary it) /// public Task DeleteConsentToken(string consentId, string tokenId) { + if (consentId == "") + { + throw new AppwriteException("Missing required parameter: \"consentId\""); + } + + if (tokenId == "") + { + throw new AppwriteException("Missing required parameter: \"tokenId\""); + } + var apiPath = "/account/consents/{consentId}/tokens/{tokenId}" .Replace("{consentId}", consentId) .Replace("{tokenId}", tokenId); @@ -384,6 +419,11 @@ static Models.IdentityList Convert(Dictionary it) /// public Task DeleteIdentity(string identityId) { + if (identityId == "") + { + throw new AppwriteException("Missing required parameter: \"identityId\""); + } + var apiPath = "/account/identities/{identityId}" .Replace("{identityId}", identityId); @@ -394,7 +434,8 @@ public Task DeleteIdentity(string identityId) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -407,42 +448,6 @@ public Task DeleteIdentity(string identityId) } - /// - /// Get the list of latest security activity logs for the currently logged in - /// user. Each log returns user IP address, location and date and time of log. - /// - /// - public Task ListLogs(List? queries = null, bool? total = null) - { - var apiPath = "/account/logs"; - - var apiParameters = new Dictionary() - { - { "queries", queries }, - { "total", total } - }; - - var apiHeaders = new Dictionary() - { - { "X-Appwrite-Project", _client.GetConfig("project") }, - { "accept", "application/json" } - }; - - - static Models.LogList Convert(Dictionary it) - { - return Models.LogList.From(map: it); - } - - return _client.Call( - method: "GET", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, - convert: Convert); - - } - /// /// Enable or disable MFA on an account. /// @@ -649,7 +654,8 @@ public Task DeleteMfaAuthenticator(Appwrite.Enums.AuthenticatorType type var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -678,7 +684,8 @@ public Task DeleteMFAAuthenticator(Appwrite.Enums.AuthenticatorType type var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1174,6 +1181,248 @@ static Models.User Convert(Dictionary it) } + /// + /// Get the list of verified passkeys registered by the currently logged in + /// user. + /// + /// + public Task ListPasskeys(List? queries = null, bool? total = null) + { + var apiPath = "/account/passkeys"; + + var apiParameters = new Dictionary() + { + { "queries", queries }, + { "total", total } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.PasskeyList Convert(Dictionary it) + { + return Models.PasskeyList.From(map: it); + } + + return _client.Call( + method: "GET", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Start registering a passkey for the currently logged in user. The session + /// must have signed in or completed an MFA challenge within the last 10 + /// minutes. Pass the returned `publicKey` options to + /// `navigator.credentials.create()`, then complete the registration with + /// [Update passkey + /// verification](/docs/references/cloud/client-web/account#updatePasskeyVerification). + /// The passkey stays pending until verified, and the challenge expires after 5 + /// minutes. + /// + /// + public Task CreatePasskey(string? passkeyId = null, string? name = null) + { + var apiPath = "/account/passkeys"; + + var apiParameters = new Dictionary() + { + { "passkeyId", passkeyId }, + { "name", name } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.PasskeyChallenge Convert(Dictionary it) + { + return Models.PasskeyChallenge.From(map: it); + } + + return _client.Call( + method: "POST", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Get a verified passkey of the currently logged in user by its unique ID. + /// + /// + public Task GetPasskey(string passkeyId) + { + if (passkeyId == "") + { + throw new AppwriteException("Missing required parameter: \"passkeyId\""); + } + + var apiPath = "/account/passkeys/{passkeyId}" + .Replace("{passkeyId}", passkeyId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.Passkey Convert(Dictionary it) + { + return Models.Passkey.From(map: it); + } + + return _client.Call( + method: "GET", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Rename a passkey of the currently logged in user. + /// + /// + public Task UpdatePasskey(string passkeyId, string name) + { + if (passkeyId == "") + { + throw new AppwriteException("Missing required parameter: \"passkeyId\""); + } + + var apiPath = "/account/passkeys/{passkeyId}" + .Replace("{passkeyId}", passkeyId); + + var apiParameters = new Dictionary() + { + { "name", name } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.Passkey Convert(Dictionary it) + { + return Models.Passkey.From(map: it); + } + + return _client.Call( + method: "PATCH", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Delete a passkey from the currently logged in user. The passkey can no + /// longer be used to sign in, although it may remain stored on the user's + /// device. The session must have signed in or completed an MFA challenge + /// within the last 10 minutes. + /// + /// + public Task DeletePasskey(string passkeyId) + { + if (passkeyId == "") + { + throw new AppwriteException("Missing required parameter: \"passkeyId\""); + } + + var apiPath = "/account/passkeys/{passkeyId}" + .Replace("{passkeyId}", passkeyId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + + return _client.Call( + method: "DELETE", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!); + + } + + /// + /// Complete a passkey registration started with [Create + /// passkey](/docs/references/cloud/client-web/account#createPasskey). Pass the + /// JSON form of the credential returned by `navigator.credentials.create()`, + /// for example `credential.toJSON()`. Each registration can be verified once; + /// a failed attempt requires starting it again. + /// + /// + public Task UpdatePasskeyVerification(string passkeyId, object credential) + { + if (passkeyId == "") + { + throw new AppwriteException("Missing required parameter: \"passkeyId\""); + } + + var apiPath = "/account/passkeys/{passkeyId}/verification" + .Replace("{passkeyId}", passkeyId); + + var apiParameters = new Dictionary() + { + { "credential", credential } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.Passkey Convert(Dictionary it) + { + return Models.Passkey.From(map: it); + } + + return _client.Call( + method: "PUT", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + /// /// Update currently logged in user password. For validation, user is required /// to pass in the new password, and the old password. For users created with @@ -1411,17 +1660,110 @@ static Models.Token Convert(Dictionary it) } + /// + /// Use this endpoint to send a 6-digit password recovery code to the user's + /// email address. Unlike + /// [createRecovery](https://appwrite.io/docs/references/cloud/client-web/account#createRecovery), + /// this method requires no redirect URL, which makes it suitable for mobile + /// and desktop apps that cannot host a recovery page. Learn more about how to + /// [complete the recovery + /// process](https://appwrite.io/docs/references/cloud/client-web/account#updateRecoveryOTP). + /// The code sent to the user's email address is valid for 15 minutes. + /// + /// Enable the **phrase** parameter to include a randomly generated security + /// phrase in both the email and the response. Showing that phrase in your app + /// lets the user confirm the email genuinely came from your request, which + /// helps protect against phishing. + /// + /// + /// + public Task CreateRecoveryOTP(string email, bool? phrase = null) + { + var apiPath = "/account/recovery/otp"; + + var apiParameters = new Dictionary() + { + { "email", email }, + { "phrase", phrase } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.Token Convert(Dictionary it) + { + return Models.Token.From(map: it); + } + + return _client.Call( + method: "POST", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Use this endpoint to complete the user password recovery process using the + /// 6-digit code that was emailed by + /// [createRecoveryOTP](https://appwrite.io/docs/references/cloud/client-web/account#createRecoveryOTP). + /// Pass the **userId** of the user along with the **secret** code from the + /// email and the new **password** to set. If confirmed, this route will return + /// a 200 status code, the code is consumed and the user's password is updated. + /// + /// + /// + public Task UpdateRecoveryOTP(string userId, string secret, string password) + { + var apiPath = "/account/recovery/otp"; + + var apiParameters = new Dictionary() + { + { "userId", userId }, + { "secret", secret }, + { "password", password } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.Token Convert(Dictionary it) + { + return Models.Token.From(map: it); + } + + return _client.Call( + method: "PUT", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + /// /// Get the list of active sessions across different devices for the currently /// logged in user. /// /// - public Task ListSessions() + public Task ListSessions(bool? total = null) { var apiPath = "/account/sessions"; var apiParameters = new Dictionary() { + { "total", total } }; var apiHeaders = new Dictionary() @@ -1447,21 +1789,24 @@ static Models.SessionList Convert(Dictionary it) /// /// Delete all sessions from the user account and remove any sessions cookies - /// from the end client. + /// from the end client. Pass `current` as false to keep the session making the + /// request and sign out of every other session. /// /// - public Task DeleteSessions() + public Task DeleteSessions(bool? current = null) { var apiPath = "/account/sessions"; var apiParameters = new Dictionary() { + { "current", current } }; var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1517,20 +1862,105 @@ static Models.Session Convert(Dictionary it) /// /// Allow the user to login into their account by providing a valid email and /// password combination. This route will create a new session for the user. + /// Use the optional `duration` parameter to create a shorter session, for + /// example when the user doesn't choose "remember me". It must be at least 60 + /// seconds and cannot exceed the project maximum session length. /// /// A user is limited to 10 active sessions at a time by default. [Learn more /// about session /// limits](https://appwrite.io/docs/authentication-security#limits). /// /// - public Task CreateEmailPasswordSession(string email, string password) + public Task CreateEmailPasswordSession(string email, string password, long? duration = null) { var apiPath = "/account/sessions/email"; var apiParameters = new Dictionary() { { "email", email }, - { "password", password } + { "password", password }, + { "duration", duration } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.Session Convert(Dictionary it) + { + return Models.Session.From(map: it); + } + + return _client.Call( + method: "POST", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Allow the user to login to their account using an OpenID Connect ID token + /// obtained natively from the OAuth2 provider, for example via Google + /// Credential Manager on Android or Sign in with Apple on iOS. No browser or + /// redirect is involved: the ID token is verified against the provider's + /// published signing keys and a session is created in a single request. + /// + /// Native sign-in is switched on per provider with its nativeEnabled setting. + /// It is independent of the browser-based flow's enabled setting, which has no + /// effect on this endpoint. The token's audience must match the provider's + /// configured client ID or one of its native client IDs; tokens issued for any + /// other client ID are rejected. For Sign in with Apple, register your app's + /// bundle ID as a native client ID. For Google, the web client ID used by + /// Credential Manager is usually the configured client ID; add your Android + /// and iOS client IDs as native client IDs if your app requests tokens for + /// them. + /// + /// Pass the raw nonce used when requesting the ID token so it can be validated + /// against the token's nonce claim. When signing in with Apple, the nonce is + /// required: hash it with SHA-256 before passing it to the Apple SDK, and send + /// the raw value here - Apple tokens requested without a nonce are rejected. + /// For Google the nonce is optional: it is validated whenever the token + /// carries one, and ignored when the provider issued the token without one. + /// Apple only returns the user's name on the first authorization, and never + /// inside the ID token - capture it on the client and pass it via the name + /// parameter. + /// + /// If there is already an active session, the new session will be attached to + /// the logged-in account. If there are no active sessions, the server will + /// attempt to look for a user with the same email address as the verified + /// email received from the provider and attach the new session to the existing + /// user. If no matching user is found - the server will create a new user. + /// + /// This flow does not return provider refresh tokens. You may pass an access + /// token the provider handed your client, along with its lifetime, to store it + /// on the session - but Appwrite cannot renew it once it expires. If your app + /// needs long-lived access to provider APIs, use the browser-based OAuth2 flow + /// instead. + /// + /// A user is limited to 10 active sessions at a time by default. [Learn more + /// about session + /// limits](https://appwrite.io/docs/authentication-security#limits). + /// + /// + /// + public Task CreateIdTokenSession(Appwrite.Enums.IdTokenProvider provider, string idToken, string? nonce = null, string? accessToken = null, long? accessTokenExpiry = null, string? name = null) + { + var apiPath = "/account/sessions/id-token"; + + var apiParameters = new Dictionary() + { + { "provider", provider?.Value }, + { "idToken", idToken }, + { "nonce", nonce }, + { "accessToken", accessToken }, + { "accessTokenExpiry", accessTokenExpiry }, + { "name", name } }; var apiHeaders = new Dictionary() @@ -1678,6 +2108,11 @@ static Models.Session Convert(Dictionary it) /// public Task GetSession(string sessionId) { + if (sessionId == "") + { + throw new AppwriteException("Missing required parameter: \"sessionId\""); + } + var apiPath = "/account/sessions/{sessionId}" .Replace("{sessionId}", sessionId); @@ -1714,6 +2149,11 @@ static Models.Session Convert(Dictionary it) /// public Task UpdateSession(string sessionId) { + if (sessionId == "") + { + throw new AppwriteException("Missing required parameter: \"sessionId\""); + } + var apiPath = "/account/sessions/{sessionId}" .Replace("{sessionId}", sessionId); @@ -1753,6 +2193,11 @@ static Models.Session Convert(Dictionary it) /// public Task DeleteSession(string sessionId) { + if (sessionId == "") + { + throw new AppwriteException("Missing required parameter: \"sessionId\""); + } + var apiPath = "/account/sessions/{sessionId}" .Replace("{sessionId}", sessionId); @@ -1763,7 +2208,8 @@ public Task DeleteSession(string sessionId) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1925,6 +2371,10 @@ static Models.Token Convert(Dictionary it) /// session](https://appwrite.io/docs/references/cloud/client-web/account#createSession) /// endpoint. /// + /// If there is already an active session, the OAuth2 identity is attached to + /// the logged-in account and that session stays active until the token is + /// exchanged for a new one. + /// /// A user is limited to 10 active sessions at a time by default. [Learn more /// about session /// limits](https://appwrite.io/docs/authentication-security#limits). @@ -1959,6 +2409,90 @@ public Task CreateOAuth2Token(Appwrite.Enums.OAuthProvider provider, str } + /// + /// Start signing in with a passkey. No email or user ID is needed: pass the + /// returned `publicKey` options to `navigator.credentials.get()` and the user + /// picks one of their passkeys. Then call [Update passkey + /// token](/docs/references/cloud/client-web/account#updatePasskeyToken) with + /// the credential to receive a token, and exchange it with [Create + /// session](/docs/references/cloud/client-web/account#createSession). The + /// challenge expires after 5 minutes. + /// + /// + public Task CreatePasskeyToken() + { + var apiPath = "/account/tokens/passkey"; + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.PasskeyChallenge Convert(Dictionary it) + { + return Models.PasskeyChallenge.From(map: it); + } + + return _client.Call( + method: "POST", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Complete a passkey sign-in started with [Create passkey + /// token](/docs/references/cloud/client-web/account#createPasskeyToken). Pass + /// the challenge ID and the JSON form of the credential returned by + /// `navigator.credentials.get()`, for example `credential.toJSON()`. The + /// returned token includes its secret and expires after 1 minute: exchange it + /// for a session with [Create + /// session](/docs/references/cloud/client-web/account#createSession). Passkeys + /// require user verification, so the session also satisfies MFA. Each + /// challenge can only be used once. + /// + /// + public Task UpdatePasskeyToken(string challengeId, object credential) + { + var apiPath = "/account/tokens/passkey"; + + var apiParameters = new Dictionary() + { + { "challengeId", challengeId }, + { "credential", credential } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.TokenSecret Convert(Dictionary it) + { + return Models.TokenSecret.From(map: it); + } + + return _client.Call( + method: "PUT", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + /// /// Sends the user an SMS with a secret key for creating a session. If the /// provided user ID has not be registered, a new user will be created. Use the @@ -2182,6 +2716,96 @@ static Models.Token Convert(Dictionary it) } + /// + /// Use this endpoint to send a 6-digit verification code to the currently + /// logged in user's email address. Unlike + /// [createEmailVerification](https://appwrite.io/docs/references/cloud/client-web/account#createEmailVerification), + /// this method requires no redirect URL, which makes it suitable for mobile + /// and desktop apps that cannot host a verification page. Learn more about how + /// to [complete the verification + /// process](https://appwrite.io/docs/references/cloud/client-web/account#updateEmailVerificationOTP). + /// The code sent to the user's email address is valid for 15 minutes. + /// + /// Enable the **phrase** parameter to include a randomly generated security + /// phrase in both the email and the response. Showing that phrase in your app + /// lets the user confirm the email genuinely came from your request, which + /// helps protect against phishing. + /// + /// + /// + public Task CreateEmailVerificationOTP(bool? phrase = null) + { + var apiPath = "/account/verifications/email/otp"; + + var apiParameters = new Dictionary() + { + { "phrase", phrase } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.Token Convert(Dictionary it) + { + return Models.Token.From(map: it); + } + + return _client.Call( + method: "POST", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Use this endpoint to complete the user email verification process using the + /// 6-digit code that was emailed by + /// [createEmailVerificationOTP](https://appwrite.io/docs/references/cloud/client-web/account#createEmailVerificationOTP). + /// Pass the **userId** of the user being verified along with the **secret** + /// code from the email. If confirmed, this route will return a 200 status code + /// and the code is consumed. + /// + /// + /// + public Task UpdateEmailVerificationOTP(string userId, string secret) + { + var apiPath = "/account/verifications/email/otp"; + + var apiParameters = new Dictionary() + { + { "userId", userId }, + { "secret", secret } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.Token Convert(Dictionary it) + { + return Models.Token.From(map: it); + } + + return _client.Call( + method: "PUT", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + /// /// Use this endpoint to send a verification SMS to the currently logged in /// user. This endpoint is meant for use after updating a user's phone number diff --git a/Appwrite/Services/Activities.cs b/Appwrite/Services/Activities.cs index 59d25d56..324c6088 100644 --- a/Appwrite/Services/Activities.cs +++ b/Appwrite/Services/Activities.cs @@ -54,6 +54,11 @@ static Models.ActivityEventList Convert(Dictionary it) /// public Task GetEvent(string eventId) { + if (eventId == "") + { + throw new AppwriteException("Missing required parameter: \"eventId\""); + } + var apiPath = "/activities/events/{eventId}" .Replace("{eventId}", eventId); diff --git a/Appwrite/Services/Advisor.cs b/Appwrite/Services/Advisor.cs index af0bc406..ac530437 100644 --- a/Appwrite/Services/Advisor.cs +++ b/Appwrite/Services/Advisor.cs @@ -58,6 +58,11 @@ static Models.ReportList Convert(Dictionary it) /// public Task GetReport(string reportId) { + if (reportId == "") + { + throw new AppwriteException("Missing required parameter: \"reportId\""); + } + var apiPath = "/reports/{reportId}" .Replace("{reportId}", reportId); @@ -94,6 +99,11 @@ static Models.Report Convert(Dictionary it) /// public Task DeleteReport(string reportId) { + if (reportId == "") + { + throw new AppwriteException("Missing required parameter: \"reportId\""); + } + var apiPath = "/reports/{reportId}" .Replace("{reportId}", reportId); @@ -104,7 +114,8 @@ public Task DeleteReport(string reportId) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -125,6 +136,11 @@ public Task DeleteReport(string reportId) /// public Task ListInsights(string reportId, List? queries = null, bool? total = null) { + if (reportId == "") + { + throw new AppwriteException("Missing required parameter: \"reportId\""); + } + var apiPath = "/reports/{reportId}/insights" .Replace("{reportId}", reportId); @@ -162,6 +178,16 @@ static Models.InsightList Convert(Dictionary it) /// public Task GetInsight(string reportId, string insightId) { + if (reportId == "") + { + throw new AppwriteException("Missing required parameter: \"reportId\""); + } + + if (insightId == "") + { + throw new AppwriteException("Missing required parameter: \"insightId\""); + } + var apiPath = "/reports/{reportId}/insights/{insightId}" .Replace("{reportId}", reportId) .Replace("{insightId}", insightId); diff --git a/Appwrite/Services/Apps.cs b/Appwrite/Services/Apps.cs index 99d6a64a..1b0e1d8e 100644 --- a/Appwrite/Services/Apps.cs +++ b/Appwrite/Services/Apps.cs @@ -173,6 +173,11 @@ static Models.AppScopeList Convert(Dictionary it) /// public Task Get(string appId) { + if (appId == "") + { + throw new AppwriteException("Missing required parameter: \"appId\""); + } + var apiPath = "/apps/{appId}" .Replace("{appId}", appId); @@ -207,6 +212,11 @@ static Models.App Convert(Dictionary it) /// public Task Update(string appId, string name, string? description = null, string? clientUri = null, string? logoUri = null, string? privacyPolicyUrl = null, string? termsUrl = null, List? contacts = null, string? tagline = null, List? tags = null, List? images = null, string? supportUrl = null, string? dataDeletionUrl = null, bool? enabled = null, List? redirectUris = null, List? postLogoutRedirectUris = null, string? type = null, bool? deviceFlow = null, List? installationScopes = null, string? installationRedirectUrl = null) { + if (appId == "") + { + throw new AppwriteException("Missing required parameter: \"appId\""); + } + var apiPath = "/apps/{appId}" .Replace("{appId}", appId); @@ -261,6 +271,11 @@ static Models.App Convert(Dictionary it) /// public Task Delete(string appId) { + if (appId == "") + { + throw new AppwriteException("Missing required parameter: \"appId\""); + } + var apiPath = "/apps/{appId}" .Replace("{appId}", appId); @@ -293,6 +308,11 @@ public Task Delete(string appId) /// public Task ListInstallations(string appId, List? queries = null, bool? total = null) { + if (appId == "") + { + throw new AppwriteException("Missing required parameter: \"appId\""); + } + var apiPath = "/apps/{appId}/installations" .Replace("{appId}", appId); @@ -331,6 +351,16 @@ static Models.AppInstallationList Convert(Dictionary it) /// public Task GetInstallation(string appId, string installationId) { + if (appId == "") + { + throw new AppwriteException("Missing required parameter: \"appId\""); + } + + if (installationId == "") + { + throw new AppwriteException("Missing required parameter: \"installationId\""); + } + var apiPath = "/apps/{appId}/installations/{installationId}" .Replace("{appId}", appId) .Replace("{installationId}", installationId); @@ -368,6 +398,16 @@ static Models.AppInstallation Convert(Dictionary it) /// public Task DeleteInstallation(string appId, string installationId) { + if (appId == "") + { + throw new AppwriteException("Missing required parameter: \"appId\""); + } + + if (installationId == "") + { + throw new AppwriteException("Missing required parameter: \"installationId\""); + } + var apiPath = "/apps/{appId}/installations/{installationId}" .Replace("{appId}", appId) .Replace("{installationId}", installationId); @@ -406,6 +446,16 @@ public Task DeleteInstallation(string appId, string installationId) /// public Task CreateInstallationToken(string appId, string installationId) { + if (appId == "") + { + throw new AppwriteException("Missing required parameter: \"appId\""); + } + + if (installationId == "") + { + throw new AppwriteException("Missing required parameter: \"installationId\""); + } + var apiPath = "/apps/{appId}/installations/{installationId}/tokens" .Replace("{appId}", appId) .Replace("{installationId}", installationId); @@ -442,6 +492,11 @@ static Models.Oauth2Token Convert(Dictionary it) /// public Task ListKeys(string appId, List? queries = null, bool? total = null) { + if (appId == "") + { + throw new AppwriteException("Missing required parameter: \"appId\""); + } + var apiPath = "/apps/{appId}/keys" .Replace("{appId}", appId); @@ -480,6 +535,11 @@ static Models.AppKeyList Convert(Dictionary it) /// public Task CreateKey(string appId) { + if (appId == "") + { + throw new AppwriteException("Missing required parameter: \"appId\""); + } + var apiPath = "/apps/{appId}/keys" .Replace("{appId}", appId); @@ -515,6 +575,16 @@ static Models.AppKey Convert(Dictionary it) /// public Task GetKey(string appId, string keyId) { + if (appId == "") + { + throw new AppwriteException("Missing required parameter: \"appId\""); + } + + if (keyId == "") + { + throw new AppwriteException("Missing required parameter: \"keyId\""); + } + var apiPath = "/apps/{appId}/keys/{keyId}" .Replace("{appId}", appId) .Replace("{keyId}", keyId); @@ -550,6 +620,16 @@ static Models.AppKey Convert(Dictionary it) /// public Task DeleteKey(string appId, string keyId) { + if (appId == "") + { + throw new AppwriteException("Missing required parameter: \"appId\""); + } + + if (keyId == "") + { + throw new AppwriteException("Missing required parameter: \"keyId\""); + } + var apiPath = "/apps/{appId}/keys/{keyId}" .Replace("{appId}", appId) .Replace("{keyId}", keyId); @@ -583,6 +663,11 @@ public Task DeleteKey(string appId, string keyId) /// public Task UpdateLabels(string appId, List labels) { + if (appId == "") + { + throw new AppwriteException("Missing required parameter: \"appId\""); + } + var apiPath = "/apps/{appId}/labels" .Replace("{appId}", appId); @@ -619,6 +704,11 @@ static Models.App Convert(Dictionary it) /// public Task ListSecrets(string appId, List? queries = null, bool? total = null) { + if (appId == "") + { + throw new AppwriteException("Missing required parameter: \"appId\""); + } + var apiPath = "/apps/{appId}/secrets" .Replace("{appId}", appId); @@ -655,6 +745,11 @@ static Models.AppSecretList Convert(Dictionary it) /// public Task CreateSecret(string appId) { + if (appId == "") + { + throw new AppwriteException("Missing required parameter: \"appId\""); + } + var apiPath = "/apps/{appId}/secrets" .Replace("{appId}", appId); @@ -690,6 +785,16 @@ static Models.AppSecretPlaintext Convert(Dictionary it) /// public Task GetSecret(string appId, string secretId) { + if (appId == "") + { + throw new AppwriteException("Missing required parameter: \"appId\""); + } + + if (secretId == "") + { + throw new AppwriteException("Missing required parameter: \"secretId\""); + } + var apiPath = "/apps/{appId}/secrets/{secretId}" .Replace("{appId}", appId) .Replace("{secretId}", secretId); @@ -725,6 +830,16 @@ static Models.AppSecret Convert(Dictionary it) /// public Task DeleteSecret(string appId, string secretId) { + if (appId == "") + { + throw new AppwriteException("Missing required parameter: \"appId\""); + } + + if (secretId == "") + { + throw new AppwriteException("Missing required parameter: \"secretId\""); + } + var apiPath = "/apps/{appId}/secrets/{secretId}" .Replace("{appId}", appId) .Replace("{secretId}", secretId); @@ -756,6 +871,11 @@ public Task DeleteSecret(string appId, string secretId) /// public Task UpdateTeam(string appId, string teamId) { + if (appId == "") + { + throw new AppwriteException("Missing required parameter: \"appId\""); + } + var apiPath = "/apps/{appId}/team" .Replace("{appId}", appId); @@ -792,6 +912,11 @@ static Models.App Convert(Dictionary it) /// public Task DeleteTokens(string appId) { + if (appId == "") + { + throw new AppwriteException("Missing required parameter: \"appId\""); + } + var apiPath = "/apps/{appId}/tokens" .Replace("{appId}", appId); diff --git a/Appwrite/Services/Avatars.cs b/Appwrite/Services/Avatars.cs index 5786f608..95b2753a 100644 --- a/Appwrite/Services/Avatars.cs +++ b/Appwrite/Services/Avatars.cs @@ -257,9 +257,9 @@ public Task GetInitials(string? name = null, long? width = null, long? h /// /// Returns the best available profile photo for a user. The endpoint tries - /// each source in priority order and returns the first successful result: - /// OAuth2 identity photo, Gravatar, Libravatar, Appwrite Initials, built-in - /// static fallback. + /// each source in priority order and returns the first successful result: a + /// custom uploaded photo (see avatars.updatePhoto), OAuth2 identity photo, + /// Gravatar, Libravatar, Appwrite Initials, built-in static fallback. /// /// Passing `userId` — `current()` for the authenticated user — resolves /// the photo from everything known about that user: identity photos, email, @@ -305,6 +305,84 @@ public Task GetPhoto(long? width = null, long? height = null, long? qual } + /// + /// Update the profile photo of the currently authenticated user. The uploaded + /// image takes priority over every other photo source, including OAuth2 + /// identity photos, Gravatar, and Libravatar. Updating an already customized + /// photo replaces it. The image must be at most 5MB and is sent in a single + /// request. + /// + /// + public Task UpdatePhoto(InputFile file, Action? onProgress = null) + { + var apiPath = "/avatars/photo"; + + var apiParameters = new Dictionary() + { + { "file", file } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "multipart/form-data" }, + { "accept", "application/json" } + }; + + + static Models.Account Convert(Dictionary it) + { + return Models.Account.From(map: it); + } + + string? idParamName = null; + + var paramName = "file"; + + return _client.ChunkedUpload( + apiPath, + apiHeaders, + apiParameters, + Convert, + paramName, + idParamName, + onProgress, + method: "PUT"); + } + + /// + /// Delete the profile photo of the currently authenticated user and store the + /// built-in static placeholder in its place. The placeholder is the user's + /// photo from then on, so it takes priority over every other photo source — + /// OAuth2 identity photos, Gravatar, Libravatar, and initials — until a new + /// photo is uploaded with avatars.updatePhoto. + /// + /// + public Task DeletePhoto() + { + var apiPath = "/avatars/photo"; + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + + return _client.Call( + method: "DELETE", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!); + + } + /// /// Converts a given plain text to a QR code image. You can use the query /// parameters to change the size and style of the resulting image. diff --git a/Appwrite/Services/Backups.cs b/Appwrite/Services/Backups.cs index d8ddb688..e8edbd62 100644 --- a/Appwrite/Services/Backups.cs +++ b/Appwrite/Services/Backups.cs @@ -89,6 +89,11 @@ static Models.BackupArchive Convert(Dictionary it) /// public Task GetArchive(string archiveId) { + if (archiveId == "") + { + throw new AppwriteException("Missing required parameter: \"archiveId\""); + } + var apiPath = "/backups/archives/{archiveId}" .Replace("{archiveId}", archiveId); @@ -123,6 +128,11 @@ static Models.BackupArchive Convert(Dictionary it) /// public Task DeleteArchive(string archiveId) { + if (archiveId == "") + { + throw new AppwriteException("Missing required parameter: \"archiveId\""); + } + var apiPath = "/backups/archives/{archiveId}" .Replace("{archiveId}", archiveId); @@ -228,6 +238,11 @@ static Models.BackupPolicy Convert(Dictionary it) /// public Task GetPolicy(string policyId) { + if (policyId == "") + { + throw new AppwriteException("Missing required parameter: \"policyId\""); + } + var apiPath = "/backups/policies/{policyId}" .Replace("{policyId}", policyId); @@ -262,6 +277,11 @@ static Models.BackupPolicy Convert(Dictionary it) /// public Task UpdatePolicy(string policyId, string? name = null, long? retention = null, string? schedule = null, bool? enabled = null) { + if (policyId == "") + { + throw new AppwriteException("Missing required parameter: \"policyId\""); + } + var apiPath = "/backups/policies/{policyId}" .Replace("{policyId}", policyId); @@ -301,6 +321,11 @@ static Models.BackupPolicy Convert(Dictionary it) /// public Task DeletePolicy(string policyId) { + if (policyId == "") + { + throw new AppwriteException("Missing required parameter: \"policyId\""); + } + var apiPath = "/backups/policies/{policyId}" .Replace("{policyId}", policyId); @@ -434,6 +459,11 @@ static Models.BackupRestorationList Convert(Dictionary it) /// public Task GetRestoration(string restorationId) { + if (restorationId == "") + { + throw new AppwriteException("Missing required parameter: \"restorationId\""); + } + var apiPath = "/backups/restorations/{restorationId}" .Replace("{restorationId}", restorationId); diff --git a/Appwrite/Services/Databases.cs b/Appwrite/Services/Databases.cs index d87d2727..3b6bc5c6 100644 --- a/Appwrite/Services/Databases.cs +++ b/Appwrite/Services/Databases.cs @@ -95,13 +95,14 @@ static Models.Database Convert(Dictionary it) /// /// [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.listTransactions` instead.")] - public Task ListTransactions(List? queries = null) + public Task ListTransactions(List? queries = null, bool? total = null) { var apiPath = "/databases/transactions"; var apiParameters = new Dictionary() { - { "queries", queries } + { "queries", queries }, + { "total", total } }; var apiHeaders = new Dictionary() @@ -168,6 +169,11 @@ static Models.Transaction Convert(Dictionary it) [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.getTransaction` instead.")] public Task GetTransaction(string transactionId) { + if (transactionId == "") + { + throw new AppwriteException("Missing required parameter: \"transactionId\""); + } + var apiPath = "/databases/transactions/{transactionId}" .Replace("{transactionId}", transactionId); @@ -203,6 +209,11 @@ static Models.Transaction Convert(Dictionary it) [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.updateTransaction` instead.")] public Task UpdateTransaction(string transactionId, bool? commit = null, bool? rollback = null) { + if (transactionId == "") + { + throw new AppwriteException("Missing required parameter: \"transactionId\""); + } + var apiPath = "/databases/transactions/{transactionId}" .Replace("{transactionId}", transactionId); @@ -241,6 +252,11 @@ static Models.Transaction Convert(Dictionary it) [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.deleteTransaction` instead.")] public Task DeleteTransaction(string transactionId) { + if (transactionId == "") + { + throw new AppwriteException("Missing required parameter: \"transactionId\""); + } + var apiPath = "/databases/transactions/{transactionId}" .Replace("{transactionId}", transactionId); @@ -251,7 +267,8 @@ public Task DeleteTransaction(string transactionId) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -271,6 +288,11 @@ public Task DeleteTransaction(string transactionId) [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.createOperations` instead.")] public Task CreateOperations(string transactionId, List? operations = null) { + if (transactionId == "") + { + throw new AppwriteException("Missing required parameter: \"transactionId\""); + } + var apiPath = "/databases/transactions/{transactionId}/operations" .Replace("{transactionId}", transactionId); @@ -309,6 +331,11 @@ static Models.Transaction Convert(Dictionary it) [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.get` instead.")] public Task Get(string databaseId) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/databases/{databaseId}" .Replace("{databaseId}", databaseId); @@ -344,6 +371,11 @@ static Models.Database Convert(Dictionary it) [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.update` instead.")] public Task Update(string databaseId, string? name = null, bool? enabled = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/databases/{databaseId}" .Replace("{databaseId}", databaseId); @@ -383,6 +415,11 @@ static Models.Database Convert(Dictionary it) [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.delete` instead.")] public Task Delete(string databaseId) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/databases/{databaseId}" .Replace("{databaseId}", databaseId); @@ -393,7 +430,8 @@ public Task Delete(string databaseId) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -414,6 +452,11 @@ public Task Delete(string databaseId) [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.listTables` instead.")] public Task ListCollections(string databaseId, List? queries = null, string? search = null, bool? total = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/databases/{databaseId}/collections" .Replace("{databaseId}", databaseId); @@ -455,6 +498,11 @@ static Models.CollectionList Convert(Dictionary it) [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.createTable` instead.")] public Task CreateCollection(string databaseId, string collectionId, string name, List? permissions = null, bool? documentSecurity = null, bool? enabled = null, List? attributes = null, List? indexes = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/databases/{databaseId}/collections" .Replace("{databaseId}", databaseId); @@ -499,6 +547,16 @@ static Models.Collection Convert(Dictionary it) [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.getTable` instead.")] public Task GetCollection(string databaseId, string collectionId) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + var apiPath = "/databases/{databaseId}/collections/{collectionId}" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId); @@ -535,6 +593,16 @@ static Models.Collection Convert(Dictionary it) [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.updateTable` instead.")] public Task UpdateCollection(string databaseId, string collectionId, string? name = null, List? permissions = null, bool? documentSecurity = null, bool? enabled = null, bool? purge = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + var apiPath = "/databases/{databaseId}/collections/{collectionId}" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId); @@ -578,6 +646,16 @@ static Models.Collection Convert(Dictionary it) [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.deleteTable` instead.")] public Task DeleteCollection(string databaseId, string collectionId) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + var apiPath = "/databases/{databaseId}/collections/{collectionId}" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId); @@ -589,7 +667,8 @@ public Task DeleteCollection(string databaseId, string collectionId) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -609,6 +688,16 @@ public Task DeleteCollection(string databaseId, string collectionId) [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.listColumns` instead.")] public Task ListAttributes(string databaseId, string collectionId, List? queries = null, bool? total = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId); @@ -649,6 +738,16 @@ static Models.AttributeList Convert(Dictionary it) [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.createBigIntColumn` instead.")] public Task CreateBigIntAttribute(string databaseId, string collectionId, string key, bool required, long? min = null, long? max = null, long? @default = null, bool? array = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/bigint" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId); @@ -694,6 +793,21 @@ static Models.AttributeBigint Convert(Dictionary it) [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.updateBigIntColumn` instead.")] public Task UpdateBigIntAttribute(string databaseId, string collectionId, string key, bool required, long @default, long? min = null, long? max = null, string? newKey = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + + if (key == "") + { + throw new AppwriteException("Missing required parameter: \"key\""); + } + var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/bigint/{key}" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId) @@ -738,6 +852,16 @@ static Models.AttributeBigint Convert(Dictionary it) [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.createBooleanColumn` instead.")] public Task CreateBooleanAttribute(string databaseId, string collectionId, string key, bool required, bool? @default = null, bool? array = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/boolean" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId); @@ -780,6 +904,21 @@ static Models.AttributeBoolean Convert(Dictionary it) [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.updateBooleanColumn` instead.")] public Task UpdateBooleanAttribute(string databaseId, string collectionId, string key, bool required, bool @default, string? newKey = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + + if (key == "") + { + throw new AppwriteException("Missing required parameter: \"key\""); + } + var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/boolean/{key}" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId) @@ -821,6 +960,16 @@ static Models.AttributeBoolean Convert(Dictionary it) [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.createDatetimeColumn` instead.")] public Task CreateDatetimeAttribute(string databaseId, string collectionId, string key, bool required, string? @default = null, bool? array = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/datetime" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId); @@ -863,6 +1012,21 @@ static Models.AttributeDatetime Convert(Dictionary it) [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.updateDatetimeColumn` instead.")] public Task UpdateDatetimeAttribute(string databaseId, string collectionId, string key, bool required, string @default, string? newKey = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + + if (key == "") + { + throw new AppwriteException("Missing required parameter: \"key\""); + } + var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/datetime/{key}" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId) @@ -905,6 +1069,16 @@ static Models.AttributeDatetime Convert(Dictionary it) [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.createEmailColumn` instead.")] public Task CreateEmailAttribute(string databaseId, string collectionId, string key, bool required, string? @default = null, bool? array = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/email" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId); @@ -948,6 +1122,21 @@ static Models.AttributeEmail Convert(Dictionary it) [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.updateEmailColumn` instead.")] public Task UpdateEmailAttribute(string databaseId, string collectionId, string key, bool required, string @default, string? newKey = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + + if (key == "") + { + throw new AppwriteException("Missing required parameter: \"key\""); + } + var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/email/{key}" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId) @@ -991,6 +1180,16 @@ static Models.AttributeEmail Convert(Dictionary it) [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.createEnumColumn` instead.")] public Task CreateEnumAttribute(string databaseId, string collectionId, string key, List elements, bool required, string? @default = null, bool? array = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/enum" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId); @@ -1035,6 +1234,21 @@ static Models.AttributeEnum Convert(Dictionary it) [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.updateEnumColumn` instead.")] public Task UpdateEnumAttribute(string databaseId, string collectionId, string key, List elements, bool required, string @default, string? newKey = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + + if (key == "") + { + throw new AppwriteException("Missing required parameter: \"key\""); + } + var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/enum/{key}" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId) @@ -1079,6 +1293,16 @@ static Models.AttributeEnum Convert(Dictionary it) [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.createFloatColumn` instead.")] public Task CreateFloatAttribute(string databaseId, string collectionId, string key, bool required, double? min = null, double? max = null, double? @default = null, bool? array = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/float" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId); @@ -1124,6 +1348,21 @@ static Models.AttributeFloat Convert(Dictionary it) [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.updateFloatColumn` instead.")] public Task UpdateFloatAttribute(string databaseId, string collectionId, string key, bool required, double @default, double? min = null, double? max = null, string? newKey = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + + if (key == "") + { + throw new AppwriteException("Missing required parameter: \"key\""); + } + var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/float/{key}" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId) @@ -1169,6 +1408,16 @@ static Models.AttributeFloat Convert(Dictionary it) [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.createIntegerColumn` instead.")] public Task CreateIntegerAttribute(string databaseId, string collectionId, string key, bool required, long? min = null, long? max = null, long? @default = null, bool? array = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/integer" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId); @@ -1214,6 +1463,21 @@ static Models.AttributeInteger Convert(Dictionary it) [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.updateIntegerColumn` instead.")] public Task UpdateIntegerAttribute(string databaseId, string collectionId, string key, bool required, long @default, long? min = null, long? max = null, string? newKey = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + + if (key == "") + { + throw new AppwriteException("Missing required parameter: \"key\""); + } + var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/integer/{key}" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId) @@ -1258,6 +1522,16 @@ static Models.AttributeInteger Convert(Dictionary it) [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.createIpColumn` instead.")] public Task CreateIpAttribute(string databaseId, string collectionId, string key, bool required, string? @default = null, bool? array = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/ip" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId); @@ -1301,6 +1575,21 @@ static Models.AttributeIp Convert(Dictionary it) [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.updateIpColumn` instead.")] public Task UpdateIpAttribute(string databaseId, string collectionId, string key, bool required, string @default, string? newKey = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + + if (key == "") + { + throw new AppwriteException("Missing required parameter: \"key\""); + } + var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/ip/{key}" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId) @@ -1342,6 +1631,16 @@ static Models.AttributeIp Convert(Dictionary it) [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.createLineColumn` instead.")] public Task CreateLineAttribute(string databaseId, string collectionId, string key, bool required, List>? @default = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/line" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId); @@ -1383,6 +1682,21 @@ static Models.AttributeLine Convert(Dictionary it) [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.updateLineColumn` instead.")] public Task UpdateLineAttribute(string databaseId, string collectionId, string key, bool required, List>? @default = null, string? newKey = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + + if (key == "") + { + throw new AppwriteException("Missing required parameter: \"key\""); + } + var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/line/{key}" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId) @@ -1425,6 +1739,16 @@ static Models.AttributeLine Convert(Dictionary it) [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.createLongtextColumn` instead.")] public Task CreateLongtextAttribute(string databaseId, string collectionId, string key, bool required, string? @default = null, bool? array = null, bool? encrypt = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/longtext" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId); @@ -1469,6 +1793,21 @@ static Models.AttributeLongtext Convert(Dictionary it) [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.updateLongtextColumn` instead.")] public Task UpdateLongtextAttribute(string databaseId, string collectionId, string key, bool required, string @default, string? newKey = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + + if (key == "") + { + throw new AppwriteException("Missing required parameter: \"key\""); + } + var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/longtext/{key}" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId) @@ -1511,6 +1850,16 @@ static Models.AttributeLongtext Convert(Dictionary it) [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.createMediumtextColumn` instead.")] public Task CreateMediumtextAttribute(string databaseId, string collectionId, string key, bool required, string? @default = null, bool? array = null, bool? encrypt = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/mediumtext" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId); @@ -1555,6 +1904,21 @@ static Models.AttributeMediumtext Convert(Dictionary it) [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.updateMediumtextColumn` instead.")] public Task UpdateMediumtextAttribute(string databaseId, string collectionId, string key, bool required, string @default, string? newKey = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + + if (key == "") + { + throw new AppwriteException("Missing required parameter: \"key\""); + } + var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/mediumtext/{key}" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId) @@ -1596,6 +1960,16 @@ static Models.AttributeMediumtext Convert(Dictionary it) [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.createPointColumn` instead.")] public Task CreatePointAttribute(string databaseId, string collectionId, string key, bool required, List? @default = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/point" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId); @@ -1637,6 +2011,21 @@ static Models.AttributePoint Convert(Dictionary it) [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.updatePointColumn` instead.")] public Task UpdatePointAttribute(string databaseId, string collectionId, string key, bool required, List? @default = null, string? newKey = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + + if (key == "") + { + throw new AppwriteException("Missing required parameter: \"key\""); + } + var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/point/{key}" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId) @@ -1678,6 +2067,16 @@ static Models.AttributePoint Convert(Dictionary it) [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.createPolygonColumn` instead.")] public Task CreatePolygonAttribute(string databaseId, string collectionId, string key, bool required, List>? @default = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/polygon" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId); @@ -1719,6 +2118,21 @@ static Models.AttributePolygon Convert(Dictionary it) [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.updatePolygonColumn` instead.")] public Task UpdatePolygonAttribute(string databaseId, string collectionId, string key, bool required, List>? @default = null, string? newKey = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + + if (key == "") + { + throw new AppwriteException("Missing required parameter: \"key\""); + } + var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/polygon/{key}" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId) @@ -1762,6 +2176,16 @@ static Models.AttributePolygon Convert(Dictionary it) [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.createRelationshipColumn` instead.")] public Task CreateRelationshipAttribute(string databaseId, string collectionId, string relatedCollectionId, Appwrite.Enums.RelationshipType type, bool? twoWay = null, string? key = null, string? twoWayKey = null, Appwrite.Enums.RelationMutate? onDelete = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/relationship" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId); @@ -1807,6 +2231,21 @@ static Models.AttributeRelationship Convert(Dictionary it) [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.updateRelationshipColumn` instead.")] public Task UpdateRelationshipAttribute(string databaseId, string collectionId, string key, Appwrite.Enums.RelationMutate? onDelete = null, string? newKey = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + + if (key == "") + { + throw new AppwriteException("Missing required parameter: \"key\""); + } + var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/relationship/{key}" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId) @@ -1848,6 +2287,16 @@ static Models.AttributeRelationship Convert(Dictionary it) [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.createStringColumn` instead.")] public Task CreateStringAttribute(string databaseId, string collectionId, string key, long size, bool required, string? @default = null, bool? array = null, bool? encrypt = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/string" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId); @@ -1893,6 +2342,21 @@ static Models.AttributeString Convert(Dictionary it) [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.updateStringColumn` instead.")] public Task UpdateStringAttribute(string databaseId, string collectionId, string key, bool required, string @default, long? size = null, string? newKey = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + + if (key == "") + { + throw new AppwriteException("Missing required parameter: \"key\""); + } + var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/string/{key}" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId) @@ -1936,6 +2400,16 @@ static Models.AttributeString Convert(Dictionary it) [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.createTextColumn` instead.")] public Task CreateTextAttribute(string databaseId, string collectionId, string key, bool required, string? @default = null, bool? array = null, bool? encrypt = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/text" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId); @@ -1980,6 +2454,21 @@ static Models.AttributeText Convert(Dictionary it) [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.updateTextColumn` instead.")] public Task UpdateTextAttribute(string databaseId, string collectionId, string key, bool required, string @default, string? newKey = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + + if (key == "") + { + throw new AppwriteException("Missing required parameter: \"key\""); + } + var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/text/{key}" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId) @@ -2022,6 +2511,16 @@ static Models.AttributeText Convert(Dictionary it) [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.createUrlColumn` instead.")] public Task CreateUrlAttribute(string databaseId, string collectionId, string key, bool required, string? @default = null, bool? array = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/url" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId); @@ -2065,6 +2564,21 @@ static Models.AttributeUrl Convert(Dictionary it) [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.updateUrlColumn` instead.")] public Task UpdateUrlAttribute(string databaseId, string collectionId, string key, bool required, string @default, string? newKey = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + + if (key == "") + { + throw new AppwriteException("Missing required parameter: \"key\""); + } + var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/url/{key}" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId) @@ -2107,6 +2621,16 @@ static Models.AttributeUrl Convert(Dictionary it) [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.createVarcharColumn` instead.")] public Task CreateVarcharAttribute(string databaseId, string collectionId, string key, long size, bool required, string? @default = null, bool? array = null, bool? encrypt = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/varchar" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId); @@ -2152,6 +2676,21 @@ static Models.AttributeVarchar Convert(Dictionary it) [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.updateVarcharColumn` instead.")] public Task UpdateVarcharAttribute(string databaseId, string collectionId, string key, bool required, string @default, long? size = null, string? newKey = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + + if (key == "") + { + throw new AppwriteException("Missing required parameter: \"key\""); + } + var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/varchar/{key}" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId) @@ -2194,6 +2733,21 @@ static Models.AttributeVarchar Convert(Dictionary it) [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.getColumn` instead.")] public Task GetAttribute(string databaseId, string collectionId, string key) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + + if (key == "") + { + throw new AppwriteException("Missing required parameter: \"key\""); + } + var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/{key}" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId) @@ -2232,23 +2786,55 @@ static object Convert(Dictionary it) { return Appwrite.Models.AttributeBoolean.From(map: it); } - if (it.TryGetValue("type", out var typeValue6) && typeValue6?.ToString() == "integer") + if (it.TryGetValue("type", out var typeValue6) && typeValue6?.ToString() == "bigint") + { + return Appwrite.Models.AttributeBigint.From(map: it); + } + if (it.TryGetValue("type", out var typeValue7) && typeValue7?.ToString() == "integer") { return Appwrite.Models.AttributeInteger.From(map: it); } - if (it.TryGetValue("type", out var typeValue7) && typeValue7?.ToString() == "double") + if (it.TryGetValue("type", out var typeValue8) && typeValue8?.ToString() == "double") { return Appwrite.Models.AttributeFloat.From(map: it); } - if (it.TryGetValue("type", out var typeValue8) && typeValue8?.ToString() == "datetime") + if (it.TryGetValue("type", out var typeValue9) && typeValue9?.ToString() == "datetime") { return Appwrite.Models.AttributeDatetime.From(map: it); } - if (it.TryGetValue("type", out var typeValue9) && typeValue9?.ToString() == "relationship") + if (it.TryGetValue("type", out var typeValue10) && typeValue10?.ToString() == "relationship") { return Appwrite.Models.AttributeRelationship.From(map: it); } - if (it.TryGetValue("type", out var typeValue10) && typeValue10?.ToString() == "string") + if (it.TryGetValue("type", out var typeValue11) && typeValue11?.ToString() == "point") + { + return Appwrite.Models.AttributePoint.From(map: it); + } + if (it.TryGetValue("type", out var typeValue12) && typeValue12?.ToString() == "linestring") + { + return Appwrite.Models.AttributeLine.From(map: it); + } + if (it.TryGetValue("type", out var typeValue13) && typeValue13?.ToString() == "polygon") + { + return Appwrite.Models.AttributePolygon.From(map: it); + } + if (it.TryGetValue("type", out var typeValue14) && typeValue14?.ToString() == "varchar") + { + return Appwrite.Models.AttributeVarchar.From(map: it); + } + if (it.TryGetValue("type", out var typeValue15) && typeValue15?.ToString() == "text") + { + return Appwrite.Models.AttributeText.From(map: it); + } + if (it.TryGetValue("type", out var typeValue16) && typeValue16?.ToString() == "mediumtext") + { + return Appwrite.Models.AttributeMediumtext.From(map: it); + } + if (it.TryGetValue("type", out var typeValue17) && typeValue17?.ToString() == "longtext") + { + return Appwrite.Models.AttributeLongtext.From(map: it); + } + if (it.TryGetValue("type", out var typeValue18) && typeValue18?.ToString() == "string") { return Appwrite.Models.AttributeString.From(map: it); } @@ -2271,6 +2857,21 @@ static object Convert(Dictionary it) [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.deleteColumn` instead.")] public Task DeleteAttribute(string databaseId, string collectionId, string key) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + + if (key == "") + { + throw new AppwriteException("Missing required parameter: \"key\""); + } + var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/{key}" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId) @@ -2283,7 +2884,8 @@ public Task DeleteAttribute(string databaseId, string collectionId, stri var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -2304,6 +2906,16 @@ public Task DeleteAttribute(string databaseId, string collectionId, stri [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.listRows` instead.")] public Task ListDocuments(string databaseId, string collectionId, List? queries = null, string? transactionId = null, bool? total = null, long? ttl = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + var apiPath = "/databases/{databaseId}/collections/{collectionId}/documents" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId); @@ -2347,6 +2959,16 @@ static Models.DocumentList Convert(Dictionary it) [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.createRow` instead.")] public Task CreateDocument(string databaseId, string collectionId, string documentId, object data, List? permissions = null, string? transactionId = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + var apiPath = "/databases/{databaseId}/collections/{collectionId}/documents" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId); @@ -2391,6 +3013,16 @@ static Models.Document Convert(Dictionary it) [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.createRows` instead.")] public Task CreateDocuments(string databaseId, string collectionId, List documents, string? transactionId = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + var apiPath = "/databases/{databaseId}/collections/{collectionId}/documents" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId); @@ -2434,6 +3066,16 @@ static Models.DocumentList Convert(Dictionary it) [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.upsertRows` instead.")] public Task UpsertDocuments(string databaseId, string collectionId, List documents, string? transactionId = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + var apiPath = "/databases/{databaseId}/collections/{collectionId}/documents" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId); @@ -2475,6 +3117,16 @@ static Models.DocumentList Convert(Dictionary it) [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.updateRows` instead.")] public Task UpdateDocuments(string databaseId, string collectionId, object? data = null, List? queries = null, string? transactionId = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + var apiPath = "/databases/{databaseId}/collections/{collectionId}/documents" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId); @@ -2516,6 +3168,16 @@ static Models.DocumentList Convert(Dictionary it) [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.deleteRows` instead.")] public Task DeleteDocuments(string databaseId, string collectionId, List? queries = null, string? transactionId = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + var apiPath = "/databases/{databaseId}/collections/{collectionId}/documents" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId); @@ -2556,6 +3218,21 @@ static Models.DocumentList Convert(Dictionary it) [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.getRow` instead.")] public Task GetDocument(string databaseId, string collectionId, string documentId, List? queries = null, string? transactionId = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + + if (documentId == "") + { + throw new AppwriteException("Missing required parameter: \"documentId\""); + } + var apiPath = "/databases/{databaseId}/collections/{collectionId}/documents/{documentId}" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId) @@ -2598,6 +3275,21 @@ static Models.Document Convert(Dictionary it) [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.upsertRow` instead.")] public Task UpsertDocument(string databaseId, string collectionId, string documentId, object? data = null, List? permissions = null, string? transactionId = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + + if (documentId == "") + { + throw new AppwriteException("Missing required parameter: \"documentId\""); + } + var apiPath = "/databases/{databaseId}/collections/{collectionId}/documents/{documentId}" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId) @@ -2640,6 +3332,21 @@ static Models.Document Convert(Dictionary it) [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.updateRow` instead.")] public Task UpdateDocument(string databaseId, string collectionId, string documentId, object? data = null, List? permissions = null, string? transactionId = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + + if (documentId == "") + { + throw new AppwriteException("Missing required parameter: \"documentId\""); + } + var apiPath = "/databases/{databaseId}/collections/{collectionId}/documents/{documentId}" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId) @@ -2681,6 +3388,21 @@ static Models.Document Convert(Dictionary it) [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.deleteRow` instead.")] public Task DeleteDocument(string databaseId, string collectionId, string documentId, string? transactionId = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + + if (documentId == "") + { + throw new AppwriteException("Missing required parameter: \"documentId\""); + } + var apiPath = "/databases/{databaseId}/collections/{collectionId}/documents/{documentId}" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId) @@ -2694,7 +3416,8 @@ public Task DeleteDocument(string databaseId, string collectionId, strin var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -2714,6 +3437,26 @@ public Task DeleteDocument(string databaseId, string collectionId, strin [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.decrementRowColumn` instead.")] public Task DecrementDocumentAttribute(string databaseId, string collectionId, string documentId, string attribute, double? @value = null, double? min = null, string? transactionId = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + + if (documentId == "") + { + throw new AppwriteException("Missing required parameter: \"documentId\""); + } + + if (attribute == "") + { + throw new AppwriteException("Missing required parameter: \"attribute\""); + } + var apiPath = "/databases/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/decrement" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId) @@ -2756,6 +3499,26 @@ static Models.Document Convert(Dictionary it) [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.incrementRowColumn` instead.")] public Task IncrementDocumentAttribute(string databaseId, string collectionId, string documentId, string attribute, double? @value = null, double? max = null, string? transactionId = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + + if (documentId == "") + { + throw new AppwriteException("Missing required parameter: \"documentId\""); + } + + if (attribute == "") + { + throw new AppwriteException("Missing required parameter: \"attribute\""); + } + var apiPath = "/databases/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/increment" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId) @@ -2798,6 +3561,16 @@ static Models.Document Convert(Dictionary it) [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.listIndexes` instead.")] public Task ListIndexes(string databaseId, string collectionId, List? queries = null, bool? total = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + var apiPath = "/databases/{databaseId}/collections/{collectionId}/indexes" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId); @@ -2838,6 +3611,16 @@ static Models.IndexList Convert(Dictionary it) [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.createIndex` instead.")] public Task CreateIndex(string databaseId, string collectionId, string key, Appwrite.Enums.DatabasesIndexType type, List attributes, List? orders = null, List? lengths = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + var apiPath = "/databases/{databaseId}/collections/{collectionId}/indexes" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId); @@ -2880,6 +3663,21 @@ static Models.Index Convert(Dictionary it) [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.getIndex` instead.")] public Task GetIndex(string databaseId, string collectionId, string key) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + + if (key == "") + { + throw new AppwriteException("Missing required parameter: \"key\""); + } + var apiPath = "/databases/{databaseId}/collections/{collectionId}/indexes/{key}" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId) @@ -2917,6 +3715,21 @@ static Models.Index Convert(Dictionary it) [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.deleteIndex` instead.")] public Task DeleteIndex(string databaseId, string collectionId, string key) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + + if (key == "") + { + throw new AppwriteException("Missing required parameter: \"key\""); + } + var apiPath = "/databases/{databaseId}/collections/{collectionId}/indexes/{key}" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId) @@ -2929,7 +3742,8 @@ public Task DeleteIndex(string databaseId, string collectionId, string k var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; diff --git a/Appwrite/Services/DocumentsDB.cs b/Appwrite/Services/DocumentsDB.cs index 48a82efd..62be3469 100644 --- a/Appwrite/Services/DocumentsDB.cs +++ b/Appwrite/Services/DocumentsDB.cs @@ -92,8 +92,8 @@ static Models.Database Convert(Dictionary it) /// /// List the dedicated database specifications available on the current plan. - /// Each specification reports its resource limits, pricing, and whether it is - /// enabled for the organization. + /// Each specification reports its resource limits, its own prices and overage + /// rates, and whether it is enabled for the organization. /// /// public Task ListSpecifications() @@ -129,13 +129,14 @@ static Models.DedicatedDatabaseSpecificationList Convert(Dictionary /// - public Task ListTransactions(List? queries = null) + public Task ListTransactions(List? queries = null, bool? total = null) { var apiPath = "/documentsdb/transactions"; var apiParameters = new Dictionary() { - { "queries", queries } + { "queries", queries }, + { "total", total } }; var apiHeaders = new Dictionary() @@ -200,6 +201,11 @@ static Models.Transaction Convert(Dictionary it) /// public Task GetTransaction(string transactionId) { + if (transactionId == "") + { + throw new AppwriteException("Missing required parameter: \"transactionId\""); + } + var apiPath = "/documentsdb/transactions/{transactionId}" .Replace("{transactionId}", transactionId); @@ -234,6 +240,11 @@ static Models.Transaction Convert(Dictionary it) /// public Task UpdateTransaction(string transactionId, bool? commit = null, bool? rollback = null) { + if (transactionId == "") + { + throw new AppwriteException("Missing required parameter: \"transactionId\""); + } + var apiPath = "/documentsdb/transactions/{transactionId}" .Replace("{transactionId}", transactionId); @@ -271,6 +282,11 @@ static Models.Transaction Convert(Dictionary it) /// public Task DeleteTransaction(string transactionId) { + if (transactionId == "") + { + throw new AppwriteException("Missing required parameter: \"transactionId\""); + } + var apiPath = "/documentsdb/transactions/{transactionId}" .Replace("{transactionId}", transactionId); @@ -281,7 +297,8 @@ public Task DeleteTransaction(string transactionId) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -300,6 +317,11 @@ public Task DeleteTransaction(string transactionId) /// public Task CreateOperations(string transactionId, List? operations = null) { + if (transactionId == "") + { + throw new AppwriteException("Missing required parameter: \"transactionId\""); + } + var apiPath = "/documentsdb/transactions/{transactionId}/operations" .Replace("{transactionId}", transactionId); @@ -337,6 +359,11 @@ static Models.Transaction Convert(Dictionary it) /// public Task Get(string databaseId) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/documentsdb/{databaseId}" .Replace("{databaseId}", databaseId); @@ -371,6 +398,11 @@ static Models.Database Convert(Dictionary it) /// public Task Update(string databaseId, string name, bool? enabled = null, string? specification = null, long? replicas = null, string? syncMode = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/documentsdb/{databaseId}" .Replace("{databaseId}", databaseId); @@ -412,6 +444,11 @@ static Models.Database Convert(Dictionary it) /// public Task Delete(string databaseId) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/documentsdb/{databaseId}" .Replace("{databaseId}", databaseId); @@ -422,7 +459,8 @@ public Task Delete(string databaseId) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -442,6 +480,11 @@ public Task Delete(string databaseId) /// public Task ListCollections(string databaseId, List? queries = null, string? search = null, bool? total = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/documentsdb/{databaseId}/collections" .Replace("{databaseId}", databaseId); @@ -482,6 +525,11 @@ static Models.CollectionList Convert(Dictionary it) /// public Task CreateCollection(string databaseId, string collectionId, string name, List? permissions = null, bool? documentSecurity = null, bool? enabled = null, List? attributes = null, List? indexes = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/documentsdb/{databaseId}/collections" .Replace("{databaseId}", databaseId); @@ -525,6 +573,16 @@ static Models.Collection Convert(Dictionary it) /// public Task GetCollection(string databaseId, string collectionId) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId); @@ -560,6 +618,16 @@ static Models.Collection Convert(Dictionary it) /// public Task UpdateCollection(string databaseId, string collectionId, string name, List? permissions = null, bool? documentSecurity = null, bool? enabled = null, bool? purge = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId); @@ -602,6 +670,16 @@ static Models.Collection Convert(Dictionary it) /// public Task DeleteCollection(string databaseId, string collectionId) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId); @@ -613,7 +691,8 @@ public Task DeleteCollection(string databaseId, string collectionId) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -633,6 +712,16 @@ public Task DeleteCollection(string databaseId, string collectionId) /// public Task ListDocuments(string databaseId, string collectionId, List? queries = null, string? transactionId = null, bool? total = null, long? ttl = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId); @@ -675,6 +764,16 @@ static Models.DocumentList Convert(Dictionary it) /// public Task CreateDocument(string databaseId, string collectionId, string documentId, object data, List? permissions = null, string? transactionId = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId); @@ -718,6 +817,16 @@ static Models.Document Convert(Dictionary it) /// public Task CreateDocuments(string databaseId, string collectionId, List documents, string? transactionId = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId); @@ -760,6 +869,16 @@ static Models.DocumentList Convert(Dictionary it) /// public Task UpsertDocuments(string databaseId, string collectionId, List documents, string? transactionId = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId); @@ -800,6 +919,16 @@ static Models.DocumentList Convert(Dictionary it) /// public Task UpdateDocuments(string databaseId, string collectionId, object? data = null, List? queries = null, string? transactionId = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId); @@ -840,6 +969,16 @@ static Models.DocumentList Convert(Dictionary it) /// public Task DeleteDocuments(string databaseId, string collectionId, List? queries = null, string? transactionId = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId); @@ -879,6 +1018,21 @@ static Models.DocumentList Convert(Dictionary it) /// public Task GetDocument(string databaseId, string collectionId, string documentId, List? queries = null, string? transactionId = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + + if (documentId == "") + { + throw new AppwriteException("Missing required parameter: \"documentId\""); + } + var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents/{documentId}" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId) @@ -920,6 +1074,21 @@ static Models.Document Convert(Dictionary it) /// public Task UpsertDocument(string databaseId, string collectionId, string documentId, object? data = null, List? permissions = null, string? transactionId = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + + if (documentId == "") + { + throw new AppwriteException("Missing required parameter: \"documentId\""); + } + var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents/{documentId}" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId) @@ -961,6 +1130,21 @@ static Models.Document Convert(Dictionary it) /// public Task UpdateDocument(string databaseId, string collectionId, string documentId, object? data = null, List? permissions = null, string? transactionId = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + + if (documentId == "") + { + throw new AppwriteException("Missing required parameter: \"documentId\""); + } + var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents/{documentId}" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId) @@ -1001,6 +1185,21 @@ static Models.Document Convert(Dictionary it) /// public Task DeleteDocument(string databaseId, string collectionId, string documentId, string? transactionId = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + + if (documentId == "") + { + throw new AppwriteException("Missing required parameter: \"documentId\""); + } + var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents/{documentId}" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId) @@ -1014,7 +1213,8 @@ public Task DeleteDocument(string databaseId, string collectionId, strin var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1033,6 +1233,26 @@ public Task DeleteDocument(string databaseId, string collectionId, strin /// public Task DecrementDocumentAttribute(string databaseId, string collectionId, string documentId, string attribute, double? @value = null, double? min = null, string? transactionId = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + + if (documentId == "") + { + throw new AppwriteException("Missing required parameter: \"documentId\""); + } + + if (attribute == "") + { + throw new AppwriteException("Missing required parameter: \"attribute\""); + } + var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/decrement" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId) @@ -1074,6 +1294,26 @@ static Models.Document Convert(Dictionary it) /// public Task IncrementDocumentAttribute(string databaseId, string collectionId, string documentId, string attribute, double? @value = null, double? max = null, string? transactionId = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + + if (documentId == "") + { + throw new AppwriteException("Missing required parameter: \"documentId\""); + } + + if (attribute == "") + { + throw new AppwriteException("Missing required parameter: \"attribute\""); + } + var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/increment" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId) @@ -1115,6 +1355,16 @@ static Models.Document Convert(Dictionary it) /// public Task ListIndexes(string databaseId, string collectionId, List? queries = null, bool? total = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/indexes" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId); @@ -1154,6 +1404,16 @@ static Models.IndexList Convert(Dictionary it) /// public Task CreateIndex(string databaseId, string collectionId, string key, Appwrite.Enums.DocumentsDBIndexType type, List attributes, List? orders = null, List? lengths = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/indexes" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId); @@ -1195,6 +1455,21 @@ static Models.Index Convert(Dictionary it) /// public Task GetIndex(string databaseId, string collectionId, string key) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + + if (key == "") + { + throw new AppwriteException("Missing required parameter: \"key\""); + } + var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/indexes/{key}" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId) @@ -1231,6 +1506,21 @@ static Models.Index Convert(Dictionary it) /// public Task DeleteIndex(string databaseId, string collectionId, string key) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + + if (key == "") + { + throw new AppwriteException("Missing required parameter: \"key\""); + } + var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/indexes/{key}" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId) @@ -1243,7 +1533,8 @@ public Task DeleteIndex(string databaseId, string collectionId, string k var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1270,6 +1561,11 @@ public Task DeleteIndex(string databaseId, string collectionId, string k /// public Task CreateFailover(string databaseId, string? targetReplicaId = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/documentsdb/{databaseId}/failovers" .Replace("{databaseId}", databaseId); @@ -1309,6 +1605,11 @@ static Models.DedicatedDatabase Convert(Dictionary it) /// public Task ListOperations(string databaseId, string? status = null, long? limit = null, long? offset = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/documentsdb/{databaseId}/operations" .Replace("{databaseId}", databaseId); @@ -1347,6 +1648,11 @@ static Models.DedicatedDatabaseOperationList Convert(Dictionary /// public Task GetReplicas(string databaseId) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/documentsdb/{databaseId}/replicas" .Replace("{databaseId}", databaseId); @@ -1383,6 +1689,11 @@ static Models.DedicatedDatabaseReplicas Convert(Dictionary it) /// public Task GetStatus(string databaseId) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/documentsdb/{databaseId}/status" .Replace("{databaseId}", databaseId); diff --git a/Appwrite/Services/Domains.cs b/Appwrite/Services/Domains.cs new file mode 100644 index 00000000..721975ff --- /dev/null +++ b/Appwrite/Services/Domains.cs @@ -0,0 +1,2155 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Appwrite.Models; +using Appwrite.Enums; + +namespace Appwrite.Services +{ + public class Domains : Service + { + public Domains(Client client) : base(client) + { + } + + /// + /// List all domains registered for this project. This endpoint supports + /// pagination. + /// + /// + public Task List(List? queries = null, string? search = null) + { + var apiPath = "/domains"; + + var apiParameters = new Dictionary() + { + { "queries", queries }, + { "search", search } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DomainsList Convert(Dictionary it) + { + return Models.DomainsList.From(map: it); + } + + return _client.Call( + method: "GET", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Create a new domain. Before creating a domain, you need to ensure that your + /// DNS provider is properly configured. After creating the domain, you can use + /// the verification endpoint to check if the domain is ready to be used. + /// + /// + public Task Create(string teamId, string domain) + { + var apiPath = "/domains"; + + var apiParameters = new Dictionary() + { + { "teamId", teamId }, + { "domain", domain } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.XDomain Convert(Dictionary it) + { + return Models.XDomain.From(map: it); + } + + return _client.Call( + method: "POST", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Get the registration price for a domain name. + /// + /// + [Obsolete("This API has been deprecated since 2.0.0. Please use `Domains.listPrices` instead.")] + public Task GetPrice(string domain, long? periodYears = null, Appwrite.Enums.DomainRegistrationType? registrationType = null) + { + var apiPath = "/domains/price"; + + var apiParameters = new Dictionary() + { + { "domain", domain }, + { "periodYears", periodYears }, + { "registrationType", registrationType?.Value } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DomainPrice Convert(Dictionary it) + { + return Models.DomainPrice.From(map: it); + } + + return _client.Call( + method: "GET", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Check availability and get the requested registration price for one or more + /// domain names. Availability is resolved for all domains in a single + /// registrar lookup. Unavailable domains have a null price for new + /// registrations, but can still be priced for renewal, transfer, or trade. + /// Every priced domain also carries its renewal price for the same period, so + /// a separate renewal lookup is not needed. A domain whose price could not be + /// resolved, for example because its TLD is not supported, is returned with a + /// null price. + /// + /// + public Task ListPrices(List domains, long? periodYears = null, Appwrite.Enums.DomainRegistrationType? registrationType = null) + { + var apiPath = "/domains/prices"; + + var apiParameters = new Dictionary() + { + { "domains", domains }, + { "periodYears", periodYears }, + { "registrationType", registrationType?.Value } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DomainPricesList Convert(Dictionary it) + { + return Models.DomainPricesList.From(map: it); + } + + return _client.Call( + method: "GET", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Get a domain by its unique ID. + /// + /// + public Task Get(string domainId) + { + if (domainId == "") + { + throw new AppwriteException("Missing required parameter: \"domainId\""); + } + + var apiPath = "/domains/{domainId}" + .Replace("{domainId}", domainId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.XDomain Convert(Dictionary it) + { + return Models.XDomain.From(map: it); + } + + return _client.Call( + method: "GET", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Delete a domain by its unique ID. This endpoint can be used to delete a + /// domain from your project. + /// Once deleted, the domain will no longer be available for use and all + /// associated resources will be removed. + /// + /// + public Task Delete(string domainId) + { + if (domainId == "") + { + throw new AppwriteException("Missing required parameter: \"domainId\""); + } + + var apiPath = "/domains/{domainId}" + .Replace("{domainId}", domainId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + + return _client.Call( + method: "DELETE", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!); + + } + + /// + /// Update the registrar nameservers for the given domain. When nameservers are + /// not provided, + /// the domain will be updated to use Appwrite nameservers. + /// + /// + public Task UpdateNameservers(string domainId, List? nameservers = null) + { + if (domainId == "") + { + throw new AppwriteException("Missing required parameter: \"domainId\""); + } + + var apiPath = "/domains/{domainId}/nameservers" + .Replace("{domainId}", domainId); + + var apiParameters = new Dictionary() + { + { "nameservers", nameservers } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.XDomain Convert(Dictionary it) + { + return Models.XDomain.From(map: it); + } + + return _client.Call( + method: "PATCH", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Verify which NS records are used and update the domain accordingly. This + /// will check the domain's + /// nameservers and update the domain's status based on whether the nameservers + /// match the expected + /// Appwrite nameservers. + /// + /// + public Task VerifyNameservers(string domainId) + { + if (domainId == "") + { + throw new AppwriteException("Missing required parameter: \"domainId\""); + } + + var apiPath = "/domains/{domainId}/nameservers/verification" + .Replace("{domainId}", domainId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.XDomain Convert(Dictionary it) + { + return Models.XDomain.From(map: it); + } + + return _client.Call( + method: "PATCH", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// List Google Workspace DNS records. + /// + /// + public Task GetPresetGoogleWorkspace(string domainId) + { + if (domainId == "") + { + throw new AppwriteException("Missing required parameter: \"domainId\""); + } + + var apiPath = "/domains/{domainId}/presets/google-workspace" + .Replace("{domainId}", domainId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DnsRecordsList Convert(Dictionary it) + { + return Models.DnsRecordsList.From(map: it); + } + + return _client.Call( + method: "GET", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Add Google Workspace DNS records to the domain. This will create the + /// required MX records + /// for Google Workspace email hosting. + /// + /// + public Task CreatePresetGoogleWorkspace(string domainId) + { + if (domainId == "") + { + throw new AppwriteException("Missing required parameter: \"domainId\""); + } + + var apiPath = "/domains/{domainId}/presets/google-workspace" + .Replace("{domainId}", domainId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DnsRecordsList Convert(Dictionary it) + { + return Models.DnsRecordsList.From(map: it); + } + + return _client.Call( + method: "POST", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// List iCloud DNS records. + /// + /// + public Task GetPresetICloud(string domainId) + { + if (domainId == "") + { + throw new AppwriteException("Missing required parameter: \"domainId\""); + } + + var apiPath = "/domains/{domainId}/presets/icloud" + .Replace("{domainId}", domainId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DnsRecordsList Convert(Dictionary it) + { + return Models.DnsRecordsList.From(map: it); + } + + return _client.Call( + method: "GET", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Add iCloud DNS records to the domain. This will create the required MX and + /// SPF records + /// for using iCloud email services with your domain. + /// + /// + public Task CreatePresetICloud(string domainId) + { + if (domainId == "") + { + throw new AppwriteException("Missing required parameter: \"domainId\""); + } + + var apiPath = "/domains/{domainId}/presets/icloud" + .Replace("{domainId}", domainId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DnsRecordsList Convert(Dictionary it) + { + return Models.DnsRecordsList.From(map: it); + } + + return _client.Call( + method: "POST", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// List Mailgun DNS records. + /// + /// + public Task GetPresetMailgun(string domainId) + { + if (domainId == "") + { + throw new AppwriteException("Missing required parameter: \"domainId\""); + } + + var apiPath = "/domains/{domainId}/presets/mailgun" + .Replace("{domainId}", domainId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DnsRecordsList Convert(Dictionary it) + { + return Models.DnsRecordsList.From(map: it); + } + + return _client.Call( + method: "GET", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Add Mailgun DNS records to the domain. This endpoint will create the + /// required DNS records + /// for Mailgun in the specified domain. + /// + /// + public Task CreatePresetMailgun(string domainId) + { + if (domainId == "") + { + throw new AppwriteException("Missing required parameter: \"domainId\""); + } + + var apiPath = "/domains/{domainId}/presets/mailgun" + .Replace("{domainId}", domainId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DnsRecordsList Convert(Dictionary it) + { + return Models.DnsRecordsList.From(map: it); + } + + return _client.Call( + method: "POST", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// List Outlook DNS records. + /// + /// + public Task GetPresetOutlook(string domainId) + { + if (domainId == "") + { + throw new AppwriteException("Missing required parameter: \"domainId\""); + } + + var apiPath = "/domains/{domainId}/presets/outlook" + .Replace("{domainId}", domainId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DnsRecordsList Convert(Dictionary it) + { + return Models.DnsRecordsList.From(map: it); + } + + return _client.Call( + method: "GET", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Add Outlook DNS records to the domain. This will create the required MX + /// records + /// for setting up Outlook email hosting for your domain. + /// + /// + public Task CreatePresetOutlook(string domainId) + { + if (domainId == "") + { + throw new AppwriteException("Missing required parameter: \"domainId\""); + } + + var apiPath = "/domains/{domainId}/presets/outlook" + .Replace("{domainId}", domainId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DnsRecordsList Convert(Dictionary it) + { + return Models.DnsRecordsList.From(map: it); + } + + return _client.Call( + method: "POST", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// List ProtonMail DNS records. + /// + /// + public Task GetPresetProtonMail(string domainId) + { + if (domainId == "") + { + throw new AppwriteException("Missing required parameter: \"domainId\""); + } + + var apiPath = "/domains/{domainId}/presets/proton-mail" + .Replace("{domainId}", domainId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DnsRecordsList Convert(Dictionary it) + { + return Models.DnsRecordsList.From(map: it); + } + + return _client.Call( + method: "GET", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Add ProtonMail DNS records to the domain. This will create the required MX + /// records + /// for using ProtonMail with your custom domain. + /// + /// + public Task CreatePresetProtonMail(string domainId) + { + if (domainId == "") + { + throw new AppwriteException("Missing required parameter: \"domainId\""); + } + + var apiPath = "/domains/{domainId}/presets/proton-mail" + .Replace("{domainId}", domainId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DnsRecordsList Convert(Dictionary it) + { + return Models.DnsRecordsList.From(map: it); + } + + return _client.Call( + method: "POST", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// List Zoho DNS records. + /// + /// + public Task GetPresetZoho(string domainId) + { + if (domainId == "") + { + throw new AppwriteException("Missing required parameter: \"domainId\""); + } + + var apiPath = "/domains/{domainId}/presets/zoho" + .Replace("{domainId}", domainId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DnsRecordsList Convert(Dictionary it) + { + return Models.DnsRecordsList.From(map: it); + } + + return _client.Call( + method: "GET", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Add Zoho Mail DNS records to the domain. This will create the required MX + /// records + /// for setting up Zoho Mail on your domain. + /// + /// + public Task CreatePresetZoho(string domainId) + { + if (domainId == "") + { + throw new AppwriteException("Missing required parameter: \"domainId\""); + } + + var apiPath = "/domains/{domainId}/presets/zoho" + .Replace("{domainId}", domainId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DnsRecordsList Convert(Dictionary it) + { + return Models.DnsRecordsList.From(map: it); + } + + return _client.Call( + method: "POST", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// List DNS records for a given domain. You can use this endpoint to list all + /// the DNS records + /// associated with your domain. + /// + /// + public Task ListRecords(string domainId, List? queries = null) + { + if (domainId == "") + { + throw new AppwriteException("Missing required parameter: \"domainId\""); + } + + var apiPath = "/domains/{domainId}/records" + .Replace("{domainId}", domainId); + + var apiParameters = new Dictionary() + { + { "queries", queries } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DnsRecordsList Convert(Dictionary it) + { + return Models.DnsRecordsList.From(map: it); + } + + return _client.Call( + method: "GET", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Create a new A record for the given domain. A records are used to point a + /// domain name + /// to an IPv4 address. The record value should be a valid IPv4 address. + /// + /// + public Task CreateRecordA(string domainId, string name, string @value, long ttl, string? comment = null) + { + if (domainId == "") + { + throw new AppwriteException("Missing required parameter: \"domainId\""); + } + + var apiPath = "/domains/{domainId}/records/a" + .Replace("{domainId}", domainId); + + var apiParameters = new Dictionary() + { + { "name", name }, + { "value", @value }, + { "ttl", ttl }, + { "comment", comment } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DnsRecord Convert(Dictionary it) + { + return Models.DnsRecord.From(map: it); + } + + return _client.Call( + method: "POST", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Update an existing A record for the given domain. This endpoint allows you + /// to modify + /// the properties of an A record including its name (subdomain), IPv4 address, + /// TTL, + /// and optional comment. + /// + /// + public Task UpdateRecordA(string domainId, string recordId, string name, string @value, long ttl, string? comment = null) + { + if (domainId == "") + { + throw new AppwriteException("Missing required parameter: \"domainId\""); + } + + if (recordId == "") + { + throw new AppwriteException("Missing required parameter: \"recordId\""); + } + + var apiPath = "/domains/{domainId}/records/a/{recordId}" + .Replace("{domainId}", domainId) + .Replace("{recordId}", recordId); + + var apiParameters = new Dictionary() + { + { "name", name }, + { "value", @value }, + { "ttl", ttl }, + { "comment", comment } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DnsRecord Convert(Dictionary it) + { + return Models.DnsRecord.From(map: it); + } + + return _client.Call( + method: "PUT", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Create a new AAAA record for the given domain. This endpoint allows you to + /// add a new IPv6 DNS record + /// to your domain. The record will be used to point a hostname to an IPv6 + /// address. + /// + /// + public Task CreateRecordAAAA(string domainId, string name, string @value, long ttl, string? comment = null) + { + if (domainId == "") + { + throw new AppwriteException("Missing required parameter: \"domainId\""); + } + + var apiPath = "/domains/{domainId}/records/aaaa" + .Replace("{domainId}", domainId); + + var apiParameters = new Dictionary() + { + { "name", name }, + { "value", @value }, + { "ttl", ttl }, + { "comment", comment } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DnsRecord Convert(Dictionary it) + { + return Models.DnsRecord.From(map: it); + } + + return _client.Call( + method: "POST", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Update an existing AAAA record for the given domain. This endpoint allows + /// you to modify + /// the properties of an existing AAAA record, including its name (subdomain), + /// IPv6 address, + /// TTL, and optional comment. + /// + /// + public Task UpdateRecordAAAA(string domainId, string recordId, string name, string @value, long ttl, string? comment = null) + { + if (domainId == "") + { + throw new AppwriteException("Missing required parameter: \"domainId\""); + } + + if (recordId == "") + { + throw new AppwriteException("Missing required parameter: \"recordId\""); + } + + var apiPath = "/domains/{domainId}/records/aaaa/{recordId}" + .Replace("{domainId}", domainId) + .Replace("{recordId}", recordId); + + var apiParameters = new Dictionary() + { + { "name", name }, + { "value", @value }, + { "ttl", ttl }, + { "comment", comment } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DnsRecord Convert(Dictionary it) + { + return Models.DnsRecord.From(map: it); + } + + return _client.Call( + method: "PUT", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Create a new ALIAS record for the given domain. This record type can be + /// used to point your domain + /// to another domain name that will serve as an alias. This is particularly + /// useful when you want to + /// map your domain to a target domain that may change its IP address. + /// + /// + public Task CreateRecordAlias(string domainId, string name, string @value, long ttl, string? comment = null) + { + if (domainId == "") + { + throw new AppwriteException("Missing required parameter: \"domainId\""); + } + + var apiPath = "/domains/{domainId}/records/alias" + .Replace("{domainId}", domainId); + + var apiParameters = new Dictionary() + { + { "name", name }, + { "value", @value }, + { "ttl", ttl }, + { "comment", comment } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DnsRecord Convert(Dictionary it) + { + return Models.DnsRecord.From(map: it); + } + + return _client.Call( + method: "POST", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Update an existing ALIAS record for the specified domain. This endpoint + /// allows you to modify + /// the properties of an existing ALIAS record including its name, target + /// domain, TTL, and comment. + /// + /// The ALIAS record type is similar to a CNAME record but can be used at the + /// zone apex (root domain). + /// It provides a way to map one domain name to another. + /// + /// + public Task UpdateRecordAlias(string domainId, string recordId, string name, string @value, long ttl, string? comment = null) + { + if (domainId == "") + { + throw new AppwriteException("Missing required parameter: \"domainId\""); + } + + if (recordId == "") + { + throw new AppwriteException("Missing required parameter: \"recordId\""); + } + + var apiPath = "/domains/{domainId}/records/alias/{recordId}" + .Replace("{domainId}", domainId) + .Replace("{recordId}", recordId); + + var apiParameters = new Dictionary() + { + { "name", name }, + { "value", @value }, + { "ttl", ttl }, + { "comment", comment } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DnsRecord Convert(Dictionary it) + { + return Models.DnsRecord.From(map: it); + } + + return _client.Call( + method: "PUT", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Create a new CAA record for the given domain. CAA records are used to + /// specify which + /// Certificate Authorities (CAs) are allowed to issue SSL/TLS certificates for + /// your domain. + /// + /// + public Task CreateRecordCAA(string domainId, string name, string @value, long ttl, string? comment = null) + { + if (domainId == "") + { + throw new AppwriteException("Missing required parameter: \"domainId\""); + } + + var apiPath = "/domains/{domainId}/records/caa" + .Replace("{domainId}", domainId); + + var apiParameters = new Dictionary() + { + { "name", name }, + { "value", @value }, + { "ttl", ttl }, + { "comment", comment } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DnsRecord Convert(Dictionary it) + { + return Models.DnsRecord.From(map: it); + } + + return _client.Call( + method: "POST", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Update an existing CAA record for the given domain. A CAA (Certification + /// Authority Authorization) + /// record is used to specify which certificate authorities (CAs) are + /// authorized to issue certificates + /// for a domain. + /// + /// + public Task UpdateRecordCAA(string domainId, string recordId, string name, string @value, long ttl, string? comment = null) + { + if (domainId == "") + { + throw new AppwriteException("Missing required parameter: \"domainId\""); + } + + if (recordId == "") + { + throw new AppwriteException("Missing required parameter: \"recordId\""); + } + + var apiPath = "/domains/{domainId}/records/caa/{recordId}" + .Replace("{domainId}", domainId) + .Replace("{recordId}", recordId); + + var apiParameters = new Dictionary() + { + { "name", name }, + { "value", @value }, + { "ttl", ttl }, + { "comment", comment } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DnsRecord Convert(Dictionary it) + { + return Models.DnsRecord.From(map: it); + } + + return _client.Call( + method: "PUT", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Create a new CNAME record for the given domain. + /// + /// A CNAME record maps a subdomain to another domain name, allowing you to + /// create aliases + /// for your domain. For example, you can create a CNAME record to point + /// 'blog.example.com' + /// to 'example.wordpress.com'. + /// + /// + public Task CreateRecordCNAME(string domainId, string name, string @value, long ttl, string? comment = null) + { + if (domainId == "") + { + throw new AppwriteException("Missing required parameter: \"domainId\""); + } + + var apiPath = "/domains/{domainId}/records/cname" + .Replace("{domainId}", domainId); + + var apiParameters = new Dictionary() + { + { "name", name }, + { "value", @value }, + { "ttl", ttl }, + { "comment", comment } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DnsRecord Convert(Dictionary it) + { + return Models.DnsRecord.From(map: it); + } + + return _client.Call( + method: "POST", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Update an existing CNAME record for the given domain. + /// + /// + public Task UpdateRecordCNAME(string domainId, string recordId, string name, string @value, long ttl, string? comment = null) + { + if (domainId == "") + { + throw new AppwriteException("Missing required parameter: \"domainId\""); + } + + if (recordId == "") + { + throw new AppwriteException("Missing required parameter: \"recordId\""); + } + + var apiPath = "/domains/{domainId}/records/cname/{recordId}" + .Replace("{domainId}", domainId) + .Replace("{recordId}", recordId); + + var apiParameters = new Dictionary() + { + { "name", name }, + { "value", @value }, + { "ttl", ttl }, + { "comment", comment } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DnsRecord Convert(Dictionary it) + { + return Models.DnsRecord.From(map: it); + } + + return _client.Call( + method: "PUT", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Create a new HTTPS record for the given domain. This record is used to + /// configure HTTPS + /// settings for your domain, enabling secure communication over SSL/TLS. + /// + /// + public Task CreateRecordHTTPS(string domainId, string name, string @value, long ttl, string? comment = null) + { + if (domainId == "") + { + throw new AppwriteException("Missing required parameter: \"domainId\""); + } + + var apiPath = "/domains/{domainId}/records/https" + .Replace("{domainId}", domainId); + + var apiParameters = new Dictionary() + { + { "name", name }, + { "value", @value }, + { "ttl", ttl }, + { "comment", comment } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DnsRecord Convert(Dictionary it) + { + return Models.DnsRecord.From(map: it); + } + + return _client.Call( + method: "POST", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Update an existing HTTPS record for the given domain. This endpoint allows + /// you to modify + /// the properties of an HTTPS record associated with your domain, including + /// the name (subdomain), + /// target value, TTL, and optional comment. + /// + /// + public Task UpdateRecordHTTPS(string domainId, string recordId, string name, string @value, long ttl, string? comment = null) + { + if (domainId == "") + { + throw new AppwriteException("Missing required parameter: \"domainId\""); + } + + if (recordId == "") + { + throw new AppwriteException("Missing required parameter: \"recordId\""); + } + + var apiPath = "/domains/{domainId}/records/https/{recordId}" + .Replace("{domainId}", domainId) + .Replace("{recordId}", recordId); + + var apiParameters = new Dictionary() + { + { "name", name }, + { "value", @value }, + { "ttl", ttl }, + { "comment", comment } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DnsRecord Convert(Dictionary it) + { + return Models.DnsRecord.From(map: it); + } + + return _client.Call( + method: "PUT", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Create a new MX record for the given domain. MX records are used to define + /// the mail servers responsible + /// for accepting email messages for the domain. Multiple MX records can be + /// created with different priorities. + /// The priority parameter determines the order in which mail servers are used, + /// with lower values indicating + /// higher priority. + /// + /// + public Task CreateRecordMX(string domainId, string name, string @value, long ttl, long priority, string? comment = null) + { + if (domainId == "") + { + throw new AppwriteException("Missing required parameter: \"domainId\""); + } + + var apiPath = "/domains/{domainId}/records/mx" + .Replace("{domainId}", domainId); + + var apiParameters = new Dictionary() + { + { "name", name }, + { "value", @value }, + { "ttl", ttl }, + { "priority", priority }, + { "comment", comment } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DnsRecord Convert(Dictionary it) + { + return Models.DnsRecord.From(map: it); + } + + return _client.Call( + method: "POST", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Update an existing MX record for the given domain. + /// + /// + public Task UpdateRecordMX(string domainId, string recordId, string name, string @value, long ttl, long priority, string? comment = null) + { + if (domainId == "") + { + throw new AppwriteException("Missing required parameter: \"domainId\""); + } + + if (recordId == "") + { + throw new AppwriteException("Missing required parameter: \"recordId\""); + } + + var apiPath = "/domains/{domainId}/records/mx/{recordId}" + .Replace("{domainId}", domainId) + .Replace("{recordId}", recordId); + + var apiParameters = new Dictionary() + { + { "name", name }, + { "value", @value }, + { "ttl", ttl }, + { "priority", priority }, + { "comment", comment } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DnsRecord Convert(Dictionary it) + { + return Models.DnsRecord.From(map: it); + } + + return _client.Call( + method: "PUT", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Create a new NS record for the given domain. NS records specify the + /// nameservers that are used + /// to resolve the domain name to IP addresses. Each domain can have multiple + /// NS records. + /// + /// + public Task CreateRecordNS(string domainId, string name, string @value, long ttl, string? comment = null) + { + if (domainId == "") + { + throw new AppwriteException("Missing required parameter: \"domainId\""); + } + + var apiPath = "/domains/{domainId}/records/ns" + .Replace("{domainId}", domainId); + + var apiParameters = new Dictionary() + { + { "name", name }, + { "value", @value }, + { "ttl", ttl }, + { "comment", comment } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DnsRecord Convert(Dictionary it) + { + return Models.DnsRecord.From(map: it); + } + + return _client.Call( + method: "POST", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Update an existing NS record for the given domain. This endpoint allows you + /// to modify + /// the properties of an NS (nameserver) record associated with your domain. + /// You can update + /// the record name (subdomain), target nameserver value, TTL, and add or + /// modify comments + /// for better record management. + /// + /// + public Task UpdateRecordNS(string domainId, string recordId, string name, string @value, long ttl, string? comment = null) + { + if (domainId == "") + { + throw new AppwriteException("Missing required parameter: \"domainId\""); + } + + if (recordId == "") + { + throw new AppwriteException("Missing required parameter: \"recordId\""); + } + + var apiPath = "/domains/{domainId}/records/ns/{recordId}" + .Replace("{domainId}", domainId) + .Replace("{recordId}", recordId); + + var apiParameters = new Dictionary() + { + { "name", name }, + { "value", @value }, + { "ttl", ttl }, + { "comment", comment } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DnsRecord Convert(Dictionary it) + { + return Models.DnsRecord.From(map: it); + } + + return _client.Call( + method: "PUT", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Create a new SRV record for the given domain. SRV records are used to + /// define the location + /// of servers for specific services. For example, they can be used to specify + /// which server + /// handles a specific service like SIP or XMPP for the domain. + /// + /// + public Task CreateRecordSRV(string domainId, string name, string @value, long ttl, long priority, long weight, long port, string? comment = null) + { + if (domainId == "") + { + throw new AppwriteException("Missing required parameter: \"domainId\""); + } + + var apiPath = "/domains/{domainId}/records/srv" + .Replace("{domainId}", domainId); + + var apiParameters = new Dictionary() + { + { "name", name }, + { "value", @value }, + { "ttl", ttl }, + { "priority", priority }, + { "weight", weight }, + { "port", port }, + { "comment", comment } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DnsRecord Convert(Dictionary it) + { + return Models.DnsRecord.From(map: it); + } + + return _client.Call( + method: "POST", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Update an existing SRV record for the given domain. + /// + /// Required parameters: + /// - domainId: Domain unique ID + /// - recordId: DNS record unique ID + /// - name: Record name (service name) + /// - value: Target hostname for this SRV record + /// - ttl: Time to live, in seconds + /// - priority: Record priority + /// - weight: Record weight + /// - port: Port number for the service + /// + /// Optional parameters: + /// - comment: A comment for this record + /// + /// + public Task UpdateRecordSRV(string domainId, string recordId, string name, string @value, long ttl, long priority, long weight, long port, string? comment = null) + { + if (domainId == "") + { + throw new AppwriteException("Missing required parameter: \"domainId\""); + } + + if (recordId == "") + { + throw new AppwriteException("Missing required parameter: \"recordId\""); + } + + var apiPath = "/domains/{domainId}/records/srv/{recordId}" + .Replace("{domainId}", domainId) + .Replace("{recordId}", recordId); + + var apiParameters = new Dictionary() + { + { "name", name }, + { "value", @value }, + { "ttl", ttl }, + { "priority", priority }, + { "weight", weight }, + { "port", port }, + { "comment", comment } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DnsRecord Convert(Dictionary it) + { + return Models.DnsRecord.From(map: it); + } + + return _client.Call( + method: "PUT", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Create a new TXT record for the given domain. TXT records can be used + /// to provide additional information about your domain, such as domain + /// verification records, SPF records, or DKIM records. + /// + /// + public Task CreateRecordTXT(string domainId, string name, long ttl, string? @value = null, string? comment = null) + { + if (domainId == "") + { + throw new AppwriteException("Missing required parameter: \"domainId\""); + } + + var apiPath = "/domains/{domainId}/records/txt" + .Replace("{domainId}", domainId); + + var apiParameters = new Dictionary() + { + { "name", name }, + { "value", @value }, + { "ttl", ttl }, + { "comment", comment } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DnsRecord Convert(Dictionary it) + { + return Models.DnsRecord.From(map: it); + } + + return _client.Call( + method: "POST", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Update an existing TXT record for the given domain. + /// + /// Update the TXT record details for a specific domain by providing the domain + /// ID, + /// record ID, and the new record configuration including name, value, TTL, and + /// an optional comment. + /// + /// + public Task UpdateRecordTXT(string domainId, string recordId, string name, string @value, long ttl, string? comment = null) + { + if (domainId == "") + { + throw new AppwriteException("Missing required parameter: \"domainId\""); + } + + if (recordId == "") + { + throw new AppwriteException("Missing required parameter: \"recordId\""); + } + + var apiPath = "/domains/{domainId}/records/txt/{recordId}" + .Replace("{domainId}", domainId) + .Replace("{recordId}", recordId); + + var apiParameters = new Dictionary() + { + { "name", name }, + { "value", @value }, + { "ttl", ttl }, + { "comment", comment } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DnsRecord Convert(Dictionary it) + { + return Models.DnsRecord.From(map: it); + } + + return _client.Call( + method: "PUT", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Get a single DNS record for a given domain by record ID. + /// + /// This endpoint allows you to retrieve a specific DNS record associated with + /// a domain + /// using its unique identifier. The record contains information about the DNS + /// configuration + /// such as type, value, and TTL settings. + /// + /// + public Task GetRecord(string domainId, string recordId) + { + if (domainId == "") + { + throw new AppwriteException("Missing required parameter: \"domainId\""); + } + + if (recordId == "") + { + throw new AppwriteException("Missing required parameter: \"recordId\""); + } + + var apiPath = "/domains/{domainId}/records/{recordId}" + .Replace("{domainId}", domainId) + .Replace("{recordId}", recordId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DnsRecord Convert(Dictionary it) + { + return Models.DnsRecord.From(map: it); + } + + return _client.Call( + method: "GET", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Delete a DNS record for the given domain. This endpoint allows you to + /// delete an existing DNS record + /// from a specific domain. + /// + /// + public Task DeleteRecord(string domainId, string recordId) + { + if (domainId == "") + { + throw new AppwriteException("Missing required parameter: \"domainId\""); + } + + if (recordId == "") + { + throw new AppwriteException("Missing required parameter: \"recordId\""); + } + + var apiPath = "/domains/{domainId}/records/{recordId}" + .Replace("{domainId}", domainId) + .Replace("{recordId}", recordId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + + return _client.Call( + method: "DELETE", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!); + + } + + /// + /// Update the team ID for a specific domain. The caller must administer the + /// current + /// team and be an owner of the destination team. + /// + /// Updating the team ID will transfer ownership and access control of the + /// domain + /// and all its DNS records to the new team. + /// + /// + public Task UpdateTeam(string domainId, string teamId) + { + if (domainId == "") + { + throw new AppwriteException("Missing required parameter: \"domainId\""); + } + + var apiPath = "/domains/{domainId}/team" + .Replace("{domainId}", domainId); + + var apiParameters = new Dictionary() + { + { "teamId", teamId } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.XDomain Convert(Dictionary it) + { + return Models.XDomain.From(map: it); + } + + return _client.Call( + method: "PATCH", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Retrieve the current transfer status for a domain. Returns the status, an + /// optional reason, and a timestamp of the last status change. + /// + /// + public Task GetTransferStatus(string domainId) + { + if (domainId == "") + { + throw new AppwriteException("Missing required parameter: \"domainId\""); + } + + var apiPath = "/domains/{domainId}/transfers/status" + .Replace("{domainId}", domainId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DomainTransferStatus Convert(Dictionary it) + { + return Models.DomainTransferStatus.From(map: it); + } + + return _client.Call( + method: "GET", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Retrieve the DNS zone file for the given domain. This endpoint will return + /// the DNS + /// zone file in a standardized format that can be used to configure DNS + /// servers. + /// + /// + public Task GetZone(string domainId) + { + if (domainId == "") + { + throw new AppwriteException("Missing required parameter: \"domainId\""); + } + + var apiPath = "/domains/{domainId}/zone" + .Replace("{domainId}", domainId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "text/plain" } + }; + + + + return _client.Call( + method: "GET", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!); + + } + + /// + /// Update the DNS zone for the given domain using the provided zone file + /// content. + /// All parsed records are imported and then the main domain document is + /// returned. + /// + /// + public Task UpdateZone(string domainId, string content) + { + if (domainId == "") + { + throw new AppwriteException("Missing required parameter: \"domainId\""); + } + + var apiPath = "/domains/{domainId}/zone" + .Replace("{domainId}", domainId); + + var apiParameters = new Dictionary() + { + { "content", content } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.XDomain Convert(Dictionary it) + { + return Models.XDomain.From(map: it); + } + + return _client.Call( + method: "PUT", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + } +} diff --git a/Appwrite/Services/Functions.cs b/Appwrite/Services/Functions.cs index 740d6d1d..3ef308f9 100644 --- a/Appwrite/Services/Functions.cs +++ b/Appwrite/Services/Functions.cs @@ -114,12 +114,13 @@ static Models.Function Convert(Dictionary it) /// Get a list of all runtimes that are currently active on your instance. /// /// - public Task ListRuntimes() + public Task ListRuntimes(bool? total = null) { var apiPath = "/functions/runtimes"; var apiParameters = new Dictionary() { + { "total", total } }; var apiHeaders = new Dictionary() @@ -147,13 +148,14 @@ static Models.RuntimeList Convert(Dictionary it) /// List allowed function specifications for this instance. /// /// - public Task ListSpecifications(string? type = null) + public Task ListSpecifications(string? type = null, bool? total = null) { var apiPath = "/functions/specifications"; var apiParameters = new Dictionary() { - { "type", type } + { "type", type }, + { "total", total } }; var apiHeaders = new Dictionary() @@ -183,6 +185,11 @@ static Models.SpecificationList Convert(Dictionary it) /// public Task Get(string functionId) { + if (functionId == "") + { + throw new AppwriteException("Missing required parameter: \"functionId\""); + } + var apiPath = "/functions/{functionId}" .Replace("{functionId}", functionId); @@ -217,6 +224,11 @@ static Models.Function Convert(Dictionary it) /// public Task Update(string functionId, string name, Appwrite.Enums.Runtime? runtime = null, List? execute = null, List? events = null, string? schedule = null, long? timeout = null, bool? enabled = null, bool? logging = null, string? entrypoint = null, string? commands = null, List? scopes = null, string? installationId = null, string? providerRepositoryId = null, string? providerBranch = null, bool? providerSilentMode = null, string? providerRootDirectory = null, List? providerBranches = null, List? providerPaths = null, string? buildSpecification = null, string? runtimeSpecification = null, long? deploymentRetention = null, long? interval = null) { + if (functionId == "") + { + throw new AppwriteException("Missing required parameter: \"functionId\""); + } + var apiPath = "/functions/{functionId}" .Replace("{functionId}", functionId); @@ -274,6 +286,11 @@ static Models.Function Convert(Dictionary it) /// public Task Delete(string functionId) { + if (functionId == "") + { + throw new AppwriteException("Missing required parameter: \"functionId\""); + } + var apiPath = "/functions/{functionId}" .Replace("{functionId}", functionId); @@ -284,7 +301,8 @@ public Task Delete(string functionId) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -304,6 +322,11 @@ public Task Delete(string functionId) /// public Task UpdateFunctionDeployment(string functionId, string deploymentId) { + if (functionId == "") + { + throw new AppwriteException("Missing required parameter: \"functionId\""); + } + var apiPath = "/functions/{functionId}/deployment" .Replace("{functionId}", functionId); @@ -341,6 +364,11 @@ static Models.Function Convert(Dictionary it) /// public Task ListDeployments(string functionId, List? queries = null, string? search = null, bool? total = null) { + if (functionId == "") + { + throw new AppwriteException("Missing required parameter: \"functionId\""); + } + var apiPath = "/functions/{functionId}/deployments" .Replace("{functionId}", functionId); @@ -387,6 +415,11 @@ static Models.DeploymentList Convert(Dictionary it) /// public Task CreateDeployment(string functionId, InputFile code, bool activate, string? entrypoint = null, string? commands = null, Action? onProgress = null) { + if (functionId == "") + { + throw new AppwriteException("Missing required parameter: \"functionId\""); + } + var apiPath = "/functions/{functionId}/deployments" .Replace("{functionId}", functionId); @@ -422,7 +455,8 @@ static Models.Deployment Convert(Dictionary it) Convert, paramName, idParamName, - onProgress); + onProgress, + method: "POST"); } /// @@ -435,6 +469,11 @@ static Models.Deployment Convert(Dictionary it) /// public Task CreateDuplicateDeployment(string functionId, string deploymentId, string? buildId = null) { + if (functionId == "") + { + throw new AppwriteException("Missing required parameter: \"functionId\""); + } + var apiPath = "/functions/{functionId}/deployments/duplicate" .Replace("{functionId}", functionId); @@ -476,6 +515,11 @@ static Models.Deployment Convert(Dictionary it) /// public Task CreateTemplateDeployment(string functionId, string repository, string owner, string rootDirectory, Appwrite.Enums.TemplateReferenceType type, string reference, bool? activate = null) { + if (functionId == "") + { + throw new AppwriteException("Missing required parameter: \"functionId\""); + } + var apiPath = "/functions/{functionId}/deployments/template" .Replace("{functionId}", functionId); @@ -519,6 +563,11 @@ static Models.Deployment Convert(Dictionary it) /// public Task CreateVcsDeployment(string functionId, Appwrite.Enums.VCSReferenceType type, string reference, bool? activate = null) { + if (functionId == "") + { + throw new AppwriteException("Missing required parameter: \"functionId\""); + } + var apiPath = "/functions/{functionId}/deployments/vcs" .Replace("{functionId}", functionId); @@ -557,6 +606,16 @@ static Models.Deployment Convert(Dictionary it) /// public Task GetDeployment(string functionId, string deploymentId) { + if (functionId == "") + { + throw new AppwriteException("Missing required parameter: \"functionId\""); + } + + if (deploymentId == "") + { + throw new AppwriteException("Missing required parameter: \"deploymentId\""); + } + var apiPath = "/functions/{functionId}/deployments/{deploymentId}" .Replace("{functionId}", functionId) .Replace("{deploymentId}", deploymentId); @@ -592,6 +651,16 @@ static Models.Deployment Convert(Dictionary it) /// public Task DeleteDeployment(string functionId, string deploymentId) { + if (functionId == "") + { + throw new AppwriteException("Missing required parameter: \"functionId\""); + } + + if (deploymentId == "") + { + throw new AppwriteException("Missing required parameter: \"deploymentId\""); + } + var apiPath = "/functions/{functionId}/deployments/{deploymentId}" .Replace("{functionId}", functionId) .Replace("{deploymentId}", deploymentId); @@ -603,7 +672,8 @@ public Task DeleteDeployment(string functionId, string deploymentId) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -624,6 +694,16 @@ public Task DeleteDeployment(string functionId, string deploymentId) /// public Task GetDeploymentDownload(string functionId, string deploymentId, Appwrite.Enums.DeploymentDownloadType? type = null, string? token = null) { + if (functionId == "") + { + throw new AppwriteException("Missing required parameter: \"functionId\""); + } + + if (deploymentId == "") + { + throw new AppwriteException("Missing required parameter: \"deploymentId\""); + } + var apiPath = "/functions/{functionId}/deployments/{deploymentId}/download" .Replace("{functionId}", functionId) .Replace("{deploymentId}", deploymentId); @@ -660,6 +740,16 @@ public Task GetDeploymentDownload(string functionId, string deploymentId /// public Task UpdateDeploymentStatus(string functionId, string deploymentId) { + if (functionId == "") + { + throw new AppwriteException("Missing required parameter: \"functionId\""); + } + + if (deploymentId == "") + { + throw new AppwriteException("Missing required parameter: \"deploymentId\""); + } + var apiPath = "/functions/{functionId}/deployments/{deploymentId}/status" .Replace("{functionId}", functionId) .Replace("{deploymentId}", deploymentId); @@ -697,6 +787,11 @@ static Models.Deployment Convert(Dictionary it) /// public Task ListExecutions(string functionId, List? queries = null, bool? total = null) { + if (functionId == "") + { + throw new AppwriteException("Missing required parameter: \"functionId\""); + } + var apiPath = "/functions/{functionId}/executions" .Replace("{functionId}", functionId); @@ -736,6 +831,11 @@ static Models.ExecutionList Convert(Dictionary it) /// public Task CreateExecution(string functionId, string? body = null, bool? @async = null, string? @path = null, Appwrite.Enums.ExecutionMethod? method = null, object? headers = null, string? scheduledAt = null) { + if (functionId == "") + { + throw new AppwriteException("Missing required parameter: \"functionId\""); + } + var apiPath = "/functions/{functionId}/executions" .Replace("{functionId}", functionId); @@ -777,6 +877,16 @@ static Models.Execution Convert(Dictionary it) /// public Task GetExecution(string functionId, string executionId) { + if (functionId == "") + { + throw new AppwriteException("Missing required parameter: \"functionId\""); + } + + if (executionId == "") + { + throw new AppwriteException("Missing required parameter: \"executionId\""); + } + var apiPath = "/functions/{functionId}/executions/{executionId}" .Replace("{functionId}", functionId) .Replace("{executionId}", executionId); @@ -812,6 +922,16 @@ static Models.Execution Convert(Dictionary it) /// public Task DeleteExecution(string functionId, string executionId) { + if (functionId == "") + { + throw new AppwriteException("Missing required parameter: \"functionId\""); + } + + if (executionId == "") + { + throw new AppwriteException("Missing required parameter: \"executionId\""); + } + var apiPath = "/functions/{functionId}/executions/{executionId}" .Replace("{functionId}", functionId) .Replace("{executionId}", executionId); @@ -823,7 +943,8 @@ public Task DeleteExecution(string functionId, string executionId) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -842,6 +963,11 @@ public Task DeleteExecution(string functionId, string executionId) /// public Task ListVariables(string functionId, List? queries = null, bool? total = null) { + if (functionId == "") + { + throw new AppwriteException("Missing required parameter: \"functionId\""); + } + var apiPath = "/functions/{functionId}/variables" .Replace("{functionId}", functionId); @@ -879,6 +1005,11 @@ static Models.VariableList Convert(Dictionary it) /// public Task CreateVariable(string functionId, string variableId, string key, string @value, bool? secret = null) { + if (functionId == "") + { + throw new AppwriteException("Missing required parameter: \"functionId\""); + } + var apiPath = "/functions/{functionId}/variables" .Replace("{functionId}", functionId); @@ -918,6 +1049,16 @@ static Models.Variable Convert(Dictionary it) /// public Task GetVariable(string functionId, string variableId) { + if (functionId == "") + { + throw new AppwriteException("Missing required parameter: \"functionId\""); + } + + if (variableId == "") + { + throw new AppwriteException("Missing required parameter: \"variableId\""); + } + var apiPath = "/functions/{functionId}/variables/{variableId}" .Replace("{functionId}", functionId) .Replace("{variableId}", variableId); @@ -953,6 +1094,16 @@ static Models.Variable Convert(Dictionary it) /// public Task UpdateVariable(string functionId, string variableId, string? key = null, string? @value = null, bool? secret = null) { + if (functionId == "") + { + throw new AppwriteException("Missing required parameter: \"functionId\""); + } + + if (variableId == "") + { + throw new AppwriteException("Missing required parameter: \"variableId\""); + } + var apiPath = "/functions/{functionId}/variables/{variableId}" .Replace("{functionId}", functionId) .Replace("{variableId}", variableId); @@ -992,6 +1143,16 @@ static Models.Variable Convert(Dictionary it) /// public Task DeleteVariable(string functionId, string variableId) { + if (functionId == "") + { + throw new AppwriteException("Missing required parameter: \"functionId\""); + } + + if (variableId == "") + { + throw new AppwriteException("Missing required parameter: \"variableId\""); + } + var apiPath = "/functions/{functionId}/variables/{variableId}" .Replace("{functionId}", functionId) .Replace("{variableId}", variableId); @@ -1003,7 +1164,8 @@ public Task DeleteVariable(string functionId, string variableId) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; diff --git a/Appwrite/Services/Locale.cs b/Appwrite/Services/Locale.cs index 5b80b0dc..84f6ca57 100644 --- a/Appwrite/Services/Locale.cs +++ b/Appwrite/Services/Locale.cs @@ -56,12 +56,13 @@ static Models.Locale Convert(Dictionary it) /// 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes). /// /// - public Task ListCodes() + public Task ListCodes(bool? total = null) { var apiPath = "/locale/codes"; var apiParameters = new Dictionary() { + { "total", total } }; var apiHeaders = new Dictionary() @@ -90,12 +91,13 @@ static Models.LocaleCodeList Convert(Dictionary it) /// supported language. /// /// - public Task ListContinents() + public Task ListContinents(bool? total = null) { var apiPath = "/locale/continents"; var apiParameters = new Dictionary() { + { "total", total } }; var apiHeaders = new Dictionary() @@ -124,12 +126,13 @@ static Models.ContinentList Convert(Dictionary it) /// supported language. /// /// - public Task ListCountries() + public Task ListCountries(bool? total = null) { var apiPath = "/locale/countries"; var apiParameters = new Dictionary() { + { "total", total } }; var apiHeaders = new Dictionary() @@ -158,12 +161,13 @@ static Models.CountryList Convert(Dictionary it) /// locale header to get the data in a supported language. /// /// - public Task ListCountriesEU() + public Task ListCountriesEU(bool? total = null) { var apiPath = "/locale/countries/eu"; var apiParameters = new Dictionary() { + { "total", total } }; var apiHeaders = new Dictionary() @@ -192,12 +196,13 @@ static Models.CountryList Convert(Dictionary it) /// data in a supported language. /// /// - public Task ListCountriesPhones() + public Task ListCountriesPhones(bool? total = null) { var apiPath = "/locale/countries/phones"; var apiParameters = new Dictionary() { + { "total", total } }; var apiHeaders = new Dictionary() @@ -227,12 +232,13 @@ static Models.PhoneList Convert(Dictionary it) /// header to get the data in a supported language. /// /// - public Task ListCurrencies() + public Task ListCurrencies(bool? total = null) { var apiPath = "/locale/currencies"; var apiParameters = new Dictionary() { + { "total", total } }; var apiHeaders = new Dictionary() @@ -261,12 +267,13 @@ static Models.CurrencyList Convert(Dictionary it) /// in English, and name in the respective language. /// /// - public Task ListLanguages() + public Task ListLanguages(bool? total = null) { var apiPath = "/locale/languages"; var apiParameters = new Dictionary() { + { "total", total } }; var apiHeaders = new Dictionary() diff --git a/Appwrite/Services/Messaging.cs b/Appwrite/Services/Messaging.cs index aa8ef109..8a4d9d2b 100644 --- a/Appwrite/Services/Messaging.cs +++ b/Appwrite/Services/Messaging.cs @@ -53,7 +53,7 @@ static Models.MessageList Convert(Dictionary it) /// Create a new email message. /// /// - public Task CreateEmail(string messageId, string subject, string content, List? topics = null, List? users = null, List? targets = null, List? cc = null, List? bcc = null, List? attachments = null, bool? draft = null, bool? html = null, string? scheduledAt = null) + public Task CreateEmail(string messageId, string subject, string content, List? topics = null, List? users = null, List? targets = null, List? cc = null, List? bcc = null, List? attachments = null, string? replyToEmail = null, string? replyToName = null, bool? draft = null, bool? html = null, string? scheduledAt = null) { var apiPath = "/messaging/messages/email"; @@ -68,6 +68,8 @@ static Models.MessageList Convert(Dictionary it) { "cc", cc }, { "bcc", bcc }, { "attachments", attachments }, + { "replyToEmail", replyToEmail }, + { "replyToName", replyToName }, { "draft", draft }, { "html", html }, { "scheduledAt", scheduledAt } @@ -102,24 +104,31 @@ static Models.Message Convert(Dictionary it) /// /// /// - public Task UpdateEmail(string messageId, List? topics = null, List? users = null, List? targets = null, string? subject = null, string? content = null, bool? draft = null, bool? html = null, List? cc = null, List? bcc = null, string? scheduledAt = null, List? attachments = null) + public Task UpdateEmail(string messageId, string? subject = null, string? content = null, List? topics = null, List? users = null, List? targets = null, List? cc = null, List? bcc = null, List? attachments = null, string? replyToEmail = null, string? replyToName = null, bool? draft = null, bool? html = null, string? scheduledAt = null) { + if (messageId == "") + { + throw new AppwriteException("Missing required parameter: \"messageId\""); + } + var apiPath = "/messaging/messages/email/{messageId}" .Replace("{messageId}", messageId); var apiParameters = new Dictionary() { + { "subject", subject }, + { "content", content }, { "topics", topics }, { "users", users }, { "targets", targets }, - { "subject", subject }, - { "content", content }, - { "draft", draft }, - { "html", html }, { "cc", cc }, { "bcc", bcc }, - { "scheduledAt", scheduledAt }, - { "attachments", attachments } + { "attachments", attachments }, + { "replyToEmail", replyToEmail }, + { "replyToName", replyToName }, + { "draft", draft }, + { "html", html }, + { "scheduledAt", scheduledAt } }; var apiHeaders = new Dictionary() @@ -148,7 +157,7 @@ static Models.Message Convert(Dictionary it) /// Create a new push notification. /// /// - public Task CreatePush(string messageId, string? title = null, string? body = null, List? topics = null, List? users = null, List? targets = null, object? data = null, string? action = null, string? image = null, string? icon = null, string? sound = null, string? color = null, string? tag = null, long? badge = null, bool? draft = null, string? scheduledAt = null, bool? contentAvailable = null, bool? critical = null, Appwrite.Enums.MessagePriority? priority = null) + public Task CreatePush(string messageId, string? title = null, string? body = null, List? topics = null, List? users = null, List? targets = null, object? data = null, string? action = null, string? image = null, string? icon = null, string? sound = null, string? color = null, string? tag = null, long? badge = null, bool? draft = null, string? scheduledAt = null, bool? contentAvailable = null, bool? critical = null, Appwrite.Enums.MessagePriority? priority = null, string? channelId = null) { var apiPath = "/messaging/messages/push"; @@ -172,7 +181,8 @@ static Models.Message Convert(Dictionary it) { "scheduledAt", scheduledAt }, { "contentAvailable", contentAvailable }, { "critical", critical }, - { "priority", priority?.Value } + { "priority", priority?.Value }, + { "channelId", channelId } }; var apiHeaders = new Dictionary() @@ -204,18 +214,23 @@ static Models.Message Convert(Dictionary it) /// /// /// - public Task UpdatePush(string messageId, List? topics = null, List? users = null, List? targets = null, string? title = null, string? body = null, object? data = null, string? action = null, string? image = null, string? icon = null, string? sound = null, string? color = null, string? tag = null, long? badge = null, bool? draft = null, string? scheduledAt = null, bool? contentAvailable = null, bool? critical = null, Appwrite.Enums.MessagePriority? priority = null) + public Task UpdatePush(string messageId, string? title = null, string? body = null, List? topics = null, List? users = null, List? targets = null, object? data = null, string? action = null, string? image = null, string? icon = null, string? sound = null, string? color = null, string? tag = null, long? badge = null, bool? draft = null, string? scheduledAt = null, bool? contentAvailable = null, bool? critical = null, Appwrite.Enums.MessagePriority? priority = null, string? channelId = null) { + if (messageId == "") + { + throw new AppwriteException("Missing required parameter: \"messageId\""); + } + var apiPath = "/messaging/messages/push/{messageId}" .Replace("{messageId}", messageId); var apiParameters = new Dictionary() { + { "title", title }, + { "body", body }, { "topics", topics }, { "users", users }, { "targets", targets }, - { "title", title }, - { "body", body }, { "data", data }, { "action", action }, { "image", image }, @@ -228,7 +243,8 @@ static Models.Message Convert(Dictionary it) { "scheduledAt", scheduledAt }, { "contentAvailable", contentAvailable }, { "critical", critical }, - { "priority", priority?.Value } + { "priority", priority?.Value }, + { "channelId", channelId } }; var apiHeaders = new Dictionary() @@ -344,17 +360,22 @@ static Models.Message Convert(Dictionary it) /// /// [Obsolete("This API has been deprecated since 1.8.0. Please use `Messaging.updateSMS` instead.")] - public Task UpdateSms(string messageId, List? topics = null, List? users = null, List? targets = null, string? content = null, bool? draft = null, string? scheduledAt = null) + public Task UpdateSms(string messageId, string? content = null, List? topics = null, List? users = null, List? targets = null, bool? draft = null, string? scheduledAt = null) { + if (messageId == "") + { + throw new AppwriteException("Missing required parameter: \"messageId\""); + } + var apiPath = "/messaging/messages/sms/{messageId}" .Replace("{messageId}", messageId); var apiParameters = new Dictionary() { + { "content", content }, { "topics", topics }, { "users", users }, { "targets", targets }, - { "content", content }, { "draft", draft }, { "scheduledAt", scheduledAt } }; @@ -388,17 +409,22 @@ static Models.Message Convert(Dictionary it) /// /// /// - public Task UpdateSMS(string messageId, List? topics = null, List? users = null, List? targets = null, string? content = null, bool? draft = null, string? scheduledAt = null) + public Task UpdateSMS(string messageId, string? content = null, List? topics = null, List? users = null, List? targets = null, bool? draft = null, string? scheduledAt = null) { + if (messageId == "") + { + throw new AppwriteException("Missing required parameter: \"messageId\""); + } + var apiPath = "/messaging/messages/sms/{messageId}" .Replace("{messageId}", messageId); var apiParameters = new Dictionary() { + { "content", content }, { "topics", topics }, { "users", users }, { "targets", targets }, - { "content", content }, { "draft", draft }, { "scheduledAt", scheduledAt } }; @@ -432,6 +458,11 @@ static Models.Message Convert(Dictionary it) /// public Task GetMessage(string messageId) { + if (messageId == "") + { + throw new AppwriteException("Missing required parameter: \"messageId\""); + } + var apiPath = "/messaging/messages/{messageId}" .Replace("{messageId}", messageId); @@ -467,6 +498,11 @@ static Models.Message Convert(Dictionary it) /// public Task Delete(string messageId) { + if (messageId == "") + { + throw new AppwriteException("Missing required parameter: \"messageId\""); + } + var apiPath = "/messaging/messages/{messageId}" .Replace("{messageId}", messageId); @@ -477,7 +513,8 @@ public Task Delete(string messageId) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -496,6 +533,11 @@ public Task Delete(string messageId) /// public Task ListTargets(string messageId, List? queries = null, bool? total = null) { + if (messageId == "") + { + throw new AppwriteException("Missing required parameter: \"messageId\""); + } + var apiPath = "/messaging/messages/{messageId}/targets" .Replace("{messageId}", messageId); @@ -654,6 +696,11 @@ static Models.Provider Convert(Dictionary it) [Obsolete("This API has been deprecated since 1.8.0. Please use `Messaging.updateAPNSProvider` instead.")] public Task UpdateApnsProvider(string providerId, string? name = null, bool? enabled = null, string? authKey = null, string? authKeyId = null, string? teamId = null, string? bundleId = null, bool? sandbox = null) { + if (providerId == "") + { + throw new AppwriteException("Missing required parameter: \"providerId\""); + } + var apiPath = "/messaging/providers/apns/{providerId}" .Replace("{providerId}", providerId); @@ -696,6 +743,11 @@ static Models.Provider Convert(Dictionary it) /// public Task UpdateAPNSProvider(string providerId, string? name = null, bool? enabled = null, string? authKey = null, string? authKeyId = null, string? teamId = null, string? bundleId = null, bool? sandbox = null) { + if (providerId == "") + { + throw new AppwriteException("Missing required parameter: \"providerId\""); + } + var apiPath = "/messaging/providers/apns/{providerId}" .Replace("{providerId}", providerId); @@ -732,6 +784,89 @@ static Models.Provider Convert(Dictionary it) } + /// + /// Create a new Appwrite push provider. + /// + /// + public Task CreateAppwriteProvider(string providerId, string name, bool? enabled = null, long? qos = null, long? expiry = null) + { + var apiPath = "/messaging/providers/appwrite"; + + var apiParameters = new Dictionary() + { + { "providerId", providerId }, + { "name", name }, + { "enabled", enabled }, + { "qos", qos }, + { "expiry", expiry } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.Provider Convert(Dictionary it) + { + return Models.Provider.From(map: it); + } + + return _client.Call( + method: "POST", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Update an Appwrite push provider by its unique ID. + /// + /// + public Task UpdateAppwriteProvider(string providerId, string? name = null, bool? enabled = null, long? qos = null, long? expiry = null) + { + if (providerId == "") + { + throw new AppwriteException("Missing required parameter: \"providerId\""); + } + + var apiPath = "/messaging/providers/appwrite/{providerId}" + .Replace("{providerId}", providerId); + + var apiParameters = new Dictionary() + { + { "name", name }, + { "enabled", enabled }, + { "qos", qos }, + { "expiry", expiry } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.Provider Convert(Dictionary it) + { + return Models.Provider.From(map: it); + } + + return _client.Call( + method: "PATCH", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + /// /// Create a new Firebase Cloud Messaging provider. /// @@ -816,6 +951,11 @@ static Models.Provider Convert(Dictionary it) [Obsolete("This API has been deprecated since 1.8.0. Please use `Messaging.updateFCMProvider` instead.")] public Task UpdateFcmProvider(string providerId, string? name = null, bool? enabled = null, object? serviceAccountJSON = null) { + if (providerId == "") + { + throw new AppwriteException("Missing required parameter: \"providerId\""); + } + var apiPath = "/messaging/providers/fcm/{providerId}" .Replace("{providerId}", providerId); @@ -854,6 +994,11 @@ static Models.Provider Convert(Dictionary it) /// public Task UpdateFCMProvider(string providerId, string? name = null, bool? enabled = null, object? serviceAccountJSON = null) { + if (providerId == "") + { + throw new AppwriteException("Missing required parameter: \"providerId\""); + } + var apiPath = "/messaging/providers/fcm/{providerId}" .Replace("{providerId}", providerId); @@ -936,6 +1081,11 @@ static Models.Provider Convert(Dictionary it) /// public Task UpdateMailgunProvider(string providerId, string? name = null, string? apiKey = null, string? domain = null, bool? isEuRegion = null, bool? enabled = null, string? fromName = null, string? fromEmail = null, string? replyToName = null, string? replyToEmail = null) { + if (providerId == "") + { + throw new AppwriteException("Missing required parameter: \"providerId\""); + } + var apiPath = "/messaging/providers/mailgun/{providerId}" .Replace("{providerId}", providerId); @@ -1020,6 +1170,11 @@ static Models.Provider Convert(Dictionary it) /// public Task UpdateMsg91Provider(string providerId, string? name = null, bool? enabled = null, string? templateId = null, string? senderId = null, string? authKey = null) { + if (providerId == "") + { + throw new AppwriteException("Missing required parameter: \"providerId\""); + } + var apiPath = "/messaging/providers/msg91/{providerId}" .Replace("{providerId}", providerId); @@ -1102,6 +1257,11 @@ static Models.Provider Convert(Dictionary it) /// public Task UpdateResendProvider(string providerId, string? name = null, bool? enabled = null, string? apiKey = null, string? fromName = null, string? fromEmail = null, string? replyToName = null, string? replyToEmail = null) { + if (providerId == "") + { + throw new AppwriteException("Missing required parameter: \"providerId\""); + } + var apiPath = "/messaging/providers/resend/{providerId}" .Replace("{providerId}", providerId); @@ -1186,6 +1346,11 @@ static Models.Provider Convert(Dictionary it) /// public Task UpdateSendgridProvider(string providerId, string? name = null, bool? enabled = null, string? apiKey = null, string? fromName = null, string? fromEmail = null, string? replyToName = null, string? replyToEmail = null) { + if (providerId == "") + { + throw new AppwriteException("Missing required parameter: \"providerId\""); + } + var apiPath = "/messaging/providers/sendgrid/{providerId}" .Replace("{providerId}", providerId); @@ -1272,6 +1437,11 @@ static Models.Provider Convert(Dictionary it) /// public Task UpdateSesProvider(string providerId, string? name = null, bool? enabled = null, string? accessKey = null, string? secretKey = null, string? region = null, string? fromName = null, string? fromEmail = null, string? replyToName = null, string? replyToEmail = null) { + if (providerId == "") + { + throw new AppwriteException("Missing required parameter: \"providerId\""); + } + var apiPath = "/messaging/providers/ses/{providerId}" .Replace("{providerId}", providerId); @@ -1414,6 +1584,11 @@ static Models.Provider Convert(Dictionary it) [Obsolete("This API has been deprecated since 1.8.0. Please use `Messaging.updateSMTPProvider` instead.")] public Task UpdateSmtpProvider(string providerId, string? name = null, string? host = null, long? port = null, string? username = null, string? password = null, Appwrite.Enums.SmtpEncryption? encryption = null, bool? autoTLS = null, string? mailer = null, string? fromName = null, string? fromEmail = null, string? replyToName = null, string? replyToEmail = null, bool? enabled = null) { + if (providerId == "") + { + throw new AppwriteException("Missing required parameter: \"providerId\""); + } + var apiPath = "/messaging/providers/smtp/{providerId}" .Replace("{providerId}", providerId); @@ -1462,6 +1637,11 @@ static Models.Provider Convert(Dictionary it) /// public Task UpdateSMTPProvider(string providerId, string? name = null, string? host = null, long? port = null, string? username = null, string? password = null, Appwrite.Enums.SmtpEncryption? encryption = null, bool? autoTLS = null, string? mailer = null, string? fromName = null, string? fromEmail = null, string? replyToName = null, string? replyToEmail = null, bool? enabled = null) { + if (providerId == "") + { + throw new AppwriteException("Missing required parameter: \"providerId\""); + } + var apiPath = "/messaging/providers/smtp/{providerId}" .Replace("{providerId}", providerId); @@ -1550,6 +1730,11 @@ static Models.Provider Convert(Dictionary it) /// public Task UpdateTelesignProvider(string providerId, string? name = null, bool? enabled = null, string? customerId = null, string? apiKey = null, string? @from = null) { + if (providerId == "") + { + throw new AppwriteException("Missing required parameter: \"providerId\""); + } + var apiPath = "/messaging/providers/telesign/{providerId}" .Replace("{providerId}", providerId); @@ -1630,6 +1815,11 @@ static Models.Provider Convert(Dictionary it) /// public Task UpdateTextmagicProvider(string providerId, string? name = null, bool? enabled = null, string? username = null, string? apiKey = null, string? @from = null) { + if (providerId == "") + { + throw new AppwriteException("Missing required parameter: \"providerId\""); + } + var apiPath = "/messaging/providers/textmagic/{providerId}" .Replace("{providerId}", providerId); @@ -1710,6 +1900,11 @@ static Models.Provider Convert(Dictionary it) /// public Task UpdateTwilioProvider(string providerId, string? name = null, bool? enabled = null, string? accountSid = null, string? authToken = null, string? @from = null) { + if (providerId == "") + { + throw new AppwriteException("Missing required parameter: \"providerId\""); + } + var apiPath = "/messaging/providers/twilio/{providerId}" .Replace("{providerId}", providerId); @@ -1790,6 +1985,11 @@ static Models.Provider Convert(Dictionary it) /// public Task UpdateVonageProvider(string providerId, string? name = null, bool? enabled = null, string? apiKey = null, string? apiSecret = null, string? @from = null) { + if (providerId == "") + { + throw new AppwriteException("Missing required parameter: \"providerId\""); + } + var apiPath = "/messaging/providers/vonage/{providerId}" .Replace("{providerId}", providerId); @@ -1831,6 +2031,11 @@ static Models.Provider Convert(Dictionary it) /// public Task GetProvider(string providerId) { + if (providerId == "") + { + throw new AppwriteException("Missing required parameter: \"providerId\""); + } + var apiPath = "/messaging/providers/{providerId}" .Replace("{providerId}", providerId); @@ -1865,6 +2070,11 @@ static Models.Provider Convert(Dictionary it) /// public Task DeleteProvider(string providerId) { + if (providerId == "") + { + throw new AppwriteException("Missing required parameter: \"providerId\""); + } + var apiPath = "/messaging/providers/{providerId}" .Replace("{providerId}", providerId); @@ -1875,7 +2085,8 @@ public Task DeleteProvider(string providerId) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1928,7 +2139,7 @@ static Models.TopicList Convert(Dictionary it) /// Create a new topic. /// /// - public Task CreateTopic(string topicId, string name, List? subscribe = null) + public Task CreateTopic(string topicId, string name, List? subscribe = null, long? qos = null, long? expiry = null) { var apiPath = "/messaging/topics"; @@ -1936,7 +2147,9 @@ static Models.TopicList Convert(Dictionary it) { { "topicId", topicId }, { "name", name }, - { "subscribe", subscribe } + { "subscribe", subscribe }, + { "qos", qos }, + { "expiry", expiry } }; var apiHeaders = new Dictionary() @@ -1968,6 +2181,11 @@ static Models.Topic Convert(Dictionary it) /// public Task GetTopic(string topicId) { + if (topicId == "") + { + throw new AppwriteException("Missing required parameter: \"topicId\""); + } + var apiPath = "/messaging/topics/{topicId}" .Replace("{topicId}", topicId); @@ -2001,15 +2219,22 @@ static Models.Topic Convert(Dictionary it) /// /// /// - public Task UpdateTopic(string topicId, string? name = null, List? subscribe = null) + public Task UpdateTopic(string topicId, string? name = null, List? subscribe = null, long? qos = null, long? expiry = null) { + if (topicId == "") + { + throw new AppwriteException("Missing required parameter: \"topicId\""); + } + var apiPath = "/messaging/topics/{topicId}" .Replace("{topicId}", topicId); var apiParameters = new Dictionary() { { "name", name }, - { "subscribe", subscribe } + { "subscribe", subscribe }, + { "qos", qos }, + { "expiry", expiry } }; var apiHeaders = new Dictionary() @@ -2040,6 +2265,11 @@ static Models.Topic Convert(Dictionary it) /// public Task DeleteTopic(string topicId) { + if (topicId == "") + { + throw new AppwriteException("Missing required parameter: \"topicId\""); + } + var apiPath = "/messaging/topics/{topicId}" .Replace("{topicId}", topicId); @@ -2050,7 +2280,8 @@ public Task DeleteTopic(string topicId) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -2069,6 +2300,11 @@ public Task DeleteTopic(string topicId) /// public Task ListSubscribers(string topicId, List? queries = null, string? search = null, bool? total = null) { + if (topicId == "") + { + throw new AppwriteException("Missing required parameter: \"topicId\""); + } + var apiPath = "/messaging/topics/{topicId}/subscribers" .Replace("{topicId}", topicId); @@ -2106,6 +2342,11 @@ static Models.SubscriberList Convert(Dictionary it) /// public Task CreateSubscriber(string topicId, string subscriberId, string targetId) { + if (topicId == "") + { + throw new AppwriteException("Missing required parameter: \"topicId\""); + } + var apiPath = "/messaging/topics/{topicId}/subscribers" .Replace("{topicId}", topicId); @@ -2144,6 +2385,16 @@ static Models.Subscriber Convert(Dictionary it) /// public Task GetSubscriber(string topicId, string subscriberId) { + if (topicId == "") + { + throw new AppwriteException("Missing required parameter: \"topicId\""); + } + + if (subscriberId == "") + { + throw new AppwriteException("Missing required parameter: \"subscriberId\""); + } + var apiPath = "/messaging/topics/{topicId}/subscribers/{subscriberId}" .Replace("{topicId}", topicId) .Replace("{subscriberId}", subscriberId); @@ -2179,6 +2430,16 @@ static Models.Subscriber Convert(Dictionary it) /// public Task DeleteSubscriber(string topicId, string subscriberId) { + if (topicId == "") + { + throw new AppwriteException("Missing required parameter: \"topicId\""); + } + + if (subscriberId == "") + { + throw new AppwriteException("Missing required parameter: \"subscriberId\""); + } + var apiPath = "/messaging/topics/{topicId}/subscribers/{subscriberId}" .Replace("{topicId}", topicId) .Replace("{subscriberId}", subscriberId); @@ -2190,7 +2451,8 @@ public Task DeleteSubscriber(string topicId, string subscriberId) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; diff --git a/Appwrite/Services/Mongo.cs b/Appwrite/Services/Mongo.cs index 2c81ed34..d8340bdc 100644 --- a/Appwrite/Services/Mongo.cs +++ b/Appwrite/Services/Mongo.cs @@ -98,8 +98,8 @@ static Models.DedicatedDatabase Convert(Dictionary it) /// /// List the dedicated database specifications available on the current plan. - /// Each specification reports its resource limits, pricing, and whether it is - /// enabled for the organization. + /// Each specification reports its resource limits, its own prices and overage + /// rates, and whether it is enabled for the organization. /// /// public Task ListSpecifications() @@ -138,6 +138,11 @@ static Models.DedicatedDatabaseSpecificationList Convert(Dictionary public Task Get(string databaseId) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/mongo/{databaseId}" .Replace("{databaseId}", databaseId); @@ -175,6 +180,11 @@ static Models.DedicatedDatabase Convert(Dictionary it) /// public Task Update(string databaseId, string? name = null, string? status = null, string? specification = null, long? replicas = null, string? syncMode = null, long? networkIdleTimeoutSeconds = null, List? networkIPAllowlist = null, long? idleTimeoutMinutes = null, bool? pitr = null, long? pitrRetentionDays = null, bool? storageAutoscaling = null, long? storageAutoscalingThresholdPercent = null, long? storageAutoscalingMaxGb = null, double? metricsTraceSampleRate = null, long? metricsSlowQueryLogThresholdMs = null, bool? sqlApiEnabled = null, List? sqlApiAllowedStatements = null, long? sqlApiMaxRows = null, long? sqlApiMaxBytes = null, long? sqlApiTimeoutSeconds = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/mongo/{databaseId}" .Replace("{databaseId}", databaseId); @@ -233,6 +243,11 @@ static Models.DedicatedDatabase Convert(Dictionary it) /// public Task Delete(string databaseId) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/mongo/{databaseId}" .Replace("{databaseId}", databaseId); @@ -264,6 +279,11 @@ public Task Delete(string databaseId) /// public Task ListBackups(string databaseId, List? queries = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/mongo/{databaseId}/backups" .Replace("{databaseId}", databaseId); @@ -300,6 +320,11 @@ static Models.DedicatedDatabaseBackupList Convert(Dictionary it) /// public Task CreateBackup(string databaseId, string? type = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/mongo/{databaseId}/backups" .Replace("{databaseId}", databaseId); @@ -336,6 +361,11 @@ static Models.DedicatedDatabaseBackup Convert(Dictionary it) /// public Task ListBackupPolicies(string databaseId, List? queries = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/mongo/{databaseId}/backups/policies" .Replace("{databaseId}", databaseId); @@ -371,6 +401,11 @@ static Models.BackupPolicyList Convert(Dictionary it) /// public Task CreateBackupPolicy(string databaseId, string policyId, string name, string schedule, long retention, string? type = null, bool? enabled = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/mongo/{databaseId}/backups/policies" .Replace("{databaseId}", databaseId); @@ -412,6 +447,16 @@ static Models.BackupPolicy Convert(Dictionary it) /// public Task GetBackupPolicy(string databaseId, string policyId) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (policyId == "") + { + throw new AppwriteException("Missing required parameter: \"policyId\""); + } + var apiPath = "/mongo/{databaseId}/backups/policies/{policyId}" .Replace("{databaseId}", databaseId) .Replace("{policyId}", policyId); @@ -447,6 +492,16 @@ static Models.BackupPolicy Convert(Dictionary it) /// public Task UpdateBackupPolicy(string databaseId, string policyId, string? name = null, string? schedule = null, long? retention = null, bool? enabled = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (policyId == "") + { + throw new AppwriteException("Missing required parameter: \"policyId\""); + } + var apiPath = "/mongo/{databaseId}/backups/policies/{policyId}" .Replace("{databaseId}", databaseId) .Replace("{policyId}", policyId); @@ -488,6 +543,16 @@ static Models.BackupPolicy Convert(Dictionary it) /// public Task DeleteBackupPolicy(string databaseId, string policyId) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (policyId == "") + { + throw new AppwriteException("Missing required parameter: \"policyId\""); + } + var apiPath = "/mongo/{databaseId}/backups/policies/{policyId}" .Replace("{databaseId}", databaseId) .Replace("{policyId}", policyId); @@ -521,6 +586,11 @@ public Task DeleteBackupPolicy(string databaseId, string policyId) /// public Task UpdateBackupStorage(string databaseId, string provider, string bucket, string accessKey, string secretKey, string? region = null, string? prefix = null, string? endpoint = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/mongo/{databaseId}/backups/storage" .Replace("{databaseId}", databaseId); @@ -564,6 +634,16 @@ static Models.DedicatedDatabaseBackupStorage Convert(Dictionary /// public Task GetBackup(string databaseId, string backupId) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (backupId == "") + { + throw new AppwriteException("Missing required parameter: \"backupId\""); + } + var apiPath = "/mongo/{databaseId}/backups/{backupId}" .Replace("{databaseId}", databaseId) .Replace("{backupId}", backupId); @@ -600,6 +680,16 @@ static Models.DedicatedDatabaseBackup Convert(Dictionary it) /// public Task DeleteBackup(string databaseId, string backupId) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (backupId == "") + { + throw new AppwriteException("Missing required parameter: \"backupId\""); + } + var apiPath = "/mongo/{databaseId}/backups/{backupId}" .Replace("{databaseId}", databaseId) .Replace("{backupId}", backupId); @@ -632,6 +722,11 @@ public Task DeleteBackup(string databaseId, string backupId) /// public Task ListBranches(string databaseId) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/mongo/{databaseId}/branches" .Replace("{databaseId}", databaseId); @@ -670,6 +765,11 @@ static Models.DedicatedDatabaseBranchList Convert(Dictionary it) /// public Task CreateBranch(string databaseId, string? branchId = null, long? ttl = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/mongo/{databaseId}/branches" .Replace("{databaseId}", databaseId); @@ -709,6 +809,16 @@ static Models.DedicatedDatabase Convert(Dictionary it) /// public Task DeleteBranch(string databaseId, string branchId) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (branchId == "") + { + throw new AppwriteException("Missing required parameter: \"branchId\""); + } + var apiPath = "/mongo/{databaseId}/branches/{branchId}" .Replace("{databaseId}", databaseId) .Replace("{branchId}", branchId); @@ -748,6 +858,11 @@ static Models.DedicatedDatabase Convert(Dictionary it) /// public Task UpdateCredentials(string databaseId) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/mongo/{databaseId}/credentials" .Replace("{databaseId}", databaseId); @@ -791,6 +906,11 @@ static Models.DedicatedDatabaseOperation Convert(Dictionary it) /// public Task CreateFailover(string databaseId, string? targetReplicaId = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/mongo/{databaseId}/failovers" .Replace("{databaseId}", databaseId); @@ -829,6 +949,11 @@ static Models.DedicatedDatabase Convert(Dictionary it) /// public Task UpdateMaintenance(string databaseId, string day, long hourUtc) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/mongo/{databaseId}/maintenance" .Replace("{databaseId}", databaseId); @@ -869,6 +994,11 @@ static Models.DedicatedDatabase Convert(Dictionary it) /// public Task CreateMigration(string databaseId, string targetType, string? specification = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/mongo/{databaseId}/migrations" .Replace("{databaseId}", databaseId); @@ -909,6 +1039,11 @@ static Models.DedicatedDatabase Convert(Dictionary it) /// public Task ListOperations(string databaseId, string? status = null, long? limit = null, long? offset = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/mongo/{databaseId}/operations" .Replace("{databaseId}", databaseId); @@ -947,6 +1082,11 @@ static Models.DedicatedDatabaseOperationList Convert(Dictionary /// public Task GetPitr(string databaseId) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/mongo/{databaseId}/pitr" .Replace("{databaseId}", databaseId); @@ -982,6 +1122,11 @@ static Models.DedicatedDatabasePITRWindows Convert(Dictionary it /// public Task GetReplicas(string databaseId) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/mongo/{databaseId}/replicas" .Replace("{databaseId}", databaseId); @@ -1017,6 +1162,11 @@ static Models.DedicatedDatabaseReplicas Convert(Dictionary it) /// public Task ListRestorations(string databaseId, string? status = null, string? type = null, long? limit = null, long? offset = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/mongo/{databaseId}/restorations" .Replace("{databaseId}", databaseId); @@ -1058,6 +1208,11 @@ static Models.DedicatedDatabaseRestorationList Convert(Dictionary public Task CreateRestoration(string databaseId, string? type = null, string? backupId = null, string? targetDatabaseId = null, string? targetTime = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/mongo/{databaseId}/restorations" .Replace("{databaseId}", databaseId); @@ -1098,6 +1253,16 @@ static Models.DedicatedDatabaseRestoration Convert(Dictionary it /// public Task GetRestoration(string databaseId, string restorationId) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (restorationId == "") + { + throw new AppwriteException("Missing required parameter: \"restorationId\""); + } + var apiPath = "/mongo/{databaseId}/restorations/{restorationId}" .Replace("{databaseId}", databaseId) .Replace("{restorationId}", restorationId); @@ -1135,6 +1300,11 @@ static Models.DedicatedDatabaseRestoration Convert(Dictionary it /// public Task GetStatus(string databaseId) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/mongo/{databaseId}/status" .Replace("{databaseId}", databaseId); @@ -1170,6 +1340,11 @@ static Models.DatabaseStatus Convert(Dictionary it) /// public Task CreateUpgrade(string databaseId, string targetVersion) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/mongo/{databaseId}/upgrades" .Replace("{databaseId}", databaseId); diff --git a/Appwrite/Services/Mysql.cs b/Appwrite/Services/Mysql.cs index 04fb81e1..eb3edf81 100644 --- a/Appwrite/Services/Mysql.cs +++ b/Appwrite/Services/Mysql.cs @@ -98,8 +98,8 @@ static Models.DedicatedDatabase Convert(Dictionary it) /// /// List the dedicated database specifications available on the current plan. - /// Each specification reports its resource limits, pricing, and whether it is - /// enabled for the organization. + /// Each specification reports its resource limits, its own prices and overage + /// rates, and whether it is enabled for the organization. /// /// public Task ListSpecifications() @@ -138,6 +138,11 @@ static Models.DedicatedDatabaseSpecificationList Convert(Dictionary public Task Get(string databaseId) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/mysql/{databaseId}" .Replace("{databaseId}", databaseId); @@ -175,6 +180,11 @@ static Models.DedicatedDatabase Convert(Dictionary it) /// public Task Update(string databaseId, string? name = null, string? status = null, string? specification = null, long? replicas = null, string? syncMode = null, long? networkIdleTimeoutSeconds = null, List? networkIPAllowlist = null, long? idleTimeoutMinutes = null, bool? pitr = null, long? pitrRetentionDays = null, bool? storageAutoscaling = null, long? storageAutoscalingThresholdPercent = null, long? storageAutoscalingMaxGb = null, double? metricsTraceSampleRate = null, long? metricsSlowQueryLogThresholdMs = null, bool? sqlApiEnabled = null, List? sqlApiAllowedStatements = null, long? sqlApiMaxRows = null, long? sqlApiMaxBytes = null, long? sqlApiTimeoutSeconds = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/mysql/{databaseId}" .Replace("{databaseId}", databaseId); @@ -233,6 +243,11 @@ static Models.DedicatedDatabase Convert(Dictionary it) /// public Task Delete(string databaseId) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/mysql/{databaseId}" .Replace("{databaseId}", databaseId); @@ -264,6 +279,11 @@ public Task Delete(string databaseId) /// public Task ListBackups(string databaseId, List? queries = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/mysql/{databaseId}/backups" .Replace("{databaseId}", databaseId); @@ -300,6 +320,11 @@ static Models.DedicatedDatabaseBackupList Convert(Dictionary it) /// public Task CreateBackup(string databaseId, string? type = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/mysql/{databaseId}/backups" .Replace("{databaseId}", databaseId); @@ -336,6 +361,11 @@ static Models.DedicatedDatabaseBackup Convert(Dictionary it) /// public Task ListBackupPolicies(string databaseId, List? queries = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/mysql/{databaseId}/backups/policies" .Replace("{databaseId}", databaseId); @@ -371,6 +401,11 @@ static Models.BackupPolicyList Convert(Dictionary it) /// public Task CreateBackupPolicy(string databaseId, string policyId, string name, string schedule, long retention, string? type = null, bool? enabled = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/mysql/{databaseId}/backups/policies" .Replace("{databaseId}", databaseId); @@ -412,6 +447,16 @@ static Models.BackupPolicy Convert(Dictionary it) /// public Task GetBackupPolicy(string databaseId, string policyId) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (policyId == "") + { + throw new AppwriteException("Missing required parameter: \"policyId\""); + } + var apiPath = "/mysql/{databaseId}/backups/policies/{policyId}" .Replace("{databaseId}", databaseId) .Replace("{policyId}", policyId); @@ -447,6 +492,16 @@ static Models.BackupPolicy Convert(Dictionary it) /// public Task UpdateBackupPolicy(string databaseId, string policyId, string? name = null, string? schedule = null, long? retention = null, bool? enabled = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (policyId == "") + { + throw new AppwriteException("Missing required parameter: \"policyId\""); + } + var apiPath = "/mysql/{databaseId}/backups/policies/{policyId}" .Replace("{databaseId}", databaseId) .Replace("{policyId}", policyId); @@ -488,6 +543,16 @@ static Models.BackupPolicy Convert(Dictionary it) /// public Task DeleteBackupPolicy(string databaseId, string policyId) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (policyId == "") + { + throw new AppwriteException("Missing required parameter: \"policyId\""); + } + var apiPath = "/mysql/{databaseId}/backups/policies/{policyId}" .Replace("{databaseId}", databaseId) .Replace("{policyId}", policyId); @@ -521,6 +586,11 @@ public Task DeleteBackupPolicy(string databaseId, string policyId) /// public Task UpdateBackupStorage(string databaseId, string provider, string bucket, string accessKey, string secretKey, string? region = null, string? prefix = null, string? endpoint = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/mysql/{databaseId}/backups/storage" .Replace("{databaseId}", databaseId); @@ -564,6 +634,16 @@ static Models.DedicatedDatabaseBackupStorage Convert(Dictionary /// public Task GetBackup(string databaseId, string backupId) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (backupId == "") + { + throw new AppwriteException("Missing required parameter: \"backupId\""); + } + var apiPath = "/mysql/{databaseId}/backups/{backupId}" .Replace("{databaseId}", databaseId) .Replace("{backupId}", backupId); @@ -600,6 +680,16 @@ static Models.DedicatedDatabaseBackup Convert(Dictionary it) /// public Task DeleteBackup(string databaseId, string backupId) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (backupId == "") + { + throw new AppwriteException("Missing required parameter: \"backupId\""); + } + var apiPath = "/mysql/{databaseId}/backups/{backupId}" .Replace("{databaseId}", databaseId) .Replace("{backupId}", backupId); @@ -632,6 +722,11 @@ public Task DeleteBackup(string databaseId, string backupId) /// public Task ListBranches(string databaseId) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/mysql/{databaseId}/branches" .Replace("{databaseId}", databaseId); @@ -670,6 +765,11 @@ static Models.DedicatedDatabaseBranchList Convert(Dictionary it) /// public Task CreateBranch(string databaseId, string? branchId = null, long? ttl = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/mysql/{databaseId}/branches" .Replace("{databaseId}", databaseId); @@ -709,6 +809,16 @@ static Models.DedicatedDatabase Convert(Dictionary it) /// public Task DeleteBranch(string databaseId, string branchId) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (branchId == "") + { + throw new AppwriteException("Missing required parameter: \"branchId\""); + } + var apiPath = "/mysql/{databaseId}/branches/{branchId}" .Replace("{databaseId}", databaseId) .Replace("{branchId}", branchId); @@ -748,6 +858,11 @@ static Models.DedicatedDatabase Convert(Dictionary it) /// public Task UpdateCredentials(string databaseId) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/mysql/{databaseId}/credentials" .Replace("{databaseId}", databaseId); @@ -791,6 +906,11 @@ static Models.DedicatedDatabaseOperation Convert(Dictionary it) /// public Task CreateExecution(string databaseId, string sql, object? bindings = null, long? timeoutSeconds = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/mysql/{databaseId}/executions" .Replace("{databaseId}", databaseId); @@ -837,6 +957,11 @@ static Models.DedicatedDatabaseExecution Convert(Dictionary it) /// public Task CreateFailover(string databaseId, string? targetReplicaId = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/mysql/{databaseId}/failovers" .Replace("{databaseId}", databaseId); @@ -875,6 +1000,11 @@ static Models.DedicatedDatabase Convert(Dictionary it) /// public Task UpdateMaintenance(string databaseId, string day, long hourUtc) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/mysql/{databaseId}/maintenance" .Replace("{databaseId}", databaseId); @@ -915,6 +1045,11 @@ static Models.DedicatedDatabase Convert(Dictionary it) /// public Task CreateMigration(string databaseId, string targetType, string? specification = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/mysql/{databaseId}/migrations" .Replace("{databaseId}", databaseId); @@ -955,6 +1090,11 @@ static Models.DedicatedDatabase Convert(Dictionary it) /// public Task ListOperations(string databaseId, string? status = null, long? limit = null, long? offset = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/mysql/{databaseId}/operations" .Replace("{databaseId}", databaseId); @@ -993,6 +1133,11 @@ static Models.DedicatedDatabaseOperationList Convert(Dictionary /// public Task GetPitr(string databaseId) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/mysql/{databaseId}/pitr" .Replace("{databaseId}", databaseId); @@ -1028,6 +1173,11 @@ static Models.DedicatedDatabasePITRWindows Convert(Dictionary it /// public Task GetPooler(string databaseId) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/mysql/{databaseId}/pooler" .Replace("{databaseId}", databaseId); @@ -1063,6 +1213,11 @@ static Models.DedicatedDatabasePooler Convert(Dictionary it) /// public Task UpdatePooler(string databaseId, string? mode = null, long? maxConnections = null, long? defaultPoolSize = null, bool? readWriteSplitting = null, string? poolerCpuRequest = null, string? poolerCpuLimit = null, string? poolerMemoryRequest = null, string? poolerMemoryLimit = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/mysql/{databaseId}/pooler" .Replace("{databaseId}", databaseId); @@ -1107,6 +1262,11 @@ static Models.DedicatedDatabasePooler Convert(Dictionary it) /// public Task GetReplicas(string databaseId) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/mysql/{databaseId}/replicas" .Replace("{databaseId}", databaseId); @@ -1142,6 +1302,11 @@ static Models.DedicatedDatabaseReplicas Convert(Dictionary it) /// public Task ListRestorations(string databaseId, string? status = null, string? type = null, long? limit = null, long? offset = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/mysql/{databaseId}/restorations" .Replace("{databaseId}", databaseId); @@ -1183,6 +1348,11 @@ static Models.DedicatedDatabaseRestorationList Convert(Dictionary public Task CreateRestoration(string databaseId, string? type = null, string? backupId = null, string? targetDatabaseId = null, string? targetTime = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/mysql/{databaseId}/restorations" .Replace("{databaseId}", databaseId); @@ -1223,6 +1393,16 @@ static Models.DedicatedDatabaseRestoration Convert(Dictionary it /// public Task GetRestoration(string databaseId, string restorationId) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (restorationId == "") + { + throw new AppwriteException("Missing required parameter: \"restorationId\""); + } + var apiPath = "/mysql/{databaseId}/restorations/{restorationId}" .Replace("{databaseId}", databaseId) .Replace("{restorationId}", restorationId); @@ -1260,6 +1440,11 @@ static Models.DedicatedDatabaseRestoration Convert(Dictionary it /// public Task GetStatus(string databaseId) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/mysql/{databaseId}/status" .Replace("{databaseId}", databaseId); @@ -1295,6 +1480,11 @@ static Models.DatabaseStatus Convert(Dictionary it) /// public Task CreateUpgrade(string databaseId, string targetVersion) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/mysql/{databaseId}/upgrades" .Replace("{databaseId}", databaseId); diff --git a/Appwrite/Services/Oauth2.cs b/Appwrite/Services/Oauth2.cs index 534c1ab0..24b4cafb 100644 --- a/Appwrite/Services/Oauth2.cs +++ b/Appwrite/Services/Oauth2.cs @@ -62,7 +62,7 @@ static Models.Oauth2Approve Convert(Dictionary it) /// redirect. /// /// - public Task Authorize(string? clientId = null, string? redirectUri = null, string? responseType = null, string? scope = null, string? state = null, string? nonce = null, string? codeChallenge = null, string? codeChallengeMethod = null, string? prompt = null, long? maxAge = null, string? authorizationDetails = null, string? resource = null, string? audience = null, string? requestUri = null) + public Task Authorize(string? clientId = null, string? redirectUri = null, string? responseType = null, string? scope = null, string? state = null, string? nonce = null, string? codeChallenge = null, string? codeChallengeMethod = null, string? prompt = null, long? maxAge = null, string? authorizationDetails = null, List? resource = null, string? audience = null, string? requestUri = null) { var apiPath = "/oauth2/{project_id}/authorize" .Replace("{project_id}", _client.GetConfig("project")); @@ -113,7 +113,7 @@ static Models.Oauth2Authorize Convert(Dictionary it) /// redirect. /// /// - public Task AuthorizePost(string? clientId = null, string? redirectUri = null, string? responseType = null, string? scope = null, string? state = null, string? nonce = null, string? codeChallenge = null, string? codeChallengeMethod = null, string? prompt = null, long? maxAge = null, string? authorizationDetails = null, string? resource = null, string? audience = null, string? requestUri = null) + public Task AuthorizePost(string? clientId = null, string? redirectUri = null, string? responseType = null, string? scope = null, string? state = null, string? nonce = null, string? codeChallenge = null, string? codeChallengeMethod = null, string? prompt = null, long? maxAge = null, string? authorizationDetails = null, List? resource = null, string? audience = null, string? requestUri = null) { var apiPath = "/oauth2/{project_id}/authorize" .Replace("{project_id}", _client.GetConfig("project")); @@ -162,7 +162,7 @@ static Models.Oauth2Authorize Convert(Dictionary it) /// code, verification URL, expiration, and polling interval. /// /// - public Task CreateDeviceAuthorization(string? clientId = null, string? scope = null, string? authorizationDetails = null, string? resource = null, string? audience = null) + public Task CreateDeviceAuthorization(string? clientId = null, string? scope = null, string? authorizationDetails = null, List? resource = null, string? audience = null) { var apiPath = "/oauth2/{project_id}/device_authorization" .Replace("{project_id}", _client.GetConfig("project")); @@ -243,6 +243,11 @@ static Models.Oauth2Grant Convert(Dictionary it) /// public Task GetGrant(string grantId) { + if (grantId == "") + { + throw new AppwriteException("Missing required parameter: \"grantId\""); + } + var apiPath = "/oauth2/{project_id}/grants/{grant_id}" .Replace("{project_id}", _client.GetConfig("project")) .Replace("{grant_id}", grantId); @@ -271,6 +276,47 @@ static Models.Oauth2Grant Convert(Dictionary it) } + /// + /// Introspect an OAuth2 access token or refresh token. Authenticate with an + /// API key holding the `oauth2.introspect` scope to introspect any token in + /// the project, or with the client credentials of the app the token was issued + /// to. + /// + /// + public Task Introspect(string token, string? tokenTypeHint = null, string? clientId = null, string? clientSecret = null) + { + var apiPath = "/oauth2/{project_id}/introspect" + .Replace("{project_id}", _client.GetConfig("project")); + + var apiParameters = new Dictionary() + { + { "token", token }, + { "token_type_hint", tokenTypeHint }, + { "client_id", clientId }, + { "client_secret", clientSecret } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.Oauth2Introspection Convert(Dictionary it) + { + return Models.Oauth2Introspection.From(map: it); + } + + return _client.Call( + method: "POST", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + /// /// List the organizations the OAuth2 access token can access. Resolves the /// token's `organization` authorization details, expanding the `*` wildcard @@ -314,7 +360,7 @@ static Models.Oauth2OrganizationList Convert(Dictionary it) /// request_uri handle for the authorize endpoint. /// /// - public Task CreatePAR(string clientId, string redirectUri, string responseType, string? scope = null, string? state = null, string? nonce = null, string? codeChallenge = null, string? codeChallengeMethod = null, string? prompt = null, long? maxAge = null, string? authorizationDetails = null, string? resource = null, string? audience = null) + public Task CreatePAR(string clientId, string redirectUri, string responseType, string? scope = null, string? state = null, string? nonce = null, string? codeChallenge = null, string? codeChallengeMethod = null, string? prompt = null, long? maxAge = null, string? authorizationDetails = null, List? resource = null, string? audience = null) { var apiPath = "/oauth2/{project_id}/par" .Replace("{project_id}", _client.GetConfig("project")); @@ -471,7 +517,7 @@ public Task Revoke(string token, string? tokenTypeHint = null, string? c /// access and refresh tokens. /// /// - public Task CreateToken(string grantType, string? code = null, string? refreshToken = null, string? deviceCode = null, string? clientId = null, string? clientSecret = null, string? codeVerifier = null, string? redirectUri = null, string? resource = null, string? audience = null) + public Task CreateToken(string grantType, string? code = null, string? refreshToken = null, string? deviceCode = null, string? clientId = null, string? clientSecret = null, string? codeVerifier = null, string? redirectUri = null, List? resource = null, string? audience = null) { var apiPath = "/oauth2/{project_id}/token" .Replace("{project_id}", _client.GetConfig("project")); diff --git a/Appwrite/Services/Organization.cs b/Appwrite/Services/Organization.cs index 91e2ceb4..82a959f3 100644 --- a/Appwrite/Services/Organization.cs +++ b/Appwrite/Services/Organization.cs @@ -97,7 +97,8 @@ public Task Delete() var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -191,6 +192,11 @@ static Models.AppInstallation Convert(Dictionary it) /// public Task GetInstallation(string installationId) { + if (installationId == "") + { + throw new AppwriteException("Missing required parameter: \"installationId\""); + } + var apiPath = "/organization/installations/{installationId}" .Replace("{installationId}", installationId); @@ -228,6 +234,11 @@ static Models.AppInstallation Convert(Dictionary it) /// public Task UpdateInstallation(string installationId, string? authorizationDetails = null) { + if (installationId == "") + { + throw new AppwriteException("Missing required parameter: \"installationId\""); + } + var apiPath = "/organization/installations/{installationId}" .Replace("{installationId}", installationId); @@ -266,6 +277,11 @@ static Models.AppInstallation Convert(Dictionary it) /// public Task DeleteInstallation(string installationId) { + if (installationId == "") + { + throw new AppwriteException("Missing required parameter: \"installationId\""); + } + var apiPath = "/organization/installations/{installationId}" .Replace("{installationId}", installationId); @@ -291,16 +307,17 @@ public Task DeleteInstallation(string installationId) } /// - /// Get a list of all API keys from the current organization. + /// Get a list of all memberships from the current organization. /// /// - public Task ListKeys(List? queries = null, bool? total = null) + public Task ListMemberships(List? queries = null, string? search = null, bool? total = null) { - var apiPath = "/organization/keys"; + var apiPath = "/organization/memberships"; var apiParameters = new Dictionary() { { "queries", queries }, + { "search", search }, { "total", total } }; @@ -311,12 +328,12 @@ public Task DeleteInstallation(string installationId) }; - static Models.KeyList Convert(Dictionary it) + static Models.MembershipList Convert(Dictionary it) { - return Models.KeyList.From(map: it); + return Models.MembershipList.From(map: it); } - return _client.Call( + return _client.Call( method: "GET", path: apiPath, headers: apiHeaders, @@ -326,19 +343,23 @@ static Models.KeyList Convert(Dictionary it) } /// - /// Create a new organization API key. + /// Invite a new member to join the current organization. An email with a link + /// to join the organization will be sent to the new member's email address. If + /// member doesn't exist in the project it will be automatically created. /// /// - public Task CreateKey(string keyId, string name, List scopes, string? expire = null) + public Task CreateMembership(List roles, string? email = null, string? userId = null, string? phone = null, string? url = null, string? name = null) { - var apiPath = "/organization/keys"; + var apiPath = "/organization/memberships"; var apiParameters = new Dictionary() { - { "keyId", keyId }, - { "name", name }, - { "scopes", scopes?.Select(e => e.Value).ToList() }, - { "expire", expire } + { "email", email }, + { "userId", userId }, + { "phone", phone }, + { "roles", roles }, + { "url", url }, + { "name", name } }; var apiHeaders = new Dictionary() @@ -349,12 +370,12 @@ static Models.KeyList Convert(Dictionary it) }; - static Models.Key Convert(Dictionary it) + static Models.Membership Convert(Dictionary it) { - return Models.Key.From(map: it); + return Models.Membership.From(map: it); } - return _client.Call( + return _client.Call( method: "POST", path: apiPath, headers: apiHeaders, @@ -364,14 +385,18 @@ static Models.Key Convert(Dictionary it) } /// - /// Get a key by its unique ID. This endpoint returns details about a specific - /// API key in your organization including its scopes. + /// Get a membership from the current organization by its unique ID. /// /// - public Task GetKey(string keyId) + public Task GetMembership(string membershipId) { - var apiPath = "/organization/keys/{keyId}" - .Replace("{keyId}", keyId); + if (membershipId == "") + { + throw new AppwriteException("Missing required parameter: \"membershipId\""); + } + + var apiPath = "/organization/memberships/{membershipId}" + .Replace("{membershipId}", membershipId); var apiParameters = new Dictionary() { @@ -384,12 +409,12 @@ static Models.Key Convert(Dictionary it) }; - static Models.Key Convert(Dictionary it) + static Models.Membership Convert(Dictionary it) { - return Models.Key.From(map: it); + return Models.Membership.From(map: it); } - return _client.Call( + return _client.Call( method: "GET", path: apiPath, headers: apiHeaders, @@ -399,20 +424,22 @@ static Models.Key Convert(Dictionary it) } /// - /// Update a key by its unique ID. Use this endpoint to update the name, - /// scopes, or expiration time of an API key. + /// Modify the roles of a member in the current organization. /// /// - public Task UpdateKey(string keyId, string name, List scopes, string? expire = null) + public Task UpdateMembership(string membershipId, List roles) { - var apiPath = "/organization/keys/{keyId}" - .Replace("{keyId}", keyId); + if (membershipId == "") + { + throw new AppwriteException("Missing required parameter: \"membershipId\""); + } + + var apiPath = "/organization/memberships/{membershipId}" + .Replace("{membershipId}", membershipId); var apiParameters = new Dictionary() { - { "name", name }, - { "scopes", scopes?.Select(e => e.Value).ToList() }, - { "expire", expire } + { "roles", roles } }; var apiHeaders = new Dictionary() @@ -423,13 +450,13 @@ static Models.Key Convert(Dictionary it) }; - static Models.Key Convert(Dictionary it) + static Models.Membership Convert(Dictionary it) { - return Models.Key.From(map: it); + return Models.Membership.From(map: it); } - return _client.Call( - method: "PUT", + return _client.Call( + method: "PATCH", path: apiPath, headers: apiHeaders, parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, @@ -438,14 +465,20 @@ static Models.Key Convert(Dictionary it) } /// - /// Delete a key by its unique ID. Once deleted, the key can no longer be used - /// to authenticate API calls. + /// Remove a member from the current organization. The member is removed + /// whether they accepted the invitation or not; a pending invitation is + /// revoked. /// /// - public Task DeleteKey(string keyId) + public Task DeleteMembership(string membershipId) { - var apiPath = "/organization/keys/{keyId}" - .Replace("{keyId}", keyId); + if (membershipId == "") + { + throw new AppwriteException("Missing required parameter: \"membershipId\""); + } + + var apiPath = "/organization/memberships/{membershipId}" + .Replace("{membershipId}", membershipId); var apiParameters = new Dictionary() { @@ -454,7 +487,8 @@ public Task DeleteKey(string keyId) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -468,12 +502,13 @@ public Task DeleteKey(string keyId) } /// - /// Get a list of all memberships from the current organization. + /// Get a list of all projects. You can use the query params to filter your + /// results. /// /// - public Task ListMemberships(List? queries = null, string? search = null, bool? total = null) + public Task ListProjects(List? queries = null, string? search = null, bool? total = null) { - var apiPath = "/organization/memberships"; + var apiPath = "/organization/projects"; var apiParameters = new Dictionary() { @@ -489,12 +524,12 @@ public Task DeleteKey(string keyId) }; - static Models.MembershipList Convert(Dictionary it) + static Models.ProjectList Convert(Dictionary it) { - return Models.MembershipList.From(map: it); + return Models.ProjectList.From(map: it); } - return _client.Call( + return _client.Call( method: "GET", path: apiPath, headers: apiHeaders, @@ -504,23 +539,18 @@ static Models.MembershipList Convert(Dictionary it) } /// - /// Invite a new member to join the current organization. An email with a link - /// to join the organization will be sent to the new member's email address. If - /// member doesn't exist in the project it will be automatically created. + /// Create a new project. /// /// - public Task CreateMembership(List roles, string? email = null, string? userId = null, string? phone = null, string? url = null, string? name = null) + public Task CreateProject(string projectId, string name, Appwrite.Enums.Region? region = null) { - var apiPath = "/organization/memberships"; + var apiPath = "/organization/projects"; var apiParameters = new Dictionary() { - { "email", email }, - { "userId", userId }, - { "phone", phone }, - { "roles", roles }, - { "url", url }, - { "name", name } + { "projectId", projectId }, + { "name", name }, + { "region", region?.Value } }; var apiHeaders = new Dictionary() @@ -531,12 +561,12 @@ static Models.MembershipList Convert(Dictionary it) }; - static Models.Membership Convert(Dictionary it) + static Models.Project Convert(Dictionary it) { - return Models.Membership.From(map: it); + return Models.Project.From(map: it); } - return _client.Call( + return _client.Call( method: "POST", path: apiPath, headers: apiHeaders, @@ -546,13 +576,18 @@ static Models.Membership Convert(Dictionary it) } /// - /// Get a membership from the current organization by its unique ID. + /// Get a project. /// /// - public Task GetMembership(string membershipId) + public Task GetProject(string projectId) { - var apiPath = "/organization/memberships/{membershipId}" - .Replace("{membershipId}", membershipId); + if (projectId == "") + { + throw new AppwriteException("Missing required parameter: \"projectId\""); + } + + var apiPath = "/organization/projects/{projectId}" + .Replace("{projectId}", projectId); var apiParameters = new Dictionary() { @@ -565,12 +600,12 @@ static Models.Membership Convert(Dictionary it) }; - static Models.Membership Convert(Dictionary it) + static Models.Project Convert(Dictionary it) { - return Models.Membership.From(map: it); + return Models.Project.From(map: it); } - return _client.Call( + return _client.Call( method: "GET", path: apiPath, headers: apiHeaders, @@ -580,17 +615,22 @@ static Models.Membership Convert(Dictionary it) } /// - /// Modify the roles of a member in the current organization. + /// Update a project by its unique ID. /// /// - public Task UpdateMembership(string membershipId, List roles) + public Task UpdateProject(string projectId, string name) { - var apiPath = "/organization/memberships/{membershipId}" - .Replace("{membershipId}", membershipId); + if (projectId == "") + { + throw new AppwriteException("Missing required parameter: \"projectId\""); + } + + var apiPath = "/organization/projects/{projectId}" + .Replace("{projectId}", projectId); var apiParameters = new Dictionary() { - { "roles", roles } + { "name", name } }; var apiHeaders = new Dictionary() @@ -601,12 +641,12 @@ static Models.Membership Convert(Dictionary it) }; - static Models.Membership Convert(Dictionary it) + static Models.Project Convert(Dictionary it) { - return Models.Membership.From(map: it); + return Models.Project.From(map: it); } - return _client.Call( + return _client.Call( method: "PATCH", path: apiPath, headers: apiHeaders, @@ -616,15 +656,18 @@ static Models.Membership Convert(Dictionary it) } /// - /// Remove a member from the current organization. The member is removed - /// whether they accepted the invitation or not; a pending invitation is - /// revoked. + /// Delete a project by its unique ID. /// /// - public Task DeleteMembership(string membershipId) + public Task DeleteProject(string projectId) { - var apiPath = "/organization/memberships/{membershipId}" - .Replace("{membershipId}", membershipId); + if (projectId == "") + { + throw new AppwriteException("Missing required parameter: \"projectId\""); + } + + var apiPath = "/organization/projects/{projectId}" + .Replace("{projectId}", projectId); var apiParameters = new Dictionary() { @@ -633,7 +676,8 @@ public Task DeleteMembership(string membershipId) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -647,18 +691,22 @@ public Task DeleteMembership(string membershipId) } /// - /// Get a list of all projects. You can use the query params to filter your - /// results. + /// Get a list of all API keys of a project in your organization. /// /// - public Task ListProjects(List? queries = null, string? search = null, bool? total = null) + public Task ListProjectKeys(string projectId, List? queries = null, bool? total = null) { - var apiPath = "/organization/projects"; + if (projectId == "") + { + throw new AppwriteException("Missing required parameter: \"projectId\""); + } + + var apiPath = "/organization/projects/{projectId}/keys" + .Replace("{projectId}", projectId); var apiParameters = new Dictionary() { { "queries", queries }, - { "search", search }, { "total", total } }; @@ -669,12 +717,12 @@ public Task DeleteMembership(string membershipId) }; - static Models.ProjectList Convert(Dictionary it) + static Models.KeyList Convert(Dictionary it) { - return Models.ProjectList.From(map: it); + return Models.KeyList.From(map: it); } - return _client.Call( + return _client.Call( method: "GET", path: apiPath, headers: apiHeaders, @@ -684,18 +732,28 @@ static Models.ProjectList Convert(Dictionary it) } /// - /// Create a new project. + /// Create a new ephemeral API key for a project in your organization. It's + /// recommended to have multiple API keys with strict scopes for separate + /// functions within your project. + /// + /// You can also create a standard API key if you need a longer-lived key + /// instead. /// /// - public Task CreateProject(string projectId, string name, Appwrite.Enums.Region? region = null) + public Task CreateEphemeralProjectKey(string projectId, List scopes, long duration) { - var apiPath = "/organization/projects"; + if (projectId == "") + { + throw new AppwriteException("Missing required parameter: \"projectId\""); + } + + var apiPath = "/organization/projects/{projectId}/keys/ephemeral" + .Replace("{projectId}", projectId); var apiParameters = new Dictionary() { - { "projectId", projectId }, - { "name", name }, - { "region", region?.Value } + { "scopes", scopes?.Select(e => e.Value).ToList() }, + { "duration", duration } }; var apiHeaders = new Dictionary() @@ -706,12 +764,12 @@ static Models.ProjectList Convert(Dictionary it) }; - static Models.Project Convert(Dictionary it) + static Models.EphemeralKey Convert(Dictionary it) { - return Models.Project.From(map: it); + return Models.EphemeralKey.From(map: it); } - return _client.Call( + return _client.Call( method: "POST", path: apiPath, headers: apiHeaders, @@ -721,13 +779,24 @@ static Models.Project Convert(Dictionary it) } /// - /// Get a project. + /// Get a project key by its unique ID. /// /// - public Task GetProject(string projectId) + public Task GetProjectKey(string projectId, string keyId) { - var apiPath = "/organization/projects/{projectId}" - .Replace("{projectId}", projectId); + if (projectId == "") + { + throw new AppwriteException("Missing required parameter: \"projectId\""); + } + + if (keyId == "") + { + throw new AppwriteException("Missing required parameter: \"keyId\""); + } + + var apiPath = "/organization/projects/{projectId}/keys/{keyId}" + .Replace("{projectId}", projectId) + .Replace("{keyId}", keyId); var apiParameters = new Dictionary() { @@ -735,16 +804,17 @@ static Models.Project Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; - static Models.Project Convert(Dictionary it) + static Models.Key Convert(Dictionary it) { - return Models.Project.From(map: it); + return Models.Key.From(map: it); } - return _client.Call( + return _client.Call( method: "GET", path: apiPath, headers: apiHeaders, @@ -754,17 +824,31 @@ static Models.Project Convert(Dictionary it) } /// - /// Update a project by its unique ID. + /// Update a project key by its unique ID. Use this endpoint to update the + /// name, scopes, or expiration time of an API key. /// /// - public Task UpdateProject(string projectId, string name) + public Task UpdateProjectKey(string projectId, string keyId, string name, List scopes, string? expire = null) { - var apiPath = "/organization/projects/{projectId}" - .Replace("{projectId}", projectId); + if (projectId == "") + { + throw new AppwriteException("Missing required parameter: \"projectId\""); + } + + if (keyId == "") + { + throw new AppwriteException("Missing required parameter: \"keyId\""); + } + + var apiPath = "/organization/projects/{projectId}/keys/{keyId}" + .Replace("{projectId}", projectId) + .Replace("{keyId}", keyId); var apiParameters = new Dictionary() { - { "name", name } + { "name", name }, + { "scopes", scopes?.Select(e => e.Value).ToList() }, + { "expire", expire } }; var apiHeaders = new Dictionary() @@ -775,13 +859,13 @@ static Models.Project Convert(Dictionary it) }; - static Models.Project Convert(Dictionary it) + static Models.Key Convert(Dictionary it) { - return Models.Project.From(map: it); + return Models.Key.From(map: it); } - return _client.Call( - method: "PATCH", + return _client.Call( + method: "PUT", path: apiPath, headers: apiHeaders, parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, @@ -790,13 +874,25 @@ static Models.Project Convert(Dictionary it) } /// - /// Delete a project by its unique ID. + /// Delete a project key by its unique ID. Once deleted, the key can no longer + /// be used to authenticate API calls. /// /// - public Task DeleteProject(string projectId) + public Task DeleteProjectKey(string projectId, string keyId) { - var apiPath = "/organization/projects/{projectId}" - .Replace("{projectId}", projectId); + if (projectId == "") + { + throw new AppwriteException("Missing required parameter: \"projectId\""); + } + + if (keyId == "") + { + throw new AppwriteException("Missing required parameter: \"keyId\""); + } + + var apiPath = "/organization/projects/{projectId}/keys/{keyId}" + .Replace("{projectId}", projectId) + .Replace("{keyId}", keyId); var apiParameters = new Dictionary() { @@ -805,7 +901,8 @@ public Task DeleteProject(string projectId) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; diff --git a/Appwrite/Services/Postgresql.cs b/Appwrite/Services/Postgresql.cs index dd27430b..614e34a7 100644 --- a/Appwrite/Services/Postgresql.cs +++ b/Appwrite/Services/Postgresql.cs @@ -98,8 +98,8 @@ static Models.DedicatedDatabase Convert(Dictionary it) /// /// List the dedicated database specifications available on the current plan. - /// Each specification reports its resource limits, pricing, and whether it is - /// enabled for the organization. + /// Each specification reports its resource limits, its own prices and overage + /// rates, and whether it is enabled for the organization. /// /// public Task ListSpecifications() @@ -138,6 +138,11 @@ static Models.DedicatedDatabaseSpecificationList Convert(Dictionary public Task Get(string databaseId) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/postgresql/{databaseId}" .Replace("{databaseId}", databaseId); @@ -175,6 +180,11 @@ static Models.DedicatedDatabase Convert(Dictionary it) /// public Task Update(string databaseId, string? name = null, string? status = null, string? specification = null, long? replicas = null, string? syncMode = null, long? networkIdleTimeoutSeconds = null, List? networkIPAllowlist = null, long? idleTimeoutMinutes = null, bool? pitr = null, long? pitrRetentionDays = null, bool? storageAutoscaling = null, long? storageAutoscalingThresholdPercent = null, long? storageAutoscalingMaxGb = null, double? metricsTraceSampleRate = null, long? metricsSlowQueryLogThresholdMs = null, bool? sqlApiEnabled = null, List? sqlApiAllowedStatements = null, long? sqlApiMaxRows = null, long? sqlApiMaxBytes = null, long? sqlApiTimeoutSeconds = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/postgresql/{databaseId}" .Replace("{databaseId}", databaseId); @@ -233,6 +243,11 @@ static Models.DedicatedDatabase Convert(Dictionary it) /// public Task Delete(string databaseId) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/postgresql/{databaseId}" .Replace("{databaseId}", databaseId); @@ -264,6 +279,11 @@ public Task Delete(string databaseId) /// public Task ListBackups(string databaseId, List? queries = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/postgresql/{databaseId}/backups" .Replace("{databaseId}", databaseId); @@ -300,6 +320,11 @@ static Models.DedicatedDatabaseBackupList Convert(Dictionary it) /// public Task CreateBackup(string databaseId, string? type = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/postgresql/{databaseId}/backups" .Replace("{databaseId}", databaseId); @@ -336,6 +361,11 @@ static Models.DedicatedDatabaseBackup Convert(Dictionary it) /// public Task ListBackupPolicies(string databaseId, List? queries = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/postgresql/{databaseId}/backups/policies" .Replace("{databaseId}", databaseId); @@ -371,6 +401,11 @@ static Models.BackupPolicyList Convert(Dictionary it) /// public Task CreateBackupPolicy(string databaseId, string policyId, string name, string schedule, long retention, string? type = null, bool? enabled = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/postgresql/{databaseId}/backups/policies" .Replace("{databaseId}", databaseId); @@ -412,6 +447,16 @@ static Models.BackupPolicy Convert(Dictionary it) /// public Task GetBackupPolicy(string databaseId, string policyId) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (policyId == "") + { + throw new AppwriteException("Missing required parameter: \"policyId\""); + } + var apiPath = "/postgresql/{databaseId}/backups/policies/{policyId}" .Replace("{databaseId}", databaseId) .Replace("{policyId}", policyId); @@ -447,6 +492,16 @@ static Models.BackupPolicy Convert(Dictionary it) /// public Task UpdateBackupPolicy(string databaseId, string policyId, string? name = null, string? schedule = null, long? retention = null, bool? enabled = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (policyId == "") + { + throw new AppwriteException("Missing required parameter: \"policyId\""); + } + var apiPath = "/postgresql/{databaseId}/backups/policies/{policyId}" .Replace("{databaseId}", databaseId) .Replace("{policyId}", policyId); @@ -488,6 +543,16 @@ static Models.BackupPolicy Convert(Dictionary it) /// public Task DeleteBackupPolicy(string databaseId, string policyId) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (policyId == "") + { + throw new AppwriteException("Missing required parameter: \"policyId\""); + } + var apiPath = "/postgresql/{databaseId}/backups/policies/{policyId}" .Replace("{databaseId}", databaseId) .Replace("{policyId}", policyId); @@ -521,6 +586,11 @@ public Task DeleteBackupPolicy(string databaseId, string policyId) /// public Task UpdateBackupStorage(string databaseId, string provider, string bucket, string accessKey, string secretKey, string? region = null, string? prefix = null, string? endpoint = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/postgresql/{databaseId}/backups/storage" .Replace("{databaseId}", databaseId); @@ -564,6 +634,16 @@ static Models.DedicatedDatabaseBackupStorage Convert(Dictionary /// public Task GetBackup(string databaseId, string backupId) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (backupId == "") + { + throw new AppwriteException("Missing required parameter: \"backupId\""); + } + var apiPath = "/postgresql/{databaseId}/backups/{backupId}" .Replace("{databaseId}", databaseId) .Replace("{backupId}", backupId); @@ -600,6 +680,16 @@ static Models.DedicatedDatabaseBackup Convert(Dictionary it) /// public Task DeleteBackup(string databaseId, string backupId) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (backupId == "") + { + throw new AppwriteException("Missing required parameter: \"backupId\""); + } + var apiPath = "/postgresql/{databaseId}/backups/{backupId}" .Replace("{databaseId}", databaseId) .Replace("{backupId}", backupId); @@ -632,6 +722,11 @@ public Task DeleteBackup(string databaseId, string backupId) /// public Task ListBranches(string databaseId) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/postgresql/{databaseId}/branches" .Replace("{databaseId}", databaseId); @@ -670,6 +765,11 @@ static Models.DedicatedDatabaseBranchList Convert(Dictionary it) /// public Task CreateBranch(string databaseId, string? branchId = null, long? ttl = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/postgresql/{databaseId}/branches" .Replace("{databaseId}", databaseId); @@ -709,6 +809,16 @@ static Models.DedicatedDatabase Convert(Dictionary it) /// public Task DeleteBranch(string databaseId, string branchId) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (branchId == "") + { + throw new AppwriteException("Missing required parameter: \"branchId\""); + } + var apiPath = "/postgresql/{databaseId}/branches/{branchId}" .Replace("{databaseId}", databaseId) .Replace("{branchId}", branchId); @@ -748,6 +858,11 @@ static Models.DedicatedDatabase Convert(Dictionary it) /// public Task UpdateCredentials(string databaseId) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/postgresql/{databaseId}/credentials" .Replace("{databaseId}", databaseId); @@ -791,6 +906,11 @@ static Models.DedicatedDatabaseOperation Convert(Dictionary it) /// public Task CreateExecution(string databaseId, string sql, object? bindings = null, long? timeoutSeconds = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/postgresql/{databaseId}/executions" .Replace("{databaseId}", databaseId); @@ -829,6 +949,11 @@ static Models.DedicatedDatabaseExecution Convert(Dictionary it) /// public Task ListExtensions(string databaseId) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/postgresql/{databaseId}/extensions" .Replace("{databaseId}", databaseId); @@ -864,6 +989,11 @@ static Models.DedicatedDatabaseExtensions Convert(Dictionary it) /// public Task CreateExtension(string databaseId, string name) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/postgresql/{databaseId}/extensions" .Replace("{databaseId}", databaseId); @@ -901,6 +1031,16 @@ static Models.DedicatedDatabase Convert(Dictionary it) /// public Task DeleteExtension(string databaseId, string extensionName) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (extensionName == "") + { + throw new AppwriteException("Missing required parameter: \"extensionName\""); + } + var apiPath = "/postgresql/{databaseId}/extensions/{extensionName}" .Replace("{databaseId}", databaseId) .Replace("{extensionName}", extensionName); @@ -945,6 +1085,11 @@ static Models.DedicatedDatabase Convert(Dictionary it) /// public Task CreateFailover(string databaseId, string? targetReplicaId = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/postgresql/{databaseId}/failovers" .Replace("{databaseId}", databaseId); @@ -983,6 +1128,11 @@ static Models.DedicatedDatabase Convert(Dictionary it) /// public Task UpdateMaintenance(string databaseId, string day, long hourUtc) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/postgresql/{databaseId}/maintenance" .Replace("{databaseId}", databaseId); @@ -1023,6 +1173,11 @@ static Models.DedicatedDatabase Convert(Dictionary it) /// public Task CreateMigration(string databaseId, string targetType, string? specification = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/postgresql/{databaseId}/migrations" .Replace("{databaseId}", databaseId); @@ -1063,6 +1218,11 @@ static Models.DedicatedDatabase Convert(Dictionary it) /// public Task ListOperations(string databaseId, string? status = null, long? limit = null, long? offset = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/postgresql/{databaseId}/operations" .Replace("{databaseId}", databaseId); @@ -1101,6 +1261,11 @@ static Models.DedicatedDatabaseOperationList Convert(Dictionary /// public Task GetPitr(string databaseId) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/postgresql/{databaseId}/pitr" .Replace("{databaseId}", databaseId); @@ -1136,6 +1301,11 @@ static Models.DedicatedDatabasePITRWindows Convert(Dictionary it /// public Task GetPooler(string databaseId) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/postgresql/{databaseId}/pooler" .Replace("{databaseId}", databaseId); @@ -1171,6 +1341,11 @@ static Models.DedicatedDatabasePooler Convert(Dictionary it) /// public Task UpdatePooler(string databaseId, string? mode = null, long? maxConnections = null, long? defaultPoolSize = null, bool? readWriteSplitting = null, string? poolerCpuRequest = null, string? poolerCpuLimit = null, string? poolerMemoryRequest = null, string? poolerMemoryLimit = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/postgresql/{databaseId}/pooler" .Replace("{databaseId}", databaseId); @@ -1215,6 +1390,11 @@ static Models.DedicatedDatabasePooler Convert(Dictionary it) /// public Task GetReplicas(string databaseId) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/postgresql/{databaseId}/replicas" .Replace("{databaseId}", databaseId); @@ -1250,6 +1430,11 @@ static Models.DedicatedDatabaseReplicas Convert(Dictionary it) /// public Task ListRestorations(string databaseId, string? status = null, string? type = null, long? limit = null, long? offset = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/postgresql/{databaseId}/restorations" .Replace("{databaseId}", databaseId); @@ -1291,6 +1476,11 @@ static Models.DedicatedDatabaseRestorationList Convert(Dictionary public Task CreateRestoration(string databaseId, string? type = null, string? backupId = null, string? targetDatabaseId = null, string? targetTime = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/postgresql/{databaseId}/restorations" .Replace("{databaseId}", databaseId); @@ -1331,6 +1521,16 @@ static Models.DedicatedDatabaseRestoration Convert(Dictionary it /// public Task GetRestoration(string databaseId, string restorationId) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (restorationId == "") + { + throw new AppwriteException("Missing required parameter: \"restorationId\""); + } + var apiPath = "/postgresql/{databaseId}/restorations/{restorationId}" .Replace("{databaseId}", databaseId) .Replace("{restorationId}", restorationId); @@ -1368,6 +1568,11 @@ static Models.DedicatedDatabaseRestoration Convert(Dictionary it /// public Task GetStatus(string databaseId) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/postgresql/{databaseId}/status" .Replace("{databaseId}", databaseId); @@ -1403,6 +1608,11 @@ static Models.DatabaseStatus Convert(Dictionary it) /// public Task CreateUpgrade(string databaseId, string targetVersion) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/postgresql/{databaseId}/upgrades" .Replace("{databaseId}", databaseId); diff --git a/Appwrite/Services/Presences.cs b/Appwrite/Services/Presences.cs index 4c653ce8..ec58bbb8 100644 --- a/Appwrite/Services/Presences.cs +++ b/Appwrite/Services/Presences.cs @@ -58,6 +58,11 @@ static Models.PresenceList Convert(Dictionary it) /// public Task Get(string presenceId) { + if (presenceId == "") + { + throw new AppwriteException("Missing required parameter: \"presenceId\""); + } + var apiPath = "/presences/{presenceId}" .Replace("{presenceId}", presenceId); @@ -93,6 +98,11 @@ static Models.Presence Convert(Dictionary it) /// public Task Upsert(string presenceId, string userId, string status, List? permissions = null, string? expiresAt = null, object? metadata = null) { + if (presenceId == "") + { + throw new AppwriteException("Missing required parameter: \"presenceId\""); + } + var apiPath = "/presences/{presenceId}" .Replace("{presenceId}", presenceId); @@ -135,6 +145,11 @@ static Models.Presence Convert(Dictionary it) /// public Task Update(string presenceId, string userId, string? status = null, string? expiresAt = null, object? metadata = null, List? permissions = null, bool? purge = null) { + if (presenceId == "") + { + throw new AppwriteException("Missing required parameter: \"presenceId\""); + } + var apiPath = "/presences/{presenceId}" .Replace("{presenceId}", presenceId); @@ -177,6 +192,11 @@ static Models.Presence Convert(Dictionary it) /// public Task Delete(string presenceId) { + if (presenceId == "") + { + throw new AppwriteException("Missing required parameter: \"presenceId\""); + } + var apiPath = "/presences/{presenceId}" .Replace("{presenceId}", presenceId); @@ -187,7 +207,8 @@ public Task Delete(string presenceId) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; diff --git a/Appwrite/Services/Project.cs b/Appwrite/Services/Project.cs index 47565409..da2bbf18 100644 --- a/Appwrite/Services/Project.cs +++ b/Appwrite/Services/Project.cs @@ -27,7 +27,8 @@ public Project(Client client) : base(client) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -60,7 +61,8 @@ public Task Delete() var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -191,6 +193,11 @@ static Models.EphemeralKey Convert(Dictionary it) /// public Task GetKey(string keyId) { + if (keyId == "") + { + throw new AppwriteException("Missing required parameter: \"keyId\""); + } + var apiPath = "/project/keys/{keyId}" .Replace("{keyId}", keyId); @@ -226,6 +233,11 @@ static Models.Key Convert(Dictionary it) /// public Task UpdateKey(string keyId, string name, List scopes, string? expire = null) { + if (keyId == "") + { + throw new AppwriteException("Missing required parameter: \"keyId\""); + } + var apiPath = "/project/keys/{keyId}" .Replace("{keyId}", keyId); @@ -265,6 +277,11 @@ static Models.Key Convert(Dictionary it) /// public Task DeleteKey(string keyId) { + if (keyId == "") + { + throw new AppwriteException("Missing required parameter: \"keyId\""); + } + var apiPath = "/project/keys/{keyId}" .Replace("{keyId}", keyId); @@ -275,7 +292,8 @@ public Task DeleteKey(string keyId) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -404,6 +422,11 @@ static Models.MockNumber Convert(Dictionary it) /// public Task GetMockPhone(string number) { + if (number == "") + { + throw new AppwriteException("Missing required parameter: \"number\""); + } + var apiPath = "/project/mock-phones/{number}" .Replace("{number}", number); @@ -439,6 +462,11 @@ static Models.MockNumber Convert(Dictionary it) /// public Task UpdateMockPhone(string number, string otp) { + if (number == "") + { + throw new AppwriteException("Missing required parameter: \"number\""); + } + var apiPath = "/project/mock-phones/{number}" .Replace("{number}", number); @@ -476,6 +504,11 @@ static Models.MockNumber Convert(Dictionary it) /// public Task DeleteMockPhone(string number) { + if (number == "") + { + throw new AppwriteException("Missing required parameter: \"number\""); + } + var apiPath = "/project/mock-phones/{number}" .Replace("{number}", number); @@ -486,7 +519,8 @@ public Task DeleteMockPhone(string number) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -627,7 +661,7 @@ static Models.OAuth2Amazon Convert(Dictionary it) /// Update the project OAuth2 Apple configuration. /// /// - public Task UpdateOAuth2Apple(string? serviceId = null, string? keyId = null, string? teamId = null, string? p8File = null, bool? enabled = null) + public Task UpdateOAuth2Apple(string? serviceId = null, string? keyId = null, string? teamId = null, string? p8File = null, List? nativeClientIds = null, bool? enabled = null, bool? nativeEnabled = null) { var apiPath = "/project/oauth2/apple"; @@ -637,7 +671,9 @@ static Models.OAuth2Amazon Convert(Dictionary it) { "keyId", keyId }, { "teamId", teamId }, { "p8File", p8File }, - { "enabled", enabled } + { "nativeClientIds", nativeClientIds }, + { "enabled", enabled }, + { "nativeEnabled", nativeEnabled } }; var apiHeaders = new Dictionary() @@ -703,7 +739,7 @@ static Models.OAuth2Appwrite Convert(Dictionary it) /// Update the project OAuth2 Auth0 configuration. /// /// - public Task UpdateOAuth2Auth0(string? clientId = null, string? clientSecret = null, string? endpoint = null, bool? enabled = null) + public Task UpdateOAuth2Auth0(string? clientId = null, string? clientSecret = null, string? endpoint = null, List? prompt = null, bool? enabled = null) { var apiPath = "/project/oauth2/auth0"; @@ -712,6 +748,7 @@ static Models.OAuth2Appwrite Convert(Dictionary it) { "clientId", clientId }, { "clientSecret", clientSecret }, { "endpoint", endpoint }, + { "prompt", prompt?.Select(e => e.Value).ToList() }, { "enabled", enabled } }; @@ -1001,7 +1038,7 @@ static Models.OAuth2Dailymotion Convert(Dictionary it) /// Update the project OAuth2 Discord configuration. /// /// - public Task UpdateOAuth2Discord(string? clientId = null, string? clientSecret = null, bool? enabled = null) + public Task UpdateOAuth2Discord(string? clientId = null, string? clientSecret = null, List? prompt = null, bool? enabled = null) { var apiPath = "/project/oauth2/discord"; @@ -1009,6 +1046,7 @@ static Models.OAuth2Dailymotion Convert(Dictionary it) { { "clientId", clientId }, { "clientSecret", clientSecret }, + { "prompt", prompt?.Select(e => e.Value).ToList() }, { "enabled", enabled } }; @@ -1261,7 +1299,7 @@ static Models.OAuth2FusionAuth Convert(Dictionary it) /// Update the project OAuth2 GitHub configuration. /// /// - public Task UpdateOAuth2GitHub(string? clientId = null, string? clientSecret = null, bool? enabled = null) + public Task UpdateOAuth2GitHub(string? clientId = null, string? clientSecret = null, List? prompt = null, bool? enabled = null) { var apiPath = "/project/oauth2/github"; @@ -1269,6 +1307,7 @@ static Models.OAuth2FusionAuth Convert(Dictionary it) { { "clientId", clientId }, { "clientSecret", clientSecret }, + { "prompt", prompt?.Select(e => e.Value).ToList() }, { "enabled", enabled } }; @@ -1336,7 +1375,7 @@ static Models.OAuth2Gitlab Convert(Dictionary it) /// Update the project OAuth2 Google configuration. /// /// - public Task UpdateOAuth2Google(string? clientId = null, string? clientSecret = null, List? prompt = null, bool? enabled = null) + public Task UpdateOAuth2Google(string? clientId = null, string? clientSecret = null, List? prompt = null, List? nativeClientIds = null, bool? enabled = null, bool? nativeEnabled = null) { var apiPath = "/project/oauth2/google"; @@ -1345,7 +1384,9 @@ static Models.OAuth2Gitlab Convert(Dictionary it) { "clientId", clientId }, { "clientSecret", clientSecret }, { "prompt", prompt?.Select(e => e.Value).ToList() }, - { "enabled", enabled } + { "nativeClientIds", nativeClientIds }, + { "enabled", enabled }, + { "nativeEnabled", nativeEnabled } }; var apiHeaders = new Dictionary() @@ -1407,6 +1448,44 @@ static Models.OAuth2HuggingFace Convert(Dictionary it) } + /// + /// Update the project OAuth2 Kakao configuration. + /// + /// + public Task UpdateOAuth2Kakao(string? clientId = null, string? clientSecret = null, List? prompt = null, bool? enabled = null) + { + var apiPath = "/project/oauth2/kakao"; + + var apiParameters = new Dictionary() + { + { "clientId", clientId }, + { "clientSecret", clientSecret }, + { "prompt", prompt?.Select(e => e.Value).ToList() }, + { "enabled", enabled } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.OAuth2Kakao Convert(Dictionary it) + { + return Models.OAuth2Kakao.From(map: it); + } + + return _client.Call( + method: "PATCH", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + /// /// Update the project OAuth2 Keycloak configuration. /// @@ -1524,7 +1603,7 @@ static Models.OAuth2Linkedin Convert(Dictionary it) /// Update the project OAuth2 Microsoft configuration. /// /// - public Task UpdateOAuth2Microsoft(string? applicationId = null, string? applicationSecret = null, string? tenant = null, bool? enabled = null) + public Task UpdateOAuth2Microsoft(string? applicationId = null, string? applicationSecret = null, string? tenant = null, List? prompt = null, bool? enabled = null) { var apiPath = "/project/oauth2/microsoft"; @@ -1533,6 +1612,7 @@ static Models.OAuth2Linkedin Convert(Dictionary it) { "applicationId", applicationId }, { "applicationSecret", applicationSecret }, { "tenant", tenant }, + { "prompt", prompt?.Select(e => e.Value).ToList() }, { "enabled", enabled } }; @@ -1642,7 +1722,7 @@ static Models.OAuth2Oidc Convert(Dictionary it) /// Update the project OAuth2 Okta configuration. /// /// - public Task UpdateOAuth2Okta(string? clientId = null, string? clientSecret = null, string? domain = null, string? authorizationServerId = null, bool? enabled = null) + public Task UpdateOAuth2Okta(string? clientId = null, string? clientSecret = null, string? domain = null, string? authorizationServerId = null, List? prompt = null, bool? enabled = null) { var apiPath = "/project/oauth2/okta"; @@ -1652,6 +1732,7 @@ static Models.OAuth2Oidc Convert(Dictionary it) { "clientSecret", clientSecret }, { "domain", domain }, { "authorizationServerId", authorizationServerId }, + { "prompt", prompt?.Select(e => e.Value).ToList() }, { "enabled", enabled } }; @@ -1829,7 +1910,7 @@ static Models.OAuth2Resend Convert(Dictionary it) /// Update the project OAuth2 Salesforce configuration. /// /// - public Task UpdateOAuth2Salesforce(string? customerKey = null, string? customerSecret = null, bool? enabled = null) + public Task UpdateOAuth2Salesforce(string? customerKey = null, string? customerSecret = null, List? prompt = null, bool? enabled = null) { var apiPath = "/project/oauth2/salesforce"; @@ -1837,6 +1918,7 @@ static Models.OAuth2Resend Convert(Dictionary it) { { "customerKey", customerKey }, { "customerSecret", customerSecret }, + { "prompt", prompt?.Select(e => e.Value).ToList() }, { "enabled", enabled } }; @@ -1973,6 +2055,43 @@ static Models.OAuth2Stripe Convert(Dictionary it) } + /// + /// Update the project OAuth2 TikTok configuration. + /// + /// + public Task UpdateOAuth2TikTok(string? clientId = null, string? clientSecret = null, bool? enabled = null) + { + var apiPath = "/project/oauth2/tiktok"; + + var apiParameters = new Dictionary() + { + { "clientId", clientId }, + { "clientSecret", clientSecret }, + { "enabled", enabled } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.OAuth2TikTok Convert(Dictionary it) + { + return Models.OAuth2TikTok.From(map: it); + } + + return _client.Call( + method: "PATCH", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + /// /// Update the project OAuth2 Tradeshift configuration. /// @@ -2084,6 +2203,43 @@ static Models.OAuth2Twitch Convert(Dictionary it) } + /// + /// Update the project OAuth2 Webflow configuration. + /// + /// + public Task UpdateOAuth2Webflow(string? clientId = null, string? clientSecret = null, bool? enabled = null) + { + var apiPath = "/project/oauth2/webflow"; + + var apiParameters = new Dictionary() + { + { "clientId", clientId }, + { "clientSecret", clientSecret }, + { "enabled", enabled } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.OAuth2Webflow Convert(Dictionary it) + { + return Models.OAuth2Webflow.From(map: it); + } + + return _client.Call( + method: "PATCH", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + /// /// Update the project OAuth2 WordPress configuration. /// @@ -2236,7 +2392,7 @@ static Models.OAuth2Yandex Convert(Dictionary it) /// Update the project OAuth2 Zoho configuration. /// /// - public Task UpdateOAuth2Zoho(string? clientId = null, string? clientSecret = null, bool? enabled = null) + public Task UpdateOAuth2Zoho(string? clientId = null, string? clientSecret = null, List? prompt = null, bool? enabled = null) { var apiPath = "/project/oauth2/zoho"; @@ -2244,6 +2400,7 @@ static Models.OAuth2Yandex Convert(Dictionary it) { { "clientId", clientId }, { "clientSecret", clientSecret }, + { "prompt", prompt?.Select(e => e.Value).ToList() }, { "enabled", enabled } }; @@ -2389,118 +2546,130 @@ static object Convert(Dictionary it) { return Appwrite.Models.OAuth2WordPress.From(map: it); } - if (it.TryGetValue("$id", out var idValue16) && idValue16?.ToString() == "twitch") + if (it.TryGetValue("$id", out var idValue16) && idValue16?.ToString() == "webflow") + { + return Appwrite.Models.OAuth2Webflow.From(map: it); + } + if (it.TryGetValue("$id", out var idValue17) && idValue17?.ToString() == "twitch") { return Appwrite.Models.OAuth2Twitch.From(map: it); } - if (it.TryGetValue("$id", out var idValue17) && idValue17?.ToString() == "stripe") + if (it.TryGetValue("$id", out var idValue18) && idValue18?.ToString() == "stripe") { return Appwrite.Models.OAuth2Stripe.From(map: it); } - if (it.TryGetValue("$id", out var idValue18) && idValue18?.ToString() == "spotify") + if (it.TryGetValue("$id", out var idValue19) && idValue19?.ToString() == "spotify") { return Appwrite.Models.OAuth2Spotify.From(map: it); } - if (it.TryGetValue("$id", out var idValue19) && idValue19?.ToString() == "slack") + if (it.TryGetValue("$id", out var idValue20) && idValue20?.ToString() == "slack") { return Appwrite.Models.OAuth2Slack.From(map: it); } - if (it.TryGetValue("$id", out var idValue20) && idValue20?.ToString() == "podio") + if (it.TryGetValue("$id", out var idValue21) && idValue21?.ToString() == "podio") { return Appwrite.Models.OAuth2Podio.From(map: it); } - if (it.TryGetValue("$id", out var idValue21) && idValue21?.ToString() == "notion") + if (it.TryGetValue("$id", out var idValue22) && idValue22?.ToString() == "notion") { return Appwrite.Models.OAuth2Notion.From(map: it); } - if (it.TryGetValue("$id", out var idValue22) && idValue22?.ToString() == "salesforce") + if (it.TryGetValue("$id", out var idValue23) && idValue23?.ToString() == "salesforce") { return Appwrite.Models.OAuth2Salesforce.From(map: it); } - if (it.TryGetValue("$id", out var idValue23) && idValue23?.ToString() == "yahoo") + if (it.TryGetValue("$id", out var idValue24) && idValue24?.ToString() == "yahoo") { return Appwrite.Models.OAuth2Yahoo.From(map: it); } - if (it.TryGetValue("$id", out var idValue24) && idValue24?.ToString() == "huggingface") + if (it.TryGetValue("$id", out var idValue25) && idValue25?.ToString() == "huggingface") { return Appwrite.Models.OAuth2HuggingFace.From(map: it); } - if (it.TryGetValue("$id", out var idValue25) && idValue25?.ToString() == "resend") + if (it.TryGetValue("$id", out var idValue26) && idValue26?.ToString() == "resend") { return Appwrite.Models.OAuth2Resend.From(map: it); } - if (it.TryGetValue("$id", out var idValue26) && idValue26?.ToString() == "cloudflare") + if (it.TryGetValue("$id", out var idValue27) && idValue27?.ToString() == "cloudflare") { return Appwrite.Models.OAuth2Cloudflare.From(map: it); } - if (it.TryGetValue("$id", out var idValue27) && idValue27?.ToString() == "linkedin") + if (it.TryGetValue("$id", out var idValue28) && idValue28?.ToString() == "linkedin") { return Appwrite.Models.OAuth2Linkedin.From(map: it); } - if (it.TryGetValue("$id", out var idValue28) && idValue28?.ToString() == "disqus") + if (it.TryGetValue("$id", out var idValue29) && idValue29?.ToString() == "disqus") { return Appwrite.Models.OAuth2Disqus.From(map: it); } - if (it.TryGetValue("$id", out var idValue29) && idValue29?.ToString() == "amazon") + if (it.TryGetValue("$id", out var idValue30) && idValue30?.ToString() == "amazon") { return Appwrite.Models.OAuth2Amazon.From(map: it); } - if (it.TryGetValue("$id", out var idValue30) && idValue30?.ToString() == "etsy") + if (it.TryGetValue("$id", out var idValue31) && idValue31?.ToString() == "etsy") { return Appwrite.Models.OAuth2Etsy.From(map: it); } - if (it.TryGetValue("$id", out var idValue31) && idValue31?.ToString() == "facebook") + if (it.TryGetValue("$id", out var idValue32) && idValue32?.ToString() == "facebook") { return Appwrite.Models.OAuth2Facebook.From(map: it); } - if (it.TryGetValue("$id", out var idValue32) && idValue32?.ToString() == "tradeshiftBox") + if (it.TryGetValue("$id", out var idValue33) && idValue33?.ToString() == "tradeshiftBox") { return Appwrite.Models.OAuth2Tradeshift.From(map: it); } - if (it.TryGetValue("$id", out var idValue33) && idValue33?.ToString() == "paypalSandbox") + if (it.TryGetValue("$id", out var idValue34) && idValue34?.ToString() == "paypalSandbox") { return Appwrite.Models.OAuth2Paypal.From(map: it); } - if (it.TryGetValue("$id", out var idValue34) && idValue34?.ToString() == "gitlab") + if (it.TryGetValue("$id", out var idValue35) && idValue35?.ToString() == "gitlab") { return Appwrite.Models.OAuth2Gitlab.From(map: it); } - if (it.TryGetValue("$id", out var idValue35) && idValue35?.ToString() == "authentik") + if (it.TryGetValue("$id", out var idValue36) && idValue36?.ToString() == "authentik") { return Appwrite.Models.OAuth2Authentik.From(map: it); } - if (it.TryGetValue("$id", out var idValue36) && idValue36?.ToString() == "auth0") + if (it.TryGetValue("$id", out var idValue37) && idValue37?.ToString() == "auth0") { return Appwrite.Models.OAuth2Auth0.From(map: it); } - if (it.TryGetValue("$id", out var idValue37) && idValue37?.ToString() == "fusionauth") + if (it.TryGetValue("$id", out var idValue38) && idValue38?.ToString() == "fusionauth") { return Appwrite.Models.OAuth2FusionAuth.From(map: it); } - if (it.TryGetValue("$id", out var idValue38) && idValue38?.ToString() == "keycloak") + if (it.TryGetValue("$id", out var idValue39) && idValue39?.ToString() == "keycloak") { return Appwrite.Models.OAuth2Keycloak.From(map: it); } - if (it.TryGetValue("$id", out var idValue39) && idValue39?.ToString() == "oidc") + if (it.TryGetValue("$id", out var idValue40) && idValue40?.ToString() == "oidc") { return Appwrite.Models.OAuth2Oidc.From(map: it); } - if (it.TryGetValue("$id", out var idValue40) && idValue40?.ToString() == "apple") + if (it.TryGetValue("$id", out var idValue41) && idValue41?.ToString() == "apple") { return Appwrite.Models.OAuth2Apple.From(map: it); } - if (it.TryGetValue("$id", out var idValue41) && idValue41?.ToString() == "okta") + if (it.TryGetValue("$id", out var idValue42) && idValue42?.ToString() == "okta") { return Appwrite.Models.OAuth2Okta.From(map: it); } - if (it.TryGetValue("$id", out var idValue42) && idValue42?.ToString() == "kick") + if (it.TryGetValue("$id", out var idValue43) && idValue43?.ToString() == "kick") { return Appwrite.Models.OAuth2Kick.From(map: it); } - if (it.TryGetValue("$id", out var idValue43) && idValue43?.ToString() == "microsoft") + if (it.TryGetValue("$id", out var idValue44) && idValue44?.ToString() == "microsoft") { return Appwrite.Models.OAuth2Microsoft.From(map: it); } + if (it.TryGetValue("$id", out var idValue45) && idValue45?.ToString() == "tiktok") + { + return Appwrite.Models.OAuth2TikTok.From(map: it); + } + if (it.TryGetValue("$id", out var idValue46) && idValue46?.ToString() == "kakao") + { + return Appwrite.Models.OAuth2Kakao.From(map: it); + } throw new System.Exception("Unable to match response to any expected response model"); } @@ -2555,7 +2724,7 @@ static Models.PlatformList Convert(Dictionary it) /// which will interact with the Appwrite API. /// /// - public Task CreateAndroidPlatform(string platformId, string name, string applicationId) + public Task CreateAndroidPlatform(string platformId, string name, string applicationId, List? fingerprints = null) { var apiPath = "/project/platforms/android"; @@ -2563,7 +2732,8 @@ static Models.PlatformList Convert(Dictionary it) { { "platformId", platformId }, { "name", name }, - { "applicationId", applicationId } + { "applicationId", applicationId }, + { "fingerprints", fingerprints } }; var apiHeaders = new Dictionary() @@ -2590,18 +2760,24 @@ static Models.PlatformAndroid Convert(Dictionary it) /// /// Update an Android platform by its unique ID. Use this endpoint to update - /// the platform's name or application ID. + /// the platform's name, application ID or signing certificate fingerprints. /// /// - public Task UpdateAndroidPlatform(string platformId, string name, string applicationId) + public Task UpdateAndroidPlatform(string platformId, string name, string applicationId, List? fingerprints = null) { + if (platformId == "") + { + throw new AppwriteException("Missing required parameter: \"platformId\""); + } + var apiPath = "/project/platforms/android/{platformId}" .Replace("{platformId}", platformId); var apiParameters = new Dictionary() { { "name", name }, - { "applicationId", applicationId } + { "applicationId", applicationId }, + { "fingerprints", fingerprints } }; var apiHeaders = new Dictionary() @@ -2672,6 +2848,11 @@ static Models.PlatformApple Convert(Dictionary it) /// public Task UpdateApplePlatform(string platformId, string name, string bundleIdentifier) { + if (platformId == "") + { + throw new AppwriteException("Missing required parameter: \"platformId\""); + } + var apiPath = "/project/platforms/apple/{platformId}" .Replace("{platformId}", platformId); @@ -2749,6 +2930,11 @@ static Models.PlatformLinux Convert(Dictionary it) /// public Task UpdateLinuxPlatform(string platformId, string name, string packageName) { + if (platformId == "") + { + throw new AppwriteException("Missing required parameter: \"platformId\""); + } + var apiPath = "/project/platforms/linux/{platformId}" .Replace("{platformId}", platformId); @@ -2826,6 +3012,11 @@ static Models.PlatformWeb Convert(Dictionary it) /// public Task UpdateWebPlatform(string platformId, string name, string hostname) { + if (platformId == "") + { + throw new AppwriteException("Missing required parameter: \"platformId\""); + } + var apiPath = "/project/platforms/web/{platformId}" .Replace("{platformId}", platformId); @@ -2903,6 +3094,11 @@ static Models.PlatformWindows Convert(Dictionary it) /// public Task UpdateWindowsPlatform(string platformId, string name, string packageIdentifierName) { + if (platformId == "") + { + throw new AppwriteException("Missing required parameter: \"platformId\""); + } + var apiPath = "/project/platforms/windows/{platformId}" .Replace("{platformId}", platformId); @@ -2941,6 +3137,11 @@ static Models.PlatformWindows Convert(Dictionary it) /// public Task GetPlatform(string platformId) { + if (platformId == "") + { + throw new AppwriteException("Missing required parameter: \"platformId\""); + } + var apiPath = "/project/platforms/{platformId}" .Replace("{platformId}", platformId); @@ -2996,6 +3197,11 @@ static object Convert(Dictionary it) /// public Task DeletePlatform(string platformId) { + if (platformId == "") + { + throw new AppwriteException("Missing required parameter: \"platformId\""); + } + var apiPath = "/project/platforms/{platformId}" .Replace("{platformId}", platformId); @@ -3006,7 +3212,8 @@ public Task DeletePlatform(string platformId) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -3282,6 +3489,46 @@ static Models.Project Convert(Dictionary it) } + /// + /// Set the relying party ID passkeys are bound to: the domain of your + /// application. Passkeys work on the project's web platforms on that domain or + /// its subdomains, and on the domain itself for Apple apps. A localhost web + /// platform enables passkeys for local development without a relying party ID. + /// The relying party ID cannot change while users have passkeys, and any + /// change invalidates ceremonies in progress. + /// + /// + public Task UpdatePasskeyPolicy(string rpId) + { + var apiPath = "/project/policies/passkey"; + + var apiParameters = new Dictionary() + { + { "rpId", rpId } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.Project Convert(Dictionary it) + { + return Models.Project.From(map: it); + } + + return _client.Call( + method: "PATCH", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + /// /// Updating this policy allows you to control if new passwords are checked /// against most common passwords dictionary. When enabled, and user changes @@ -3400,6 +3647,88 @@ static Models.Project Convert(Dictionary it) } + /// + /// Updating this policy allows you to control if passwords are checked against + /// the Have I Been Pwned breach database. When enabled, every password a user + /// signs up, signs in or resets with is checked and the result is recorded on + /// the user as `passwordPwned`. On its own the policy only records. Enable + /// `users` to reject a breached password when a user signs up or sets a new + /// password, and `sessions` to refuse a sign-in with a breached password until + /// it is reset. Only the first five characters of the password hash are ever + /// shared with the service. Options left out keep their current value. + /// + /// + public Task UpdatePasswordPwnedPolicy(bool? enabled = null, bool? sessions = null, bool? users = null) + { + var apiPath = "/project/policies/password-pwned"; + + var apiParameters = new Dictionary() + { + { "enabled", enabled }, + { "sessions", sessions }, + { "users", users } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.Project Convert(Dictionary it) + { + return Models.Project.From(map: it); + } + + return _client.Call( + method: "PATCH", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Require a password reset when an email/password sign-in uses a password + /// older than the configured maximum age. Options left out keep their current + /// value. + /// + /// + public Task UpdatePasswordRotationPolicy(bool? enabled = null, long? maxAge = null) + { + var apiPath = "/project/policies/password-rotation"; + + var apiParameters = new Dictionary() + { + { "enabled", enabled }, + { "maxAge", maxAge } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.Project Convert(Dictionary it) + { + return Models.Project.From(map: it); + } + + return _client.Call( + method: "PATCH", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + /// /// Update the password strength requirements for users in the project. /// @@ -3663,50 +3992,62 @@ static object Convert(Dictionary it) { return Appwrite.Models.PolicyPasswordPersonalData.From(map: it); } - if (it.TryGetValue("$id", out var idValue5) && idValue5?.ToString() == "session-alert") + if (it.TryGetValue("$id", out var idValue5) && idValue5?.ToString() == "password-pwned") + { + return Appwrite.Models.PolicyPasswordPwned.From(map: it); + } + if (it.TryGetValue("$id", out var idValue6) && idValue6?.ToString() == "password-rotation") + { + return Appwrite.Models.PolicyPasswordRotation.From(map: it); + } + if (it.TryGetValue("$id", out var idValue7) && idValue7?.ToString() == "session-alert") { return Appwrite.Models.PolicySessionAlert.From(map: it); } - if (it.TryGetValue("$id", out var idValue6) && idValue6?.ToString() == "session-duration") + if (it.TryGetValue("$id", out var idValue8) && idValue8?.ToString() == "session-duration") { return Appwrite.Models.PolicySessionDuration.From(map: it); } - if (it.TryGetValue("$id", out var idValue7) && idValue7?.ToString() == "session-invalidation") + if (it.TryGetValue("$id", out var idValue9) && idValue9?.ToString() == "session-invalidation") { return Appwrite.Models.PolicySessionInvalidation.From(map: it); } - if (it.TryGetValue("$id", out var idValue8) && idValue8?.ToString() == "session-limit") + if (it.TryGetValue("$id", out var idValue10) && idValue10?.ToString() == "session-limit") { return Appwrite.Models.PolicySessionLimit.From(map: it); } - if (it.TryGetValue("$id", out var idValue9) && idValue9?.ToString() == "user-limit") + if (it.TryGetValue("$id", out var idValue11) && idValue11?.ToString() == "user-limit") { return Appwrite.Models.PolicyUserLimit.From(map: it); } - if (it.TryGetValue("$id", out var idValue10) && idValue10?.ToString() == "membership-privacy") + if (it.TryGetValue("$id", out var idValue12) && idValue12?.ToString() == "membership-privacy") { return Appwrite.Models.PolicyMembershipPrivacy.From(map: it); } - if (it.TryGetValue("$id", out var idValue11) && idValue11?.ToString() == "mfa-factors") + if (it.TryGetValue("$id", out var idValue13) && idValue13?.ToString() == "mfa-factors") { return Appwrite.Models.PolicyMfaFactors.From(map: it); } - if (it.TryGetValue("$id", out var idValue12) && idValue12?.ToString() == "deny-aliased-email") + if (it.TryGetValue("$id", out var idValue14) && idValue14?.ToString() == "deny-aliased-email") { return Appwrite.Models.PolicyDenyAliasedEmail.From(map: it); } - if (it.TryGetValue("$id", out var idValue13) && idValue13?.ToString() == "deny-disposable-email") + if (it.TryGetValue("$id", out var idValue15) && idValue15?.ToString() == "deny-disposable-email") { return Appwrite.Models.PolicyDenyDisposableEmail.From(map: it); } - if (it.TryGetValue("$id", out var idValue14) && idValue14?.ToString() == "deny-free-email") + if (it.TryGetValue("$id", out var idValue16) && idValue16?.ToString() == "deny-free-email") { return Appwrite.Models.PolicyDenyFreeEmail.From(map: it); } - if (it.TryGetValue("$id", out var idValue15) && idValue15?.ToString() == "deny-corporate-email") + if (it.TryGetValue("$id", out var idValue17) && idValue17?.ToString() == "deny-corporate-email") { return Appwrite.Models.PolicyDenyCorporateEmail.From(map: it); } + if (it.TryGetValue("$id", out var idValue18) && idValue18?.ToString() == "passkey") + { + return Appwrite.Models.PolicyPasskey.From(map: it); + } throw new System.Exception("Unable to match response to any expected response model"); } @@ -3855,7 +4196,8 @@ public Task CreateSMTPTest(List emails) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -4065,6 +4407,11 @@ static Models.Variable Convert(Dictionary it) /// public Task GetVariable(string variableId) { + if (variableId == "") + { + throw new AppwriteException("Missing required parameter: \"variableId\""); + } + var apiPath = "/project/variables/{variableId}" .Replace("{variableId}", variableId); @@ -4099,6 +4446,11 @@ static Models.Variable Convert(Dictionary it) /// public Task UpdateVariable(string variableId, string? key = null, string? @value = null, bool? secret = null) { + if (variableId == "") + { + throw new AppwriteException("Missing required parameter: \"variableId\""); + } + var apiPath = "/project/variables/{variableId}" .Replace("{variableId}", variableId); @@ -4137,6 +4489,11 @@ static Models.Variable Convert(Dictionary it) /// public Task DeleteVariable(string variableId) { + if (variableId == "") + { + throw new AppwriteException("Missing required parameter: \"variableId\""); + } + var apiPath = "/project/variables/{variableId}" .Replace("{variableId}", variableId); @@ -4147,7 +4504,8 @@ public Task DeleteVariable(string variableId) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; diff --git a/Appwrite/Services/Proxy.cs b/Appwrite/Services/Proxy.cs index b64feee0..59fb1392 100644 --- a/Appwrite/Services/Proxy.cs +++ b/Appwrite/Services/Proxy.cs @@ -19,6 +19,8 @@ public Proxy(Client client) : base(client) /// /// Depending on type, the invalidation purges a single cache tag, a single URL /// path, or all cached content for the domain. + /// + /// Domains that route to a function do not support cache invalidation. /// /// public Task CreateInvalidation(string domain, Appwrite.Enums.InvalidationType type, string? reference = null) @@ -257,6 +259,11 @@ static Models.ProxyRule Convert(Dictionary it) /// public Task GetRule(string ruleId) { + if (ruleId == "") + { + throw new AppwriteException("Missing required parameter: \"ruleId\""); + } + var apiPath = "/proxy/rules/{ruleId}" .Replace("{ruleId}", ruleId); @@ -291,6 +298,11 @@ static Models.ProxyRule Convert(Dictionary it) /// public Task DeleteRule(string ruleId) { + if (ruleId == "") + { + throw new AppwriteException("Missing required parameter: \"ruleId\""); + } + var apiPath = "/proxy/rules/{ruleId}" .Replace("{ruleId}", ruleId); @@ -301,7 +313,8 @@ public Task DeleteRule(string ruleId) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -323,6 +336,11 @@ public Task DeleteRule(string ruleId) /// public Task UpdateRuleStatus(string ruleId) { + if (ruleId == "") + { + throw new AppwriteException("Missing required parameter: \"ruleId\""); + } + var apiPath = "/proxy/rules/{ruleId}/status" .Replace("{ruleId}", ruleId); diff --git a/Appwrite/Services/Sites.cs b/Appwrite/Services/Sites.cs index b6a939cf..4ab5917d 100644 --- a/Appwrite/Services/Sites.cs +++ b/Appwrite/Services/Sites.cs @@ -113,12 +113,13 @@ static Models.Site Convert(Dictionary it) /// instance. /// /// - public Task ListFrameworks() + public Task ListFrameworks(bool? total = null) { var apiPath = "/sites/frameworks"; var apiParameters = new Dictionary() { + { "total", total } }; var apiHeaders = new Dictionary() @@ -146,13 +147,14 @@ static Models.FrameworkList Convert(Dictionary it) /// List allowed site specifications for this instance. /// /// - public Task ListSpecifications(string? type = null) + public Task ListSpecifications(string? type = null, bool? total = null) { var apiPath = "/sites/specifications"; var apiParameters = new Dictionary() { - { "type", type } + { "type", type }, + { "total", total } }; var apiHeaders = new Dictionary() @@ -182,6 +184,11 @@ static Models.SpecificationList Convert(Dictionary it) /// public Task Get(string siteId) { + if (siteId == "") + { + throw new AppwriteException("Missing required parameter: \"siteId\""); + } + var apiPath = "/sites/{siteId}" .Replace("{siteId}", siteId); @@ -216,6 +223,11 @@ static Models.Site Convert(Dictionary it) /// public Task Update(string siteId, string name, Appwrite.Enums.Framework framework, bool? enabled = null, bool? logging = null, long? timeout = null, string? installCommand = null, string? buildCommand = null, string? startCommand = null, string? outputDirectory = null, Appwrite.Enums.BuildRuntime? buildRuntime = null, Appwrite.Enums.Adapter? adapter = null, string? fallbackFile = null, string? installationId = null, string? providerRepositoryId = null, string? providerBranch = null, bool? providerSilentMode = null, string? providerRootDirectory = null, List? providerBranches = null, List? providerPaths = null, string? buildSpecification = null, string? runtimeSpecification = null, long? deploymentRetention = null, List? scopes = null) { + if (siteId == "") + { + throw new AppwriteException("Missing required parameter: \"siteId\""); + } + var apiPath = "/sites/{siteId}" .Replace("{siteId}", siteId); @@ -274,6 +286,11 @@ static Models.Site Convert(Dictionary it) /// public Task Delete(string siteId) { + if (siteId == "") + { + throw new AppwriteException("Missing required parameter: \"siteId\""); + } + var apiPath = "/sites/{siteId}" .Replace("{siteId}", siteId); @@ -284,7 +301,8 @@ public Task Delete(string siteId) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -304,6 +322,11 @@ public Task Delete(string siteId) /// public Task UpdateSiteDeployment(string siteId, string deploymentId) { + if (siteId == "") + { + throw new AppwriteException("Missing required parameter: \"siteId\""); + } + var apiPath = "/sites/{siteId}/deployment" .Replace("{siteId}", siteId); @@ -341,6 +364,11 @@ static Models.Site Convert(Dictionary it) /// public Task ListDeployments(string siteId, List? queries = null, string? search = null, bool? total = null) { + if (siteId == "") + { + throw new AppwriteException("Missing required parameter: \"siteId\""); + } + var apiPath = "/sites/{siteId}/deployments" .Replace("{siteId}", siteId); @@ -380,6 +408,11 @@ static Models.DeploymentList Convert(Dictionary it) /// public Task CreateDeployment(string siteId, InputFile code, string? installCommand = null, string? buildCommand = null, string? outputDirectory = null, bool? activate = null, Action? onProgress = null) { + if (siteId == "") + { + throw new AppwriteException("Missing required parameter: \"siteId\""); + } + var apiPath = "/sites/{siteId}/deployments" .Replace("{siteId}", siteId); @@ -416,7 +449,8 @@ static Models.Deployment Convert(Dictionary it) Convert, paramName, idParamName, - onProgress); + onProgress, + method: "POST"); } /// @@ -429,6 +463,11 @@ static Models.Deployment Convert(Dictionary it) /// public Task CreateDuplicateDeployment(string siteId, string deploymentId) { + if (siteId == "") + { + throw new AppwriteException("Missing required parameter: \"siteId\""); + } + var apiPath = "/sites/{siteId}/deployments/duplicate" .Replace("{siteId}", siteId); @@ -469,6 +508,11 @@ static Models.Deployment Convert(Dictionary it) /// public Task CreateTemplateDeployment(string siteId, string repository, string owner, string rootDirectory, Appwrite.Enums.TemplateReferenceType type, string reference, bool? activate = null) { + if (siteId == "") + { + throw new AppwriteException("Missing required parameter: \"siteId\""); + } + var apiPath = "/sites/{siteId}/deployments/template" .Replace("{siteId}", siteId); @@ -512,6 +556,11 @@ static Models.Deployment Convert(Dictionary it) /// public Task CreateVcsDeployment(string siteId, Appwrite.Enums.VCSReferenceType type, string reference, bool? activate = null) { + if (siteId == "") + { + throw new AppwriteException("Missing required parameter: \"siteId\""); + } + var apiPath = "/sites/{siteId}/deployments/vcs" .Replace("{siteId}", siteId); @@ -550,6 +599,16 @@ static Models.Deployment Convert(Dictionary it) /// public Task GetDeployment(string siteId, string deploymentId) { + if (siteId == "") + { + throw new AppwriteException("Missing required parameter: \"siteId\""); + } + + if (deploymentId == "") + { + throw new AppwriteException("Missing required parameter: \"deploymentId\""); + } + var apiPath = "/sites/{siteId}/deployments/{deploymentId}" .Replace("{siteId}", siteId) .Replace("{deploymentId}", deploymentId); @@ -585,6 +644,16 @@ static Models.Deployment Convert(Dictionary it) /// public Task DeleteDeployment(string siteId, string deploymentId) { + if (siteId == "") + { + throw new AppwriteException("Missing required parameter: \"siteId\""); + } + + if (deploymentId == "") + { + throw new AppwriteException("Missing required parameter: \"deploymentId\""); + } + var apiPath = "/sites/{siteId}/deployments/{deploymentId}" .Replace("{siteId}", siteId) .Replace("{deploymentId}", deploymentId); @@ -596,7 +665,8 @@ public Task DeleteDeployment(string siteId, string deploymentId) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -617,6 +687,16 @@ public Task DeleteDeployment(string siteId, string deploymentId) /// public Task GetDeploymentDownload(string siteId, string deploymentId, Appwrite.Enums.DeploymentDownloadType? type = null, string? token = null) { + if (siteId == "") + { + throw new AppwriteException("Missing required parameter: \"siteId\""); + } + + if (deploymentId == "") + { + throw new AppwriteException("Missing required parameter: \"deploymentId\""); + } + var apiPath = "/sites/{siteId}/deployments/{deploymentId}/download" .Replace("{siteId}", siteId) .Replace("{deploymentId}", deploymentId); @@ -653,6 +733,16 @@ public Task GetDeploymentDownload(string siteId, string deploymentId, Ap /// public Task UpdateDeploymentStatus(string siteId, string deploymentId) { + if (siteId == "") + { + throw new AppwriteException("Missing required parameter: \"siteId\""); + } + + if (deploymentId == "") + { + throw new AppwriteException("Missing required parameter: \"deploymentId\""); + } + var apiPath = "/sites/{siteId}/deployments/{deploymentId}/status" .Replace("{siteId}", siteId) .Replace("{deploymentId}", deploymentId); @@ -690,6 +780,11 @@ static Models.Deployment Convert(Dictionary it) /// public Task ListLogs(string siteId, List? queries = null, bool? total = null) { + if (siteId == "") + { + throw new AppwriteException("Missing required parameter: \"siteId\""); + } + var apiPath = "/sites/{siteId}/logs" .Replace("{siteId}", siteId); @@ -726,6 +821,16 @@ static Models.ExecutionList Convert(Dictionary it) /// public Task GetLog(string siteId, string logId) { + if (siteId == "") + { + throw new AppwriteException("Missing required parameter: \"siteId\""); + } + + if (logId == "") + { + throw new AppwriteException("Missing required parameter: \"logId\""); + } + var apiPath = "/sites/{siteId}/logs/{logId}" .Replace("{siteId}", siteId) .Replace("{logId}", logId); @@ -761,6 +866,16 @@ static Models.Execution Convert(Dictionary it) /// public Task DeleteLog(string siteId, string logId) { + if (siteId == "") + { + throw new AppwriteException("Missing required parameter: \"siteId\""); + } + + if (logId == "") + { + throw new AppwriteException("Missing required parameter: \"logId\""); + } + var apiPath = "/sites/{siteId}/logs/{logId}" .Replace("{siteId}", siteId) .Replace("{logId}", logId); @@ -792,6 +907,11 @@ public Task DeleteLog(string siteId, string logId) /// public Task ListVariables(string siteId, List? queries = null, bool? total = null) { + if (siteId == "") + { + throw new AppwriteException("Missing required parameter: \"siteId\""); + } + var apiPath = "/sites/{siteId}/variables" .Replace("{siteId}", siteId); @@ -829,6 +949,11 @@ static Models.VariableList Convert(Dictionary it) /// public Task CreateVariable(string siteId, string variableId, string key, string @value, bool? secret = null) { + if (siteId == "") + { + throw new AppwriteException("Missing required parameter: \"siteId\""); + } + var apiPath = "/sites/{siteId}/variables" .Replace("{siteId}", siteId); @@ -868,6 +993,16 @@ static Models.Variable Convert(Dictionary it) /// public Task GetVariable(string siteId, string variableId) { + if (siteId == "") + { + throw new AppwriteException("Missing required parameter: \"siteId\""); + } + + if (variableId == "") + { + throw new AppwriteException("Missing required parameter: \"variableId\""); + } + var apiPath = "/sites/{siteId}/variables/{variableId}" .Replace("{siteId}", siteId) .Replace("{variableId}", variableId); @@ -903,6 +1038,16 @@ static Models.Variable Convert(Dictionary it) /// public Task UpdateVariable(string siteId, string variableId, string? key = null, string? @value = null, bool? secret = null) { + if (siteId == "") + { + throw new AppwriteException("Missing required parameter: \"siteId\""); + } + + if (variableId == "") + { + throw new AppwriteException("Missing required parameter: \"variableId\""); + } + var apiPath = "/sites/{siteId}/variables/{variableId}" .Replace("{siteId}", siteId) .Replace("{variableId}", variableId); @@ -942,6 +1087,16 @@ static Models.Variable Convert(Dictionary it) /// public Task DeleteVariable(string siteId, string variableId) { + if (siteId == "") + { + throw new AppwriteException("Missing required parameter: \"siteId\""); + } + + if (variableId == "") + { + throw new AppwriteException("Missing required parameter: \"variableId\""); + } + var apiPath = "/sites/{siteId}/variables/{variableId}" .Replace("{siteId}", siteId) .Replace("{variableId}", variableId); @@ -953,7 +1108,8 @@ public Task DeleteVariable(string siteId, string variableId) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; diff --git a/Appwrite/Services/Storage.cs b/Appwrite/Services/Storage.cs index 0e6a1ebe..25d8457c 100644 --- a/Appwrite/Services/Storage.cs +++ b/Appwrite/Services/Storage.cs @@ -102,6 +102,11 @@ static Models.Bucket Convert(Dictionary it) /// public Task GetBucket(string bucketId) { + if (bucketId == "") + { + throw new AppwriteException("Missing required parameter: \"bucketId\""); + } + var apiPath = "/storage/buckets/{bucketId}" .Replace("{bucketId}", bucketId); @@ -136,6 +141,11 @@ static Models.Bucket Convert(Dictionary it) /// public Task UpdateBucket(string bucketId, string name, List? permissions = null, bool? fileSecurity = null, bool? enabled = null, long? maximumFileSize = null, List? allowedFileExtensions = null, Appwrite.Enums.Compression? compression = null, bool? encryption = null, bool? antivirus = null, bool? transformations = null) { + if (bucketId == "") + { + throw new AppwriteException("Missing required parameter: \"bucketId\""); + } + var apiPath = "/storage/buckets/{bucketId}" .Replace("{bucketId}", bucketId); @@ -181,6 +191,11 @@ static Models.Bucket Convert(Dictionary it) /// public Task DeleteBucket(string bucketId) { + if (bucketId == "") + { + throw new AppwriteException("Missing required parameter: \"bucketId\""); + } + var apiPath = "/storage/buckets/{bucketId}" .Replace("{bucketId}", bucketId); @@ -191,7 +206,8 @@ public Task DeleteBucket(string bucketId) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -211,6 +227,11 @@ public Task DeleteBucket(string bucketId) /// public Task ListFiles(string bucketId, List? queries = null, string? search = null, bool? total = null) { + if (bucketId == "") + { + throw new AppwriteException("Missing required parameter: \"bucketId\""); + } + var apiPath = "/storage/buckets/{bucketId}/files" .Replace("{bucketId}", bucketId); @@ -265,6 +286,11 @@ static Models.FileList Convert(Dictionary it) /// public Task CreateFile(string bucketId, string fileId, InputFile file, List? permissions = null, string? folder = null, Action? onProgress = null) { + if (bucketId == "") + { + throw new AppwriteException("Missing required parameter: \"bucketId\""); + } + var apiPath = "/storage/buckets/{bucketId}/files" .Replace("{bucketId}", bucketId); @@ -300,7 +326,8 @@ static Models.File Convert(Dictionary it) Convert, paramName, idParamName, - onProgress); + onProgress, + method: "POST"); } /// @@ -310,6 +337,16 @@ static Models.File Convert(Dictionary it) /// public Task GetFile(string bucketId, string fileId) { + if (bucketId == "") + { + throw new AppwriteException("Missing required parameter: \"bucketId\""); + } + + if (fileId == "") + { + throw new AppwriteException("Missing required parameter: \"fileId\""); + } + var apiPath = "/storage/buckets/{bucketId}/files/{fileId}" .Replace("{bucketId}", bucketId) .Replace("{fileId}", fileId); @@ -346,6 +383,16 @@ static Models.File Convert(Dictionary it) /// public Task UpdateFile(string bucketId, string fileId, string? name = null, List? permissions = null) { + if (bucketId == "") + { + throw new AppwriteException("Missing required parameter: \"bucketId\""); + } + + if (fileId == "") + { + throw new AppwriteException("Missing required parameter: \"fileId\""); + } + var apiPath = "/storage/buckets/{bucketId}/files/{fileId}" .Replace("{bucketId}", bucketId) .Replace("{fileId}", fileId); @@ -385,6 +432,16 @@ static Models.File Convert(Dictionary it) /// public Task DeleteFile(string bucketId, string fileId) { + if (bucketId == "") + { + throw new AppwriteException("Missing required parameter: \"bucketId\""); + } + + if (fileId == "") + { + throw new AppwriteException("Missing required parameter: \"fileId\""); + } + var apiPath = "/storage/buckets/{bucketId}/files/{fileId}" .Replace("{bucketId}", bucketId) .Replace("{fileId}", fileId); @@ -396,7 +453,8 @@ public Task DeleteFile(string bucketId, string fileId) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -417,6 +475,16 @@ public Task DeleteFile(string bucketId, string fileId) /// public Task GetFileDownload(string bucketId, string fileId, string? token = null) { + if (bucketId == "") + { + throw new AppwriteException("Missing required parameter: \"bucketId\""); + } + + if (fileId == "") + { + throw new AppwriteException("Missing required parameter: \"fileId\""); + } + var apiPath = "/storage/buckets/{bucketId}/files/{fileId}/download" .Replace("{bucketId}", bucketId) .Replace("{fileId}", fileId); @@ -452,6 +520,16 @@ public Task GetFileDownload(string bucketId, string fileId, string? toke /// public Task GetFilePreview(string bucketId, string fileId, long? width = null, long? height = null, Appwrite.Enums.ImageGravity? gravity = null, long? quality = null, long? borderWidth = null, string? borderColor = null, long? borderRadius = null, double? opacity = null, long? rotation = null, string? background = null, Appwrite.Enums.ImageFormat? output = null, string? token = null) { + if (bucketId == "") + { + throw new AppwriteException("Missing required parameter: \"bucketId\""); + } + + if (fileId == "") + { + throw new AppwriteException("Missing required parameter: \"fileId\""); + } + var apiPath = "/storage/buckets/{bucketId}/files/{fileId}/preview" .Replace("{bucketId}", bucketId) .Replace("{fileId}", fileId); @@ -496,6 +574,16 @@ public Task GetFilePreview(string bucketId, string fileId, long? width = /// public Task GetFileView(string bucketId, string fileId, string? token = null) { + if (bucketId == "") + { + throw new AppwriteException("Missing required parameter: \"bucketId\""); + } + + if (fileId == "") + { + throw new AppwriteException("Missing required parameter: \"fileId\""); + } + var apiPath = "/storage/buckets/{bucketId}/files/{fileId}/view" .Replace("{bucketId}", bucketId) .Replace("{fileId}", fileId); diff --git a/Appwrite/Services/TablesDB.cs b/Appwrite/Services/TablesDB.cs index 51327851..9ede1f9a 100644 --- a/Appwrite/Services/TablesDB.cs +++ b/Appwrite/Services/TablesDB.cs @@ -93,8 +93,8 @@ static Models.Database Convert(Dictionary it) /// /// List the dedicated database specifications available on the current plan. - /// Each specification reports its resource limits, pricing, and whether it is - /// enabled for the organization. + /// Each specification reports its resource limits, its own prices and overage + /// rates, and whether it is enabled for the organization. /// /// public Task ListSpecifications() @@ -130,13 +130,14 @@ static Models.DedicatedDatabaseSpecificationList Convert(Dictionary /// - public Task ListTransactions(List? queries = null) + public Task ListTransactions(List? queries = null, bool? total = null) { var apiPath = "/tablesdb/transactions"; var apiParameters = new Dictionary() { - { "queries", queries } + { "queries", queries }, + { "total", total } }; var apiHeaders = new Dictionary() @@ -201,6 +202,11 @@ static Models.Transaction Convert(Dictionary it) /// public Task GetTransaction(string transactionId) { + if (transactionId == "") + { + throw new AppwriteException("Missing required parameter: \"transactionId\""); + } + var apiPath = "/tablesdb/transactions/{transactionId}" .Replace("{transactionId}", transactionId); @@ -235,6 +241,11 @@ static Models.Transaction Convert(Dictionary it) /// public Task UpdateTransaction(string transactionId, bool? commit = null, bool? rollback = null) { + if (transactionId == "") + { + throw new AppwriteException("Missing required parameter: \"transactionId\""); + } + var apiPath = "/tablesdb/transactions/{transactionId}" .Replace("{transactionId}", transactionId); @@ -272,6 +283,11 @@ static Models.Transaction Convert(Dictionary it) /// public Task DeleteTransaction(string transactionId) { + if (transactionId == "") + { + throw new AppwriteException("Missing required parameter: \"transactionId\""); + } + var apiPath = "/tablesdb/transactions/{transactionId}" .Replace("{transactionId}", transactionId); @@ -282,7 +298,8 @@ public Task DeleteTransaction(string transactionId) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -301,6 +318,11 @@ public Task DeleteTransaction(string transactionId) /// public Task CreateOperations(string transactionId, List? operations = null) { + if (transactionId == "") + { + throw new AppwriteException("Missing required parameter: \"transactionId\""); + } + var apiPath = "/tablesdb/transactions/{transactionId}/operations" .Replace("{transactionId}", transactionId); @@ -338,6 +360,11 @@ static Models.Transaction Convert(Dictionary it) /// public Task Get(string databaseId) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/tablesdb/{databaseId}" .Replace("{databaseId}", databaseId); @@ -372,6 +399,11 @@ static Models.Database Convert(Dictionary it) /// public Task Update(string databaseId, string? name = null, bool? enabled = null, string? specification = null, long? replicas = null, string? syncMode = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/tablesdb/{databaseId}" .Replace("{databaseId}", databaseId); @@ -413,6 +445,11 @@ static Models.Database Convert(Dictionary it) /// public Task Delete(string databaseId) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/tablesdb/{databaseId}" .Replace("{databaseId}", databaseId); @@ -423,7 +460,8 @@ public Task Delete(string databaseId) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -450,6 +488,11 @@ public Task Delete(string databaseId) /// public Task CreateFailover(string databaseId, string? targetReplicaId = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/tablesdb/{databaseId}/failovers" .Replace("{databaseId}", databaseId); @@ -487,6 +530,11 @@ static Models.DedicatedDatabase Convert(Dictionary it) /// public Task ListMigrations(string databaseId) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/tablesdb/{databaseId}/migrations" .Replace("{databaseId}", databaseId); @@ -523,6 +571,11 @@ static Models.DatabaseMigrationList Convert(Dictionary it) /// public Task CreateMigration(string databaseId, string specification, bool? autoCutover = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/tablesdb/{databaseId}/migrations" .Replace("{databaseId}", databaseId); @@ -560,6 +613,16 @@ static Models.DatabaseMigration Convert(Dictionary it) /// public Task GetMigration(string databaseId, string migrationId) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (migrationId == "") + { + throw new AppwriteException("Missing required parameter: \"migrationId\""); + } + var apiPath = "/tablesdb/{databaseId}/migrations/{migrationId}" .Replace("{databaseId}", databaseId) .Replace("{migrationId}", migrationId); @@ -596,6 +659,16 @@ static Models.DatabaseMigration Convert(Dictionary it) /// public Task DeleteMigration(string databaseId, string migrationId) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (migrationId == "") + { + throw new AppwriteException("Missing required parameter: \"migrationId\""); + } + var apiPath = "/tablesdb/{databaseId}/migrations/{migrationId}" .Replace("{databaseId}", databaseId) .Replace("{migrationId}", migrationId); @@ -632,6 +705,16 @@ public Task DeleteMigration(string databaseId, string migrationId) /// public Task CreateCutover(string databaseId, string migrationId) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (migrationId == "") + { + throw new AppwriteException("Missing required parameter: \"migrationId\""); + } + var apiPath = "/tablesdb/{databaseId}/migrations/{migrationId}/cutovers" .Replace("{databaseId}", databaseId) .Replace("{migrationId}", migrationId); @@ -671,6 +754,11 @@ static Models.DatabaseMigration Convert(Dictionary it) /// public Task ListOperations(string databaseId, string? status = null, long? limit = null, long? offset = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/tablesdb/{databaseId}/operations" .Replace("{databaseId}", databaseId); @@ -709,6 +797,11 @@ static Models.DedicatedDatabaseOperationList Convert(Dictionary /// public Task GetReplicas(string databaseId) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/tablesdb/{databaseId}/replicas" .Replace("{databaseId}", databaseId); @@ -745,6 +838,11 @@ static Models.DedicatedDatabaseReplicas Convert(Dictionary it) /// public Task GetStatus(string databaseId) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/tablesdb/{databaseId}/status" .Replace("{databaseId}", databaseId); @@ -780,6 +878,11 @@ static Models.DatabaseStatus Convert(Dictionary it) /// public Task ListTables(string databaseId, List? queries = null, string? search = null, bool? total = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/tablesdb/{databaseId}/tables" .Replace("{databaseId}", databaseId); @@ -820,6 +923,11 @@ static Models.TableList Convert(Dictionary it) /// public Task CreateTable(string databaseId, string tableId, string name, List? permissions = null, bool? rowSecurity = null, bool? enabled = null, List? columns = null, List? indexes = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/tablesdb/{databaseId}/tables" .Replace("{databaseId}", databaseId); @@ -863,6 +971,16 @@ static Models.Table Convert(Dictionary it) /// public Task GetTable(string databaseId, string tableId) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (tableId == "") + { + throw new AppwriteException("Missing required parameter: \"tableId\""); + } + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}" .Replace("{databaseId}", databaseId) .Replace("{tableId}", tableId); @@ -898,6 +1016,16 @@ static Models.Table Convert(Dictionary it) /// public Task UpdateTable(string databaseId, string tableId, string? name = null, List? permissions = null, bool? rowSecurity = null, bool? enabled = null, bool? purge = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (tableId == "") + { + throw new AppwriteException("Missing required parameter: \"tableId\""); + } + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}" .Replace("{databaseId}", databaseId) .Replace("{tableId}", tableId); @@ -940,6 +1068,16 @@ static Models.Table Convert(Dictionary it) /// public Task DeleteTable(string databaseId, string tableId) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (tableId == "") + { + throw new AppwriteException("Missing required parameter: \"tableId\""); + } + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}" .Replace("{databaseId}", databaseId) .Replace("{tableId}", tableId); @@ -951,7 +1089,8 @@ public Task DeleteTable(string databaseId, string tableId) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -970,6 +1109,16 @@ public Task DeleteTable(string databaseId, string tableId) /// public Task ListColumns(string databaseId, string tableId, List? queries = null, bool? total = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (tableId == "") + { + throw new AppwriteException("Missing required parameter: \"tableId\""); + } + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns" .Replace("{databaseId}", databaseId) .Replace("{tableId}", tableId); @@ -1009,6 +1158,16 @@ static Models.ColumnList Convert(Dictionary it) /// public Task CreateBigIntColumn(string databaseId, string tableId, string key, bool required, long? min = null, long? max = null, long? @default = null, bool? array = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (tableId == "") + { + throw new AppwriteException("Missing required parameter: \"tableId\""); + } + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/bigint" .Replace("{databaseId}", databaseId) .Replace("{tableId}", tableId); @@ -1053,6 +1212,21 @@ static Models.ColumnBigint Convert(Dictionary it) /// public Task UpdateBigIntColumn(string databaseId, string tableId, string key, bool required, long @default, long? min = null, long? max = null, string? newKey = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (tableId == "") + { + throw new AppwriteException("Missing required parameter: \"tableId\""); + } + + if (key == "") + { + throw new AppwriteException("Missing required parameter: \"key\""); + } + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/bigint/{key}" .Replace("{databaseId}", databaseId) .Replace("{tableId}", tableId) @@ -1096,6 +1270,16 @@ static Models.ColumnBigint Convert(Dictionary it) /// public Task CreateBooleanColumn(string databaseId, string tableId, string key, bool required, bool? @default = null, bool? array = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (tableId == "") + { + throw new AppwriteException("Missing required parameter: \"tableId\""); + } + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/boolean" .Replace("{databaseId}", databaseId) .Replace("{tableId}", tableId); @@ -1137,6 +1321,21 @@ static Models.ColumnBoolean Convert(Dictionary it) /// public Task UpdateBooleanColumn(string databaseId, string tableId, string key, bool required, bool @default, string? newKey = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (tableId == "") + { + throw new AppwriteException("Missing required parameter: \"tableId\""); + } + + if (key == "") + { + throw new AppwriteException("Missing required parameter: \"key\""); + } + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/boolean/{key}" .Replace("{databaseId}", databaseId) .Replace("{tableId}", tableId) @@ -1177,6 +1376,16 @@ static Models.ColumnBoolean Convert(Dictionary it) /// public Task CreateDatetimeColumn(string databaseId, string tableId, string key, bool required, string? @default = null, bool? array = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (tableId == "") + { + throw new AppwriteException("Missing required parameter: \"tableId\""); + } + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/datetime" .Replace("{databaseId}", databaseId) .Replace("{tableId}", tableId); @@ -1218,6 +1427,21 @@ static Models.ColumnDatetime Convert(Dictionary it) /// public Task UpdateDatetimeColumn(string databaseId, string tableId, string key, bool required, string @default, string? newKey = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (tableId == "") + { + throw new AppwriteException("Missing required parameter: \"tableId\""); + } + + if (key == "") + { + throw new AppwriteException("Missing required parameter: \"key\""); + } + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/datetime/{key}" .Replace("{databaseId}", databaseId) .Replace("{tableId}", tableId) @@ -1259,6 +1483,16 @@ static Models.ColumnDatetime Convert(Dictionary it) /// public Task CreateEmailColumn(string databaseId, string tableId, string key, bool required, string? @default = null, bool? array = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (tableId == "") + { + throw new AppwriteException("Missing required parameter: \"tableId\""); + } + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/email" .Replace("{databaseId}", databaseId) .Replace("{tableId}", tableId); @@ -1301,6 +1535,21 @@ static Models.ColumnEmail Convert(Dictionary it) /// public Task UpdateEmailColumn(string databaseId, string tableId, string key, bool required, string @default, string? newKey = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (tableId == "") + { + throw new AppwriteException("Missing required parameter: \"tableId\""); + } + + if (key == "") + { + throw new AppwriteException("Missing required parameter: \"key\""); + } + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/email/{key}" .Replace("{databaseId}", databaseId) .Replace("{tableId}", tableId) @@ -1342,6 +1591,16 @@ static Models.ColumnEmail Convert(Dictionary it) /// public Task CreateEnumColumn(string databaseId, string tableId, string key, List elements, bool required, string? @default = null, bool? array = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (tableId == "") + { + throw new AppwriteException("Missing required parameter: \"tableId\""); + } + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/enum" .Replace("{databaseId}", databaseId) .Replace("{tableId}", tableId); @@ -1385,6 +1644,21 @@ static Models.ColumnEnum Convert(Dictionary it) /// public Task UpdateEnumColumn(string databaseId, string tableId, string key, List elements, bool required, string @default, string? newKey = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (tableId == "") + { + throw new AppwriteException("Missing required parameter: \"tableId\""); + } + + if (key == "") + { + throw new AppwriteException("Missing required parameter: \"key\""); + } + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/enum/{key}" .Replace("{databaseId}", databaseId) .Replace("{tableId}", tableId) @@ -1428,6 +1702,16 @@ static Models.ColumnEnum Convert(Dictionary it) /// public Task CreateFloatColumn(string databaseId, string tableId, string key, bool required, double? min = null, double? max = null, double? @default = null, bool? array = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (tableId == "") + { + throw new AppwriteException("Missing required parameter: \"tableId\""); + } + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/float" .Replace("{databaseId}", databaseId) .Replace("{tableId}", tableId); @@ -1472,6 +1756,21 @@ static Models.ColumnFloat Convert(Dictionary it) /// public Task UpdateFloatColumn(string databaseId, string tableId, string key, bool required, double @default, double? min = null, double? max = null, string? newKey = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (tableId == "") + { + throw new AppwriteException("Missing required parameter: \"tableId\""); + } + + if (key == "") + { + throw new AppwriteException("Missing required parameter: \"key\""); + } + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/float/{key}" .Replace("{databaseId}", databaseId) .Replace("{tableId}", tableId) @@ -1516,6 +1815,16 @@ static Models.ColumnFloat Convert(Dictionary it) /// public Task CreateIntegerColumn(string databaseId, string tableId, string key, bool required, long? min = null, long? max = null, long? @default = null, bool? array = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (tableId == "") + { + throw new AppwriteException("Missing required parameter: \"tableId\""); + } + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/integer" .Replace("{databaseId}", databaseId) .Replace("{tableId}", tableId); @@ -1560,6 +1869,21 @@ static Models.ColumnInteger Convert(Dictionary it) /// public Task UpdateIntegerColumn(string databaseId, string tableId, string key, bool required, long @default, long? min = null, long? max = null, string? newKey = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (tableId == "") + { + throw new AppwriteException("Missing required parameter: \"tableId\""); + } + + if (key == "") + { + throw new AppwriteException("Missing required parameter: \"key\""); + } + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/integer/{key}" .Replace("{databaseId}", databaseId) .Replace("{tableId}", tableId) @@ -1603,6 +1927,16 @@ static Models.ColumnInteger Convert(Dictionary it) /// public Task CreateIpColumn(string databaseId, string tableId, string key, bool required, string? @default = null, bool? array = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (tableId == "") + { + throw new AppwriteException("Missing required parameter: \"tableId\""); + } + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/ip" .Replace("{databaseId}", databaseId) .Replace("{tableId}", tableId); @@ -1645,6 +1979,21 @@ static Models.ColumnIp Convert(Dictionary it) /// public Task UpdateIpColumn(string databaseId, string tableId, string key, bool required, string @default, string? newKey = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (tableId == "") + { + throw new AppwriteException("Missing required parameter: \"tableId\""); + } + + if (key == "") + { + throw new AppwriteException("Missing required parameter: \"key\""); + } + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/ip/{key}" .Replace("{databaseId}", databaseId) .Replace("{tableId}", tableId) @@ -1685,6 +2034,16 @@ static Models.ColumnIp Convert(Dictionary it) /// public Task CreateLineColumn(string databaseId, string tableId, string key, bool required, List>? @default = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (tableId == "") + { + throw new AppwriteException("Missing required parameter: \"tableId\""); + } + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/line" .Replace("{databaseId}", databaseId) .Replace("{tableId}", tableId); @@ -1725,6 +2084,21 @@ static Models.ColumnLine Convert(Dictionary it) /// public Task UpdateLineColumn(string databaseId, string tableId, string key, bool required, List>? @default = null, string? newKey = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (tableId == "") + { + throw new AppwriteException("Missing required parameter: \"tableId\""); + } + + if (key == "") + { + throw new AppwriteException("Missing required parameter: \"key\""); + } + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/line/{key}" .Replace("{databaseId}", databaseId) .Replace("{tableId}", tableId) @@ -1766,6 +2140,16 @@ static Models.ColumnLine Convert(Dictionary it) /// public Task CreateLongtextColumn(string databaseId, string tableId, string key, bool required, string? @default = null, bool? array = null, bool? encrypt = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (tableId == "") + { + throw new AppwriteException("Missing required parameter: \"tableId\""); + } + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/longtext" .Replace("{databaseId}", databaseId) .Replace("{tableId}", tableId); @@ -1809,6 +2193,21 @@ static Models.ColumnLongtext Convert(Dictionary it) /// public Task UpdateLongtextColumn(string databaseId, string tableId, string key, bool required, string @default, string? newKey = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (tableId == "") + { + throw new AppwriteException("Missing required parameter: \"tableId\""); + } + + if (key == "") + { + throw new AppwriteException("Missing required parameter: \"key\""); + } + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/longtext/{key}" .Replace("{databaseId}", databaseId) .Replace("{tableId}", tableId) @@ -1850,6 +2249,16 @@ static Models.ColumnLongtext Convert(Dictionary it) /// public Task CreateMediumtextColumn(string databaseId, string tableId, string key, bool required, string? @default = null, bool? array = null, bool? encrypt = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (tableId == "") + { + throw new AppwriteException("Missing required parameter: \"tableId\""); + } + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/mediumtext" .Replace("{databaseId}", databaseId) .Replace("{tableId}", tableId); @@ -1893,11 +2302,26 @@ static Models.ColumnMediumtext Convert(Dictionary it) /// public Task UpdateMediumtextColumn(string databaseId, string tableId, string key, bool required, string @default, string? newKey = null) { - var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/mediumtext/{key}" - .Replace("{databaseId}", databaseId) - .Replace("{tableId}", tableId) - .Replace("{key}", key); - + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (tableId == "") + { + throw new AppwriteException("Missing required parameter: \"tableId\""); + } + + if (key == "") + { + throw new AppwriteException("Missing required parameter: \"key\""); + } + + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/mediumtext/{key}" + .Replace("{databaseId}", databaseId) + .Replace("{tableId}", tableId) + .Replace("{key}", key); + var apiParameters = new Dictionary() { { "required", required }, @@ -1933,6 +2357,16 @@ static Models.ColumnMediumtext Convert(Dictionary it) /// public Task CreatePointColumn(string databaseId, string tableId, string key, bool required, List? @default = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (tableId == "") + { + throw new AppwriteException("Missing required parameter: \"tableId\""); + } + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/point" .Replace("{databaseId}", databaseId) .Replace("{tableId}", tableId); @@ -1973,6 +2407,21 @@ static Models.ColumnPoint Convert(Dictionary it) /// public Task UpdatePointColumn(string databaseId, string tableId, string key, bool required, List? @default = null, string? newKey = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (tableId == "") + { + throw new AppwriteException("Missing required parameter: \"tableId\""); + } + + if (key == "") + { + throw new AppwriteException("Missing required parameter: \"key\""); + } + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/point/{key}" .Replace("{databaseId}", databaseId) .Replace("{tableId}", tableId) @@ -2013,6 +2462,16 @@ static Models.ColumnPoint Convert(Dictionary it) /// public Task CreatePolygonColumn(string databaseId, string tableId, string key, bool required, List>? @default = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (tableId == "") + { + throw new AppwriteException("Missing required parameter: \"tableId\""); + } + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/polygon" .Replace("{databaseId}", databaseId) .Replace("{tableId}", tableId); @@ -2053,6 +2512,21 @@ static Models.ColumnPolygon Convert(Dictionary it) /// public Task UpdatePolygonColumn(string databaseId, string tableId, string key, bool required, List>? @default = null, string? newKey = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (tableId == "") + { + throw new AppwriteException("Missing required parameter: \"tableId\""); + } + + if (key == "") + { + throw new AppwriteException("Missing required parameter: \"key\""); + } + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/polygon/{key}" .Replace("{databaseId}", databaseId) .Replace("{tableId}", tableId) @@ -2095,6 +2569,16 @@ static Models.ColumnPolygon Convert(Dictionary it) /// public Task CreateRelationshipColumn(string databaseId, string tableId, string relatedTableId, Appwrite.Enums.RelationshipType type, bool? twoWay = null, string? key = null, string? twoWayKey = null, Appwrite.Enums.RelationMutate? onDelete = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (tableId == "") + { + throw new AppwriteException("Missing required parameter: \"tableId\""); + } + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/relationship" .Replace("{databaseId}", databaseId) .Replace("{tableId}", tableId); @@ -2131,6 +2615,62 @@ static Models.ColumnRelationship Convert(Dictionary it) } + /// + /// Update relationship column. [Learn more about relationship + /// columns](https://appwrite.io/docs/databases-relationships#relationship-columns). + /// + /// + /// + public Task UpdateRelationshipColumn(string databaseId, string tableId, string key, Appwrite.Enums.RelationMutate? onDelete = null, string? newKey = null) + { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (tableId == "") + { + throw new AppwriteException("Missing required parameter: \"tableId\""); + } + + if (key == "") + { + throw new AppwriteException("Missing required parameter: \"key\""); + } + + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/relationship/{key}" + .Replace("{databaseId}", databaseId) + .Replace("{tableId}", tableId) + .Replace("{key}", key); + + var apiParameters = new Dictionary() + { + { "onDelete", onDelete?.Value }, + { "newKey", newKey } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.ColumnRelationship Convert(Dictionary it) + { + return Models.ColumnRelationship.From(map: it); + } + + return _client.Call( + method: "PATCH", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + /// /// Create a string column. /// @@ -2139,6 +2679,16 @@ static Models.ColumnRelationship Convert(Dictionary it) [Obsolete("This API has been deprecated since 1.9.0. Please use `TablesDB.createTextColumn` instead.")] public Task CreateStringColumn(string databaseId, string tableId, string key, long size, bool required, string? @default = null, bool? array = null, bool? encrypt = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (tableId == "") + { + throw new AppwriteException("Missing required parameter: \"tableId\""); + } + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/string" .Replace("{databaseId}", databaseId) .Replace("{tableId}", tableId); @@ -2184,6 +2734,21 @@ static Models.ColumnString Convert(Dictionary it) [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.updateTextColumn` instead.")] public Task UpdateStringColumn(string databaseId, string tableId, string key, bool required, string @default, long? size = null, string? newKey = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (tableId == "") + { + throw new AppwriteException("Missing required parameter: \"tableId\""); + } + + if (key == "") + { + throw new AppwriteException("Missing required parameter: \"key\""); + } + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/string/{key}" .Replace("{databaseId}", databaseId) .Replace("{tableId}", tableId) @@ -2226,6 +2791,16 @@ static Models.ColumnString Convert(Dictionary it) /// public Task CreateTextColumn(string databaseId, string tableId, string key, bool required, string? @default = null, bool? array = null, bool? encrypt = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (tableId == "") + { + throw new AppwriteException("Missing required parameter: \"tableId\""); + } + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/text" .Replace("{databaseId}", databaseId) .Replace("{tableId}", tableId); @@ -2269,6 +2844,21 @@ static Models.ColumnText Convert(Dictionary it) /// public Task UpdateTextColumn(string databaseId, string tableId, string key, bool required, string @default, string? newKey = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (tableId == "") + { + throw new AppwriteException("Missing required parameter: \"tableId\""); + } + + if (key == "") + { + throw new AppwriteException("Missing required parameter: \"key\""); + } + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/text/{key}" .Replace("{databaseId}", databaseId) .Replace("{tableId}", tableId) @@ -2310,6 +2900,16 @@ static Models.ColumnText Convert(Dictionary it) /// public Task CreateUrlColumn(string databaseId, string tableId, string key, bool required, string? @default = null, bool? array = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (tableId == "") + { + throw new AppwriteException("Missing required parameter: \"tableId\""); + } + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/url" .Replace("{databaseId}", databaseId) .Replace("{tableId}", tableId); @@ -2352,6 +2952,21 @@ static Models.ColumnUrl Convert(Dictionary it) /// public Task UpdateUrlColumn(string databaseId, string tableId, string key, bool required, string @default, string? newKey = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (tableId == "") + { + throw new AppwriteException("Missing required parameter: \"tableId\""); + } + + if (key == "") + { + throw new AppwriteException("Missing required parameter: \"key\""); + } + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/url/{key}" .Replace("{databaseId}", databaseId) .Replace("{tableId}", tableId) @@ -2393,6 +3008,16 @@ static Models.ColumnUrl Convert(Dictionary it) /// public Task CreateVarcharColumn(string databaseId, string tableId, string key, long size, bool required, string? @default = null, bool? array = null, bool? encrypt = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (tableId == "") + { + throw new AppwriteException("Missing required parameter: \"tableId\""); + } + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/varchar" .Replace("{databaseId}", databaseId) .Replace("{tableId}", tableId); @@ -2437,6 +3062,21 @@ static Models.ColumnVarchar Convert(Dictionary it) /// public Task UpdateVarcharColumn(string databaseId, string tableId, string key, bool required, string @default, long? size = null, string? newKey = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (tableId == "") + { + throw new AppwriteException("Missing required parameter: \"tableId\""); + } + + if (key == "") + { + throw new AppwriteException("Missing required parameter: \"key\""); + } + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/varchar/{key}" .Replace("{databaseId}", databaseId) .Replace("{tableId}", tableId) @@ -2478,6 +3118,21 @@ static Models.ColumnVarchar Convert(Dictionary it) /// public Task GetColumn(string databaseId, string tableId, string key) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (tableId == "") + { + throw new AppwriteException("Missing required parameter: \"tableId\""); + } + + if (key == "") + { + throw new AppwriteException("Missing required parameter: \"key\""); + } + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/{key}" .Replace("{databaseId}", databaseId) .Replace("{tableId}", tableId) @@ -2516,23 +3171,55 @@ static object Convert(Dictionary it) { return Appwrite.Models.ColumnBoolean.From(map: it); } - if (it.TryGetValue("type", out var typeValue6) && typeValue6?.ToString() == "integer") + if (it.TryGetValue("type", out var typeValue6) && typeValue6?.ToString() == "bigint") + { + return Appwrite.Models.ColumnBigint.From(map: it); + } + if (it.TryGetValue("type", out var typeValue7) && typeValue7?.ToString() == "integer") { return Appwrite.Models.ColumnInteger.From(map: it); } - if (it.TryGetValue("type", out var typeValue7) && typeValue7?.ToString() == "double") + if (it.TryGetValue("type", out var typeValue8) && typeValue8?.ToString() == "double") { return Appwrite.Models.ColumnFloat.From(map: it); } - if (it.TryGetValue("type", out var typeValue8) && typeValue8?.ToString() == "datetime") + if (it.TryGetValue("type", out var typeValue9) && typeValue9?.ToString() == "datetime") { return Appwrite.Models.ColumnDatetime.From(map: it); } - if (it.TryGetValue("type", out var typeValue9) && typeValue9?.ToString() == "relationship") + if (it.TryGetValue("type", out var typeValue10) && typeValue10?.ToString() == "relationship") { return Appwrite.Models.ColumnRelationship.From(map: it); } - if (it.TryGetValue("type", out var typeValue10) && typeValue10?.ToString() == "string") + if (it.TryGetValue("type", out var typeValue11) && typeValue11?.ToString() == "point") + { + return Appwrite.Models.ColumnPoint.From(map: it); + } + if (it.TryGetValue("type", out var typeValue12) && typeValue12?.ToString() == "linestring") + { + return Appwrite.Models.ColumnLine.From(map: it); + } + if (it.TryGetValue("type", out var typeValue13) && typeValue13?.ToString() == "polygon") + { + return Appwrite.Models.ColumnPolygon.From(map: it); + } + if (it.TryGetValue("type", out var typeValue14) && typeValue14?.ToString() == "varchar") + { + return Appwrite.Models.ColumnVarchar.From(map: it); + } + if (it.TryGetValue("type", out var typeValue15) && typeValue15?.ToString() == "text") + { + return Appwrite.Models.ColumnText.From(map: it); + } + if (it.TryGetValue("type", out var typeValue16) && typeValue16?.ToString() == "mediumtext") + { + return Appwrite.Models.ColumnMediumtext.From(map: it); + } + if (it.TryGetValue("type", out var typeValue17) && typeValue17?.ToString() == "longtext") + { + return Appwrite.Models.ColumnLongtext.From(map: it); + } + if (it.TryGetValue("type", out var typeValue18) && typeValue18?.ToString() == "string") { return Appwrite.Models.ColumnString.From(map: it); } @@ -2554,48 +3241,28 @@ static object Convert(Dictionary it) /// public Task DeleteColumn(string databaseId, string tableId, string key) { - var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/{key}" - .Replace("{databaseId}", databaseId) - .Replace("{tableId}", tableId) - .Replace("{key}", key); - - var apiParameters = new Dictionary() + if (databaseId == "") { - }; + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } - var apiHeaders = new Dictionary() + if (tableId == "") { - { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } - }; - - - - return _client.Call( - method: "DELETE", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!); + throw new AppwriteException("Missing required parameter: \"tableId\""); + } - } + if (key == "") + { + throw new AppwriteException("Missing required parameter: \"key\""); + } - /// - /// Update relationship column. [Learn more about relationship - /// columns](https://appwrite.io/docs/databases-relationships#relationship-columns). - /// - /// - /// - public Task UpdateRelationshipColumn(string databaseId, string tableId, string key, Appwrite.Enums.RelationMutate? onDelete = null, string? newKey = null) - { - var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/{key}/relationship" + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/{key}" .Replace("{databaseId}", databaseId) .Replace("{tableId}", tableId) .Replace("{key}", key); var apiParameters = new Dictionary() { - { "onDelete", onDelete?.Value }, - { "newKey", newKey } }; var apiHeaders = new Dictionary() @@ -2606,17 +3273,12 @@ public Task DeleteColumn(string databaseId, string tableId, string key) }; - static Models.ColumnRelationship Convert(Dictionary it) - { - return Models.ColumnRelationship.From(map: it); - } - return _client.Call( - method: "PATCH", + return _client.Call( + method: "DELETE", path: apiPath, headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, - convert: Convert); + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!); } @@ -2626,6 +3288,16 @@ static Models.ColumnRelationship Convert(Dictionary it) /// public Task ListIndexes(string databaseId, string tableId, List? queries = null, bool? total = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (tableId == "") + { + throw new AppwriteException("Missing required parameter: \"tableId\""); + } + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/indexes" .Replace("{databaseId}", databaseId) .Replace("{tableId}", tableId); @@ -2665,6 +3337,16 @@ static Models.ColumnIndexList Convert(Dictionary it) /// public Task CreateIndex(string databaseId, string tableId, string key, Appwrite.Enums.TablesDBIndexType type, List columns, List? orders = null, List? lengths = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (tableId == "") + { + throw new AppwriteException("Missing required parameter: \"tableId\""); + } + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/indexes" .Replace("{databaseId}", databaseId) .Replace("{tableId}", tableId); @@ -2706,6 +3388,21 @@ static Models.ColumnIndex Convert(Dictionary it) /// public Task GetIndex(string databaseId, string tableId, string key) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (tableId == "") + { + throw new AppwriteException("Missing required parameter: \"tableId\""); + } + + if (key == "") + { + throw new AppwriteException("Missing required parameter: \"key\""); + } + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/indexes/{key}" .Replace("{databaseId}", databaseId) .Replace("{tableId}", tableId) @@ -2742,6 +3439,21 @@ static Models.ColumnIndex Convert(Dictionary it) /// public Task DeleteIndex(string databaseId, string tableId, string key) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (tableId == "") + { + throw new AppwriteException("Missing required parameter: \"tableId\""); + } + + if (key == "") + { + throw new AppwriteException("Missing required parameter: \"key\""); + } + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/indexes/{key}" .Replace("{databaseId}", databaseId) .Replace("{tableId}", tableId) @@ -2754,7 +3466,8 @@ public Task DeleteIndex(string databaseId, string tableId, string key) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -2774,6 +3487,16 @@ public Task DeleteIndex(string databaseId, string tableId, string key) /// public Task ListRows(string databaseId, string tableId, List? queries = null, string? transactionId = null, bool? total = null, long? ttl = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (tableId == "") + { + throw new AppwriteException("Missing required parameter: \"tableId\""); + } + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows" .Replace("{databaseId}", databaseId) .Replace("{tableId}", tableId); @@ -2816,6 +3539,16 @@ static Models.RowList Convert(Dictionary it) /// public Task CreateRow(string databaseId, string tableId, string rowId, object data, List? permissions = null, string? transactionId = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (tableId == "") + { + throw new AppwriteException("Missing required parameter: \"tableId\""); + } + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows" .Replace("{databaseId}", databaseId) .Replace("{tableId}", tableId); @@ -2859,6 +3592,16 @@ static Models.Row Convert(Dictionary it) /// public Task CreateRows(string databaseId, string tableId, List rows, string? transactionId = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (tableId == "") + { + throw new AppwriteException("Missing required parameter: \"tableId\""); + } + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows" .Replace("{databaseId}", databaseId) .Replace("{tableId}", tableId); @@ -2901,6 +3644,16 @@ static Models.RowList Convert(Dictionary it) /// public Task UpsertRows(string databaseId, string tableId, List rows, string? transactionId = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (tableId == "") + { + throw new AppwriteException("Missing required parameter: \"tableId\""); + } + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows" .Replace("{databaseId}", databaseId) .Replace("{tableId}", tableId); @@ -2940,6 +3693,16 @@ static Models.RowList Convert(Dictionary it) /// public Task UpdateRows(string databaseId, string tableId, object? data = null, List? queries = null, string? transactionId = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (tableId == "") + { + throw new AppwriteException("Missing required parameter: \"tableId\""); + } + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows" .Replace("{databaseId}", databaseId) .Replace("{tableId}", tableId); @@ -2980,6 +3743,16 @@ static Models.RowList Convert(Dictionary it) /// public Task DeleteRows(string databaseId, string tableId, List? queries = null, string? transactionId = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (tableId == "") + { + throw new AppwriteException("Missing required parameter: \"tableId\""); + } + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows" .Replace("{databaseId}", databaseId) .Replace("{tableId}", tableId); @@ -3019,6 +3792,21 @@ static Models.RowList Convert(Dictionary it) /// public Task GetRow(string databaseId, string tableId, string rowId, List? queries = null, string? transactionId = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (tableId == "") + { + throw new AppwriteException("Missing required parameter: \"tableId\""); + } + + if (rowId == "") + { + throw new AppwriteException("Missing required parameter: \"rowId\""); + } + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}" .Replace("{databaseId}", databaseId) .Replace("{tableId}", tableId) @@ -3060,6 +3848,21 @@ static Models.Row Convert(Dictionary it) /// public Task UpsertRow(string databaseId, string tableId, string rowId, object? data = null, List? permissions = null, string? transactionId = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (tableId == "") + { + throw new AppwriteException("Missing required parameter: \"tableId\""); + } + + if (rowId == "") + { + throw new AppwriteException("Missing required parameter: \"rowId\""); + } + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}" .Replace("{databaseId}", databaseId) .Replace("{tableId}", tableId) @@ -3101,6 +3904,21 @@ static Models.Row Convert(Dictionary it) /// public Task UpdateRow(string databaseId, string tableId, string rowId, object? data = null, List? permissions = null, string? transactionId = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (tableId == "") + { + throw new AppwriteException("Missing required parameter: \"tableId\""); + } + + if (rowId == "") + { + throw new AppwriteException("Missing required parameter: \"rowId\""); + } + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}" .Replace("{databaseId}", databaseId) .Replace("{tableId}", tableId) @@ -3141,6 +3959,21 @@ static Models.Row Convert(Dictionary it) /// public Task DeleteRow(string databaseId, string tableId, string rowId, string? transactionId = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (tableId == "") + { + throw new AppwriteException("Missing required parameter: \"tableId\""); + } + + if (rowId == "") + { + throw new AppwriteException("Missing required parameter: \"rowId\""); + } + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}" .Replace("{databaseId}", databaseId) .Replace("{tableId}", tableId) @@ -3154,7 +3987,8 @@ public Task DeleteRow(string databaseId, string tableId, string rowId, s var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -3173,6 +4007,26 @@ public Task DeleteRow(string databaseId, string tableId, string rowId, s /// public Task DecrementRowColumn(string databaseId, string tableId, string rowId, string column, double? @value = null, double? min = null, string? transactionId = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (tableId == "") + { + throw new AppwriteException("Missing required parameter: \"tableId\""); + } + + if (rowId == "") + { + throw new AppwriteException("Missing required parameter: \"rowId\""); + } + + if (column == "") + { + throw new AppwriteException("Missing required parameter: \"column\""); + } + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}/{column}/decrement" .Replace("{databaseId}", databaseId) .Replace("{tableId}", tableId) @@ -3214,6 +4068,26 @@ static Models.Row Convert(Dictionary it) /// public Task IncrementRowColumn(string databaseId, string tableId, string rowId, string column, double? @value = null, double? max = null, string? transactionId = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (tableId == "") + { + throw new AppwriteException("Missing required parameter: \"tableId\""); + } + + if (rowId == "") + { + throw new AppwriteException("Missing required parameter: \"rowId\""); + } + + if (column == "") + { + throw new AppwriteException("Missing required parameter: \"column\""); + } + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}/{column}/increment" .Replace("{databaseId}", databaseId) .Replace("{tableId}", tableId) diff --git a/Appwrite/Services/Teams.cs b/Appwrite/Services/Teams.cs index f47c7630..e8c90373 100644 --- a/Appwrite/Services/Teams.cs +++ b/Appwrite/Services/Teams.cs @@ -95,6 +95,11 @@ static Models.Team Convert(Dictionary it) /// public Task Get(string teamId) { + if (teamId == "") + { + throw new AppwriteException("Missing required parameter: \"teamId\""); + } + var apiPath = "/teams/{teamId}" .Replace("{teamId}", teamId); @@ -129,6 +134,11 @@ static Models.Team Convert(Dictionary it) /// public Task UpdateName(string teamId, string name) { + if (teamId == "") + { + throw new AppwriteException("Missing required parameter: \"teamId\""); + } + var apiPath = "/teams/{teamId}" .Replace("{teamId}", teamId); @@ -166,6 +176,11 @@ static Models.Team Convert(Dictionary it) /// public Task Delete(string teamId) { + if (teamId == "") + { + throw new AppwriteException("Missing required parameter: \"teamId\""); + } + var apiPath = "/teams/{teamId}" .Replace("{teamId}", teamId); @@ -176,7 +191,8 @@ public Task Delete(string teamId) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -195,6 +211,11 @@ public Task Delete(string teamId) /// public Task ListInstallations(string teamId, List? queries = null, bool? total = null) { + if (teamId == "") + { + throw new AppwriteException("Missing required parameter: \"teamId\""); + } + var apiPath = "/teams/{teamId}/installations" .Replace("{teamId}", teamId); @@ -234,6 +255,11 @@ static Models.AppInstallationList Convert(Dictionary it) /// public Task CreateInstallation(string teamId, string appId, string? authorizationDetails = null) { + if (teamId == "") + { + throw new AppwriteException("Missing required parameter: \"teamId\""); + } + var apiPath = "/teams/{teamId}/installations" .Replace("{teamId}", teamId); @@ -272,6 +298,16 @@ static Models.AppInstallation Convert(Dictionary it) /// public Task GetInstallation(string teamId, string installationId) { + if (teamId == "") + { + throw new AppwriteException("Missing required parameter: \"teamId\""); + } + + if (installationId == "") + { + throw new AppwriteException("Missing required parameter: \"installationId\""); + } + var apiPath = "/teams/{teamId}/installations/{installationId}" .Replace("{teamId}", teamId) .Replace("{installationId}", installationId); @@ -310,6 +346,16 @@ static Models.AppInstallation Convert(Dictionary it) /// public Task UpdateInstallation(string teamId, string installationId, string? authorizationDetails = null) { + if (teamId == "") + { + throw new AppwriteException("Missing required parameter: \"teamId\""); + } + + if (installationId == "") + { + throw new AppwriteException("Missing required parameter: \"installationId\""); + } + var apiPath = "/teams/{teamId}/installations/{installationId}" .Replace("{teamId}", teamId) .Replace("{installationId}", installationId); @@ -349,6 +395,16 @@ static Models.AppInstallation Convert(Dictionary it) /// public Task DeleteInstallation(string teamId, string installationId) { + if (teamId == "") + { + throw new AppwriteException("Missing required parameter: \"teamId\""); + } + + if (installationId == "") + { + throw new AppwriteException("Missing required parameter: \"installationId\""); + } + var apiPath = "/teams/{teamId}/installations/{installationId}" .Replace("{teamId}", teamId) .Replace("{installationId}", installationId); @@ -382,6 +438,11 @@ public Task DeleteInstallation(string teamId, string installationId) /// public Task ListMemberships(string teamId, List? queries = null, string? search = null, bool? total = null) { + if (teamId == "") + { + throw new AppwriteException("Missing required parameter: \"teamId\""); + } + var apiPath = "/teams/{teamId}/memberships" .Replace("{teamId}", teamId); @@ -437,13 +498,19 @@ static Models.MembershipList Convert(Dictionary it) /// /// /// - public Task CreateMembership(string teamId, List roles, string? email = null, string? userId = null, string? phone = null, string? url = null, string? name = null) + public Task CreateMembership(string teamId, List roles, string? membershipId = null, string? email = null, string? userId = null, string? phone = null, string? url = null, string? name = null) { + if (teamId == "") + { + throw new AppwriteException("Missing required parameter: \"teamId\""); + } + var apiPath = "/teams/{teamId}/memberships" .Replace("{teamId}", teamId); var apiParameters = new Dictionary() { + { "membershipId", membershipId }, { "email", email }, { "userId", userId }, { "phone", phone }, @@ -482,6 +549,16 @@ static Models.Membership Convert(Dictionary it) /// public Task GetMembership(string teamId, string membershipId) { + if (teamId == "") + { + throw new AppwriteException("Missing required parameter: \"teamId\""); + } + + if (membershipId == "") + { + throw new AppwriteException("Missing required parameter: \"membershipId\""); + } + var apiPath = "/teams/{teamId}/memberships/{membershipId}" .Replace("{teamId}", teamId) .Replace("{membershipId}", membershipId); @@ -520,6 +597,16 @@ static Models.Membership Convert(Dictionary it) /// public Task UpdateMembership(string teamId, string membershipId, List roles) { + if (teamId == "") + { + throw new AppwriteException("Missing required parameter: \"teamId\""); + } + + if (membershipId == "") + { + throw new AppwriteException("Missing required parameter: \"membershipId\""); + } + var apiPath = "/teams/{teamId}/memberships/{membershipId}" .Replace("{teamId}", teamId) .Replace("{membershipId}", membershipId); @@ -559,6 +646,16 @@ static Models.Membership Convert(Dictionary it) /// public Task DeleteMembership(string teamId, string membershipId) { + if (teamId == "") + { + throw new AppwriteException("Missing required parameter: \"teamId\""); + } + + if (membershipId == "") + { + throw new AppwriteException("Missing required parameter: \"membershipId\""); + } + var apiPath = "/teams/{teamId}/memberships/{membershipId}" .Replace("{teamId}", teamId) .Replace("{membershipId}", membershipId); @@ -570,7 +667,8 @@ public Task DeleteMembership(string teamId, string membershipId) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -595,6 +693,16 @@ public Task DeleteMembership(string teamId, string membershipId) /// public Task UpdateMembershipStatus(string teamId, string membershipId, string userId, string secret) { + if (teamId == "") + { + throw new AppwriteException("Missing required parameter: \"teamId\""); + } + + if (membershipId == "") + { + throw new AppwriteException("Missing required parameter: \"membershipId\""); + } + var apiPath = "/teams/{teamId}/memberships/{membershipId}/status" .Replace("{teamId}", teamId) .Replace("{membershipId}", membershipId); @@ -635,6 +743,11 @@ static Models.Membership Convert(Dictionary it) /// public Task GetPrefs(string teamId) { + if (teamId == "") + { + throw new AppwriteException("Missing required parameter: \"teamId\""); + } + var apiPath = "/teams/{teamId}/prefs" .Replace("{teamId}", teamId); @@ -671,6 +784,11 @@ static Models.Preferences Convert(Dictionary it) /// public Task UpdatePrefs(string teamId, object prefs) { + if (teamId == "") + { + throw new AppwriteException("Missing required parameter: \"teamId\""); + } + var apiPath = "/teams/{teamId}/prefs" .Replace("{teamId}", teamId); diff --git a/Appwrite/Services/Tokens.cs b/Appwrite/Services/Tokens.cs index d9d4f631..449f2ca6 100644 --- a/Appwrite/Services/Tokens.cs +++ b/Appwrite/Services/Tokens.cs @@ -20,6 +20,16 @@ public Tokens(Client client) : base(client) /// public Task List(string bucketId, string fileId, List? queries = null, bool? total = null) { + if (bucketId == "") + { + throw new AppwriteException("Missing required parameter: \"bucketId\""); + } + + if (fileId == "") + { + throw new AppwriteException("Missing required parameter: \"fileId\""); + } + var apiPath = "/tokens/buckets/{bucketId}/files/{fileId}" .Replace("{bucketId}", bucketId) .Replace("{fileId}", fileId); @@ -58,6 +68,16 @@ static Models.ResourceTokenList Convert(Dictionary it) /// public Task CreateFileToken(string bucketId, string fileId, string? expire = null) { + if (bucketId == "") + { + throw new AppwriteException("Missing required parameter: \"bucketId\""); + } + + if (fileId == "") + { + throw new AppwriteException("Missing required parameter: \"fileId\""); + } + var apiPath = "/tokens/buckets/{bucketId}/files/{fileId}" .Replace("{bucketId}", bucketId) .Replace("{fileId}", fileId); @@ -95,6 +115,11 @@ static Models.ResourceToken Convert(Dictionary it) /// public Task Get(string tokenId) { + if (tokenId == "") + { + throw new AppwriteException("Missing required parameter: \"tokenId\""); + } + var apiPath = "/tokens/{tokenId}" .Replace("{tokenId}", tokenId); @@ -130,6 +155,11 @@ static Models.ResourceToken Convert(Dictionary it) /// public Task Update(string tokenId, string? expire = null) { + if (tokenId == "") + { + throw new AppwriteException("Missing required parameter: \"tokenId\""); + } + var apiPath = "/tokens/{tokenId}" .Replace("{tokenId}", tokenId); @@ -166,6 +196,11 @@ static Models.ResourceToken Convert(Dictionary it) /// public Task Delete(string tokenId) { + if (tokenId == "") + { + throw new AppwriteException("Missing required parameter: \"tokenId\""); + } + var apiPath = "/tokens/{tokenId}" .Replace("{tokenId}", tokenId); @@ -176,7 +211,8 @@ public Task Delete(string tokenId) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; diff --git a/Appwrite/Services/Users.cs b/Appwrite/Services/Users.cs index d7a8ee4d..61bb5761 100644 --- a/Appwrite/Services/Users.cs +++ b/Appwrite/Services/Users.cs @@ -213,6 +213,11 @@ static Models.IdentityList Convert(Dictionary it) /// public Task DeleteIdentity(string identityId) { + if (identityId == "") + { + throw new AppwriteException("Missing required parameter: \"identityId\""); + } + var apiPath = "/users/identities/{identityId}" .Replace("{identityId}", identityId); @@ -223,7 +228,8 @@ public Task DeleteIdentity(string identityId) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -457,6 +463,11 @@ static Models.User Convert(Dictionary it) /// public Task Get(string userId) { + if (userId == "") + { + throw new AppwriteException("Missing required parameter: \"userId\""); + } + var apiPath = "/users/{userId}" .Replace("{userId}", userId); @@ -496,6 +507,11 @@ static Models.User Convert(Dictionary it) /// public Task Delete(string userId) { + if (userId == "") + { + throw new AppwriteException("Missing required parameter: \"userId\""); + } + var apiPath = "/users/{userId}" .Replace("{userId}", userId); @@ -506,7 +522,8 @@ public Task Delete(string userId) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -525,6 +542,11 @@ public Task Delete(string userId) /// public Task UpdateEmail(string userId, string email) { + if (userId == "") + { + throw new AppwriteException("Missing required parameter: \"userId\""); + } + var apiPath = "/users/{userId}/email" .Replace("{userId}", userId); @@ -560,12 +582,20 @@ static Models.User Convert(Dictionary it) /// impersonation headers are used, the request runs as the target user for API /// behavior, while internal audit logs still attribute the action to the /// original impersonator and store the impersonated target details only in - /// internal audit payload data. + /// internal audit payload data. Account endpoints are read-only while + /// impersonating: they report the target's account, and anything that would + /// change it is refused, so an impersonator cannot alter the target's + /// credentials or delete their account. /// /// /// public Task UpdateImpersonator(string userId, bool impersonator) { + if (userId == "") + { + throw new AppwriteException("Missing required parameter: \"userId\""); + } + var apiPath = "/users/{userId}/impersonator" .Replace("{userId}", userId); @@ -604,6 +634,11 @@ static Models.User Convert(Dictionary it) /// public Task CreateJWT(string userId, string? sessionId = null, long? duration = null) { + if (userId == "") + { + throw new AppwriteException("Missing required parameter: \"userId\""); + } + var apiPath = "/users/{userId}/jwts" .Replace("{userId}", userId); @@ -646,6 +681,11 @@ static Models.JWT Convert(Dictionary it) /// public Task UpdateLabels(string userId, List labels) { + if (userId == "") + { + throw new AppwriteException("Missing required parameter: \"userId\""); + } + var apiPath = "/users/{userId}/labels" .Replace("{userId}", userId); @@ -677,47 +717,16 @@ static Models.User Convert(Dictionary it) } /// - /// Get the user activity logs list by its unique ID. + /// Get the user membership list by its unique ID. /// /// - public Task ListLogs(string userId, List? queries = null, bool? total = null) + public Task ListMemberships(string userId, List? queries = null, string? search = null, bool? total = null) { - var apiPath = "/users/{userId}/logs" - .Replace("{userId}", userId); - - var apiParameters = new Dictionary() - { - { "queries", queries }, - { "total", total } - }; - - var apiHeaders = new Dictionary() - { - { "X-Appwrite-Project", _client.GetConfig("project") }, - { "accept", "application/json" } - }; - - - static Models.LogList Convert(Dictionary it) + if (userId == "") { - return Models.LogList.From(map: it); + throw new AppwriteException("Missing required parameter: \"userId\""); } - return _client.Call( - method: "GET", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, - convert: Convert); - - } - - /// - /// Get the user membership list by its unique ID. - /// - /// - public Task ListMemberships(string userId, List? queries = null, string? search = null, bool? total = null) - { var apiPath = "/users/{userId}/memberships" .Replace("{userId}", userId); @@ -756,6 +765,11 @@ static Models.MembershipList Convert(Dictionary it) [Obsolete("This API has been deprecated since 1.8.0. Please use `Users.updateMFA` instead.")] public Task UpdateMfa(string userId, bool mfa) { + if (userId == "") + { + throw new AppwriteException("Missing required parameter: \"userId\""); + } + var apiPath = "/users/{userId}/mfa" .Replace("{userId}", userId); @@ -792,6 +806,11 @@ static Models.User Convert(Dictionary it) /// public Task UpdateMFA(string userId, bool mfa) { + if (userId == "") + { + throw new AppwriteException("Missing required parameter: \"userId\""); + } + var apiPath = "/users/{userId}/mfa" .Replace("{userId}", userId); @@ -829,6 +848,11 @@ static Models.User Convert(Dictionary it) [Obsolete("This API has been deprecated since 1.8.0. Please use `Users.deleteMFAAuthenticator` instead.")] public Task DeleteMfaAuthenticator(string userId, Appwrite.Enums.AuthenticatorType type) { + if (userId == "") + { + throw new AppwriteException("Missing required parameter: \"userId\""); + } + var apiPath = "/users/{userId}/mfa/authenticators/{type}" .Replace("{userId}", userId) .Replace("{type}", type.Value); @@ -840,7 +864,8 @@ public Task DeleteMfaAuthenticator(string userId, Appwrite.Enums.Authent var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -859,6 +884,11 @@ public Task DeleteMfaAuthenticator(string userId, Appwrite.Enums.Authent /// public Task DeleteMFAAuthenticator(string userId, Appwrite.Enums.AuthenticatorType type) { + if (userId == "") + { + throw new AppwriteException("Missing required parameter: \"userId\""); + } + var apiPath = "/users/{userId}/mfa/authenticators/{type}" .Replace("{userId}", userId) .Replace("{type}", type.Value); @@ -870,7 +900,8 @@ public Task DeleteMFAAuthenticator(string userId, Appwrite.Enums.Authent var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -890,6 +921,16 @@ public Task DeleteMFAAuthenticator(string userId, Appwrite.Enums.Authent /// public Task GetMFAChallenge(string userId, string challengeId) { + if (userId == "") + { + throw new AppwriteException("Missing required parameter: \"userId\""); + } + + if (challengeId == "") + { + throw new AppwriteException("Missing required parameter: \"challengeId\""); + } + var apiPath = "/users/{userId}/mfa/challenges/{challengeId}" .Replace("{userId}", userId) .Replace("{challengeId}", challengeId); @@ -926,6 +967,11 @@ static Models.MfaChallengeSecret Convert(Dictionary it) [Obsolete("This API has been deprecated since 1.8.0. Please use `Users.listMFAFactors` instead.")] public Task ListMfaFactors(string userId) { + if (userId == "") + { + throw new AppwriteException("Missing required parameter: \"userId\""); + } + var apiPath = "/users/{userId}/mfa/factors" .Replace("{userId}", userId); @@ -960,6 +1006,11 @@ static Models.MfaFactors Convert(Dictionary it) /// public Task ListMFAFactors(string userId) { + if (userId == "") + { + throw new AppwriteException("Missing required parameter: \"userId\""); + } + var apiPath = "/users/{userId}/mfa/factors" .Replace("{userId}", userId); @@ -998,6 +1049,11 @@ static Models.MfaFactors Convert(Dictionary it) [Obsolete("This API has been deprecated since 1.8.0. Please use `Users.getMFARecoveryCodes` instead.")] public Task GetMfaRecoveryCodes(string userId) { + if (userId == "") + { + throw new AppwriteException("Missing required parameter: \"userId\""); + } + var apiPath = "/users/{userId}/mfa/recovery-codes" .Replace("{userId}", userId); @@ -1035,6 +1091,11 @@ static Models.MfaRecoveryCodes Convert(Dictionary it) /// public Task GetMFARecoveryCodes(string userId) { + if (userId == "") + { + throw new AppwriteException("Missing required parameter: \"userId\""); + } + var apiPath = "/users/{userId}/mfa/recovery-codes" .Replace("{userId}", userId); @@ -1073,6 +1134,11 @@ static Models.MfaRecoveryCodes Convert(Dictionary it) [Obsolete("This API has been deprecated since 1.8.0. Please use `Users.updateMFARecoveryCodes` instead.")] public Task UpdateMfaRecoveryCodes(string userId) { + if (userId == "") + { + throw new AppwriteException("Missing required parameter: \"userId\""); + } + var apiPath = "/users/{userId}/mfa/recovery-codes" .Replace("{userId}", userId); @@ -1111,6 +1177,11 @@ static Models.MfaRecoveryCodes Convert(Dictionary it) /// public Task UpdateMFARecoveryCodes(string userId) { + if (userId == "") + { + throw new AppwriteException("Missing required parameter: \"userId\""); + } + var apiPath = "/users/{userId}/mfa/recovery-codes" .Replace("{userId}", userId); @@ -1150,6 +1221,11 @@ static Models.MfaRecoveryCodes Convert(Dictionary it) [Obsolete("This API has been deprecated since 1.8.0. Please use `Users.createMFARecoveryCodes` instead.")] public Task CreateMfaRecoveryCodes(string userId) { + if (userId == "") + { + throw new AppwriteException("Missing required parameter: \"userId\""); + } + var apiPath = "/users/{userId}/mfa/recovery-codes" .Replace("{userId}", userId); @@ -1188,6 +1264,11 @@ static Models.MfaRecoveryCodes Convert(Dictionary it) /// public Task CreateMFARecoveryCodes(string userId) { + if (userId == "") + { + throw new AppwriteException("Missing required parameter: \"userId\""); + } + var apiPath = "/users/{userId}/mfa/recovery-codes" .Replace("{userId}", userId); @@ -1223,6 +1304,11 @@ static Models.MfaRecoveryCodes Convert(Dictionary it) /// public Task UpdateName(string userId, string name) { + if (userId == "") + { + throw new AppwriteException("Missing required parameter: \"userId\""); + } + var apiPath = "/users/{userId}/name" .Replace("{userId}", userId); @@ -1253,12 +1339,192 @@ static Models.User Convert(Dictionary it) } + /// + /// Get the list of verified passkeys registered by a user. + /// + /// + public Task ListPasskeys(string userId, List? queries = null, bool? total = null) + { + if (userId == "") + { + throw new AppwriteException("Missing required parameter: \"userId\""); + } + + var apiPath = "/users/{userId}/passkeys" + .Replace("{userId}", userId); + + var apiParameters = new Dictionary() + { + { "queries", queries }, + { "total", total } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.PasskeyList Convert(Dictionary it) + { + return Models.PasskeyList.From(map: it); + } + + return _client.Call( + method: "GET", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Get a verified passkey of a user by its unique ID. + /// + /// + public Task GetPasskey(string userId, string passkeyId) + { + if (userId == "") + { + throw new AppwriteException("Missing required parameter: \"userId\""); + } + + if (passkeyId == "") + { + throw new AppwriteException("Missing required parameter: \"passkeyId\""); + } + + var apiPath = "/users/{userId}/passkeys/{passkeyId}" + .Replace("{userId}", userId) + .Replace("{passkeyId}", passkeyId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.Passkey Convert(Dictionary it) + { + return Models.Passkey.From(map: it); + } + + return _client.Call( + method: "GET", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Rename a passkey of a user. + /// + /// + public Task UpdatePasskey(string userId, string passkeyId, string name) + { + if (userId == "") + { + throw new AppwriteException("Missing required parameter: \"userId\""); + } + + if (passkeyId == "") + { + throw new AppwriteException("Missing required parameter: \"passkeyId\""); + } + + var apiPath = "/users/{userId}/passkeys/{passkeyId}" + .Replace("{userId}", userId) + .Replace("{passkeyId}", passkeyId); + + var apiParameters = new Dictionary() + { + { "name", name } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.Passkey Convert(Dictionary it) + { + return Models.Passkey.From(map: it); + } + + return _client.Call( + method: "PATCH", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Delete a passkey from a user, for example when a device is lost. The + /// passkey can no longer be used to sign in. + /// + /// + public Task DeletePasskey(string userId, string passkeyId) + { + if (userId == "") + { + throw new AppwriteException("Missing required parameter: \"userId\""); + } + + if (passkeyId == "") + { + throw new AppwriteException("Missing required parameter: \"passkeyId\""); + } + + var apiPath = "/users/{userId}/passkeys/{passkeyId}" + .Replace("{userId}", userId) + .Replace("{passkeyId}", passkeyId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + + return _client.Call( + method: "DELETE", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!); + + } + /// /// Update the user password by its unique ID. /// /// public Task UpdatePassword(string userId, string password) { + if (userId == "") + { + throw new AppwriteException("Missing required parameter: \"userId\""); + } + var apiPath = "/users/{userId}/password" .Replace("{userId}", userId); @@ -1295,6 +1561,11 @@ static Models.User Convert(Dictionary it) /// public Task UpdatePhone(string userId, string number) { + if (userId == "") + { + throw new AppwriteException("Missing required parameter: \"userId\""); + } + var apiPath = "/users/{userId}/phone" .Replace("{userId}", userId); @@ -1331,6 +1602,11 @@ static Models.User Convert(Dictionary it) /// public Task GetPrefs(string userId) { + if (userId == "") + { + throw new AppwriteException("Missing required parameter: \"userId\""); + } + var apiPath = "/users/{userId}/prefs" .Replace("{userId}", userId); @@ -1367,6 +1643,11 @@ static Models.Preferences Convert(Dictionary it) /// public Task UpdatePrefs(string userId, object prefs) { + if (userId == "") + { + throw new AppwriteException("Missing required parameter: \"userId\""); + } + var apiPath = "/users/{userId}/prefs" .Replace("{userId}", userId); @@ -1403,6 +1684,11 @@ static Models.Preferences Convert(Dictionary it) /// public Task ListSessions(string userId, bool? total = null) { + if (userId == "") + { + throw new AppwriteException("Missing required parameter: \"userId\""); + } + var apiPath = "/users/{userId}/sessions" .Replace("{userId}", userId); @@ -1443,6 +1729,11 @@ static Models.SessionList Convert(Dictionary it) /// public Task CreateSession(string userId) { + if (userId == "") + { + throw new AppwriteException("Missing required parameter: \"userId\""); + } + var apiPath = "/users/{userId}/sessions" .Replace("{userId}", userId); @@ -1478,6 +1769,11 @@ static Models.Session Convert(Dictionary it) /// public Task DeleteSessions(string userId) { + if (userId == "") + { + throw new AppwriteException("Missing required parameter: \"userId\""); + } + var apiPath = "/users/{userId}/sessions" .Replace("{userId}", userId); @@ -1488,7 +1784,8 @@ public Task DeleteSessions(string userId) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1507,6 +1804,16 @@ public Task DeleteSessions(string userId) /// public Task DeleteSession(string userId, string sessionId) { + if (userId == "") + { + throw new AppwriteException("Missing required parameter: \"userId\""); + } + + if (sessionId == "") + { + throw new AppwriteException("Missing required parameter: \"sessionId\""); + } + var apiPath = "/users/{userId}/sessions/{sessionId}" .Replace("{userId}", userId) .Replace("{sessionId}", sessionId); @@ -1518,7 +1825,8 @@ public Task DeleteSession(string userId, string sessionId) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1538,6 +1846,11 @@ public Task DeleteSession(string userId, string sessionId) /// public Task UpdateStatus(string userId, bool status) { + if (userId == "") + { + throw new AppwriteException("Missing required parameter: \"userId\""); + } + var apiPath = "/users/{userId}/status" .Replace("{userId}", userId); @@ -1574,6 +1887,11 @@ static Models.User Convert(Dictionary it) /// public Task ListTargets(string userId, List? queries = null, bool? total = null) { + if (userId == "") + { + throw new AppwriteException("Missing required parameter: \"userId\""); + } + var apiPath = "/users/{userId}/targets" .Replace("{userId}", userId); @@ -1610,6 +1928,11 @@ static Models.TargetList Convert(Dictionary it) /// public Task CreateTarget(string userId, string targetId, Appwrite.Enums.MessagingProviderType providerType, string identifier, string? providerId = null, string? name = null) { + if (userId == "") + { + throw new AppwriteException("Missing required parameter: \"userId\""); + } + var apiPath = "/users/{userId}/targets" .Replace("{userId}", userId); @@ -1650,6 +1973,16 @@ static Models.Target Convert(Dictionary it) /// public Task GetTarget(string userId, string targetId) { + if (userId == "") + { + throw new AppwriteException("Missing required parameter: \"userId\""); + } + + if (targetId == "") + { + throw new AppwriteException("Missing required parameter: \"targetId\""); + } + var apiPath = "/users/{userId}/targets/{targetId}" .Replace("{userId}", userId) .Replace("{targetId}", targetId); @@ -1685,6 +2018,16 @@ static Models.Target Convert(Dictionary it) /// public Task UpdateTarget(string userId, string targetId, string? identifier = null, string? providerId = null, string? name = null) { + if (userId == "") + { + throw new AppwriteException("Missing required parameter: \"userId\""); + } + + if (targetId == "") + { + throw new AppwriteException("Missing required parameter: \"targetId\""); + } + var apiPath = "/users/{userId}/targets/{targetId}" .Replace("{userId}", userId) .Replace("{targetId}", targetId); @@ -1724,6 +2067,16 @@ static Models.Target Convert(Dictionary it) /// public Task DeleteTarget(string userId, string targetId) { + if (userId == "") + { + throw new AppwriteException("Missing required parameter: \"userId\""); + } + + if (targetId == "") + { + throw new AppwriteException("Missing required parameter: \"targetId\""); + } + var apiPath = "/users/{userId}/targets/{targetId}" .Replace("{userId}", userId) .Replace("{targetId}", targetId); @@ -1735,7 +2088,8 @@ public Task DeleteTarget(string userId, string targetId) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1758,6 +2112,11 @@ public Task DeleteTarget(string userId, string targetId) /// public Task CreateToken(string userId, long? length = null, long? expire = null) { + if (userId == "") + { + throw new AppwriteException("Missing required parameter: \"userId\""); + } + var apiPath = "/users/{userId}/tokens" .Replace("{userId}", userId); @@ -1795,6 +2154,11 @@ static Models.Token Convert(Dictionary it) /// public Task UpdateEmailVerification(string userId, bool emailVerification) { + if (userId == "") + { + throw new AppwriteException("Missing required parameter: \"userId\""); + } + var apiPath = "/users/{userId}/verification" .Replace("{userId}", userId); @@ -1831,6 +2195,11 @@ static Models.User Convert(Dictionary it) /// public Task UpdatePhoneVerification(string userId, bool phoneVerification) { + if (userId == "") + { + throw new AppwriteException("Missing required parameter: \"userId\""); + } + var apiPath = "/users/{userId}/verification/phone" .Replace("{userId}", userId); diff --git a/Appwrite/Services/VectorsDB.cs b/Appwrite/Services/VectorsDB.cs index 31986d74..9142f0f8 100644 --- a/Appwrite/Services/VectorsDB.cs +++ b/Appwrite/Services/VectorsDB.cs @@ -92,8 +92,8 @@ static Models.Database Convert(Dictionary it) /// /// List the dedicated database specifications available on the current plan. - /// Each specification reports its resource limits, pricing, and whether it is - /// enabled for the organization. + /// Each specification reports its resource limits, its own prices and overage + /// rates, and whether it is enabled for the organization. /// /// public Task ListSpecifications() @@ -129,13 +129,14 @@ static Models.DedicatedDatabaseSpecificationList Convert(Dictionary /// - public Task ListTransactions(List? queries = null) + public Task ListTransactions(List? queries = null, bool? total = null) { var apiPath = "/vectorsdb/transactions"; var apiParameters = new Dictionary() { - { "queries", queries } + { "queries", queries }, + { "total", total } }; var apiHeaders = new Dictionary() @@ -200,6 +201,11 @@ static Models.Transaction Convert(Dictionary it) /// public Task GetTransaction(string transactionId) { + if (transactionId == "") + { + throw new AppwriteException("Missing required parameter: \"transactionId\""); + } + var apiPath = "/vectorsdb/transactions/{transactionId}" .Replace("{transactionId}", transactionId); @@ -234,6 +240,11 @@ static Models.Transaction Convert(Dictionary it) /// public Task UpdateTransaction(string transactionId, bool? commit = null, bool? rollback = null) { + if (transactionId == "") + { + throw new AppwriteException("Missing required parameter: \"transactionId\""); + } + var apiPath = "/vectorsdb/transactions/{transactionId}" .Replace("{transactionId}", transactionId); @@ -271,6 +282,11 @@ static Models.Transaction Convert(Dictionary it) /// public Task DeleteTransaction(string transactionId) { + if (transactionId == "") + { + throw new AppwriteException("Missing required parameter: \"transactionId\""); + } + var apiPath = "/vectorsdb/transactions/{transactionId}" .Replace("{transactionId}", transactionId); @@ -281,7 +297,8 @@ public Task DeleteTransaction(string transactionId) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -300,6 +317,11 @@ public Task DeleteTransaction(string transactionId) /// public Task CreateOperations(string transactionId, List? operations = null) { + if (transactionId == "") + { + throw new AppwriteException("Missing required parameter: \"transactionId\""); + } + var apiPath = "/vectorsdb/transactions/{transactionId}/operations" .Replace("{transactionId}", transactionId); @@ -337,6 +359,11 @@ static Models.Transaction Convert(Dictionary it) /// public Task Get(string databaseId) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/vectorsdb/{databaseId}" .Replace("{databaseId}", databaseId); @@ -371,6 +398,11 @@ static Models.Database Convert(Dictionary it) /// public Task Update(string databaseId, string name, bool? enabled = null, string? specification = null, long? replicas = null, string? syncMode = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/vectorsdb/{databaseId}" .Replace("{databaseId}", databaseId); @@ -412,6 +444,11 @@ static Models.Database Convert(Dictionary it) /// public Task Delete(string databaseId) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/vectorsdb/{databaseId}" .Replace("{databaseId}", databaseId); @@ -422,7 +459,8 @@ public Task Delete(string databaseId) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -442,6 +480,11 @@ public Task Delete(string databaseId) /// public Task ListCollections(string databaseId, List? queries = null, string? search = null, bool? total = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/vectorsdb/{databaseId}/collections" .Replace("{databaseId}", databaseId); @@ -482,6 +525,11 @@ static Models.VectorsdbCollectionList Convert(Dictionary it) /// public Task CreateCollection(string databaseId, string collectionId, string name, long dimension, List? permissions = null, bool? documentSecurity = null, bool? enabled = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/vectorsdb/{databaseId}/collections" .Replace("{databaseId}", databaseId); @@ -524,6 +572,16 @@ static Models.VectorsdbCollection Convert(Dictionary it) /// public Task GetCollection(string databaseId, string collectionId) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId); @@ -559,6 +617,16 @@ static Models.VectorsdbCollection Convert(Dictionary it) /// public Task UpdateCollection(string databaseId, string collectionId, string name, long? dimension = null, List? permissions = null, bool? documentSecurity = null, bool? enabled = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId); @@ -601,6 +669,16 @@ static Models.VectorsdbCollection Convert(Dictionary it) /// public Task DeleteCollection(string databaseId, string collectionId) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId); @@ -612,7 +690,8 @@ public Task DeleteCollection(string databaseId, string collectionId) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -632,6 +711,16 @@ public Task DeleteCollection(string databaseId, string collectionId) /// public Task ListDocuments(string databaseId, string collectionId, List? queries = null, string? transactionId = null, bool? total = null, long? ttl = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/documents" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId); @@ -674,6 +763,16 @@ static Models.DocumentList Convert(Dictionary it) /// public Task CreateDocument(string databaseId, string collectionId, string documentId, object data, List? permissions = null, string? transactionId = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/documents" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId); @@ -717,6 +816,16 @@ static Models.Document Convert(Dictionary it) /// public Task CreateDocuments(string databaseId, string collectionId, List documents, string? transactionId = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/documents" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId); @@ -759,6 +868,16 @@ static Models.DocumentList Convert(Dictionary it) /// public Task UpsertDocuments(string databaseId, string collectionId, List documents, string? transactionId = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/documents" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId); @@ -799,6 +918,16 @@ static Models.DocumentList Convert(Dictionary it) /// public Task UpdateDocuments(string databaseId, string collectionId, object? data = null, List? queries = null, string? transactionId = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/documents" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId); @@ -839,6 +968,16 @@ static Models.DocumentList Convert(Dictionary it) /// public Task DeleteDocuments(string databaseId, string collectionId, List? queries = null, string? transactionId = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/documents" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId); @@ -881,6 +1020,16 @@ static Models.DocumentList Convert(Dictionary it) /// public Task CreateQuery(string databaseId, string collectionId, List? queries = null, string? transactionId = null, bool? total = null, long? ttl = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/documents/query" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId); @@ -922,6 +1071,21 @@ static Models.DocumentList Convert(Dictionary it) /// public Task GetDocument(string databaseId, string collectionId, string documentId, List? queries = null, string? transactionId = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + + if (documentId == "") + { + throw new AppwriteException("Missing required parameter: \"documentId\""); + } + var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/documents/{documentId}" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId) @@ -963,6 +1127,21 @@ static Models.Document Convert(Dictionary it) /// public Task UpsertDocument(string databaseId, string collectionId, string documentId, object? data = null, List? permissions = null, string? transactionId = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + + if (documentId == "") + { + throw new AppwriteException("Missing required parameter: \"documentId\""); + } + var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/documents/{documentId}" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId) @@ -1004,6 +1183,21 @@ static Models.Document Convert(Dictionary it) /// public Task UpdateDocument(string databaseId, string collectionId, string documentId, object? data = null, List? permissions = null, string? transactionId = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + + if (documentId == "") + { + throw new AppwriteException("Missing required parameter: \"documentId\""); + } + var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/documents/{documentId}" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId) @@ -1044,6 +1238,21 @@ static Models.Document Convert(Dictionary it) /// public Task DeleteDocument(string databaseId, string collectionId, string documentId, string? transactionId = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + + if (documentId == "") + { + throw new AppwriteException("Missing required parameter: \"documentId\""); + } + var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/documents/{documentId}" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId) @@ -1057,7 +1266,8 @@ public Task DeleteDocument(string databaseId, string collectionId, strin var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1076,6 +1286,16 @@ public Task DeleteDocument(string databaseId, string collectionId, strin /// public Task ListIndexes(string databaseId, string collectionId, List? queries = null, bool? total = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/indexes" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId); @@ -1115,6 +1335,16 @@ static Models.IndexList Convert(Dictionary it) /// public Task CreateIndex(string databaseId, string collectionId, string key, Appwrite.Enums.VectorsDBIndexType type, List attributes, List? orders = null, List? lengths = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/indexes" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId); @@ -1156,6 +1386,21 @@ static Models.Index Convert(Dictionary it) /// public Task GetIndex(string databaseId, string collectionId, string key) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + + if (key == "") + { + throw new AppwriteException("Missing required parameter: \"key\""); + } + var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/indexes/{key}" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId) @@ -1192,6 +1437,21 @@ static Models.Index Convert(Dictionary it) /// public Task DeleteIndex(string databaseId, string collectionId, string key) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + + if (collectionId == "") + { + throw new AppwriteException("Missing required parameter: \"collectionId\""); + } + + if (key == "") + { + throw new AppwriteException("Missing required parameter: \"key\""); + } + var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/indexes/{key}" .Replace("{databaseId}", databaseId) .Replace("{collectionId}", collectionId) @@ -1204,7 +1464,8 @@ public Task DeleteIndex(string databaseId, string collectionId, string k var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1231,6 +1492,11 @@ public Task DeleteIndex(string databaseId, string collectionId, string k /// public Task CreateFailover(string databaseId, string? targetReplicaId = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/vectorsdb/{databaseId}/failovers" .Replace("{databaseId}", databaseId); @@ -1270,6 +1536,11 @@ static Models.DedicatedDatabase Convert(Dictionary it) /// public Task ListOperations(string databaseId, string? status = null, long? limit = null, long? offset = null) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/vectorsdb/{databaseId}/operations" .Replace("{databaseId}", databaseId); @@ -1308,6 +1579,11 @@ static Models.DedicatedDatabaseOperationList Convert(Dictionary /// public Task GetReplicas(string databaseId) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/vectorsdb/{databaseId}/replicas" .Replace("{databaseId}", databaseId); @@ -1344,6 +1620,11 @@ static Models.DedicatedDatabaseReplicas Convert(Dictionary it) /// public Task GetStatus(string databaseId) { + if (databaseId == "") + { + throw new AppwriteException("Missing required parameter: \"databaseId\""); + } + var apiPath = "/vectorsdb/{databaseId}/status" .Replace("{databaseId}", databaseId); diff --git a/Appwrite/Services/Waf.cs b/Appwrite/Services/Waf.cs new file mode 100644 index 00000000..c0349415 --- /dev/null +++ b/Appwrite/Services/Waf.cs @@ -0,0 +1,682 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Appwrite.Models; +using Appwrite.Enums; + +namespace Appwrite.Services +{ + public class Waf : Service + { + public Waf(Client client) : base(client) + { + } + + /// + /// List WAF rules for the current project. + /// + /// + /// + public Task ListRules(List? queries = null, string? search = null, bool? total = null) + { + var apiPath = "/waf/rules"; + + var apiParameters = new Dictionary() + { + { "queries", queries }, + { "search", search }, + { "total", total } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.WafRuleList Convert(Dictionary it) + { + return Models.WafRuleList.From(map: it); + } + + return _client.Call( + method: "GET", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Create a bypass WAF rule. Conditions can match request attributes including + /// `ip` (plain IPs or CIDR blocks like `10.0.0.0/8`), `method`, `path`, + /// `host`, `country`, `continent`, `headers.`, `query.`, + /// `queryKeys`, `userAgent`, `os`, `osVersion`, `browser`, and + /// `browserVersion`. Conditions on `city` and `state` require the premium Geo + /// DB addon. + /// + /// + /// + public Task CreateBypassRule(string ruleId, string resourceType, string name, string? resourceId = null, string? description = null, long? priority = null, bool? enabled = null, List? conditions = null) + { + var apiPath = "/waf/rules/bypass"; + + var apiParameters = new Dictionary() + { + { "ruleId", ruleId }, + { "resourceType", resourceType }, + { "resourceId", resourceId }, + { "name", name }, + { "description", description }, + { "priority", priority }, + { "enabled", enabled }, + { "conditions", conditions } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.WafRuleBypass Convert(Dictionary it) + { + return Models.WafRuleBypass.From(map: it); + } + + return _client.Call( + method: "POST", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Update a bypass WAF rule. Conditions can match request attributes including + /// `ip` (plain IPs or CIDR blocks like `10.0.0.0/8`), `method`, `path`, + /// `host`, `country`, `continent`, `headers.`, `query.`, + /// `queryKeys`, `userAgent`, `os`, `osVersion`, `browser`, and + /// `browserVersion`. Conditions on `city` and `state` require the premium Geo + /// DB addon. + /// + /// + /// + public Task UpdateBypassRule(string ruleId, string? resourceType = null, string? resourceId = null, string? name = null, string? description = null, long? priority = null, bool? enabled = null, List? conditions = null) + { + if (ruleId == "") + { + throw new AppwriteException("Missing required parameter: \"ruleId\""); + } + + var apiPath = "/waf/rules/bypass/{ruleId}" + .Replace("{ruleId}", ruleId); + + var apiParameters = new Dictionary() + { + { "resourceType", resourceType }, + { "resourceId", resourceId }, + { "name", name }, + { "description", description }, + { "priority", priority }, + { "enabled", enabled }, + { "conditions", conditions } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.WafRuleBypass Convert(Dictionary it) + { + return Models.WafRuleBypass.From(map: it); + } + + return _client.Call( + method: "PATCH", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Create a challenge WAF rule. Use `difficulty` (1 easiest to 5 hardest) to + /// tune the client-side proof-of-work cost, and `ttl` to control how long, in + /// seconds, a visitor stays cleared after passing the challenge before being + /// challenged again. Conditions can match request attributes including `ip` + /// (plain IPs or CIDR blocks like `10.0.0.0/8`), `method`, `path`, `host`, + /// `country`, `continent`, `headers.`, `query.`, `queryKeys`, + /// `userAgent`, `os`, `osVersion`, `browser`, and `browserVersion`. Conditions + /// on `city` and `state` require the premium Geo DB addon. + /// + /// + /// + public Task CreateChallengeRule(string ruleId, string resourceType, string name, string? resourceId = null, string? description = null, string? challengeType = null, long? priority = null, bool? enabled = null, List? conditions = null, long? difficulty = null, long? ttl = null) + { + var apiPath = "/waf/rules/challenge"; + + var apiParameters = new Dictionary() + { + { "ruleId", ruleId }, + { "resourceType", resourceType }, + { "resourceId", resourceId }, + { "name", name }, + { "description", description }, + { "challengeType", challengeType }, + { "priority", priority }, + { "enabled", enabled }, + { "conditions", conditions }, + { "difficulty", difficulty }, + { "ttl", ttl } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.WafRuleChallenge Convert(Dictionary it) + { + return Models.WafRuleChallenge.From(map: it); + } + + return _client.Call( + method: "POST", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Update a challenge WAF rule. Use `difficulty` (1 easiest to 5 hardest) to + /// tune the client-side proof-of-work cost, and `ttl` to control how long, in + /// seconds, a visitor stays cleared after passing the challenge before being + /// challenged again. Conditions can match request attributes including `ip` + /// (plain IPs or CIDR blocks like `10.0.0.0/8`), `method`, `path`, `host`, + /// `country`, `continent`, `headers.`, `query.`, `queryKeys`, + /// `userAgent`, `os`, `osVersion`, `browser`, and `browserVersion`. Conditions + /// on `city` and `state` require the premium Geo DB addon. + /// + /// + /// + public Task UpdateChallengeRule(string ruleId, string? resourceType = null, string? resourceId = null, string? name = null, string? description = null, string? challengeType = null, long? priority = null, bool? enabled = null, List? conditions = null, long? difficulty = null, long? ttl = null) + { + if (ruleId == "") + { + throw new AppwriteException("Missing required parameter: \"ruleId\""); + } + + var apiPath = "/waf/rules/challenge/{ruleId}" + .Replace("{ruleId}", ruleId); + + var apiParameters = new Dictionary() + { + { "resourceType", resourceType }, + { "resourceId", resourceId }, + { "name", name }, + { "description", description }, + { "challengeType", challengeType }, + { "priority", priority }, + { "enabled", enabled }, + { "conditions", conditions }, + { "difficulty", difficulty }, + { "ttl", ttl } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.WafRuleChallenge Convert(Dictionary it) + { + return Models.WafRuleChallenge.From(map: it); + } + + return _client.Call( + method: "PATCH", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Create a deny WAF rule. Conditions can match request attributes including + /// `ip` (plain IPs or CIDR blocks like `10.0.0.0/8`), `method`, `path`, + /// `host`, `country`, `continent`, `headers.`, `query.`, + /// `queryKeys`, `userAgent`, `os`, `osVersion`, `browser`, and + /// `browserVersion`. Conditions on `city` and `state` require the premium Geo + /// DB addon. + /// + /// + /// + public Task CreateDenyRule(string ruleId, string resourceType, string name, string? resourceId = null, string? description = null, long? priority = null, bool? enabled = null, List? conditions = null) + { + var apiPath = "/waf/rules/deny"; + + var apiParameters = new Dictionary() + { + { "ruleId", ruleId }, + { "resourceType", resourceType }, + { "resourceId", resourceId }, + { "name", name }, + { "description", description }, + { "priority", priority }, + { "enabled", enabled }, + { "conditions", conditions } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.WafRuleDeny Convert(Dictionary it) + { + return Models.WafRuleDeny.From(map: it); + } + + return _client.Call( + method: "POST", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Update a deny WAF rule. Conditions can match request attributes including + /// `ip` (plain IPs or CIDR blocks like `10.0.0.0/8`), `method`, `path`, + /// `host`, `country`, `continent`, `headers.`, `query.`, + /// `queryKeys`, `userAgent`, `os`, `osVersion`, `browser`, and + /// `browserVersion`. Conditions on `city` and `state` require the premium Geo + /// DB addon. + /// + /// + /// + public Task UpdateDenyRule(string ruleId, string? resourceType = null, string? resourceId = null, string? name = null, string? description = null, long? priority = null, bool? enabled = null, List? conditions = null) + { + if (ruleId == "") + { + throw new AppwriteException("Missing required parameter: \"ruleId\""); + } + + var apiPath = "/waf/rules/deny/{ruleId}" + .Replace("{ruleId}", ruleId); + + var apiParameters = new Dictionary() + { + { "resourceType", resourceType }, + { "resourceId", resourceId }, + { "name", name }, + { "description", description }, + { "priority", priority }, + { "enabled", enabled }, + { "conditions", conditions } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.WafRuleDeny Convert(Dictionary it) + { + return Models.WafRuleDeny.From(map: it); + } + + return _client.Call( + method: "PATCH", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Create a rate limit WAF rule. Use `key` to choose the counter: `ip` limits + /// per client IP, while `userId` limits per authenticated user (requests + /// without an authenticated user skip `userId` rules). Conditions can match + /// request attributes including `ip` (plain IPs or CIDR blocks like + /// `10.0.0.0/8`), `method`, `path`, `host`, `country`, `continent`, + /// `headers.`, `query.`, `queryKeys`, `userAgent`, `os`, + /// `osVersion`, `browser`, and `browserVersion`. Conditions on `city` and + /// `state` require the premium Geo DB addon. + /// + /// + /// + public Task CreateRateLimitRule(string ruleId, string resourceType, string name, long limit, long interval, string? resourceId = null, string? description = null, string? key = null, string? strategy = null, long? maxBucketSize = null, long? priority = null, bool? enabled = null, List? conditions = null) + { + var apiPath = "/waf/rules/rate-limit"; + + var apiParameters = new Dictionary() + { + { "ruleId", ruleId }, + { "resourceType", resourceType }, + { "resourceId", resourceId }, + { "name", name }, + { "description", description }, + { "limit", limit }, + { "interval", interval }, + { "key", key }, + { "strategy", strategy }, + { "maxBucketSize", maxBucketSize }, + { "priority", priority }, + { "enabled", enabled }, + { "conditions", conditions } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.WafRuleRateLimit Convert(Dictionary it) + { + return Models.WafRuleRateLimit.From(map: it); + } + + return _client.Call( + method: "POST", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Update a rate limit WAF rule. Use `key` to choose the counter: `ip` limits + /// per client IP, while `userId` limits per authenticated user (requests + /// without an authenticated user skip `userId` rules). Conditions can match + /// request attributes including `ip` (plain IPs or CIDR blocks like + /// `10.0.0.0/8`), `method`, `path`, `host`, `country`, `continent`, + /// `headers.`, `query.`, `queryKeys`, `userAgent`, `os`, + /// `osVersion`, `browser`, and `browserVersion`. Conditions on `city` and + /// `state` require the premium Geo DB addon. + /// + /// + /// + public Task UpdateRateLimitRule(string ruleId, string? resourceType = null, string? resourceId = null, string? name = null, string? description = null, long? limit = null, long? interval = null, string? key = null, long? maxBucketSize = null, long? priority = null, bool? enabled = null, List? conditions = null) + { + if (ruleId == "") + { + throw new AppwriteException("Missing required parameter: \"ruleId\""); + } + + var apiPath = "/waf/rules/rate-limit/{ruleId}" + .Replace("{ruleId}", ruleId); + + var apiParameters = new Dictionary() + { + { "resourceType", resourceType }, + { "resourceId", resourceId }, + { "name", name }, + { "description", description }, + { "limit", limit }, + { "interval", interval }, + { "key", key }, + { "maxBucketSize", maxBucketSize }, + { "priority", priority }, + { "enabled", enabled }, + { "conditions", conditions } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.WafRuleRateLimit Convert(Dictionary it) + { + return Models.WafRuleRateLimit.From(map: it); + } + + return _client.Call( + method: "PATCH", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Create a redirect WAF rule. Conditions can match request attributes + /// including `ip` (plain IPs or CIDR blocks like `10.0.0.0/8`), `method`, + /// `path`, `host`, `country`, `continent`, `headers.`, `query.`, + /// `queryKeys`, `userAgent`, `os`, `osVersion`, `browser`, and + /// `browserVersion`. Conditions on `city` and `state` require the premium Geo + /// DB addon. + /// + /// + /// + public Task CreateRedirectRule(string ruleId, string resourceType, string name, string location, long statusCode, string? resourceId = null, string? description = null, long? priority = null, bool? enabled = null, List? conditions = null) + { + var apiPath = "/waf/rules/redirect"; + + var apiParameters = new Dictionary() + { + { "ruleId", ruleId }, + { "resourceType", resourceType }, + { "resourceId", resourceId }, + { "name", name }, + { "description", description }, + { "location", location }, + { "statusCode", statusCode }, + { "priority", priority }, + { "enabled", enabled }, + { "conditions", conditions } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.WafRuleRedirect Convert(Dictionary it) + { + return Models.WafRuleRedirect.From(map: it); + } + + return _client.Call( + method: "POST", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Update a redirect WAF rule. Conditions can match request attributes + /// including `ip` (plain IPs or CIDR blocks like `10.0.0.0/8`), `method`, + /// `path`, `host`, `country`, `continent`, `headers.`, `query.`, + /// `queryKeys`, `userAgent`, `os`, `osVersion`, `browser`, and + /// `browserVersion`. Conditions on `city` and `state` require the premium Geo + /// DB addon. + /// + /// + /// + public Task UpdateRedirectRule(string ruleId, string? resourceType = null, string? resourceId = null, string? name = null, string? description = null, string? location = null, long? statusCode = null, long? priority = null, bool? enabled = null, List? conditions = null) + { + if (ruleId == "") + { + throw new AppwriteException("Missing required parameter: \"ruleId\""); + } + + var apiPath = "/waf/rules/redirect/{ruleId}" + .Replace("{ruleId}", ruleId); + + var apiParameters = new Dictionary() + { + { "resourceType", resourceType }, + { "resourceId", resourceId }, + { "name", name }, + { "description", description }, + { "location", location }, + { "statusCode", statusCode }, + { "priority", priority }, + { "enabled", enabled }, + { "conditions", conditions } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.WafRuleRedirect Convert(Dictionary it) + { + return Models.WafRuleRedirect.From(map: it); + } + + return _client.Call( + method: "PATCH", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Get a WAF rule by its ID. + /// + /// + /// + public Task GetRule(string ruleId) + { + if (ruleId == "") + { + throw new AppwriteException("Missing required parameter: \"ruleId\""); + } + + var apiPath = "/waf/rules/{ruleId}" + .Replace("{ruleId}", ruleId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static object Convert(Dictionary it) + { + if (it.TryGetValue("action", out var actionValue1) && actionValue1?.ToString() == "bypass") + { + return Appwrite.Models.WafRuleBypass.From(map: it); + } + if (it.TryGetValue("action", out var actionValue2) && actionValue2?.ToString() == "deny") + { + return Appwrite.Models.WafRuleDeny.From(map: it); + } + if (it.TryGetValue("action", out var actionValue3) && actionValue3?.ToString() == "challenge") + { + return Appwrite.Models.WafRuleChallenge.From(map: it); + } + if (it.TryGetValue("action", out var actionValue4) && actionValue4?.ToString() == "rateLimit") + { + return Appwrite.Models.WafRuleRateLimit.From(map: it); + } + if (it.TryGetValue("action", out var actionValue5) && actionValue5?.ToString() == "redirect") + { + return Appwrite.Models.WafRuleRedirect.From(map: it); + } + throw new System.Exception("Unable to match response to any expected response model"); + } + + return _client.Call( + method: "GET", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Delete a WAF rule. + /// + /// + /// + public Task DeleteRule(string ruleId) + { + if (ruleId == "") + { + throw new AppwriteException("Missing required parameter: \"ruleId\""); + } + + var apiPath = "/waf/rules/{ruleId}" + .Replace("{ruleId}", ruleId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + + return _client.Call( + method: "DELETE", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!); + + } + + } +} diff --git a/Appwrite/Services/Webhooks.cs b/Appwrite/Services/Webhooks.cs index c9e43260..a49a1a2f 100644 --- a/Appwrite/Services/Webhooks.cs +++ b/Appwrite/Services/Webhooks.cs @@ -100,6 +100,11 @@ static Models.Webhook Convert(Dictionary it) /// public Task Get(string webhookId) { + if (webhookId == "") + { + throw new AppwriteException("Missing required parameter: \"webhookId\""); + } + var apiPath = "/webhooks/{webhookId}" .Replace("{webhookId}", webhookId); @@ -135,6 +140,11 @@ static Models.Webhook Convert(Dictionary it) /// public Task Update(string webhookId, string name, string url, List events, bool? enabled = null, bool? tls = null, string? authUsername = null, string? authPassword = null) { + if (webhookId == "") + { + throw new AppwriteException("Missing required parameter: \"webhookId\""); + } + var apiPath = "/webhooks/{webhookId}" .Replace("{webhookId}", webhookId); @@ -178,6 +188,11 @@ static Models.Webhook Convert(Dictionary it) /// public Task Delete(string webhookId) { + if (webhookId == "") + { + throw new AppwriteException("Missing required parameter: \"webhookId\""); + } + var apiPath = "/webhooks/{webhookId}" .Replace("{webhookId}", webhookId); @@ -188,7 +203,8 @@ public Task Delete(string webhookId) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -209,6 +225,11 @@ public Task Delete(string webhookId) /// public Task UpdateSecret(string webhookId, string? secret = null) { + if (webhookId == "") + { + throw new AppwriteException("Missing required parameter: \"webhookId\""); + } + var apiPath = "/webhooks/{webhookId}/secret" .Replace("{webhookId}", webhookId); diff --git a/Appwrite/Topic.cs b/Appwrite/Topic.cs new file mode 100644 index 00000000..64e97f14 --- /dev/null +++ b/Appwrite/Topic.cs @@ -0,0 +1,144 @@ +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Appwrite +{ + /// + /// Helper to build MQTT topics for Push, level by level. + /// + /// Topic.Path(new[] { "user", userId, "notification" }); // "user/123/notification" + /// Topic.Path(new[] { "user" }).Any().Path(new[] { "notification" }); // "user/+/notification" + /// Topic.Path(new[] { "org" }).Any().Path(new[] { "logs" }).All(); // "org/+/logs/#" + /// + /// Any() matches exactly one level and All() everything below, at any depth + /// (including the parent itself). All() ends the topic, so it returns a + /// . The instance Path, Any and All that + /// append to a topic live in . + /// + public sealed class Topic + { + internal IReadOnlyList Levels { get; } + + internal Topic(IReadOnlyList levels) + { + Levels = levels; + } + + /// Start a topic with the given levels, e.g. Topic.Path(new[] { "user", userId }). + /// A level is empty, or holds "/", "+" or "#". + public static Topic Path(IEnumerable levels) + { + return new Topic(LevelsOf(levels)); + } + + /// Start a topic with a single-level wildcard (+). + public static Topic Any() + { + return new Topic(new[] { "+" }); + } + + /// The multi-level wildcard alone (#): matches every topic. + public static ResolvedTopic All() + { + return new ResolvedTopic(new[] { "#" }); + } + + public override string ToString() => string.Join("/", Levels); + + /// + /// Validate the levels passed to Path: a non-empty list of non-empty strings, none + /// holding the level separator / or the wildcards + and # (use + /// Any() and All() for those). + /// + internal static List LevelsOf(IEnumerable levels) + { + if (levels == null) + { + throw new ArgumentException("path() expects an array, e.g. path(['user'])"); + } + + var list = levels.ToList(); + if (list.Count == 0) + { + throw new ArgumentException("path() needs at least one level"); + } + + for (var index = 0; index < list.Count; index++) + { + var level = list[index]; + if (level == null) + { + throw new ArgumentException($"level at index {index} must be a string, got null"); + } + if (level.Length == 0) + { + throw new ArgumentException($"empty level at index {index}"); + } + if (level.Contains("/")) + { + var parts = string.Join(", ", level.Split('/').Select(part => $"'{part}'")); + throw new ArgumentException($"\"{level}\" contains \"/\", split it: path([{parts}])"); + } + if (level == "+") + { + throw new ArgumentException("\"+\" is reserved, use any()"); + } + if (level.Contains("+")) + { + throw new ArgumentException($"\"{level}\" contains \"+\", use any() for wildcards"); + } + if (level == "#") + { + throw new ArgumentException("\"#\" is reserved, use all()"); + } + if (level.Contains("#")) + { + throw new ArgumentException($"\"{level}\" contains \"#\", use all() for wildcards"); + } + } + + return list; + } + } + + /// + /// Appends levels to a . These are extension methods because C# does not + /// allow a static and an instance method with the same signature on one class, and they + /// keep chains reading Topic.Path(...).Any().Path(...). + /// + public static class TopicExtensions + { + /// Append the given levels. + /// A level is empty, or holds "/", "+" or "#". + public static Topic Path(this Topic topic, IEnumerable levels) + { + return new Topic(topic.Levels.Concat(Topic.LevelsOf(levels)).ToList()); + } + + /// Append a single-level wildcard (+): matches exactly one level. + public static Topic Any(this Topic topic) + { + return new Topic(topic.Levels.Concat(new[] { "+" }).ToList()); + } + + /// Append the multi-level wildcard (#) and end the topic. + public static ResolvedTopic All(this Topic topic) + { + return new ResolvedTopic(topic.Levels.Concat(new[] { "#" }).ToList()); + } + } + + /// A topic ended by All(): nothing can be appended after the # wildcard. + public sealed class ResolvedTopic + { + private readonly IReadOnlyList _levels; + + internal ResolvedTopic(IReadOnlyList levels) + { + _levels = levels; + } + + public override string ToString() => string.Join("/", _levels); + } +} diff --git a/CHANGELOG.md b/CHANGELOG.md index b2c2c505..7b3c7b09 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,43 @@ # Change Log +## 9.0.0 + +* Breaking: `Account.ListLogs`, `Users.ListLogs`, `Log` and `LogList` removed +* Breaking: `organization` key methods renamed to `CreateEphemeralProjectKey`, `GetProjectKey`, `ListProjectKeys`, `UpdateProjectKey` and `DeleteProjectKey`; `OrganizationKeyScopes` removed +* Breaking: `SetDevKey` client method, `DevKey` model and `Project.DevKeys` removed +* Breaking: `ProjectName`, `Region`, `OrganizationId`, `OrganizationName`, `BillingPlan` and `Reason` removed from `Block` +* Breaking: `DedicatedDatabaseSpecificationList.Pricing` and `DedicatedDatabaseSpecificationPricing` removed; rates now live on `DedicatedDatabaseSpecification` +* Breaking: `BillingPlanGroup` `starter` replaced by `free` and `start` +* Breaking: `resource` is now an array on `Oauth2.Authorize`, `Oauth2.CreatePAR`, `Oauth2.CreateToken` and `Oauth2.CreateDeviceAuthorization` +* Breaking: `BackupRestoration.Options` is now a key-value object instead of a string +* Breaking: several model fields are now nullable, e.g. `DedicatedDatabase.Engine`, `Organization.BillingStartDate`, `BillingPlan.Usage`, `BackupArchive.Size` +* Breaking: optional parameters reordered in `Messaging.UpdateEmail`, `Messaging.UpdatePush` and `Messaging.UpdateSMS`; new ones inserted mid-list in `Messaging.CreateEmail`, `Teams.CreateMembership` and `project` OAuth2 provider updates; use named arguments +* Added: passkey methods `Account.ListPasskeys`, `Account.CreatePasskey`, `Account.GetPasskey`, `Account.UpdatePasskey`, `Account.DeletePasskey`, `Account.UpdatePasskeyVerification`, `Account.CreatePasskeyToken` and `Account.UpdatePasskeyToken` +* Added: `Users.ListPasskeys`, `Users.GetPasskey`, `Users.UpdatePasskey`, `Users.DeletePasskey`, plus `Project.UpdatePasskeyPolicy` +* Added: `Passkey`, `PasskeyList`, `PasskeyChallenge`, `PolicyPasskey` and `TokenSecret` models +* Added: `Fingerprints` on Android platforms for passkeys +* Added: `domains` service for domains, DNS records, email presets, prices and transfers +* Added: `waf` service for bypass, challenge, deny, rate-limit and redirect rules +* Added: `Account.CreateIdTokenSession` for native Apple and Google sign-in, with native client IDs on those providers +* Added: email verification and recovery OTP methods on `account` +* Added: `Oauth2.Introspect` for RFC 7662 token introspection, returning `Oauth2Introspection` +* Added: `Avatars.UpdatePhoto` and `Avatars.DeletePhoto` +* Added: `Messaging.CreateAppwriteProvider` and `Messaging.UpdateAppwriteProvider` +* Added: `Project.UpdatePasswordPwnedPolicy`, `PolicyPasswordPwned` model and `User.PasswordPwned` +* Added: Kakao, TikTok and Webflow OAuth2 providers +* Added: `prompt` on Auth0, Discord, GitHub, Microsoft, Okta, Salesforce and Zoho providers, with prompt enums +* Added: `Topic` and `ResolvedTopic` helpers for building MQTT push topics +* Added: reply-to on email messages, `ChannelId` on push messages, `Qos` and `Expiry` on topics +* Added: `MembershipId` on `Teams.CreateMembership`, and `Total` on locale and other list endpoints +* Added: `StorageStatus` and `StorageTargetGb` on `DedicatedDatabase`; `EligibleCountries` on `BillingPlan` +* Added: `auto` image gravity, `jaspr` framework, `dart-3.13` and `flutter-3.47` runtimes +* Added: `Project.UpdatePasswordRotationPolicy` and the `PolicyPasswordRotation` model +* Fixed: response models fill missing fields from spec defaults instead of throwing +* Fixed: object parameters in multipart requests are sent as JSON +* Fixed: stream inputs are read fully before a single-request upload +* Updated: requests send `X-Appwrite-Response-Format` `2.4.0` +* Updated: `System.Text.Json` bumped to `9.0.20` + ## 8.2.0 * Added: optional `interval` parameter on `functions.create` and `functions.update` to run a function every N minutes diff --git a/README.md b/README.md index 76632609..382b7a71 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ # Appwrite .NET SDK ![License](https://img.shields.io/github/license/appwrite/sdk-for-dotnet.svg?style=flat-square) -![Version](https://img.shields.io/badge/api%20version-2.0.0-blue.svg?style=flat-square) +![Version](https://img.shields.io/badge/api%20version-2.4.0-blue.svg?style=flat-square) [![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator) [![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite) [![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord) -**This SDK targets Appwrite server version 1.9.x as shipped on Appwrite Cloud.** Self-hosted releases can lag behind Cloud — if you run an older self-hosted build, use a matching older SDK from [previous releases](https://github.com/appwrite/sdk-for-dotnet/releases) when APIs differ. +**This SDK targets Appwrite server version 2.4.x as shipped on Appwrite Cloud.** Self-hosted releases can lag behind Cloud — if you run an older self-hosted build, use a matching older SDK from [previous releases](https://github.com/appwrite/sdk-for-dotnet/releases) when APIs differ. Appwrite is an open-source backend as a service server that abstracts and simplifies complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. Use the .NET SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs) @@ -17,17 +17,17 @@ Appwrite is an open-source backend as a service server that abstracts and simpli Add this reference to your project's `.csproj` file: ```xml - + ``` You can install packages from the command line: ```powershell # Package Manager -Install-Package Appwrite -Version 8.2.0 +Install-Package Appwrite -Version 9.0.0 # or .NET CLI -dotnet add package Appwrite --version 8.2.0 +dotnet add package Appwrite --version 9.0.0 ``` diff --git a/docs/examples/account/create-anonymous-session.md b/docs/examples/account/create-anonymous-session.md index 35b3aab4..81dc71b4 100644 --- a/docs/examples/account/create-anonymous-session.md +++ b/docs/examples/account/create-anonymous-session.md @@ -10,7 +10,7 @@ Client client = new Client() Account account = new Account(client); -Session result = await account.CreateAnonymousSession(); +Appwrite.Models.Session result = await account.CreateAnonymousSession(); ``` diff --git a/docs/examples/account/create-email-password-session.md b/docs/examples/account/create-email-password-session.md index f24e35ca..06f70f33 100644 --- a/docs/examples/account/create-email-password-session.md +++ b/docs/examples/account/create-email-password-session.md @@ -10,9 +10,10 @@ Client client = new Client() Account account = new Account(client); -Session result = await account.CreateEmailPasswordSession( +Appwrite.Models.Session result = await account.CreateEmailPasswordSession( email: "email@example.com", - password: "password" + password: "password", + duration: 60 // optional ); ``` diff --git a/docs/examples/account/create-email-token.md b/docs/examples/account/create-email-token.md index be003ffe..a43eb0bb 100644 --- a/docs/examples/account/create-email-token.md +++ b/docs/examples/account/create-email-token.md @@ -10,7 +10,7 @@ Client client = new Client() Account account = new Account(client); -Token result = await account.CreateEmailToken( +Appwrite.Models.Token result = await account.CreateEmailToken( userId: "", email: "email@example.com", phrase: false // optional diff --git a/docs/examples/account/create-email-verification-otp.md b/docs/examples/account/create-email-verification-otp.md new file mode 100644 index 00000000..13e56543 --- /dev/null +++ b/docs/examples/account/create-email-verification-otp.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +Appwrite.Models.Token result = await account.CreateEmailVerificationOTP( + phrase: false // optional +); + +``` diff --git a/docs/examples/account/create-email-verification.md b/docs/examples/account/create-email-verification.md index b5c4aad4..b3b841be 100644 --- a/docs/examples/account/create-email-verification.md +++ b/docs/examples/account/create-email-verification.md @@ -10,7 +10,7 @@ Client client = new Client() Account account = new Account(client); -Token result = await account.CreateEmailVerification( +Appwrite.Models.Token result = await account.CreateEmailVerification( url: "https://example.com" ); diff --git a/docs/examples/account/create-id-token-session.md b/docs/examples/account/create-id-token-session.md new file mode 100644 index 00000000..fd3945ba --- /dev/null +++ b/docs/examples/account/create-id-token-session.md @@ -0,0 +1,23 @@ +```csharp +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +Appwrite.Models.Session result = await account.CreateIdTokenSession( + provider: IdTokenProvider.Apple, + idToken: "", + nonce: "", // optional + accessToken: "", // optional + accessTokenExpiry: 0, // optional + name: "" // optional +); + +``` diff --git a/docs/examples/account/create-magic-url-token.md b/docs/examples/account/create-magic-url-token.md index 85e77164..84562431 100644 --- a/docs/examples/account/create-magic-url-token.md +++ b/docs/examples/account/create-magic-url-token.md @@ -10,7 +10,7 @@ Client client = new Client() Account account = new Account(client); -Token result = await account.CreateMagicURLToken( +Appwrite.Models.Token result = await account.CreateMagicURLToken( userId: "", email: "email@example.com", url: "https://example.com", // optional diff --git a/docs/examples/account/create-mfa-authenticator.md b/docs/examples/account/create-mfa-authenticator.md index 74e3d105..8405427d 100644 --- a/docs/examples/account/create-mfa-authenticator.md +++ b/docs/examples/account/create-mfa-authenticator.md @@ -11,7 +11,7 @@ Client client = new Client() Account account = new Account(client); -MfaType result = await account.CreateMFAAuthenticator( +Appwrite.Models.MfaType result = await account.CreateMFAAuthenticator( type: AuthenticatorType.Totp ); diff --git a/docs/examples/account/create-mfa-challenge.md b/docs/examples/account/create-mfa-challenge.md index 8f7a9208..7ca2d569 100644 --- a/docs/examples/account/create-mfa-challenge.md +++ b/docs/examples/account/create-mfa-challenge.md @@ -11,7 +11,7 @@ Client client = new Client() Account account = new Account(client); -MfaChallenge result = await account.CreateMFAChallenge( +Appwrite.Models.MfaChallenge result = await account.CreateMFAChallenge( factor: AuthenticationFactor.Email ); diff --git a/docs/examples/account/create-mfa-recovery-codes.md b/docs/examples/account/create-mfa-recovery-codes.md index 6869828d..37dd3a89 100644 --- a/docs/examples/account/create-mfa-recovery-codes.md +++ b/docs/examples/account/create-mfa-recovery-codes.md @@ -10,7 +10,7 @@ Client client = new Client() Account account = new Account(client); -MfaRecoveryCodes result = await account.CreateMFARecoveryCodes(); +Appwrite.Models.MfaRecoveryCodes result = await account.CreateMFARecoveryCodes(); ``` diff --git a/docs/examples/account/create-passkey-token.md b/docs/examples/account/create-passkey-token.md new file mode 100644 index 00000000..bed3c988 --- /dev/null +++ b/docs/examples/account/create-passkey-token.md @@ -0,0 +1,16 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +Appwrite.Models.PasskeyChallenge result = await account.CreatePasskeyToken(); + + +``` diff --git a/docs/examples/account/create-passkey.md b/docs/examples/account/create-passkey.md new file mode 100644 index 00000000..366e221a --- /dev/null +++ b/docs/examples/account/create-passkey.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +Appwrite.Models.PasskeyChallenge result = await account.CreatePasskey( + passkeyId: "", // optional + name: "" // optional +); + +``` diff --git a/docs/examples/account/create-phone-token.md b/docs/examples/account/create-phone-token.md index e296f8ed..5f3e5bb5 100644 --- a/docs/examples/account/create-phone-token.md +++ b/docs/examples/account/create-phone-token.md @@ -10,7 +10,7 @@ Client client = new Client() Account account = new Account(client); -Token result = await account.CreatePhoneToken( +Appwrite.Models.Token result = await account.CreatePhoneToken( userId: "", phone: "+12065550100" ); diff --git a/docs/examples/account/create-phone-verification.md b/docs/examples/account/create-phone-verification.md index e5f1144d..f6cd2d1b 100644 --- a/docs/examples/account/create-phone-verification.md +++ b/docs/examples/account/create-phone-verification.md @@ -10,7 +10,7 @@ Client client = new Client() Account account = new Account(client); -Token result = await account.CreatePhoneVerification(); +Appwrite.Models.Token result = await account.CreatePhoneVerification(); ``` diff --git a/docs/examples/account/create-recovery-otp.md b/docs/examples/account/create-recovery-otp.md new file mode 100644 index 00000000..93602e46 --- /dev/null +++ b/docs/examples/account/create-recovery-otp.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +Appwrite.Models.Token result = await account.CreateRecoveryOTP( + email: "email@example.com", + phrase: false // optional +); + +``` diff --git a/docs/examples/account/create-recovery.md b/docs/examples/account/create-recovery.md index 7951fcb6..df9fba03 100644 --- a/docs/examples/account/create-recovery.md +++ b/docs/examples/account/create-recovery.md @@ -10,7 +10,7 @@ Client client = new Client() Account account = new Account(client); -Token result = await account.CreateRecovery( +Appwrite.Models.Token result = await account.CreateRecovery( email: "email@example.com", url: "https://example.com" ); diff --git a/docs/examples/account/create-session.md b/docs/examples/account/create-session.md index 9cd8558a..b3a0cae6 100644 --- a/docs/examples/account/create-session.md +++ b/docs/examples/account/create-session.md @@ -10,7 +10,7 @@ Client client = new Client() Account account = new Account(client); -Session result = await account.CreateSession( +Appwrite.Models.Session result = await account.CreateSession( userId: "", secret: "" ); diff --git a/docs/examples/account/create-verification.md b/docs/examples/account/create-verification.md index a25aa0de..c7b6112f 100644 --- a/docs/examples/account/create-verification.md +++ b/docs/examples/account/create-verification.md @@ -10,7 +10,7 @@ Client client = new Client() Account account = new Account(client); -Token result = await account.CreateVerification( +Appwrite.Models.Token result = await account.CreateVerification( url: "https://example.com" ); diff --git a/docs/examples/account/create.md b/docs/examples/account/create.md index b068e0c3..4f136558 100644 --- a/docs/examples/account/create.md +++ b/docs/examples/account/create.md @@ -10,7 +10,7 @@ Client client = new Client() Account account = new Account(client); -User result = await account.Create( +Appwrite.Models.User result = await account.Create( userId: "", email: "email@example.com", password: "password", diff --git a/docs/examples/account/delete-passkey.md b/docs/examples/account/delete-passkey.md new file mode 100644 index 00000000..77ba3d03 --- /dev/null +++ b/docs/examples/account/delete-passkey.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +await account.DeletePasskey( + passkeyId: "" +); + +``` diff --git a/docs/examples/account/delete-sessions.md b/docs/examples/account/delete-sessions.md index 31bd03a1..1dba1fce 100644 --- a/docs/examples/account/delete-sessions.md +++ b/docs/examples/account/delete-sessions.md @@ -10,7 +10,8 @@ Client client = new Client() Account account = new Account(client); -await account.DeleteSessions(); - +await account.DeleteSessions( + current: false // optional +); ``` diff --git a/docs/examples/account/get-consent-token.md b/docs/examples/account/get-consent-token.md index d348e155..6e4df6d1 100644 --- a/docs/examples/account/get-consent-token.md +++ b/docs/examples/account/get-consent-token.md @@ -10,7 +10,7 @@ Client client = new Client() Account account = new Account(client); -Oauth2ConsentToken result = await account.GetConsentToken( +Appwrite.Models.Oauth2ConsentToken result = await account.GetConsentToken( consentId: "", tokenId: "" ); diff --git a/docs/examples/account/get-consent.md b/docs/examples/account/get-consent.md index 816f6d5e..d5780f08 100644 --- a/docs/examples/account/get-consent.md +++ b/docs/examples/account/get-consent.md @@ -10,7 +10,7 @@ Client client = new Client() Account account = new Account(client); -Oauth2Consent result = await account.GetConsent( +Appwrite.Models.Oauth2Consent result = await account.GetConsent( consentId: "" ); diff --git a/docs/examples/account/get-mfa-recovery-codes.md b/docs/examples/account/get-mfa-recovery-codes.md index 54ffda45..479dea14 100644 --- a/docs/examples/account/get-mfa-recovery-codes.md +++ b/docs/examples/account/get-mfa-recovery-codes.md @@ -10,7 +10,7 @@ Client client = new Client() Account account = new Account(client); -MfaRecoveryCodes result = await account.GetMFARecoveryCodes(); +Appwrite.Models.MfaRecoveryCodes result = await account.GetMFARecoveryCodes(); ``` diff --git a/docs/examples/account/get-passkey.md b/docs/examples/account/get-passkey.md new file mode 100644 index 00000000..fb9d3841 --- /dev/null +++ b/docs/examples/account/get-passkey.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +Appwrite.Models.Passkey result = await account.GetPasskey( + passkeyId: "" +); + +``` diff --git a/docs/examples/account/get-prefs.md b/docs/examples/account/get-prefs.md index fb891b6e..b95905bf 100644 --- a/docs/examples/account/get-prefs.md +++ b/docs/examples/account/get-prefs.md @@ -10,7 +10,7 @@ Client client = new Client() Account account = new Account(client); -Preferences result = await account.GetPrefs(); +Appwrite.Models.Preferences result = await account.GetPrefs(); ``` diff --git a/docs/examples/account/get-session.md b/docs/examples/account/get-session.md index dee7ad1b..6dcd4501 100644 --- a/docs/examples/account/get-session.md +++ b/docs/examples/account/get-session.md @@ -10,7 +10,7 @@ Client client = new Client() Account account = new Account(client); -Session result = await account.GetSession( +Appwrite.Models.Session result = await account.GetSession( sessionId: "" ); diff --git a/docs/examples/account/get.md b/docs/examples/account/get.md index ba7c848b..bb80674a 100644 --- a/docs/examples/account/get.md +++ b/docs/examples/account/get.md @@ -10,7 +10,7 @@ Client client = new Client() Account account = new Account(client); -User result = await account.Get(); +Appwrite.Models.User result = await account.Get(); ``` diff --git a/docs/examples/account/list-consent-tokens.md b/docs/examples/account/list-consent-tokens.md index 5f1f36d4..38371315 100644 --- a/docs/examples/account/list-consent-tokens.md +++ b/docs/examples/account/list-consent-tokens.md @@ -10,7 +10,7 @@ Client client = new Client() Account account = new Account(client); -Oauth2ConsentTokenList result = await account.ListConsentTokens( +Appwrite.Models.Oauth2ConsentTokenList result = await account.ListConsentTokens( consentId: "", queries: new List(), // optional total: false // optional diff --git a/docs/examples/account/list-consents.md b/docs/examples/account/list-consents.md index ca7eb65a..475d93ff 100644 --- a/docs/examples/account/list-consents.md +++ b/docs/examples/account/list-consents.md @@ -10,7 +10,7 @@ Client client = new Client() Account account = new Account(client); -Oauth2ConsentList result = await account.ListConsents( +Appwrite.Models.Oauth2ConsentList result = await account.ListConsents( queries: new List(), // optional total: false // optional ); diff --git a/docs/examples/account/list-identities.md b/docs/examples/account/list-identities.md index f64b03b0..913d5b98 100644 --- a/docs/examples/account/list-identities.md +++ b/docs/examples/account/list-identities.md @@ -10,7 +10,7 @@ Client client = new Client() Account account = new Account(client); -IdentityList result = await account.ListIdentities( +Appwrite.Models.IdentityList result = await account.ListIdentities( queries: new List(), // optional total: false // optional ); diff --git a/docs/examples/account/list-mfa-factors.md b/docs/examples/account/list-mfa-factors.md index 5fa29c29..8146e644 100644 --- a/docs/examples/account/list-mfa-factors.md +++ b/docs/examples/account/list-mfa-factors.md @@ -10,7 +10,7 @@ Client client = new Client() Account account = new Account(client); -MfaFactors result = await account.ListMFAFactors(); +Appwrite.Models.MfaFactors result = await account.ListMFAFactors(); ``` diff --git a/docs/examples/account/list-logs.md b/docs/examples/account/list-passkeys.md similarity index 86% rename from docs/examples/account/list-logs.md rename to docs/examples/account/list-passkeys.md index 99f6bea0..c439615d 100644 --- a/docs/examples/account/list-logs.md +++ b/docs/examples/account/list-passkeys.md @@ -10,7 +10,7 @@ Client client = new Client() Account account = new Account(client); -LogList result = await account.ListLogs( +Appwrite.Models.PasskeyList result = await account.ListPasskeys( queries: new List(), // optional total: false // optional ); diff --git a/docs/examples/account/list-sessions.md b/docs/examples/account/list-sessions.md index 81402bcc..c24270ef 100644 --- a/docs/examples/account/list-sessions.md +++ b/docs/examples/account/list-sessions.md @@ -10,7 +10,8 @@ Client client = new Client() Account account = new Account(client); -SessionList result = await account.ListSessions(); - +Appwrite.Models.SessionList result = await account.ListSessions( + total: false // optional +); ``` diff --git a/docs/examples/account/update-email-verification-otp.md b/docs/examples/account/update-email-verification-otp.md new file mode 100644 index 00000000..988084bd --- /dev/null +++ b/docs/examples/account/update-email-verification-otp.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +Appwrite.Models.Token result = await account.UpdateEmailVerificationOTP( + userId: "", + secret: "" +); + +``` diff --git a/docs/examples/account/update-email-verification.md b/docs/examples/account/update-email-verification.md index 3b4214e6..aa14f20b 100644 --- a/docs/examples/account/update-email-verification.md +++ b/docs/examples/account/update-email-verification.md @@ -10,7 +10,7 @@ Client client = new Client() Account account = new Account(client); -Token result = await account.UpdateEmailVerification( +Appwrite.Models.Token result = await account.UpdateEmailVerification( userId: "", secret: "" ); diff --git a/docs/examples/account/update-email.md b/docs/examples/account/update-email.md index 9135dc1c..30cefbc1 100644 --- a/docs/examples/account/update-email.md +++ b/docs/examples/account/update-email.md @@ -10,7 +10,7 @@ Client client = new Client() Account account = new Account(client); -User result = await account.UpdateEmail( +Appwrite.Models.User result = await account.UpdateEmail( email: "email@example.com", password: "password" ); diff --git a/docs/examples/account/update-magic-url-session.md b/docs/examples/account/update-magic-url-session.md index 06f707ee..1c8d0b55 100644 --- a/docs/examples/account/update-magic-url-session.md +++ b/docs/examples/account/update-magic-url-session.md @@ -10,7 +10,7 @@ Client client = new Client() Account account = new Account(client); -Session result = await account.UpdateMagicURLSession( +Appwrite.Models.Session result = await account.UpdateMagicURLSession( userId: "", secret: "" ); diff --git a/docs/examples/account/update-mfa-authenticator.md b/docs/examples/account/update-mfa-authenticator.md index a9cdba19..40bd083e 100644 --- a/docs/examples/account/update-mfa-authenticator.md +++ b/docs/examples/account/update-mfa-authenticator.md @@ -11,7 +11,7 @@ Client client = new Client() Account account = new Account(client); -User result = await account.UpdateMFAAuthenticator( +Appwrite.Models.User result = await account.UpdateMFAAuthenticator( type: AuthenticatorType.Totp, otp: "" ); diff --git a/docs/examples/account/update-mfa-challenge.md b/docs/examples/account/update-mfa-challenge.md index d74d8d58..918bc3f2 100644 --- a/docs/examples/account/update-mfa-challenge.md +++ b/docs/examples/account/update-mfa-challenge.md @@ -10,7 +10,7 @@ Client client = new Client() Account account = new Account(client); -Session result = await account.UpdateMFAChallenge( +Appwrite.Models.Session result = await account.UpdateMFAChallenge( challengeId: "", otp: "" ); diff --git a/docs/examples/account/update-mfa-recovery-codes.md b/docs/examples/account/update-mfa-recovery-codes.md index eefede0f..f4ac2db3 100644 --- a/docs/examples/account/update-mfa-recovery-codes.md +++ b/docs/examples/account/update-mfa-recovery-codes.md @@ -10,7 +10,7 @@ Client client = new Client() Account account = new Account(client); -MfaRecoveryCodes result = await account.UpdateMFARecoveryCodes(); +Appwrite.Models.MfaRecoveryCodes result = await account.UpdateMFARecoveryCodes(); ``` diff --git a/docs/examples/account/update-mfa.md b/docs/examples/account/update-mfa.md index 449edcb3..21fda9c5 100644 --- a/docs/examples/account/update-mfa.md +++ b/docs/examples/account/update-mfa.md @@ -10,7 +10,7 @@ Client client = new Client() Account account = new Account(client); -User result = await account.UpdateMFA( +Appwrite.Models.User result = await account.UpdateMFA( mfa: false ); diff --git a/docs/examples/account/update-name.md b/docs/examples/account/update-name.md index bf88c662..623e9584 100644 --- a/docs/examples/account/update-name.md +++ b/docs/examples/account/update-name.md @@ -10,7 +10,7 @@ Client client = new Client() Account account = new Account(client); -User result = await account.UpdateName( +Appwrite.Models.User result = await account.UpdateName( name: "" ); diff --git a/docs/examples/account/update-passkey-token.md b/docs/examples/account/update-passkey-token.md new file mode 100644 index 00000000..d5e8ed93 --- /dev/null +++ b/docs/examples/account/update-passkey-token.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +Appwrite.Models.TokenSecret result = await account.UpdatePasskeyToken( + challengeId: "", + credential: [object] +); + +``` diff --git a/docs/examples/account/update-passkey-verification.md b/docs/examples/account/update-passkey-verification.md new file mode 100644 index 00000000..b1f8a554 --- /dev/null +++ b/docs/examples/account/update-passkey-verification.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +Appwrite.Models.Passkey result = await account.UpdatePasskeyVerification( + passkeyId: "", + credential: [object] +); + +``` diff --git a/docs/examples/account/update-passkey.md b/docs/examples/account/update-passkey.md new file mode 100644 index 00000000..a1e0e0c8 --- /dev/null +++ b/docs/examples/account/update-passkey.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +Appwrite.Models.Passkey result = await account.UpdatePasskey( + passkeyId: "", + name: "" +); + +``` diff --git a/docs/examples/account/update-password.md b/docs/examples/account/update-password.md index 323934ab..78ddd235 100644 --- a/docs/examples/account/update-password.md +++ b/docs/examples/account/update-password.md @@ -10,7 +10,7 @@ Client client = new Client() Account account = new Account(client); -User result = await account.UpdatePassword( +Appwrite.Models.User result = await account.UpdatePassword( password: "password", oldPassword: "password" // optional ); diff --git a/docs/examples/account/update-phone-session.md b/docs/examples/account/update-phone-session.md index dd7ab048..ddd7759f 100644 --- a/docs/examples/account/update-phone-session.md +++ b/docs/examples/account/update-phone-session.md @@ -10,7 +10,7 @@ Client client = new Client() Account account = new Account(client); -Session result = await account.UpdatePhoneSession( +Appwrite.Models.Session result = await account.UpdatePhoneSession( userId: "", secret: "" ); diff --git a/docs/examples/account/update-phone-verification.md b/docs/examples/account/update-phone-verification.md index c2b7eebb..587b51e5 100644 --- a/docs/examples/account/update-phone-verification.md +++ b/docs/examples/account/update-phone-verification.md @@ -10,7 +10,7 @@ Client client = new Client() Account account = new Account(client); -Token result = await account.UpdatePhoneVerification( +Appwrite.Models.Token result = await account.UpdatePhoneVerification( userId: "", secret: "" ); diff --git a/docs/examples/account/update-phone.md b/docs/examples/account/update-phone.md index d2b7276b..e4b03db9 100644 --- a/docs/examples/account/update-phone.md +++ b/docs/examples/account/update-phone.md @@ -10,7 +10,7 @@ Client client = new Client() Account account = new Account(client); -User result = await account.UpdatePhone( +Appwrite.Models.User result = await account.UpdatePhone( phone: "+12065550100", password: "password" ); diff --git a/docs/examples/account/update-prefs.md b/docs/examples/account/update-prefs.md index 105e6988..db944690 100644 --- a/docs/examples/account/update-prefs.md +++ b/docs/examples/account/update-prefs.md @@ -10,7 +10,7 @@ Client client = new Client() Account account = new Account(client); -User result = await account.UpdatePrefs( +Appwrite.Models.User result = await account.UpdatePrefs( prefs: new { language = "en", timezone = "UTC", diff --git a/docs/examples/account/update-recovery-otp.md b/docs/examples/account/update-recovery-otp.md new file mode 100644 index 00000000..ad31785e --- /dev/null +++ b/docs/examples/account/update-recovery-otp.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +Appwrite.Models.Token result = await account.UpdateRecoveryOTP( + userId: "", + secret: "", + password: "password" +); + +``` diff --git a/docs/examples/account/update-recovery.md b/docs/examples/account/update-recovery.md index 5875c5b0..c0e87c28 100644 --- a/docs/examples/account/update-recovery.md +++ b/docs/examples/account/update-recovery.md @@ -10,7 +10,7 @@ Client client = new Client() Account account = new Account(client); -Token result = await account.UpdateRecovery( +Appwrite.Models.Token result = await account.UpdateRecovery( userId: "", secret: "", password: "password" diff --git a/docs/examples/account/update-session.md b/docs/examples/account/update-session.md index d49e556f..b9bdd0f5 100644 --- a/docs/examples/account/update-session.md +++ b/docs/examples/account/update-session.md @@ -10,7 +10,7 @@ Client client = new Client() Account account = new Account(client); -Session result = await account.UpdateSession( +Appwrite.Models.Session result = await account.UpdateSession( sessionId: "" ); diff --git a/docs/examples/account/update-status.md b/docs/examples/account/update-status.md index 95ac938d..e6cf9496 100644 --- a/docs/examples/account/update-status.md +++ b/docs/examples/account/update-status.md @@ -10,7 +10,7 @@ Client client = new Client() Account account = new Account(client); -User result = await account.UpdateStatus(); +Appwrite.Models.User result = await account.UpdateStatus(); ``` diff --git a/docs/examples/account/update-verification.md b/docs/examples/account/update-verification.md index 16fbc2ce..ab345bf1 100644 --- a/docs/examples/account/update-verification.md +++ b/docs/examples/account/update-verification.md @@ -10,7 +10,7 @@ Client client = new Client() Account account = new Account(client); -Token result = await account.UpdateVerification( +Appwrite.Models.Token result = await account.UpdateVerification( userId: "", secret: "" ); diff --git a/docs/examples/activities/get-event.md b/docs/examples/activities/get-event.md index 82e50a0b..38bee825 100644 --- a/docs/examples/activities/get-event.md +++ b/docs/examples/activities/get-event.md @@ -10,7 +10,7 @@ Client client = new Client() Activities activities = new Activities(client); -ActivityEvent result = await activities.GetEvent( +Appwrite.Models.ActivityEvent result = await activities.GetEvent( eventId: "" ); diff --git a/docs/examples/activities/list-events.md b/docs/examples/activities/list-events.md index c3d2ba2f..2df30841 100644 --- a/docs/examples/activities/list-events.md +++ b/docs/examples/activities/list-events.md @@ -10,7 +10,7 @@ Client client = new Client() Activities activities = new Activities(client); -ActivityEventList result = await activities.ListEvents( +Appwrite.Models.ActivityEventList result = await activities.ListEvents( queries: new List() // optional ); diff --git a/docs/examples/advisor/get-insight.md b/docs/examples/advisor/get-insight.md index 29543bdc..baa37a26 100644 --- a/docs/examples/advisor/get-insight.md +++ b/docs/examples/advisor/get-insight.md @@ -10,7 +10,7 @@ Client client = new Client() Advisor advisor = new Advisor(client); -Insight result = await advisor.GetInsight( +Appwrite.Models.Insight result = await advisor.GetInsight( reportId: "", insightId: "" ); diff --git a/docs/examples/advisor/get-report.md b/docs/examples/advisor/get-report.md index 2143cbc0..41b8828f 100644 --- a/docs/examples/advisor/get-report.md +++ b/docs/examples/advisor/get-report.md @@ -10,7 +10,7 @@ Client client = new Client() Advisor advisor = new Advisor(client); -Report result = await advisor.GetReport( +Appwrite.Models.Report result = await advisor.GetReport( reportId: "" ); diff --git a/docs/examples/advisor/list-insights.md b/docs/examples/advisor/list-insights.md index 00322495..eaae4c1c 100644 --- a/docs/examples/advisor/list-insights.md +++ b/docs/examples/advisor/list-insights.md @@ -10,7 +10,7 @@ Client client = new Client() Advisor advisor = new Advisor(client); -InsightList result = await advisor.ListInsights( +Appwrite.Models.InsightList result = await advisor.ListInsights( reportId: "", queries: new List(), // optional total: false // optional diff --git a/docs/examples/advisor/list-reports.md b/docs/examples/advisor/list-reports.md index e610e521..dcaf6415 100644 --- a/docs/examples/advisor/list-reports.md +++ b/docs/examples/advisor/list-reports.md @@ -10,7 +10,7 @@ Client client = new Client() Advisor advisor = new Advisor(client); -ReportList result = await advisor.ListReports( +Appwrite.Models.ReportList result = await advisor.ListReports( queries: new List(), // optional total: false // optional ); diff --git a/docs/examples/apps/create-installation-token.md b/docs/examples/apps/create-installation-token.md index 0aabf4b1..87d8cba1 100644 --- a/docs/examples/apps/create-installation-token.md +++ b/docs/examples/apps/create-installation-token.md @@ -10,7 +10,7 @@ Client client = new Client() Apps apps = new Apps(client); -Oauth2Token result = await apps.CreateInstallationToken( +Appwrite.Models.Oauth2Token result = await apps.CreateInstallationToken( appId: "", installationId: "" ); diff --git a/docs/examples/apps/create-key.md b/docs/examples/apps/create-key.md index a4e53d1e..f3fd184c 100644 --- a/docs/examples/apps/create-key.md +++ b/docs/examples/apps/create-key.md @@ -10,7 +10,7 @@ Client client = new Client() Apps apps = new Apps(client); -AppKey result = await apps.CreateKey( +Appwrite.Models.AppKey result = await apps.CreateKey( appId: "" ); diff --git a/docs/examples/apps/create-secret.md b/docs/examples/apps/create-secret.md index 12553ab6..3a4327f6 100644 --- a/docs/examples/apps/create-secret.md +++ b/docs/examples/apps/create-secret.md @@ -10,7 +10,7 @@ Client client = new Client() Apps apps = new Apps(client); -AppSecretPlaintext result = await apps.CreateSecret( +Appwrite.Models.AppSecretPlaintext result = await apps.CreateSecret( appId: "" ); diff --git a/docs/examples/apps/create.md b/docs/examples/apps/create.md index 18adab45..48ae9072 100644 --- a/docs/examples/apps/create.md +++ b/docs/examples/apps/create.md @@ -10,7 +10,7 @@ Client client = new Client() Apps apps = new Apps(client); -App result = await apps.Create( +Appwrite.Models.App result = await apps.Create( appId: "", name: "", redirectUris: new List(), diff --git a/docs/examples/apps/get-installation.md b/docs/examples/apps/get-installation.md index 16221bdc..cc3aa7b2 100644 --- a/docs/examples/apps/get-installation.md +++ b/docs/examples/apps/get-installation.md @@ -10,7 +10,7 @@ Client client = new Client() Apps apps = new Apps(client); -AppInstallation result = await apps.GetInstallation( +Appwrite.Models.AppInstallation result = await apps.GetInstallation( appId: "", installationId: "" ); diff --git a/docs/examples/apps/get-key.md b/docs/examples/apps/get-key.md index 4bfe168c..037a1f51 100644 --- a/docs/examples/apps/get-key.md +++ b/docs/examples/apps/get-key.md @@ -10,7 +10,7 @@ Client client = new Client() Apps apps = new Apps(client); -AppKey result = await apps.GetKey( +Appwrite.Models.AppKey result = await apps.GetKey( appId: "", keyId: "" ); diff --git a/docs/examples/apps/get-secret.md b/docs/examples/apps/get-secret.md index e1f6e4fc..1ef7d29f 100644 --- a/docs/examples/apps/get-secret.md +++ b/docs/examples/apps/get-secret.md @@ -10,7 +10,7 @@ Client client = new Client() Apps apps = new Apps(client); -AppSecret result = await apps.GetSecret( +Appwrite.Models.AppSecret result = await apps.GetSecret( appId: "", secretId: "" ); diff --git a/docs/examples/apps/get.md b/docs/examples/apps/get.md index df6aefd0..52df40d2 100644 --- a/docs/examples/apps/get.md +++ b/docs/examples/apps/get.md @@ -10,7 +10,7 @@ Client client = new Client() Apps apps = new Apps(client); -App result = await apps.Get( +Appwrite.Models.App result = await apps.Get( appId: "" ); diff --git a/docs/examples/apps/list-installation-scopes.md b/docs/examples/apps/list-installation-scopes.md index 2ba341f0..94de8be2 100644 --- a/docs/examples/apps/list-installation-scopes.md +++ b/docs/examples/apps/list-installation-scopes.md @@ -10,7 +10,7 @@ Client client = new Client() Apps apps = new Apps(client); -AppScopeList result = await apps.ListInstallationScopes(); +Appwrite.Models.AppScopeList result = await apps.ListInstallationScopes(); ``` diff --git a/docs/examples/apps/list-installations.md b/docs/examples/apps/list-installations.md index 1a1bdf8d..3176180e 100644 --- a/docs/examples/apps/list-installations.md +++ b/docs/examples/apps/list-installations.md @@ -10,7 +10,7 @@ Client client = new Client() Apps apps = new Apps(client); -AppInstallationList result = await apps.ListInstallations( +Appwrite.Models.AppInstallationList result = await apps.ListInstallations( appId: "", queries: new List(), // optional total: false // optional diff --git a/docs/examples/apps/list-keys.md b/docs/examples/apps/list-keys.md index e6e8522f..1a3f5b62 100644 --- a/docs/examples/apps/list-keys.md +++ b/docs/examples/apps/list-keys.md @@ -10,7 +10,7 @@ Client client = new Client() Apps apps = new Apps(client); -AppKeyList result = await apps.ListKeys( +Appwrite.Models.AppKeyList result = await apps.ListKeys( appId: "", queries: new List(), // optional total: false // optional diff --git a/docs/examples/apps/list-o-auth-2-scopes.md b/docs/examples/apps/list-o-auth-2-scopes.md index 6efd8503..ce048e46 100644 --- a/docs/examples/apps/list-o-auth-2-scopes.md +++ b/docs/examples/apps/list-o-auth-2-scopes.md @@ -10,7 +10,7 @@ Client client = new Client() Apps apps = new Apps(client); -AppScopeList result = await apps.ListOAuth2Scopes(); +Appwrite.Models.AppScopeList result = await apps.ListOAuth2Scopes(); ``` diff --git a/docs/examples/apps/list-secrets.md b/docs/examples/apps/list-secrets.md index ab831c0a..d7be65ff 100644 --- a/docs/examples/apps/list-secrets.md +++ b/docs/examples/apps/list-secrets.md @@ -10,7 +10,7 @@ Client client = new Client() Apps apps = new Apps(client); -AppSecretList result = await apps.ListSecrets( +Appwrite.Models.AppSecretList result = await apps.ListSecrets( appId: "", queries: new List(), // optional total: false // optional diff --git a/docs/examples/apps/list.md b/docs/examples/apps/list.md index 724cfd91..bfe49334 100644 --- a/docs/examples/apps/list.md +++ b/docs/examples/apps/list.md @@ -10,7 +10,7 @@ Client client = new Client() Apps apps = new Apps(client); -AppsList result = await apps.List( +Appwrite.Models.AppsList result = await apps.List( queries: new List(), // optional total: false // optional ); diff --git a/docs/examples/apps/update-labels.md b/docs/examples/apps/update-labels.md index 3a311d25..171321b1 100644 --- a/docs/examples/apps/update-labels.md +++ b/docs/examples/apps/update-labels.md @@ -10,7 +10,7 @@ Client client = new Client() Apps apps = new Apps(client); -App result = await apps.UpdateLabels( +Appwrite.Models.App result = await apps.UpdateLabels( appId: "", labels: new List() ); diff --git a/docs/examples/apps/update-team.md b/docs/examples/apps/update-team.md index ac6fc92d..a7e185cb 100644 --- a/docs/examples/apps/update-team.md +++ b/docs/examples/apps/update-team.md @@ -10,7 +10,7 @@ Client client = new Client() Apps apps = new Apps(client); -App result = await apps.UpdateTeam( +Appwrite.Models.App result = await apps.UpdateTeam( appId: "", teamId: "" ); diff --git a/docs/examples/apps/update.md b/docs/examples/apps/update.md index 20de7ef0..58d3f05e 100644 --- a/docs/examples/apps/update.md +++ b/docs/examples/apps/update.md @@ -10,7 +10,7 @@ Client client = new Client() Apps apps = new Apps(client); -App result = await apps.Update( +Appwrite.Models.App result = await apps.Update( appId: "", name: "", description: "", // optional diff --git a/docs/examples/avatars/delete-photo.md b/docs/examples/avatars/delete-photo.md new file mode 100644 index 00000000..b1a7e9a3 --- /dev/null +++ b/docs/examples/avatars/delete-photo.md @@ -0,0 +1,16 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetSession(""); // The user session to authenticate with + +Avatars avatars = new Avatars(client); + +await avatars.DeletePhoto(); + + +``` diff --git a/docs/examples/avatars/get-screenshot.md b/docs/examples/avatars/get-screenshot.md index 92828bf7..24481df2 100644 --- a/docs/examples/avatars/get-screenshot.md +++ b/docs/examples/avatars/get-screenshot.md @@ -13,10 +13,7 @@ Avatars avatars = new Avatars(client); byte[] result = await avatars.GetScreenshot( url: "https://example.com", - headers: new { - Authorization = "Bearer token123", - X-Custom-Header = "value" - }, // optional + headers: new { Accept-Language = "en-US,en;q=0.9" }, // optional viewportWidth: 1920, // optional viewportHeight: 1080, // optional scale: 2, // optional diff --git a/docs/examples/avatars/update-photo.md b/docs/examples/avatars/update-photo.md new file mode 100644 index 00000000..652d6618 --- /dev/null +++ b/docs/examples/avatars/update-photo.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetSession(""); // The user session to authenticate with + +Avatars avatars = new Avatars(client); + +Appwrite.Models.Account result = await avatars.UpdatePhoto( + file: InputFile.FromPath("./path-to-files/image.jpg") +); + +``` diff --git a/docs/examples/backups/create-archive.md b/docs/examples/backups/create-archive.md index 6cb21045..6d655cc4 100644 --- a/docs/examples/backups/create-archive.md +++ b/docs/examples/backups/create-archive.md @@ -11,7 +11,7 @@ Client client = new Client() Backups backups = new Backups(client); -BackupArchive result = await backups.CreateArchive( +Appwrite.Models.BackupArchive result = await backups.CreateArchive( services: new List<BackupServices> { BackupServices.Databases }, resourceId: "" // optional ); diff --git a/docs/examples/backups/create-policy.md b/docs/examples/backups/create-policy.md index cee682ed..708651cd 100644 --- a/docs/examples/backups/create-policy.md +++ b/docs/examples/backups/create-policy.md @@ -11,7 +11,7 @@ Client client = new Client() Backups backups = new Backups(client); -BackupPolicy result = await backups.CreatePolicy( +Appwrite.Models.BackupPolicy result = await backups.CreatePolicy( policyId: "", services: new List<BackupServices> { BackupServices.Databases }, retention: 1, diff --git a/docs/examples/backups/create-restoration.md b/docs/examples/backups/create-restoration.md index f3649c17..4fd80e47 100644 --- a/docs/examples/backups/create-restoration.md +++ b/docs/examples/backups/create-restoration.md @@ -11,7 +11,7 @@ Client client = new Client() Backups backups = new Backups(client); -BackupRestoration result = await backups.CreateRestoration( +Appwrite.Models.BackupRestoration result = await backups.CreateRestoration( archiveId: "", services: new List<BackupServices> { BackupServices.Databases }, newResourceId: "", // optional diff --git a/docs/examples/backups/get-archive.md b/docs/examples/backups/get-archive.md index 15c9b83d..305887c2 100644 --- a/docs/examples/backups/get-archive.md +++ b/docs/examples/backups/get-archive.md @@ -10,7 +10,7 @@ Client client = new Client() Backups backups = new Backups(client); -BackupArchive result = await backups.GetArchive( +Appwrite.Models.BackupArchive result = await backups.GetArchive( archiveId: "" ); diff --git a/docs/examples/backups/get-policy.md b/docs/examples/backups/get-policy.md index 0fe94d97..e4867fbb 100644 --- a/docs/examples/backups/get-policy.md +++ b/docs/examples/backups/get-policy.md @@ -10,7 +10,7 @@ Client client = new Client() Backups backups = new Backups(client); -BackupPolicy result = await backups.GetPolicy( +Appwrite.Models.BackupPolicy result = await backups.GetPolicy( policyId: "" ); diff --git a/docs/examples/backups/get-restoration.md b/docs/examples/backups/get-restoration.md index e48d04ee..a1fb53b1 100644 --- a/docs/examples/backups/get-restoration.md +++ b/docs/examples/backups/get-restoration.md @@ -10,7 +10,7 @@ Client client = new Client() Backups backups = new Backups(client); -BackupRestoration result = await backups.GetRestoration( +Appwrite.Models.BackupRestoration result = await backups.GetRestoration( restorationId: "" ); diff --git a/docs/examples/backups/list-archives.md b/docs/examples/backups/list-archives.md index 15f69c28..5c1eebbb 100644 --- a/docs/examples/backups/list-archives.md +++ b/docs/examples/backups/list-archives.md @@ -10,7 +10,7 @@ Client client = new Client() Backups backups = new Backups(client); -BackupArchiveList result = await backups.ListArchives( +Appwrite.Models.BackupArchiveList result = await backups.ListArchives( queries: new List() // optional ); diff --git a/docs/examples/backups/list-policies.md b/docs/examples/backups/list-policies.md index f1695519..89da023f 100644 --- a/docs/examples/backups/list-policies.md +++ b/docs/examples/backups/list-policies.md @@ -10,7 +10,7 @@ Client client = new Client() Backups backups = new Backups(client); -BackupPolicyList result = await backups.ListPolicies( +Appwrite.Models.BackupPolicyList result = await backups.ListPolicies( queries: new List() // optional ); diff --git a/docs/examples/backups/list-restorations.md b/docs/examples/backups/list-restorations.md index ee286a75..a579a1fb 100644 --- a/docs/examples/backups/list-restorations.md +++ b/docs/examples/backups/list-restorations.md @@ -10,7 +10,7 @@ Client client = new Client() Backups backups = new Backups(client); -BackupRestorationList result = await backups.ListRestorations( +Appwrite.Models.BackupRestorationList result = await backups.ListRestorations( queries: new List() // optional ); diff --git a/docs/examples/backups/update-policy.md b/docs/examples/backups/update-policy.md index 93d1233b..abce4013 100644 --- a/docs/examples/backups/update-policy.md +++ b/docs/examples/backups/update-policy.md @@ -10,7 +10,7 @@ Client client = new Client() Backups backups = new Backups(client); -BackupPolicy result = await backups.UpdatePolicy( +Appwrite.Models.BackupPolicy result = await backups.UpdatePolicy( policyId: "", name: "", // optional retention: 1, // optional diff --git a/docs/examples/databases/create-big-int-attribute.md b/docs/examples/databases/create-big-int-attribute.md index db06ba5d..4ab2421e 100644 --- a/docs/examples/databases/create-big-int-attribute.md +++ b/docs/examples/databases/create-big-int-attribute.md @@ -10,7 +10,7 @@ Client client = new Client() Databases databases = new Databases(client); -AttributeBigint result = await databases.CreateBigIntAttribute( +Appwrite.Models.AttributeBigint result = await databases.CreateBigIntAttribute( databaseId: "", collectionId: "", key: "", diff --git a/docs/examples/databases/create-boolean-attribute.md b/docs/examples/databases/create-boolean-attribute.md index ba2df46c..6354c2ff 100644 --- a/docs/examples/databases/create-boolean-attribute.md +++ b/docs/examples/databases/create-boolean-attribute.md @@ -10,7 +10,7 @@ Client client = new Client() Databases databases = new Databases(client); -AttributeBoolean result = await databases.CreateBooleanAttribute( +Appwrite.Models.AttributeBoolean result = await databases.CreateBooleanAttribute( databaseId: "", collectionId: "", key: "", diff --git a/docs/examples/databases/create-collection.md b/docs/examples/databases/create-collection.md index 8fbf9538..7ffe46bb 100644 --- a/docs/examples/databases/create-collection.md +++ b/docs/examples/databases/create-collection.md @@ -10,7 +10,7 @@ Client client = new Client() Databases databases = new Databases(client); -Collection result = await databases.CreateCollection( +Appwrite.Models.Collection result = await databases.CreateCollection( databaseId: "", collectionId: "", name: "", diff --git a/docs/examples/databases/create-datetime-attribute.md b/docs/examples/databases/create-datetime-attribute.md index f9248808..67aba769 100644 --- a/docs/examples/databases/create-datetime-attribute.md +++ b/docs/examples/databases/create-datetime-attribute.md @@ -10,7 +10,7 @@ Client client = new Client() Databases databases = new Databases(client); -AttributeDatetime result = await databases.CreateDatetimeAttribute( +Appwrite.Models.AttributeDatetime result = await databases.CreateDatetimeAttribute( databaseId: "", collectionId: "", key: "", diff --git a/docs/examples/databases/create-document.md b/docs/examples/databases/create-document.md index 54730c8d..6c65cedb 100644 --- a/docs/examples/databases/create-document.md +++ b/docs/examples/databases/create-document.md @@ -10,7 +10,7 @@ Client client = new Client() Databases databases = new Databases(client); -Document result = await databases.CreateDocument( +Appwrite.Models.Document result = await databases.CreateDocument( databaseId: "", collectionId: "", documentId: "", diff --git a/docs/examples/databases/create-documents.md b/docs/examples/databases/create-documents.md index e490a0b8..6f278379 100644 --- a/docs/examples/databases/create-documents.md +++ b/docs/examples/databases/create-documents.md @@ -10,10 +10,19 @@ Client client = new Client() Databases databases = new Databases(client); -DocumentList result = await databases.CreateDocuments( +Appwrite.Models.DocumentList result = await databases.CreateDocuments( databaseId: "", collectionId: "", - documents: new List(), + documents: [ + { + "$id": "example1", + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 30, + "isAdmin": false + } + ], transactionId: "" // optional ); diff --git a/docs/examples/databases/create-email-attribute.md b/docs/examples/databases/create-email-attribute.md index 94757f04..ef068ae8 100644 --- a/docs/examples/databases/create-email-attribute.md +++ b/docs/examples/databases/create-email-attribute.md @@ -10,7 +10,7 @@ Client client = new Client() Databases databases = new Databases(client); -AttributeEmail result = await databases.CreateEmailAttribute( +Appwrite.Models.AttributeEmail result = await databases.CreateEmailAttribute( databaseId: "", collectionId: "", key: "", diff --git a/docs/examples/databases/create-enum-attribute.md b/docs/examples/databases/create-enum-attribute.md index d66cb3ac..bb7d6ce7 100644 --- a/docs/examples/databases/create-enum-attribute.md +++ b/docs/examples/databases/create-enum-attribute.md @@ -10,7 +10,7 @@ Client client = new Client() Databases databases = new Databases(client); -AttributeEnum result = await databases.CreateEnumAttribute( +Appwrite.Models.AttributeEnum result = await databases.CreateEnumAttribute( databaseId: "", collectionId: "", key: "", diff --git a/docs/examples/databases/create-float-attribute.md b/docs/examples/databases/create-float-attribute.md index 26fb95a7..22f21b62 100644 --- a/docs/examples/databases/create-float-attribute.md +++ b/docs/examples/databases/create-float-attribute.md @@ -10,7 +10,7 @@ Client client = new Client() Databases databases = new Databases(client); -AttributeFloat result = await databases.CreateFloatAttribute( +Appwrite.Models.AttributeFloat result = await databases.CreateFloatAttribute( databaseId: "", collectionId: "", key: "", diff --git a/docs/examples/databases/create-index.md b/docs/examples/databases/create-index.md index 748394d9..95e878bc 100644 --- a/docs/examples/databases/create-index.md +++ b/docs/examples/databases/create-index.md @@ -11,12 +11,12 @@ Client client = new Client() Databases databases = new Databases(client); -Index result = await databases.CreateIndex( +Appwrite.Models.Index result = await databases.CreateIndex( databaseId: "", collectionId: "", key: "", type: DatabasesIndexType.Key, - attributes: new List(), + attributes: ["username"], orders: new List<OrderBy> { OrderBy.Asc }, // optional lengths: new List() // optional ); diff --git a/docs/examples/databases/create-integer-attribute.md b/docs/examples/databases/create-integer-attribute.md index 04678b94..1b707529 100644 --- a/docs/examples/databases/create-integer-attribute.md +++ b/docs/examples/databases/create-integer-attribute.md @@ -10,7 +10,7 @@ Client client = new Client() Databases databases = new Databases(client); -AttributeInteger result = await databases.CreateIntegerAttribute( +Appwrite.Models.AttributeInteger result = await databases.CreateIntegerAttribute( databaseId: "", collectionId: "", key: "", diff --git a/docs/examples/databases/create-ip-attribute.md b/docs/examples/databases/create-ip-attribute.md index b5de19be..7a1b824b 100644 --- a/docs/examples/databases/create-ip-attribute.md +++ b/docs/examples/databases/create-ip-attribute.md @@ -10,7 +10,7 @@ Client client = new Client() Databases databases = new Databases(client); -AttributeIp result = await databases.CreateIpAttribute( +Appwrite.Models.AttributeIp result = await databases.CreateIpAttribute( databaseId: "", collectionId: "", key: "", diff --git a/docs/examples/databases/create-line-attribute.md b/docs/examples/databases/create-line-attribute.md index 53f1ada4..21931af3 100644 --- a/docs/examples/databases/create-line-attribute.md +++ b/docs/examples/databases/create-line-attribute.md @@ -10,7 +10,7 @@ Client client = new Client() Databases databases = new Databases(client); -AttributeLine result = await databases.CreateLineAttribute( +Appwrite.Models.AttributeLine result = await databases.CreateLineAttribute( databaseId: "", collectionId: "", key: "", diff --git a/docs/examples/databases/create-longtext-attribute.md b/docs/examples/databases/create-longtext-attribute.md index 3bf127aa..a75a41c0 100644 --- a/docs/examples/databases/create-longtext-attribute.md +++ b/docs/examples/databases/create-longtext-attribute.md @@ -10,7 +10,7 @@ Client client = new Client() Databases databases = new Databases(client); -AttributeLongtext result = await databases.CreateLongtextAttribute( +Appwrite.Models.AttributeLongtext result = await databases.CreateLongtextAttribute( databaseId: "", collectionId: "", key: "", diff --git a/docs/examples/databases/create-mediumtext-attribute.md b/docs/examples/databases/create-mediumtext-attribute.md index 2e758f7b..4e176ac6 100644 --- a/docs/examples/databases/create-mediumtext-attribute.md +++ b/docs/examples/databases/create-mediumtext-attribute.md @@ -10,7 +10,7 @@ Client client = new Client() Databases databases = new Databases(client); -AttributeMediumtext result = await databases.CreateMediumtextAttribute( +Appwrite.Models.AttributeMediumtext result = await databases.CreateMediumtextAttribute( databaseId: "", collectionId: "", key: "", diff --git a/docs/examples/databases/create-operations.md b/docs/examples/databases/create-operations.md index 7b150194..bc720477 100644 --- a/docs/examples/databases/create-operations.md +++ b/docs/examples/databases/create-operations.md @@ -10,7 +10,7 @@ Client client = new Client() Databases databases = new Databases(client); -Transaction result = await databases.CreateOperations( +Appwrite.Models.Transaction result = await databases.CreateOperations( transactionId: "", operations: [ { diff --git a/docs/examples/databases/create-point-attribute.md b/docs/examples/databases/create-point-attribute.md index a08e2b9a..16c7e234 100644 --- a/docs/examples/databases/create-point-attribute.md +++ b/docs/examples/databases/create-point-attribute.md @@ -10,7 +10,7 @@ Client client = new Client() Databases databases = new Databases(client); -AttributePoint result = await databases.CreatePointAttribute( +Appwrite.Models.AttributePoint result = await databases.CreatePointAttribute( databaseId: "", collectionId: "", key: "", diff --git a/docs/examples/databases/create-polygon-attribute.md b/docs/examples/databases/create-polygon-attribute.md index 917a45c9..f2ba53f1 100644 --- a/docs/examples/databases/create-polygon-attribute.md +++ b/docs/examples/databases/create-polygon-attribute.md @@ -10,7 +10,7 @@ Client client = new Client() Databases databases = new Databases(client); -AttributePolygon result = await databases.CreatePolygonAttribute( +Appwrite.Models.AttributePolygon result = await databases.CreatePolygonAttribute( databaseId: "", collectionId: "", key: "", diff --git a/docs/examples/databases/create-relationship-attribute.md b/docs/examples/databases/create-relationship-attribute.md index 6f8ac621..202e2bec 100644 --- a/docs/examples/databases/create-relationship-attribute.md +++ b/docs/examples/databases/create-relationship-attribute.md @@ -11,7 +11,7 @@ Client client = new Client() Databases databases = new Databases(client); -AttributeRelationship result = await databases.CreateRelationshipAttribute( +Appwrite.Models.AttributeRelationship result = await databases.CreateRelationshipAttribute( databaseId: "", collectionId: "", relatedCollectionId: "", diff --git a/docs/examples/databases/create-string-attribute.md b/docs/examples/databases/create-string-attribute.md index ea547aaa..b11b5e47 100644 --- a/docs/examples/databases/create-string-attribute.md +++ b/docs/examples/databases/create-string-attribute.md @@ -10,7 +10,7 @@ Client client = new Client() Databases databases = new Databases(client); -AttributeString result = await databases.CreateStringAttribute( +Appwrite.Models.AttributeString result = await databases.CreateStringAttribute( databaseId: "", collectionId: "", key: "", diff --git a/docs/examples/databases/create-text-attribute.md b/docs/examples/databases/create-text-attribute.md index dd6fe3cb..0f8790a4 100644 --- a/docs/examples/databases/create-text-attribute.md +++ b/docs/examples/databases/create-text-attribute.md @@ -10,7 +10,7 @@ Client client = new Client() Databases databases = new Databases(client); -AttributeText result = await databases.CreateTextAttribute( +Appwrite.Models.AttributeText result = await databases.CreateTextAttribute( databaseId: "", collectionId: "", key: "", diff --git a/docs/examples/databases/create-transaction.md b/docs/examples/databases/create-transaction.md index 29b18cd4..592acce7 100644 --- a/docs/examples/databases/create-transaction.md +++ b/docs/examples/databases/create-transaction.md @@ -10,7 +10,7 @@ Client client = new Client() Databases databases = new Databases(client); -Transaction result = await databases.CreateTransaction( +Appwrite.Models.Transaction result = await databases.CreateTransaction( ttl: 60 // optional ); diff --git a/docs/examples/databases/create-url-attribute.md b/docs/examples/databases/create-url-attribute.md index dd0e356b..a830e411 100644 --- a/docs/examples/databases/create-url-attribute.md +++ b/docs/examples/databases/create-url-attribute.md @@ -10,7 +10,7 @@ Client client = new Client() Databases databases = new Databases(client); -AttributeUrl result = await databases.CreateUrlAttribute( +Appwrite.Models.AttributeUrl result = await databases.CreateUrlAttribute( databaseId: "", collectionId: "", key: "", diff --git a/docs/examples/databases/create-varchar-attribute.md b/docs/examples/databases/create-varchar-attribute.md index 4c3f3a1e..85576fa4 100644 --- a/docs/examples/databases/create-varchar-attribute.md +++ b/docs/examples/databases/create-varchar-attribute.md @@ -10,7 +10,7 @@ Client client = new Client() Databases databases = new Databases(client); -AttributeVarchar result = await databases.CreateVarcharAttribute( +Appwrite.Models.AttributeVarchar result = await databases.CreateVarcharAttribute( databaseId: "", collectionId: "", key: "", diff --git a/docs/examples/databases/create.md b/docs/examples/databases/create.md index 6d0a504c..4e80d1a5 100644 --- a/docs/examples/databases/create.md +++ b/docs/examples/databases/create.md @@ -10,7 +10,7 @@ Client client = new Client() Databases databases = new Databases(client); -Database result = await databases.Create( +Appwrite.Models.Database result = await databases.Create( databaseId: "", name: "", enabled: false // optional diff --git a/docs/examples/databases/decrement-document-attribute.md b/docs/examples/databases/decrement-document-attribute.md index 46dd163d..bf7ed449 100644 --- a/docs/examples/databases/decrement-document-attribute.md +++ b/docs/examples/databases/decrement-document-attribute.md @@ -10,7 +10,7 @@ Client client = new Client() Databases databases = new Databases(client); -Document result = await databases.DecrementDocumentAttribute( +Appwrite.Models.Document result = await databases.DecrementDocumentAttribute( databaseId: "", collectionId: "", documentId: "", diff --git a/docs/examples/databases/delete-documents.md b/docs/examples/databases/delete-documents.md index 4b14b138..f749abe1 100644 --- a/docs/examples/databases/delete-documents.md +++ b/docs/examples/databases/delete-documents.md @@ -13,7 +13,7 @@ Databases databases = new Databases(client); await databases.DeleteDocuments( databaseId: "", collectionId: "", - queries: new List(), // optional + queries: ["{\"method\":\"equal\", \"attribute\":\"$id\", \"values\":[\"\"]}"], // optional transactionId: "" // optional ); diff --git a/docs/examples/databases/get-collection.md b/docs/examples/databases/get-collection.md index 0798f68e..36c36476 100644 --- a/docs/examples/databases/get-collection.md +++ b/docs/examples/databases/get-collection.md @@ -10,7 +10,7 @@ Client client = new Client() Databases databases = new Databases(client); -Collection result = await databases.GetCollection( +Appwrite.Models.Collection result = await databases.GetCollection( databaseId: "", collectionId: "" ); diff --git a/docs/examples/databases/get-document.md b/docs/examples/databases/get-document.md index 102cbb5b..70625ad6 100644 --- a/docs/examples/databases/get-document.md +++ b/docs/examples/databases/get-document.md @@ -10,7 +10,7 @@ Client client = new Client() Databases databases = new Databases(client); -Document result = await databases.GetDocument( +Appwrite.Models.Document result = await databases.GetDocument( databaseId: "", collectionId: "", documentId: "", diff --git a/docs/examples/databases/get-index.md b/docs/examples/databases/get-index.md index ad06f1fb..b9f26869 100644 --- a/docs/examples/databases/get-index.md +++ b/docs/examples/databases/get-index.md @@ -10,7 +10,7 @@ Client client = new Client() Databases databases = new Databases(client); -Index result = await databases.GetIndex( +Appwrite.Models.Index result = await databases.GetIndex( databaseId: "", collectionId: "", key: "" diff --git a/docs/examples/databases/get-transaction.md b/docs/examples/databases/get-transaction.md index fe449961..f6e28c44 100644 --- a/docs/examples/databases/get-transaction.md +++ b/docs/examples/databases/get-transaction.md @@ -10,7 +10,7 @@ Client client = new Client() Databases databases = new Databases(client); -Transaction result = await databases.GetTransaction( +Appwrite.Models.Transaction result = await databases.GetTransaction( transactionId: "" ); diff --git a/docs/examples/databases/get.md b/docs/examples/databases/get.md index 91d9a0ec..454b1a0f 100644 --- a/docs/examples/databases/get.md +++ b/docs/examples/databases/get.md @@ -10,7 +10,7 @@ Client client = new Client() Databases databases = new Databases(client); -Database result = await databases.Get( +Appwrite.Models.Database result = await databases.Get( databaseId: "" ); diff --git a/docs/examples/databases/increment-document-attribute.md b/docs/examples/databases/increment-document-attribute.md index 230784d7..7df9b120 100644 --- a/docs/examples/databases/increment-document-attribute.md +++ b/docs/examples/databases/increment-document-attribute.md @@ -10,7 +10,7 @@ Client client = new Client() Databases databases = new Databases(client); -Document result = await databases.IncrementDocumentAttribute( +Appwrite.Models.Document result = await databases.IncrementDocumentAttribute( databaseId: "", collectionId: "", documentId: "", diff --git a/docs/examples/databases/list-attributes.md b/docs/examples/databases/list-attributes.md index ff57878c..f704a63a 100644 --- a/docs/examples/databases/list-attributes.md +++ b/docs/examples/databases/list-attributes.md @@ -10,7 +10,7 @@ Client client = new Client() Databases databases = new Databases(client); -AttributeList result = await databases.ListAttributes( +Appwrite.Models.AttributeList result = await databases.ListAttributes( databaseId: "", collectionId: "", queries: new List(), // optional diff --git a/docs/examples/databases/list-collections.md b/docs/examples/databases/list-collections.md index ed856f6e..3b44d07e 100644 --- a/docs/examples/databases/list-collections.md +++ b/docs/examples/databases/list-collections.md @@ -10,7 +10,7 @@ Client client = new Client() Databases databases = new Databases(client); -CollectionList result = await databases.ListCollections( +Appwrite.Models.CollectionList result = await databases.ListCollections( databaseId: "", queries: new List(), // optional search: "", // optional diff --git a/docs/examples/databases/list-documents.md b/docs/examples/databases/list-documents.md index d8cdff0a..414789aa 100644 --- a/docs/examples/databases/list-documents.md +++ b/docs/examples/databases/list-documents.md @@ -10,7 +10,7 @@ Client client = new Client() Databases databases = new Databases(client); -DocumentList result = await databases.ListDocuments( +Appwrite.Models.DocumentList result = await databases.ListDocuments( databaseId: "", collectionId: "", queries: new List(), // optional diff --git a/docs/examples/databases/list-indexes.md b/docs/examples/databases/list-indexes.md index 80f4bcf2..9eb8c005 100644 --- a/docs/examples/databases/list-indexes.md +++ b/docs/examples/databases/list-indexes.md @@ -10,7 +10,7 @@ Client client = new Client() Databases databases = new Databases(client); -IndexList result = await databases.ListIndexes( +Appwrite.Models.IndexList result = await databases.ListIndexes( databaseId: "", collectionId: "", queries: new List(), // optional diff --git a/docs/examples/databases/list-transactions.md b/docs/examples/databases/list-transactions.md index fc141674..c619c59d 100644 --- a/docs/examples/databases/list-transactions.md +++ b/docs/examples/databases/list-transactions.md @@ -10,8 +10,9 @@ Client client = new Client() Databases databases = new Databases(client); -TransactionList result = await databases.ListTransactions( - queries: new List() // optional +Appwrite.Models.TransactionList result = await databases.ListTransactions( + queries: new List(), // optional + total: false // optional ); ``` diff --git a/docs/examples/databases/list.md b/docs/examples/databases/list.md index 57095184..f1d94f28 100644 --- a/docs/examples/databases/list.md +++ b/docs/examples/databases/list.md @@ -10,7 +10,7 @@ Client client = new Client() Databases databases = new Databases(client); -DatabaseList result = await databases.List( +Appwrite.Models.DatabaseList result = await databases.List( queries: new List(), // optional search: "", // optional total: false // optional diff --git a/docs/examples/databases/update-big-int-attribute.md b/docs/examples/databases/update-big-int-attribute.md index 7fea78b5..83b16f36 100644 --- a/docs/examples/databases/update-big-int-attribute.md +++ b/docs/examples/databases/update-big-int-attribute.md @@ -10,7 +10,7 @@ Client client = new Client() Databases databases = new Databases(client); -AttributeBigint result = await databases.UpdateBigIntAttribute( +Appwrite.Models.AttributeBigint result = await databases.UpdateBigIntAttribute( databaseId: "", collectionId: "", key: "", diff --git a/docs/examples/databases/update-boolean-attribute.md b/docs/examples/databases/update-boolean-attribute.md index 52b0a767..e096f73e 100644 --- a/docs/examples/databases/update-boolean-attribute.md +++ b/docs/examples/databases/update-boolean-attribute.md @@ -10,7 +10,7 @@ Client client = new Client() Databases databases = new Databases(client); -AttributeBoolean result = await databases.UpdateBooleanAttribute( +Appwrite.Models.AttributeBoolean result = await databases.UpdateBooleanAttribute( databaseId: "", collectionId: "", key: "", diff --git a/docs/examples/databases/update-collection.md b/docs/examples/databases/update-collection.md index 7e3378fa..22e3bd59 100644 --- a/docs/examples/databases/update-collection.md +++ b/docs/examples/databases/update-collection.md @@ -10,7 +10,7 @@ Client client = new Client() Databases databases = new Databases(client); -Collection result = await databases.UpdateCollection( +Appwrite.Models.Collection result = await databases.UpdateCollection( databaseId: "", collectionId: "", name: "", // optional diff --git a/docs/examples/databases/update-datetime-attribute.md b/docs/examples/databases/update-datetime-attribute.md index 2a1df23f..08d000f8 100644 --- a/docs/examples/databases/update-datetime-attribute.md +++ b/docs/examples/databases/update-datetime-attribute.md @@ -10,7 +10,7 @@ Client client = new Client() Databases databases = new Databases(client); -AttributeDatetime result = await databases.UpdateDatetimeAttribute( +Appwrite.Models.AttributeDatetime result = await databases.UpdateDatetimeAttribute( databaseId: "", collectionId: "", key: "", diff --git a/docs/examples/databases/update-document.md b/docs/examples/databases/update-document.md index e18a6ef9..e6c44e7b 100644 --- a/docs/examples/databases/update-document.md +++ b/docs/examples/databases/update-document.md @@ -10,7 +10,7 @@ Client client = new Client() Databases databases = new Databases(client); -Document result = await databases.UpdateDocument( +Appwrite.Models.Document result = await databases.UpdateDocument( databaseId: "", collectionId: "", documentId: "", diff --git a/docs/examples/databases/update-documents.md b/docs/examples/databases/update-documents.md index db3133df..01b10915 100644 --- a/docs/examples/databases/update-documents.md +++ b/docs/examples/databases/update-documents.md @@ -10,7 +10,7 @@ Client client = new Client() Databases databases = new Databases(client); -DocumentList result = await databases.UpdateDocuments( +Appwrite.Models.DocumentList result = await databases.UpdateDocuments( databaseId: "", collectionId: "", data: new { diff --git a/docs/examples/databases/update-email-attribute.md b/docs/examples/databases/update-email-attribute.md index b1f0e37f..98a5b698 100644 --- a/docs/examples/databases/update-email-attribute.md +++ b/docs/examples/databases/update-email-attribute.md @@ -10,7 +10,7 @@ Client client = new Client() Databases databases = new Databases(client); -AttributeEmail result = await databases.UpdateEmailAttribute( +Appwrite.Models.AttributeEmail result = await databases.UpdateEmailAttribute( databaseId: "", collectionId: "", key: "", diff --git a/docs/examples/databases/update-enum-attribute.md b/docs/examples/databases/update-enum-attribute.md index d009b5c7..e732660d 100644 --- a/docs/examples/databases/update-enum-attribute.md +++ b/docs/examples/databases/update-enum-attribute.md @@ -10,7 +10,7 @@ Client client = new Client() Databases databases = new Databases(client); -AttributeEnum result = await databases.UpdateEnumAttribute( +Appwrite.Models.AttributeEnum result = await databases.UpdateEnumAttribute( databaseId: "", collectionId: "", key: "", diff --git a/docs/examples/databases/update-float-attribute.md b/docs/examples/databases/update-float-attribute.md index fd8dc427..116e7c77 100644 --- a/docs/examples/databases/update-float-attribute.md +++ b/docs/examples/databases/update-float-attribute.md @@ -10,7 +10,7 @@ Client client = new Client() Databases databases = new Databases(client); -AttributeFloat result = await databases.UpdateFloatAttribute( +Appwrite.Models.AttributeFloat result = await databases.UpdateFloatAttribute( databaseId: "", collectionId: "", key: "", diff --git a/docs/examples/databases/update-integer-attribute.md b/docs/examples/databases/update-integer-attribute.md index 17a0cc8b..5c13aa75 100644 --- a/docs/examples/databases/update-integer-attribute.md +++ b/docs/examples/databases/update-integer-attribute.md @@ -10,7 +10,7 @@ Client client = new Client() Databases databases = new Databases(client); -AttributeInteger result = await databases.UpdateIntegerAttribute( +Appwrite.Models.AttributeInteger result = await databases.UpdateIntegerAttribute( databaseId: "", collectionId: "", key: "", diff --git a/docs/examples/databases/update-ip-attribute.md b/docs/examples/databases/update-ip-attribute.md index 432bb4d4..b9c9982d 100644 --- a/docs/examples/databases/update-ip-attribute.md +++ b/docs/examples/databases/update-ip-attribute.md @@ -10,7 +10,7 @@ Client client = new Client() Databases databases = new Databases(client); -AttributeIp result = await databases.UpdateIpAttribute( +Appwrite.Models.AttributeIp result = await databases.UpdateIpAttribute( databaseId: "", collectionId: "", key: "", diff --git a/docs/examples/databases/update-line-attribute.md b/docs/examples/databases/update-line-attribute.md index 11dc3840..c7c40756 100644 --- a/docs/examples/databases/update-line-attribute.md +++ b/docs/examples/databases/update-line-attribute.md @@ -10,7 +10,7 @@ Client client = new Client() Databases databases = new Databases(client); -AttributeLine result = await databases.UpdateLineAttribute( +Appwrite.Models.AttributeLine result = await databases.UpdateLineAttribute( databaseId: "", collectionId: "", key: "", diff --git a/docs/examples/databases/update-longtext-attribute.md b/docs/examples/databases/update-longtext-attribute.md index 2dba9171..138dae8a 100644 --- a/docs/examples/databases/update-longtext-attribute.md +++ b/docs/examples/databases/update-longtext-attribute.md @@ -10,7 +10,7 @@ Client client = new Client() Databases databases = new Databases(client); -AttributeLongtext result = await databases.UpdateLongtextAttribute( +Appwrite.Models.AttributeLongtext result = await databases.UpdateLongtextAttribute( databaseId: "", collectionId: "", key: "", diff --git a/docs/examples/databases/update-mediumtext-attribute.md b/docs/examples/databases/update-mediumtext-attribute.md index ba356254..b8cedadf 100644 --- a/docs/examples/databases/update-mediumtext-attribute.md +++ b/docs/examples/databases/update-mediumtext-attribute.md @@ -10,7 +10,7 @@ Client client = new Client() Databases databases = new Databases(client); -AttributeMediumtext result = await databases.UpdateMediumtextAttribute( +Appwrite.Models.AttributeMediumtext result = await databases.UpdateMediumtextAttribute( databaseId: "", collectionId: "", key: "", diff --git a/docs/examples/databases/update-point-attribute.md b/docs/examples/databases/update-point-attribute.md index 7bbf9fb6..895443c3 100644 --- a/docs/examples/databases/update-point-attribute.md +++ b/docs/examples/databases/update-point-attribute.md @@ -10,7 +10,7 @@ Client client = new Client() Databases databases = new Databases(client); -AttributePoint result = await databases.UpdatePointAttribute( +Appwrite.Models.AttributePoint result = await databases.UpdatePointAttribute( databaseId: "", collectionId: "", key: "", diff --git a/docs/examples/databases/update-polygon-attribute.md b/docs/examples/databases/update-polygon-attribute.md index f35fdcff..c5fa1323 100644 --- a/docs/examples/databases/update-polygon-attribute.md +++ b/docs/examples/databases/update-polygon-attribute.md @@ -10,7 +10,7 @@ Client client = new Client() Databases databases = new Databases(client); -AttributePolygon result = await databases.UpdatePolygonAttribute( +Appwrite.Models.AttributePolygon result = await databases.UpdatePolygonAttribute( databaseId: "", collectionId: "", key: "", diff --git a/docs/examples/databases/update-relationship-attribute.md b/docs/examples/databases/update-relationship-attribute.md index aa7fd030..c3d5cded 100644 --- a/docs/examples/databases/update-relationship-attribute.md +++ b/docs/examples/databases/update-relationship-attribute.md @@ -11,7 +11,7 @@ Client client = new Client() Databases databases = new Databases(client); -AttributeRelationship result = await databases.UpdateRelationshipAttribute( +Appwrite.Models.AttributeRelationship result = await databases.UpdateRelationshipAttribute( databaseId: "", collectionId: "", key: "", diff --git a/docs/examples/databases/update-string-attribute.md b/docs/examples/databases/update-string-attribute.md index 00bf4aed..d683be9f 100644 --- a/docs/examples/databases/update-string-attribute.md +++ b/docs/examples/databases/update-string-attribute.md @@ -10,7 +10,7 @@ Client client = new Client() Databases databases = new Databases(client); -AttributeString result = await databases.UpdateStringAttribute( +Appwrite.Models.AttributeString result = await databases.UpdateStringAttribute( databaseId: "", collectionId: "", key: "", diff --git a/docs/examples/databases/update-text-attribute.md b/docs/examples/databases/update-text-attribute.md index e041f96e..1c6861ac 100644 --- a/docs/examples/databases/update-text-attribute.md +++ b/docs/examples/databases/update-text-attribute.md @@ -10,7 +10,7 @@ Client client = new Client() Databases databases = new Databases(client); -AttributeText result = await databases.UpdateTextAttribute( +Appwrite.Models.AttributeText result = await databases.UpdateTextAttribute( databaseId: "", collectionId: "", key: "", diff --git a/docs/examples/databases/update-transaction.md b/docs/examples/databases/update-transaction.md index b3058935..8ababfa1 100644 --- a/docs/examples/databases/update-transaction.md +++ b/docs/examples/databases/update-transaction.md @@ -10,7 +10,7 @@ Client client = new Client() Databases databases = new Databases(client); -Transaction result = await databases.UpdateTransaction( +Appwrite.Models.Transaction result = await databases.UpdateTransaction( transactionId: "", commit: false, // optional rollback: false // optional diff --git a/docs/examples/databases/update-url-attribute.md b/docs/examples/databases/update-url-attribute.md index 4beafd13..07ae4efd 100644 --- a/docs/examples/databases/update-url-attribute.md +++ b/docs/examples/databases/update-url-attribute.md @@ -10,7 +10,7 @@ Client client = new Client() Databases databases = new Databases(client); -AttributeUrl result = await databases.UpdateUrlAttribute( +Appwrite.Models.AttributeUrl result = await databases.UpdateUrlAttribute( databaseId: "", collectionId: "", key: "", diff --git a/docs/examples/databases/update-varchar-attribute.md b/docs/examples/databases/update-varchar-attribute.md index 2d721512..87b8955f 100644 --- a/docs/examples/databases/update-varchar-attribute.md +++ b/docs/examples/databases/update-varchar-attribute.md @@ -10,7 +10,7 @@ Client client = new Client() Databases databases = new Databases(client); -AttributeVarchar result = await databases.UpdateVarcharAttribute( +Appwrite.Models.AttributeVarchar result = await databases.UpdateVarcharAttribute( databaseId: "", collectionId: "", key: "", diff --git a/docs/examples/databases/update.md b/docs/examples/databases/update.md index 1439c1ce..33831f35 100644 --- a/docs/examples/databases/update.md +++ b/docs/examples/databases/update.md @@ -10,7 +10,7 @@ Client client = new Client() Databases databases = new Databases(client); -Database result = await databases.Update( +Appwrite.Models.Database result = await databases.Update( databaseId: "", name: "", // optional enabled: false // optional diff --git a/docs/examples/databases/upsert-document.md b/docs/examples/databases/upsert-document.md index 3eff270e..31cd4580 100644 --- a/docs/examples/databases/upsert-document.md +++ b/docs/examples/databases/upsert-document.md @@ -10,7 +10,7 @@ Client client = new Client() Databases databases = new Databases(client); -Document result = await databases.UpsertDocument( +Appwrite.Models.Document result = await databases.UpsertDocument( databaseId: "", collectionId: "", documentId: "", diff --git a/docs/examples/databases/upsert-documents.md b/docs/examples/databases/upsert-documents.md index d22184b8..58b9e62d 100644 --- a/docs/examples/databases/upsert-documents.md +++ b/docs/examples/databases/upsert-documents.md @@ -10,10 +10,19 @@ Client client = new Client() Databases databases = new Databases(client); -DocumentList result = await databases.UpsertDocuments( +Appwrite.Models.DocumentList result = await databases.UpsertDocuments( databaseId: "", collectionId: "", - documents: new List(), + documents: [ + { + "$id": "example1", + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 30, + "isAdmin": false + } + ], transactionId: "" // optional ); diff --git a/docs/examples/documentsdb/create-collection.md b/docs/examples/documentsdb/create-collection.md index 5c42dc56..42dba6f6 100644 --- a/docs/examples/documentsdb/create-collection.md +++ b/docs/examples/documentsdb/create-collection.md @@ -10,7 +10,7 @@ Client client = new Client() DocumentsDB documentsDB = new DocumentsDB(client); -Collection result = await documentsDB.CreateCollection( +Appwrite.Models.Collection result = await documentsDB.CreateCollection( databaseId: "", collectionId: "", name: "", diff --git a/docs/examples/documentsdb/create-document.md b/docs/examples/documentsdb/create-document.md index ccc8bc36..ce6b3921 100644 --- a/docs/examples/documentsdb/create-document.md +++ b/docs/examples/documentsdb/create-document.md @@ -10,7 +10,7 @@ Client client = new Client() DocumentsDB documentsDB = new DocumentsDB(client); -Document result = await documentsDB.CreateDocument( +Appwrite.Models.Document result = await documentsDB.CreateDocument( databaseId: "", collectionId: "", documentId: "", diff --git a/docs/examples/documentsdb/create-documents.md b/docs/examples/documentsdb/create-documents.md index 6b98311b..aa2ec577 100644 --- a/docs/examples/documentsdb/create-documents.md +++ b/docs/examples/documentsdb/create-documents.md @@ -10,10 +10,19 @@ Client client = new Client() DocumentsDB documentsDB = new DocumentsDB(client); -DocumentList result = await documentsDB.CreateDocuments( +Appwrite.Models.DocumentList result = await documentsDB.CreateDocuments( databaseId: "", collectionId: "", - documents: new List(), + documents: [ + { + "$id": "example1", + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 30, + "isAdmin": false + } + ], transactionId: "" // optional ); diff --git a/docs/examples/documentsdb/create-failover.md b/docs/examples/documentsdb/create-failover.md index 5a22d1c7..2d0b75c4 100644 --- a/docs/examples/documentsdb/create-failover.md +++ b/docs/examples/documentsdb/create-failover.md @@ -10,7 +10,7 @@ Client client = new Client() DocumentsDB documentsDB = new DocumentsDB(client); -DedicatedDatabase result = await documentsDB.CreateFailover( +Appwrite.Models.DedicatedDatabase result = await documentsDB.CreateFailover( databaseId: "", targetReplicaId: "" // optional ); diff --git a/docs/examples/documentsdb/create-index.md b/docs/examples/documentsdb/create-index.md index 31a06292..c24bd4d0 100644 --- a/docs/examples/documentsdb/create-index.md +++ b/docs/examples/documentsdb/create-index.md @@ -11,12 +11,12 @@ Client client = new Client() DocumentsDB documentsDB = new DocumentsDB(client); -Index result = await documentsDB.CreateIndex( +Appwrite.Models.Index result = await documentsDB.CreateIndex( databaseId: "", collectionId: "", key: "", type: DocumentsDBIndexType.Key, - attributes: new List(), + attributes: ["username"], orders: new List<OrderBy> { OrderBy.Asc }, // optional lengths: new List() // optional ); diff --git a/docs/examples/documentsdb/create-operations.md b/docs/examples/documentsdb/create-operations.md index abe507f3..ca9d74d7 100644 --- a/docs/examples/documentsdb/create-operations.md +++ b/docs/examples/documentsdb/create-operations.md @@ -10,7 +10,7 @@ Client client = new Client() DocumentsDB documentsDB = new DocumentsDB(client); -Transaction result = await documentsDB.CreateOperations( +Appwrite.Models.Transaction result = await documentsDB.CreateOperations( transactionId: "", operations: [ { diff --git a/docs/examples/documentsdb/create-transaction.md b/docs/examples/documentsdb/create-transaction.md index a948934b..8d8c1576 100644 --- a/docs/examples/documentsdb/create-transaction.md +++ b/docs/examples/documentsdb/create-transaction.md @@ -10,7 +10,7 @@ Client client = new Client() DocumentsDB documentsDB = new DocumentsDB(client); -Transaction result = await documentsDB.CreateTransaction( +Appwrite.Models.Transaction result = await documentsDB.CreateTransaction( ttl: 60 // optional ); diff --git a/docs/examples/documentsdb/create.md b/docs/examples/documentsdb/create.md index 8c1fa6b5..b4ed7ec6 100644 --- a/docs/examples/documentsdb/create.md +++ b/docs/examples/documentsdb/create.md @@ -10,7 +10,7 @@ Client client = new Client() DocumentsDB documentsDB = new DocumentsDB(client); -Database result = await documentsDB.Create( +Appwrite.Models.Database result = await documentsDB.Create( databaseId: "", name: "", enabled: false, // optional diff --git a/docs/examples/documentsdb/decrement-document-attribute.md b/docs/examples/documentsdb/decrement-document-attribute.md index 5ab49cdd..4cce51d6 100644 --- a/docs/examples/documentsdb/decrement-document-attribute.md +++ b/docs/examples/documentsdb/decrement-document-attribute.md @@ -10,7 +10,7 @@ Client client = new Client() DocumentsDB documentsDB = new DocumentsDB(client); -Document result = await documentsDB.DecrementDocumentAttribute( +Appwrite.Models.Document result = await documentsDB.DecrementDocumentAttribute( databaseId: "", collectionId: "", documentId: "", diff --git a/docs/examples/documentsdb/delete-documents.md b/docs/examples/documentsdb/delete-documents.md index c1c885aa..2cd23c63 100644 --- a/docs/examples/documentsdb/delete-documents.md +++ b/docs/examples/documentsdb/delete-documents.md @@ -13,7 +13,7 @@ DocumentsDB documentsDB = new DocumentsDB(client); await documentsDB.DeleteDocuments( databaseId: "", collectionId: "", - queries: new List(), // optional + queries: ["{\"method\":\"equal\", \"attribute\":\"$id\", \"values\":[\"\"]}"], // optional transactionId: "" // optional ); diff --git a/docs/examples/documentsdb/get-collection.md b/docs/examples/documentsdb/get-collection.md index f50e03a1..32f93a1a 100644 --- a/docs/examples/documentsdb/get-collection.md +++ b/docs/examples/documentsdb/get-collection.md @@ -10,7 +10,7 @@ Client client = new Client() DocumentsDB documentsDB = new DocumentsDB(client); -Collection result = await documentsDB.GetCollection( +Appwrite.Models.Collection result = await documentsDB.GetCollection( databaseId: "", collectionId: "" ); diff --git a/docs/examples/documentsdb/get-document.md b/docs/examples/documentsdb/get-document.md index 1e3bfa5c..be8b0849 100644 --- a/docs/examples/documentsdb/get-document.md +++ b/docs/examples/documentsdb/get-document.md @@ -10,7 +10,7 @@ Client client = new Client() DocumentsDB documentsDB = new DocumentsDB(client); -Document result = await documentsDB.GetDocument( +Appwrite.Models.Document result = await documentsDB.GetDocument( databaseId: "", collectionId: "", documentId: "", diff --git a/docs/examples/documentsdb/get-index.md b/docs/examples/documentsdb/get-index.md index e8c99e38..58b080ef 100644 --- a/docs/examples/documentsdb/get-index.md +++ b/docs/examples/documentsdb/get-index.md @@ -10,7 +10,7 @@ Client client = new Client() DocumentsDB documentsDB = new DocumentsDB(client); -Index result = await documentsDB.GetIndex( +Appwrite.Models.Index result = await documentsDB.GetIndex( databaseId: "", collectionId: "", key: "" diff --git a/docs/examples/documentsdb/get-replicas.md b/docs/examples/documentsdb/get-replicas.md index abe66999..847b934a 100644 --- a/docs/examples/documentsdb/get-replicas.md +++ b/docs/examples/documentsdb/get-replicas.md @@ -10,7 +10,7 @@ Client client = new Client() DocumentsDB documentsDB = new DocumentsDB(client); -DedicatedDatabaseReplicas result = await documentsDB.GetReplicas( +Appwrite.Models.DedicatedDatabaseReplicas result = await documentsDB.GetReplicas( databaseId: "" ); diff --git a/docs/examples/documentsdb/get-status.md b/docs/examples/documentsdb/get-status.md index 418a7613..ed1f40b2 100644 --- a/docs/examples/documentsdb/get-status.md +++ b/docs/examples/documentsdb/get-status.md @@ -10,7 +10,7 @@ Client client = new Client() DocumentsDB documentsDB = new DocumentsDB(client); -DatabaseStatus result = await documentsDB.GetStatus( +Appwrite.Models.DatabaseStatus result = await documentsDB.GetStatus( databaseId: "" ); diff --git a/docs/examples/documentsdb/get-transaction.md b/docs/examples/documentsdb/get-transaction.md index 800897c2..644380e7 100644 --- a/docs/examples/documentsdb/get-transaction.md +++ b/docs/examples/documentsdb/get-transaction.md @@ -10,7 +10,7 @@ Client client = new Client() DocumentsDB documentsDB = new DocumentsDB(client); -Transaction result = await documentsDB.GetTransaction( +Appwrite.Models.Transaction result = await documentsDB.GetTransaction( transactionId: "" ); diff --git a/docs/examples/documentsdb/get.md b/docs/examples/documentsdb/get.md index f8d06919..5e1d7047 100644 --- a/docs/examples/documentsdb/get.md +++ b/docs/examples/documentsdb/get.md @@ -10,7 +10,7 @@ Client client = new Client() DocumentsDB documentsDB = new DocumentsDB(client); -Database result = await documentsDB.Get( +Appwrite.Models.Database result = await documentsDB.Get( databaseId: "" ); diff --git a/docs/examples/documentsdb/increment-document-attribute.md b/docs/examples/documentsdb/increment-document-attribute.md index fc9d0795..1c8c69b6 100644 --- a/docs/examples/documentsdb/increment-document-attribute.md +++ b/docs/examples/documentsdb/increment-document-attribute.md @@ -10,7 +10,7 @@ Client client = new Client() DocumentsDB documentsDB = new DocumentsDB(client); -Document result = await documentsDB.IncrementDocumentAttribute( +Appwrite.Models.Document result = await documentsDB.IncrementDocumentAttribute( databaseId: "", collectionId: "", documentId: "", diff --git a/docs/examples/documentsdb/list-collections.md b/docs/examples/documentsdb/list-collections.md index 1227361b..0cde0814 100644 --- a/docs/examples/documentsdb/list-collections.md +++ b/docs/examples/documentsdb/list-collections.md @@ -10,7 +10,7 @@ Client client = new Client() DocumentsDB documentsDB = new DocumentsDB(client); -CollectionList result = await documentsDB.ListCollections( +Appwrite.Models.CollectionList result = await documentsDB.ListCollections( databaseId: "", queries: new List(), // optional search: "", // optional diff --git a/docs/examples/documentsdb/list-documents.md b/docs/examples/documentsdb/list-documents.md index 0838c9c1..cf6cdb58 100644 --- a/docs/examples/documentsdb/list-documents.md +++ b/docs/examples/documentsdb/list-documents.md @@ -10,7 +10,7 @@ Client client = new Client() DocumentsDB documentsDB = new DocumentsDB(client); -DocumentList result = await documentsDB.ListDocuments( +Appwrite.Models.DocumentList result = await documentsDB.ListDocuments( databaseId: "", collectionId: "", queries: new List(), // optional diff --git a/docs/examples/documentsdb/list-indexes.md b/docs/examples/documentsdb/list-indexes.md index aa8435ca..6a33ad69 100644 --- a/docs/examples/documentsdb/list-indexes.md +++ b/docs/examples/documentsdb/list-indexes.md @@ -10,7 +10,7 @@ Client client = new Client() DocumentsDB documentsDB = new DocumentsDB(client); -IndexList result = await documentsDB.ListIndexes( +Appwrite.Models.IndexList result = await documentsDB.ListIndexes( databaseId: "", collectionId: "", queries: new List(), // optional diff --git a/docs/examples/documentsdb/list-operations.md b/docs/examples/documentsdb/list-operations.md index 5e274792..da845f73 100644 --- a/docs/examples/documentsdb/list-operations.md +++ b/docs/examples/documentsdb/list-operations.md @@ -10,7 +10,7 @@ Client client = new Client() DocumentsDB documentsDB = new DocumentsDB(client); -DedicatedDatabaseOperationList result = await documentsDB.ListOperations( +Appwrite.Models.DedicatedDatabaseOperationList result = await documentsDB.ListOperations( databaseId: "", status: "queued", // optional limit: 1, // optional diff --git a/docs/examples/documentsdb/list-specifications.md b/docs/examples/documentsdb/list-specifications.md index 33e4c32a..ba218f8c 100644 --- a/docs/examples/documentsdb/list-specifications.md +++ b/docs/examples/documentsdb/list-specifications.md @@ -10,7 +10,7 @@ Client client = new Client() DocumentsDB documentsDB = new DocumentsDB(client); -DedicatedDatabaseSpecificationList result = await documentsDB.ListSpecifications(); +Appwrite.Models.DedicatedDatabaseSpecificationList result = await documentsDB.ListSpecifications(); ``` diff --git a/docs/examples/documentsdb/list-transactions.md b/docs/examples/documentsdb/list-transactions.md index 84539069..d884292d 100644 --- a/docs/examples/documentsdb/list-transactions.md +++ b/docs/examples/documentsdb/list-transactions.md @@ -10,8 +10,9 @@ Client client = new Client() DocumentsDB documentsDB = new DocumentsDB(client); -TransactionList result = await documentsDB.ListTransactions( - queries: new List() // optional +Appwrite.Models.TransactionList result = await documentsDB.ListTransactions( + queries: new List(), // optional + total: false // optional ); ``` diff --git a/docs/examples/documentsdb/list.md b/docs/examples/documentsdb/list.md index 79bfce24..34ef67fb 100644 --- a/docs/examples/documentsdb/list.md +++ b/docs/examples/documentsdb/list.md @@ -10,7 +10,7 @@ Client client = new Client() DocumentsDB documentsDB = new DocumentsDB(client); -DatabaseList result = await documentsDB.List( +Appwrite.Models.DatabaseList result = await documentsDB.List( queries: new List(), // optional total: false // optional ); diff --git a/docs/examples/documentsdb/update-collection.md b/docs/examples/documentsdb/update-collection.md index 093d9db9..97ee4643 100644 --- a/docs/examples/documentsdb/update-collection.md +++ b/docs/examples/documentsdb/update-collection.md @@ -10,7 +10,7 @@ Client client = new Client() DocumentsDB documentsDB = new DocumentsDB(client); -Collection result = await documentsDB.UpdateCollection( +Appwrite.Models.Collection result = await documentsDB.UpdateCollection( databaseId: "", collectionId: "", name: "", diff --git a/docs/examples/documentsdb/update-document.md b/docs/examples/documentsdb/update-document.md index 87172a6e..be80182b 100644 --- a/docs/examples/documentsdb/update-document.md +++ b/docs/examples/documentsdb/update-document.md @@ -10,7 +10,7 @@ Client client = new Client() DocumentsDB documentsDB = new DocumentsDB(client); -Document result = await documentsDB.UpdateDocument( +Appwrite.Models.Document result = await documentsDB.UpdateDocument( databaseId: "", collectionId: "", documentId: "", diff --git a/docs/examples/documentsdb/update-documents.md b/docs/examples/documentsdb/update-documents.md index f325b2ea..7ba53e77 100644 --- a/docs/examples/documentsdb/update-documents.md +++ b/docs/examples/documentsdb/update-documents.md @@ -10,7 +10,7 @@ Client client = new Client() DocumentsDB documentsDB = new DocumentsDB(client); -DocumentList result = await documentsDB.UpdateDocuments( +Appwrite.Models.DocumentList result = await documentsDB.UpdateDocuments( databaseId: "", collectionId: "", data: [object], // optional diff --git a/docs/examples/documentsdb/update-transaction.md b/docs/examples/documentsdb/update-transaction.md index b4a30687..18a93bdf 100644 --- a/docs/examples/documentsdb/update-transaction.md +++ b/docs/examples/documentsdb/update-transaction.md @@ -10,7 +10,7 @@ Client client = new Client() DocumentsDB documentsDB = new DocumentsDB(client); -Transaction result = await documentsDB.UpdateTransaction( +Appwrite.Models.Transaction result = await documentsDB.UpdateTransaction( transactionId: "", commit: false, // optional rollback: false // optional diff --git a/docs/examples/documentsdb/update.md b/docs/examples/documentsdb/update.md index e9fd54c5..61d5347d 100644 --- a/docs/examples/documentsdb/update.md +++ b/docs/examples/documentsdb/update.md @@ -10,7 +10,7 @@ Client client = new Client() DocumentsDB documentsDB = new DocumentsDB(client); -Database result = await documentsDB.Update( +Appwrite.Models.Database result = await documentsDB.Update( databaseId: "", name: "", enabled: false, // optional diff --git a/docs/examples/documentsdb/upsert-document.md b/docs/examples/documentsdb/upsert-document.md index a5de788f..3fcdeda7 100644 --- a/docs/examples/documentsdb/upsert-document.md +++ b/docs/examples/documentsdb/upsert-document.md @@ -10,7 +10,7 @@ Client client = new Client() DocumentsDB documentsDB = new DocumentsDB(client); -Document result = await documentsDB.UpsertDocument( +Appwrite.Models.Document result = await documentsDB.UpsertDocument( databaseId: "", collectionId: "", documentId: "", diff --git a/docs/examples/documentsdb/upsert-documents.md b/docs/examples/documentsdb/upsert-documents.md index 66f738cf..6a5cf7a5 100644 --- a/docs/examples/documentsdb/upsert-documents.md +++ b/docs/examples/documentsdb/upsert-documents.md @@ -10,10 +10,19 @@ Client client = new Client() DocumentsDB documentsDB = new DocumentsDB(client); -DocumentList result = await documentsDB.UpsertDocuments( +Appwrite.Models.DocumentList result = await documentsDB.UpsertDocuments( databaseId: "", collectionId: "", - documents: new List(), + documents: [ + { + "$id": "example1", + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 30, + "isAdmin": false + } + ], transactionId: "" // optional ); diff --git a/docs/examples/domains/create-preset-google-workspace.md b/docs/examples/domains/create-preset-google-workspace.md new file mode 100644 index 00000000..03b72f3e --- /dev/null +++ b/docs/examples/domains/create-preset-google-workspace.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetKey(""); // Your secret API key + +Domains domains = new Domains(client); + +Appwrite.Models.DnsRecordsList result = await domains.CreatePresetGoogleWorkspace( + domainId: "" +); + +``` diff --git a/docs/examples/domains/create-preset-i-cloud.md b/docs/examples/domains/create-preset-i-cloud.md new file mode 100644 index 00000000..bfbaab5d --- /dev/null +++ b/docs/examples/domains/create-preset-i-cloud.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetKey(""); // Your secret API key + +Domains domains = new Domains(client); + +Appwrite.Models.DnsRecordsList result = await domains.CreatePresetICloud( + domainId: "" +); + +``` diff --git a/docs/examples/domains/create-preset-mailgun.md b/docs/examples/domains/create-preset-mailgun.md new file mode 100644 index 00000000..053ca91a --- /dev/null +++ b/docs/examples/domains/create-preset-mailgun.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetKey(""); // Your secret API key + +Domains domains = new Domains(client); + +Appwrite.Models.DnsRecordsList result = await domains.CreatePresetMailgun( + domainId: "" +); + +``` diff --git a/docs/examples/domains/create-preset-outlook.md b/docs/examples/domains/create-preset-outlook.md new file mode 100644 index 00000000..81fe1c68 --- /dev/null +++ b/docs/examples/domains/create-preset-outlook.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetKey(""); // Your secret API key + +Domains domains = new Domains(client); + +Appwrite.Models.DnsRecordsList result = await domains.CreatePresetOutlook( + domainId: "" +); + +``` diff --git a/docs/examples/domains/create-preset-proton-mail.md b/docs/examples/domains/create-preset-proton-mail.md new file mode 100644 index 00000000..fbfa3827 --- /dev/null +++ b/docs/examples/domains/create-preset-proton-mail.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetKey(""); // Your secret API key + +Domains domains = new Domains(client); + +Appwrite.Models.DnsRecordsList result = await domains.CreatePresetProtonMail( + domainId: "" +); + +``` diff --git a/docs/examples/domains/create-preset-zoho.md b/docs/examples/domains/create-preset-zoho.md new file mode 100644 index 00000000..e13ff80a --- /dev/null +++ b/docs/examples/domains/create-preset-zoho.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetKey(""); // Your secret API key + +Domains domains = new Domains(client); + +Appwrite.Models.DnsRecordsList result = await domains.CreatePresetZoho( + domainId: "" +); + +``` diff --git a/docs/examples/domains/create-record-a.md b/docs/examples/domains/create-record-a.md new file mode 100644 index 00000000..c615a898 --- /dev/null +++ b/docs/examples/domains/create-record-a.md @@ -0,0 +1,21 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetKey(""); // Your secret API key + +Domains domains = new Domains(client); + +Appwrite.Models.DnsRecord result = await domains.CreateRecordA( + domainId: "", + name: "", + value: "", + ttl: 1, + comment: "" // optional +); + +``` diff --git a/docs/examples/domains/create-record-aaaa.md b/docs/examples/domains/create-record-aaaa.md new file mode 100644 index 00000000..ffd800a5 --- /dev/null +++ b/docs/examples/domains/create-record-aaaa.md @@ -0,0 +1,21 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetKey(""); // Your secret API key + +Domains domains = new Domains(client); + +Appwrite.Models.DnsRecord result = await domains.CreateRecordAAAA( + domainId: "", + name: "", + value: "", + ttl: 1, + comment: "" // optional +); + +``` diff --git a/docs/examples/domains/create-record-alias.md b/docs/examples/domains/create-record-alias.md new file mode 100644 index 00000000..3cea72b0 --- /dev/null +++ b/docs/examples/domains/create-record-alias.md @@ -0,0 +1,21 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetKey(""); // Your secret API key + +Domains domains = new Domains(client); + +Appwrite.Models.DnsRecord result = await domains.CreateRecordAlias( + domainId: "", + name: "", + value: "", + ttl: 1, + comment: "" // optional +); + +``` diff --git a/docs/examples/domains/create-record-caa.md b/docs/examples/domains/create-record-caa.md new file mode 100644 index 00000000..6f483477 --- /dev/null +++ b/docs/examples/domains/create-record-caa.md @@ -0,0 +1,21 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetKey(""); // Your secret API key + +Domains domains = new Domains(client); + +Appwrite.Models.DnsRecord result = await domains.CreateRecordCAA( + domainId: "", + name: "", + value: "", + ttl: 1, + comment: "" // optional +); + +``` diff --git a/docs/examples/domains/create-record-cname.md b/docs/examples/domains/create-record-cname.md new file mode 100644 index 00000000..c4057935 --- /dev/null +++ b/docs/examples/domains/create-record-cname.md @@ -0,0 +1,21 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetKey(""); // Your secret API key + +Domains domains = new Domains(client); + +Appwrite.Models.DnsRecord result = await domains.CreateRecordCNAME( + domainId: "", + name: "", + value: "", + ttl: 1, + comment: "" // optional +); + +``` diff --git a/docs/examples/domains/create-record-https.md b/docs/examples/domains/create-record-https.md new file mode 100644 index 00000000..2a3c27c3 --- /dev/null +++ b/docs/examples/domains/create-record-https.md @@ -0,0 +1,21 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetKey(""); // Your secret API key + +Domains domains = new Domains(client); + +Appwrite.Models.DnsRecord result = await domains.CreateRecordHTTPS( + domainId: "", + name: "", + value: "", + ttl: 1, + comment: "" // optional +); + +``` diff --git a/docs/examples/domains/create-record-mx.md b/docs/examples/domains/create-record-mx.md new file mode 100644 index 00000000..b1a7ba20 --- /dev/null +++ b/docs/examples/domains/create-record-mx.md @@ -0,0 +1,22 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetKey(""); // Your secret API key + +Domains domains = new Domains(client); + +Appwrite.Models.DnsRecord result = await domains.CreateRecordMX( + domainId: "", + name: "", + value: "", + ttl: 1, + priority: 0, + comment: "" // optional +); + +``` diff --git a/docs/examples/domains/create-record-ns.md b/docs/examples/domains/create-record-ns.md new file mode 100644 index 00000000..9b77ed93 --- /dev/null +++ b/docs/examples/domains/create-record-ns.md @@ -0,0 +1,21 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetKey(""); // Your secret API key + +Domains domains = new Domains(client); + +Appwrite.Models.DnsRecord result = await domains.CreateRecordNS( + domainId: "", + name: "", + value: "", + ttl: 1, + comment: "" // optional +); + +``` diff --git a/docs/examples/domains/create-record-srv.md b/docs/examples/domains/create-record-srv.md new file mode 100644 index 00000000..95ac8875 --- /dev/null +++ b/docs/examples/domains/create-record-srv.md @@ -0,0 +1,24 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetKey(""); // Your secret API key + +Domains domains = new Domains(client); + +Appwrite.Models.DnsRecord result = await domains.CreateRecordSRV( + domainId: "", + name: "", + value: "", + ttl: 1, + priority: 0, + weight: 0, + port: 0, + comment: "" // optional +); + +``` diff --git a/docs/examples/domains/create-record-txt.md b/docs/examples/domains/create-record-txt.md new file mode 100644 index 00000000..9681d5e6 --- /dev/null +++ b/docs/examples/domains/create-record-txt.md @@ -0,0 +1,21 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetKey(""); // Your secret API key + +Domains domains = new Domains(client); + +Appwrite.Models.DnsRecord result = await domains.CreateRecordTXT( + domainId: "", + name: "", + ttl: 1, + value: "", // optional + comment: "" // optional +); + +``` diff --git a/docs/examples/domains/create.md b/docs/examples/domains/create.md new file mode 100644 index 00000000..99fbdfab --- /dev/null +++ b/docs/examples/domains/create.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetKey(""); // Your secret API key + +Domains domains = new Domains(client); + +Appwrite.Models.XDomain result = await domains.Create( + teamId: "", + domain: "example.com" +); + +``` diff --git a/docs/examples/domains/delete-record.md b/docs/examples/domains/delete-record.md new file mode 100644 index 00000000..edb656a2 --- /dev/null +++ b/docs/examples/domains/delete-record.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetKey(""); // Your secret API key + +Domains domains = new Domains(client); + +await domains.DeleteRecord( + domainId: "", + recordId: "" +); + +``` diff --git a/docs/examples/domains/delete.md b/docs/examples/domains/delete.md new file mode 100644 index 00000000..a4cb0a77 --- /dev/null +++ b/docs/examples/domains/delete.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetKey(""); // Your secret API key + +Domains domains = new Domains(client); + +await domains.Delete( + domainId: "" +); + +``` diff --git a/docs/examples/domains/get-preset-google-workspace.md b/docs/examples/domains/get-preset-google-workspace.md new file mode 100644 index 00000000..cb5dbc12 --- /dev/null +++ b/docs/examples/domains/get-preset-google-workspace.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetKey(""); // Your secret API key + +Domains domains = new Domains(client); + +Appwrite.Models.DnsRecordsList result = await domains.GetPresetGoogleWorkspace( + domainId: "" +); + +``` diff --git a/docs/examples/domains/get-preset-i-cloud.md b/docs/examples/domains/get-preset-i-cloud.md new file mode 100644 index 00000000..04497d58 --- /dev/null +++ b/docs/examples/domains/get-preset-i-cloud.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetKey(""); // Your secret API key + +Domains domains = new Domains(client); + +Appwrite.Models.DnsRecordsList result = await domains.GetPresetICloud( + domainId: "" +); + +``` diff --git a/docs/examples/domains/get-preset-mailgun.md b/docs/examples/domains/get-preset-mailgun.md new file mode 100644 index 00000000..3157168f --- /dev/null +++ b/docs/examples/domains/get-preset-mailgun.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetKey(""); // Your secret API key + +Domains domains = new Domains(client); + +Appwrite.Models.DnsRecordsList result = await domains.GetPresetMailgun( + domainId: "" +); + +``` diff --git a/docs/examples/domains/get-preset-outlook.md b/docs/examples/domains/get-preset-outlook.md new file mode 100644 index 00000000..d446cf84 --- /dev/null +++ b/docs/examples/domains/get-preset-outlook.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetKey(""); // Your secret API key + +Domains domains = new Domains(client); + +Appwrite.Models.DnsRecordsList result = await domains.GetPresetOutlook( + domainId: "" +); + +``` diff --git a/docs/examples/domains/get-preset-proton-mail.md b/docs/examples/domains/get-preset-proton-mail.md new file mode 100644 index 00000000..dbba99dd --- /dev/null +++ b/docs/examples/domains/get-preset-proton-mail.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetKey(""); // Your secret API key + +Domains domains = new Domains(client); + +Appwrite.Models.DnsRecordsList result = await domains.GetPresetProtonMail( + domainId: "" +); + +``` diff --git a/docs/examples/domains/get-preset-zoho.md b/docs/examples/domains/get-preset-zoho.md new file mode 100644 index 00000000..8df965a3 --- /dev/null +++ b/docs/examples/domains/get-preset-zoho.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetKey(""); // Your secret API key + +Domains domains = new Domains(client); + +Appwrite.Models.DnsRecordsList result = await domains.GetPresetZoho( + domainId: "" +); + +``` diff --git a/docs/examples/domains/get-price.md b/docs/examples/domains/get-price.md new file mode 100644 index 00000000..fb0d5c4c --- /dev/null +++ b/docs/examples/domains/get-price.md @@ -0,0 +1,20 @@ +```csharp +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetKey(""); // Your secret API key + +Domains domains = new Domains(client); + +Appwrite.Models.DomainPrice result = await domains.GetPrice( + domain: "example.com", + periodYears: 0, // optional + registrationType: DomainRegistrationType.New // optional +); + +``` diff --git a/docs/examples/domains/get-record.md b/docs/examples/domains/get-record.md new file mode 100644 index 00000000..4cc61bb9 --- /dev/null +++ b/docs/examples/domains/get-record.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetKey(""); // Your secret API key + +Domains domains = new Domains(client); + +Appwrite.Models.DnsRecord result = await domains.GetRecord( + domainId: "", + recordId: "" +); + +``` diff --git a/docs/examples/domains/get-transfer-status.md b/docs/examples/domains/get-transfer-status.md new file mode 100644 index 00000000..2b3552db --- /dev/null +++ b/docs/examples/domains/get-transfer-status.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetKey(""); // Your secret API key + +Domains domains = new Domains(client); + +Appwrite.Models.DomainTransferStatus result = await domains.GetTransferStatus( + domainId: "" +); + +``` diff --git a/docs/examples/domains/get-zone.md b/docs/examples/domains/get-zone.md new file mode 100644 index 00000000..98e32138 --- /dev/null +++ b/docs/examples/domains/get-zone.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetKey(""); // Your secret API key + +Domains domains = new Domains(client); + +string result = await domains.GetZone( + domainId: "" +); + +``` diff --git a/docs/examples/domains/get.md b/docs/examples/domains/get.md new file mode 100644 index 00000000..9db5eba4 --- /dev/null +++ b/docs/examples/domains/get.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetKey(""); // Your secret API key + +Domains domains = new Domains(client); + +Appwrite.Models.XDomain result = await domains.Get( + domainId: "" +); + +``` diff --git a/docs/examples/domains/list-prices.md b/docs/examples/domains/list-prices.md new file mode 100644 index 00000000..6f32123e --- /dev/null +++ b/docs/examples/domains/list-prices.md @@ -0,0 +1,20 @@ +```csharp +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetKey(""); // Your secret API key + +Domains domains = new Domains(client); + +Appwrite.Models.DomainPricesList result = await domains.ListPrices( + domains: new List(), + periodYears: 0, // optional + registrationType: DomainRegistrationType.New // optional +); + +``` diff --git a/docs/examples/domains/list-records.md b/docs/examples/domains/list-records.md new file mode 100644 index 00000000..2376de7f --- /dev/null +++ b/docs/examples/domains/list-records.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetKey(""); // Your secret API key + +Domains domains = new Domains(client); + +Appwrite.Models.DnsRecordsList result = await domains.ListRecords( + domainId: "", + queries: new List() // optional +); + +``` diff --git a/docs/examples/domains/list.md b/docs/examples/domains/list.md new file mode 100644 index 00000000..b92de614 --- /dev/null +++ b/docs/examples/domains/list.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetKey(""); // Your secret API key + +Domains domains = new Domains(client); + +Appwrite.Models.DomainsList result = await domains.List( + queries: new List(), // optional + search: "" // optional +); + +``` diff --git a/docs/examples/domains/update-nameservers.md b/docs/examples/domains/update-nameservers.md new file mode 100644 index 00000000..fead4405 --- /dev/null +++ b/docs/examples/domains/update-nameservers.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetKey(""); // Your secret API key + +Domains domains = new Domains(client); + +Appwrite.Models.XDomain result = await domains.UpdateNameservers( + domainId: "", + nameservers: new List() // optional +); + +``` diff --git a/docs/examples/domains/update-record-a.md b/docs/examples/domains/update-record-a.md new file mode 100644 index 00000000..54e0d401 --- /dev/null +++ b/docs/examples/domains/update-record-a.md @@ -0,0 +1,22 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetKey(""); // Your secret API key + +Domains domains = new Domains(client); + +Appwrite.Models.DnsRecord result = await domains.UpdateRecordA( + domainId: "", + recordId: "", + name: "", + value: "", + ttl: 1, + comment: "" // optional +); + +``` diff --git a/docs/examples/domains/update-record-aaaa.md b/docs/examples/domains/update-record-aaaa.md new file mode 100644 index 00000000..0f951266 --- /dev/null +++ b/docs/examples/domains/update-record-aaaa.md @@ -0,0 +1,22 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetKey(""); // Your secret API key + +Domains domains = new Domains(client); + +Appwrite.Models.DnsRecord result = await domains.UpdateRecordAAAA( + domainId: "", + recordId: "", + name: "", + value: "", + ttl: 1, + comment: "" // optional +); + +``` diff --git a/docs/examples/domains/update-record-alias.md b/docs/examples/domains/update-record-alias.md new file mode 100644 index 00000000..cc877d2b --- /dev/null +++ b/docs/examples/domains/update-record-alias.md @@ -0,0 +1,22 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetKey(""); // Your secret API key + +Domains domains = new Domains(client); + +Appwrite.Models.DnsRecord result = await domains.UpdateRecordAlias( + domainId: "", + recordId: "", + name: "", + value: "", + ttl: 1, + comment: "" // optional +); + +``` diff --git a/docs/examples/domains/update-record-caa.md b/docs/examples/domains/update-record-caa.md new file mode 100644 index 00000000..9c824c2c --- /dev/null +++ b/docs/examples/domains/update-record-caa.md @@ -0,0 +1,22 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetKey(""); // Your secret API key + +Domains domains = new Domains(client); + +Appwrite.Models.DnsRecord result = await domains.UpdateRecordCAA( + domainId: "", + recordId: "", + name: "", + value: "", + ttl: 1, + comment: "" // optional +); + +``` diff --git a/docs/examples/domains/update-record-cname.md b/docs/examples/domains/update-record-cname.md new file mode 100644 index 00000000..8044947d --- /dev/null +++ b/docs/examples/domains/update-record-cname.md @@ -0,0 +1,22 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetKey(""); // Your secret API key + +Domains domains = new Domains(client); + +Appwrite.Models.DnsRecord result = await domains.UpdateRecordCNAME( + domainId: "", + recordId: "", + name: "", + value: "", + ttl: 1, + comment: "" // optional +); + +``` diff --git a/docs/examples/domains/update-record-https.md b/docs/examples/domains/update-record-https.md new file mode 100644 index 00000000..9c9f9ac7 --- /dev/null +++ b/docs/examples/domains/update-record-https.md @@ -0,0 +1,22 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetKey(""); // Your secret API key + +Domains domains = new Domains(client); + +Appwrite.Models.DnsRecord result = await domains.UpdateRecordHTTPS( + domainId: "", + recordId: "", + name: "", + value: "", + ttl: 1, + comment: "" // optional +); + +``` diff --git a/docs/examples/domains/update-record-mx.md b/docs/examples/domains/update-record-mx.md new file mode 100644 index 00000000..2c195119 --- /dev/null +++ b/docs/examples/domains/update-record-mx.md @@ -0,0 +1,23 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetKey(""); // Your secret API key + +Domains domains = new Domains(client); + +Appwrite.Models.DnsRecord result = await domains.UpdateRecordMX( + domainId: "", + recordId: "", + name: "", + value: "", + ttl: 1, + priority: 0, + comment: "" // optional +); + +``` diff --git a/docs/examples/domains/update-record-ns.md b/docs/examples/domains/update-record-ns.md new file mode 100644 index 00000000..b7a08392 --- /dev/null +++ b/docs/examples/domains/update-record-ns.md @@ -0,0 +1,22 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetKey(""); // Your secret API key + +Domains domains = new Domains(client); + +Appwrite.Models.DnsRecord result = await domains.UpdateRecordNS( + domainId: "", + recordId: "", + name: "", + value: "", + ttl: 1, + comment: "" // optional +); + +``` diff --git a/docs/examples/domains/update-record-srv.md b/docs/examples/domains/update-record-srv.md new file mode 100644 index 00000000..537c89a6 --- /dev/null +++ b/docs/examples/domains/update-record-srv.md @@ -0,0 +1,25 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetKey(""); // Your secret API key + +Domains domains = new Domains(client); + +Appwrite.Models.DnsRecord result = await domains.UpdateRecordSRV( + domainId: "", + recordId: "", + name: "", + value: "", + ttl: 1, + priority: 0, + weight: 0, + port: 0, + comment: "" // optional +); + +``` diff --git a/docs/examples/domains/update-record-txt.md b/docs/examples/domains/update-record-txt.md new file mode 100644 index 00000000..bfd734cf --- /dev/null +++ b/docs/examples/domains/update-record-txt.md @@ -0,0 +1,22 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetKey(""); // Your secret API key + +Domains domains = new Domains(client); + +Appwrite.Models.DnsRecord result = await domains.UpdateRecordTXT( + domainId: "", + recordId: "", + name: "", + value: "", + ttl: 1, + comment: "" // optional +); + +``` diff --git a/docs/examples/domains/update-team.md b/docs/examples/domains/update-team.md new file mode 100644 index 00000000..3481d46c --- /dev/null +++ b/docs/examples/domains/update-team.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetKey(""); // Your secret API key + +Domains domains = new Domains(client); + +Appwrite.Models.XDomain result = await domains.UpdateTeam( + domainId: "", + teamId: "" +); + +``` diff --git a/docs/examples/domains/update-zone.md b/docs/examples/domains/update-zone.md new file mode 100644 index 00000000..0e4444e8 --- /dev/null +++ b/docs/examples/domains/update-zone.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetKey(""); // Your secret API key + +Domains domains = new Domains(client); + +Appwrite.Models.XDomain result = await domains.UpdateZone( + domainId: "", + content: "" +); + +``` diff --git a/docs/examples/domains/verify-nameservers.md b/docs/examples/domains/verify-nameservers.md new file mode 100644 index 00000000..6857f809 --- /dev/null +++ b/docs/examples/domains/verify-nameservers.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetKey(""); // Your secret API key + +Domains domains = new Domains(client); + +Appwrite.Models.XDomain result = await domains.VerifyNameservers( + domainId: "" +); + +``` diff --git a/docs/examples/embeddings/create-text-embeddings.md b/docs/examples/embeddings/create-text-embeddings.md index 95b97cc0..1934363f 100644 --- a/docs/examples/embeddings/create-text-embeddings.md +++ b/docs/examples/embeddings/create-text-embeddings.md @@ -11,8 +11,8 @@ Client client = new Client() Embeddings embeddings = new Embeddings(client); -EmbeddingList result = await embeddings.CreateTextEmbeddings( - texts: new List(), +Appwrite.Models.EmbeddingList result = await embeddings.CreateTextEmbeddings( + texts: ["Appwrite helps developers build applications.", "Find documents with semantic search."], model: EmbeddingModel.NomicEmbedText // optional ); diff --git a/docs/examples/functions/create-deployment.md b/docs/examples/functions/create-deployment.md index a445e35f..cd3bcbca 100644 --- a/docs/examples/functions/create-deployment.md +++ b/docs/examples/functions/create-deployment.md @@ -10,7 +10,7 @@ Client client = new Client() Functions functions = new Functions(client); -Deployment result = await functions.CreateDeployment( +Appwrite.Models.Deployment result = await functions.CreateDeployment( functionId: "", code: InputFile.FromPath("./path-to-files/image.jpg"), activate: false, diff --git a/docs/examples/functions/create-duplicate-deployment.md b/docs/examples/functions/create-duplicate-deployment.md index 20ba6fab..04ab5f1f 100644 --- a/docs/examples/functions/create-duplicate-deployment.md +++ b/docs/examples/functions/create-duplicate-deployment.md @@ -10,7 +10,7 @@ Client client = new Client() Functions functions = new Functions(client); -Deployment result = await functions.CreateDuplicateDeployment( +Appwrite.Models.Deployment result = await functions.CreateDuplicateDeployment( functionId: "", deploymentId: "", buildId: "" // optional diff --git a/docs/examples/functions/create-execution.md b/docs/examples/functions/create-execution.md index 38e0b69b..f497b2e3 100644 --- a/docs/examples/functions/create-execution.md +++ b/docs/examples/functions/create-execution.md @@ -11,7 +11,7 @@ Client client = new Client() Functions functions = new Functions(client); -Execution result = await functions.CreateExecution( +Appwrite.Models.Execution result = await functions.CreateExecution( functionId: "", body: "", // optional async: false, // optional diff --git a/docs/examples/functions/create-template-deployment.md b/docs/examples/functions/create-template-deployment.md index 47edfa96..de916b4f 100644 --- a/docs/examples/functions/create-template-deployment.md +++ b/docs/examples/functions/create-template-deployment.md @@ -11,7 +11,7 @@ Client client = new Client() Functions functions = new Functions(client); -Deployment result = await functions.CreateTemplateDeployment( +Appwrite.Models.Deployment result = await functions.CreateTemplateDeployment( functionId: "", repository: "", owner: "", diff --git a/docs/examples/functions/create-variable.md b/docs/examples/functions/create-variable.md index 7e3d32f6..a69d17dd 100644 --- a/docs/examples/functions/create-variable.md +++ b/docs/examples/functions/create-variable.md @@ -10,7 +10,7 @@ Client client = new Client() Functions functions = new Functions(client); -Variable result = await functions.CreateVariable( +Appwrite.Models.Variable result = await functions.CreateVariable( functionId: "", variableId: "", key: "", diff --git a/docs/examples/functions/create-vcs-deployment.md b/docs/examples/functions/create-vcs-deployment.md index bfc06888..a21acc9d 100644 --- a/docs/examples/functions/create-vcs-deployment.md +++ b/docs/examples/functions/create-vcs-deployment.md @@ -11,7 +11,7 @@ Client client = new Client() Functions functions = new Functions(client); -Deployment result = await functions.CreateVcsDeployment( +Appwrite.Models.Deployment result = await functions.CreateVcsDeployment( functionId: "", type: VCSReferenceType.Branch, reference: "", diff --git a/docs/examples/functions/create.md b/docs/examples/functions/create.md index 0526f8f0..7ce05f9a 100644 --- a/docs/examples/functions/create.md +++ b/docs/examples/functions/create.md @@ -11,7 +11,7 @@ Client client = new Client() Functions functions = new Functions(client); -Function result = await functions.Create( +Appwrite.Models.Function result = await functions.Create( functionId: "", name: "", runtime: Runtime.Node145, diff --git a/docs/examples/functions/get-deployment.md b/docs/examples/functions/get-deployment.md index fb0905f5..e14da69d 100644 --- a/docs/examples/functions/get-deployment.md +++ b/docs/examples/functions/get-deployment.md @@ -10,7 +10,7 @@ Client client = new Client() Functions functions = new Functions(client); -Deployment result = await functions.GetDeployment( +Appwrite.Models.Deployment result = await functions.GetDeployment( functionId: "", deploymentId: "" ); diff --git a/docs/examples/functions/get-execution.md b/docs/examples/functions/get-execution.md index 6f2871b4..162f9e14 100644 --- a/docs/examples/functions/get-execution.md +++ b/docs/examples/functions/get-execution.md @@ -10,7 +10,7 @@ Client client = new Client() Functions functions = new Functions(client); -Execution result = await functions.GetExecution( +Appwrite.Models.Execution result = await functions.GetExecution( functionId: "", executionId: "" ); diff --git a/docs/examples/functions/get-variable.md b/docs/examples/functions/get-variable.md index 7b383b0b..61de1e4a 100644 --- a/docs/examples/functions/get-variable.md +++ b/docs/examples/functions/get-variable.md @@ -10,7 +10,7 @@ Client client = new Client() Functions functions = new Functions(client); -Variable result = await functions.GetVariable( +Appwrite.Models.Variable result = await functions.GetVariable( functionId: "", variableId: "" ); diff --git a/docs/examples/functions/get.md b/docs/examples/functions/get.md index 86ffaa29..ae8147c1 100644 --- a/docs/examples/functions/get.md +++ b/docs/examples/functions/get.md @@ -10,7 +10,7 @@ Client client = new Client() Functions functions = new Functions(client); -Function result = await functions.Get( +Appwrite.Models.Function result = await functions.Get( functionId: "" ); diff --git a/docs/examples/functions/list-deployments.md b/docs/examples/functions/list-deployments.md index 8e368f9f..f3769d16 100644 --- a/docs/examples/functions/list-deployments.md +++ b/docs/examples/functions/list-deployments.md @@ -10,7 +10,7 @@ Client client = new Client() Functions functions = new Functions(client); -DeploymentList result = await functions.ListDeployments( +Appwrite.Models.DeploymentList result = await functions.ListDeployments( functionId: "", queries: new List(), // optional search: "", // optional diff --git a/docs/examples/functions/list-executions.md b/docs/examples/functions/list-executions.md index 85cc2ab4..ed7b9d42 100644 --- a/docs/examples/functions/list-executions.md +++ b/docs/examples/functions/list-executions.md @@ -10,7 +10,7 @@ Client client = new Client() Functions functions = new Functions(client); -ExecutionList result = await functions.ListExecutions( +Appwrite.Models.ExecutionList result = await functions.ListExecutions( functionId: "", queries: new List(), // optional total: false // optional diff --git a/docs/examples/functions/list-runtimes.md b/docs/examples/functions/list-runtimes.md index b0b68625..391e345a 100644 --- a/docs/examples/functions/list-runtimes.md +++ b/docs/examples/functions/list-runtimes.md @@ -10,7 +10,8 @@ Client client = new Client() Functions functions = new Functions(client); -RuntimeList result = await functions.ListRuntimes(); - +Appwrite.Models.RuntimeList result = await functions.ListRuntimes( + total: false // optional +); ``` diff --git a/docs/examples/functions/list-specifications.md b/docs/examples/functions/list-specifications.md index b97f4cf4..2cf4f360 100644 --- a/docs/examples/functions/list-specifications.md +++ b/docs/examples/functions/list-specifications.md @@ -10,8 +10,9 @@ Client client = new Client() Functions functions = new Functions(client); -SpecificationList result = await functions.ListSpecifications( - type: "runtimes" // optional +Appwrite.Models.SpecificationList result = await functions.ListSpecifications( + type: "runtimes", // optional + total: false // optional ); ``` diff --git a/docs/examples/functions/list-variables.md b/docs/examples/functions/list-variables.md index df8029e3..fa78593e 100644 --- a/docs/examples/functions/list-variables.md +++ b/docs/examples/functions/list-variables.md @@ -10,7 +10,7 @@ Client client = new Client() Functions functions = new Functions(client); -VariableList result = await functions.ListVariables( +Appwrite.Models.VariableList result = await functions.ListVariables( functionId: "", queries: new List(), // optional total: false // optional diff --git a/docs/examples/functions/list.md b/docs/examples/functions/list.md index b09d8ee6..180de085 100644 --- a/docs/examples/functions/list.md +++ b/docs/examples/functions/list.md @@ -10,7 +10,7 @@ Client client = new Client() Functions functions = new Functions(client); -FunctionList result = await functions.List( +Appwrite.Models.FunctionList result = await functions.List( queries: new List(), // optional search: "", // optional total: false // optional diff --git a/docs/examples/functions/update-deployment-status.md b/docs/examples/functions/update-deployment-status.md index ee782aed..ea1acd23 100644 --- a/docs/examples/functions/update-deployment-status.md +++ b/docs/examples/functions/update-deployment-status.md @@ -10,7 +10,7 @@ Client client = new Client() Functions functions = new Functions(client); -Deployment result = await functions.UpdateDeploymentStatus( +Appwrite.Models.Deployment result = await functions.UpdateDeploymentStatus( functionId: "", deploymentId: "" ); diff --git a/docs/examples/functions/update-function-deployment.md b/docs/examples/functions/update-function-deployment.md index 563d5a21..ee24e774 100644 --- a/docs/examples/functions/update-function-deployment.md +++ b/docs/examples/functions/update-function-deployment.md @@ -10,7 +10,7 @@ Client client = new Client() Functions functions = new Functions(client); -Function result = await functions.UpdateFunctionDeployment( +Appwrite.Models.Function result = await functions.UpdateFunctionDeployment( functionId: "", deploymentId: "" ); diff --git a/docs/examples/functions/update-variable.md b/docs/examples/functions/update-variable.md index a1fd20ee..af8f71ed 100644 --- a/docs/examples/functions/update-variable.md +++ b/docs/examples/functions/update-variable.md @@ -10,7 +10,7 @@ Client client = new Client() Functions functions = new Functions(client); -Variable result = await functions.UpdateVariable( +Appwrite.Models.Variable result = await functions.UpdateVariable( functionId: "", variableId: "", key: "", // optional diff --git a/docs/examples/functions/update.md b/docs/examples/functions/update.md index 45574516..89c2f148 100644 --- a/docs/examples/functions/update.md +++ b/docs/examples/functions/update.md @@ -11,7 +11,7 @@ Client client = new Client() Functions functions = new Functions(client); -Function result = await functions.Update( +Appwrite.Models.Function result = await functions.Update( functionId: "", name: "", runtime: Runtime.Node145, // optional diff --git a/docs/examples/graphql/mutation.md b/docs/examples/graphql/mutation.md index 0145c03c..cf72da6a 100644 --- a/docs/examples/graphql/mutation.md +++ b/docs/examples/graphql/mutation.md @@ -10,8 +10,8 @@ Client client = new Client() Graphql graphql = new Graphql(client); -Any result = await graphql.Mutation( - query: [object] +Appwrite.Models.Any result = await graphql.Mutation( + query: new { query = "mutation { accountUpdateName(name: "Walter") { name } }" } ); ``` diff --git a/docs/examples/graphql/query.md b/docs/examples/graphql/query.md index 88c82162..8c5a2857 100644 --- a/docs/examples/graphql/query.md +++ b/docs/examples/graphql/query.md @@ -10,8 +10,8 @@ Client client = new Client() Graphql graphql = new Graphql(client); -Any result = await graphql.Query( - query: [object] +Appwrite.Models.Any result = await graphql.Query( + query: new { query = "query { localeGet { ip } }" } ); ``` diff --git a/docs/examples/locale/get.md b/docs/examples/locale/get.md index a1dcbcc9..045bbb06 100644 --- a/docs/examples/locale/get.md +++ b/docs/examples/locale/get.md @@ -10,7 +10,7 @@ Client client = new Client() Locale locale = new Locale(client); -Locale result = await locale.Get(); +Appwrite.Models.Locale result = await locale.Get(); ``` diff --git a/docs/examples/locale/list-codes.md b/docs/examples/locale/list-codes.md index a3bfeff5..e99c1b42 100644 --- a/docs/examples/locale/list-codes.md +++ b/docs/examples/locale/list-codes.md @@ -10,7 +10,8 @@ Client client = new Client() Locale locale = new Locale(client); -LocaleCodeList result = await locale.ListCodes(); - +Appwrite.Models.LocaleCodeList result = await locale.ListCodes( + total: false // optional +); ``` diff --git a/docs/examples/locale/list-continents.md b/docs/examples/locale/list-continents.md index 02b86116..77c6a5c4 100644 --- a/docs/examples/locale/list-continents.md +++ b/docs/examples/locale/list-continents.md @@ -10,7 +10,8 @@ Client client = new Client() Locale locale = new Locale(client); -ContinentList result = await locale.ListContinents(); - +Appwrite.Models.ContinentList result = await locale.ListContinents( + total: false // optional +); ``` diff --git a/docs/examples/locale/list-countries-eu.md b/docs/examples/locale/list-countries-eu.md index 9452cd0e..2446952c 100644 --- a/docs/examples/locale/list-countries-eu.md +++ b/docs/examples/locale/list-countries-eu.md @@ -10,7 +10,8 @@ Client client = new Client() Locale locale = new Locale(client); -CountryList result = await locale.ListCountriesEU(); - +Appwrite.Models.CountryList result = await locale.ListCountriesEU( + total: false // optional +); ``` diff --git a/docs/examples/locale/list-countries-phones.md b/docs/examples/locale/list-countries-phones.md index e3b5346e..9dedad0a 100644 --- a/docs/examples/locale/list-countries-phones.md +++ b/docs/examples/locale/list-countries-phones.md @@ -10,7 +10,8 @@ Client client = new Client() Locale locale = new Locale(client); -PhoneList result = await locale.ListCountriesPhones(); - +Appwrite.Models.PhoneList result = await locale.ListCountriesPhones( + total: false // optional +); ``` diff --git a/docs/examples/locale/list-countries.md b/docs/examples/locale/list-countries.md index c9c1fb94..6f17e805 100644 --- a/docs/examples/locale/list-countries.md +++ b/docs/examples/locale/list-countries.md @@ -10,7 +10,8 @@ Client client = new Client() Locale locale = new Locale(client); -CountryList result = await locale.ListCountries(); - +Appwrite.Models.CountryList result = await locale.ListCountries( + total: false // optional +); ``` diff --git a/docs/examples/locale/list-currencies.md b/docs/examples/locale/list-currencies.md index 18d04a69..5e5f6ae4 100644 --- a/docs/examples/locale/list-currencies.md +++ b/docs/examples/locale/list-currencies.md @@ -10,7 +10,8 @@ Client client = new Client() Locale locale = new Locale(client); -CurrencyList result = await locale.ListCurrencies(); - +Appwrite.Models.CurrencyList result = await locale.ListCurrencies( + total: false // optional +); ``` diff --git a/docs/examples/locale/list-languages.md b/docs/examples/locale/list-languages.md index 83ed0241..1cafaa16 100644 --- a/docs/examples/locale/list-languages.md +++ b/docs/examples/locale/list-languages.md @@ -10,7 +10,8 @@ Client client = new Client() Locale locale = new Locale(client); -LanguageList result = await locale.ListLanguages(); - +Appwrite.Models.LanguageList result = await locale.ListLanguages( + total: false // optional +); ``` diff --git a/docs/examples/messaging/create-apns-provider.md b/docs/examples/messaging/create-apns-provider.md index 55be57aa..c52f54bc 100644 --- a/docs/examples/messaging/create-apns-provider.md +++ b/docs/examples/messaging/create-apns-provider.md @@ -10,7 +10,7 @@ Client client = new Client() Messaging messaging = new Messaging(client); -Provider result = await messaging.CreateAPNSProvider( +Appwrite.Models.Provider result = await messaging.CreateAPNSProvider( providerId: "", name: "", authKey: "", // optional diff --git a/docs/examples/messaging/create-appwrite-provider.md b/docs/examples/messaging/create-appwrite-provider.md new file mode 100644 index 00000000..c030a582 --- /dev/null +++ b/docs/examples/messaging/create-appwrite-provider.md @@ -0,0 +1,21 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetKey(""); // Your secret API key + +Messaging messaging = new Messaging(client); + +Appwrite.Models.Provider result = await messaging.CreateAppwriteProvider( + providerId: "", + name: "", + enabled: false, // optional + qos: 0, // optional + expiry: 0 // optional +); + +``` diff --git a/docs/examples/messaging/create-email.md b/docs/examples/messaging/create-email.md index 03c71b14..b1b5610a 100644 --- a/docs/examples/messaging/create-email.md +++ b/docs/examples/messaging/create-email.md @@ -10,7 +10,7 @@ Client client = new Client() Messaging messaging = new Messaging(client); -Message result = await messaging.CreateEmail( +Appwrite.Models.Message result = await messaging.CreateEmail( messageId: "", subject: "", content: "", @@ -20,6 +20,8 @@ Message result = await messaging.CreateEmail( cc: new List(), // optional bcc: new List(), // optional attachments: new List(), // optional + replyToEmail: "email@example.com", // optional + replyToName: "", // optional draft: false, // optional html: false, // optional scheduledAt: "2020-10-15T06:38:00.000+00:00" // optional diff --git a/docs/examples/messaging/create-fcm-provider.md b/docs/examples/messaging/create-fcm-provider.md index 4ef0b591..7319e1b4 100644 --- a/docs/examples/messaging/create-fcm-provider.md +++ b/docs/examples/messaging/create-fcm-provider.md @@ -10,7 +10,7 @@ Client client = new Client() Messaging messaging = new Messaging(client); -Provider result = await messaging.CreateFCMProvider( +Appwrite.Models.Provider result = await messaging.CreateFCMProvider( providerId: "", name: "", serviceAccountJSON: [object], // optional diff --git a/docs/examples/messaging/create-mailgun-provider.md b/docs/examples/messaging/create-mailgun-provider.md index ba278efe..d4ff3668 100644 --- a/docs/examples/messaging/create-mailgun-provider.md +++ b/docs/examples/messaging/create-mailgun-provider.md @@ -10,7 +10,7 @@ Client client = new Client() Messaging messaging = new Messaging(client); -Provider result = await messaging.CreateMailgunProvider( +Appwrite.Models.Provider result = await messaging.CreateMailgunProvider( providerId: "", name: "", apiKey: "", // optional diff --git a/docs/examples/messaging/create-msg-91-provider.md b/docs/examples/messaging/create-msg-91-provider.md index e7638b6e..d247aa8e 100644 --- a/docs/examples/messaging/create-msg-91-provider.md +++ b/docs/examples/messaging/create-msg-91-provider.md @@ -10,7 +10,7 @@ Client client = new Client() Messaging messaging = new Messaging(client); -Provider result = await messaging.CreateMsg91Provider( +Appwrite.Models.Provider result = await messaging.CreateMsg91Provider( providerId: "", name: "", templateId: "", // optional diff --git a/docs/examples/messaging/create-push.md b/docs/examples/messaging/create-push.md index 3ee6e423..e9c79a57 100644 --- a/docs/examples/messaging/create-push.md +++ b/docs/examples/messaging/create-push.md @@ -11,7 +11,7 @@ Client client = new Client() Messaging messaging = new Messaging(client); -Message result = await messaging.CreatePush( +Appwrite.Models.Message result = await messaging.CreatePush( messageId: "", title: "", // optional body: "<BODY>", // optional @@ -30,7 +30,8 @@ Message result = await messaging.CreatePush( scheduledAt: "2020-10-15T06:38:00.000+00:00", // optional contentAvailable: false, // optional critical: false, // optional - priority: MessagePriority.Normal // optional + priority: MessagePriority.Normal, // optional + channelId: "<CHANNEL_ID>" // optional ); ``` diff --git a/docs/examples/messaging/create-resend-provider.md b/docs/examples/messaging/create-resend-provider.md index e2400c9f..46d1d755 100644 --- a/docs/examples/messaging/create-resend-provider.md +++ b/docs/examples/messaging/create-resend-provider.md @@ -10,7 +10,7 @@ Client client = new Client() Messaging messaging = new Messaging(client); -Provider result = await messaging.CreateResendProvider( +Appwrite.Models.Provider result = await messaging.CreateResendProvider( providerId: "<PROVIDER_ID>", name: "<NAME>", apiKey: "<API_KEY>", // optional diff --git a/docs/examples/messaging/create-sendgrid-provider.md b/docs/examples/messaging/create-sendgrid-provider.md index f18e9a05..682f15ef 100644 --- a/docs/examples/messaging/create-sendgrid-provider.md +++ b/docs/examples/messaging/create-sendgrid-provider.md @@ -10,7 +10,7 @@ Client client = new Client() Messaging messaging = new Messaging(client); -Provider result = await messaging.CreateSendgridProvider( +Appwrite.Models.Provider result = await messaging.CreateSendgridProvider( providerId: "<PROVIDER_ID>", name: "<NAME>", apiKey: "<API_KEY>", // optional diff --git a/docs/examples/messaging/create-ses-provider.md b/docs/examples/messaging/create-ses-provider.md index ef569769..7505ba5f 100644 --- a/docs/examples/messaging/create-ses-provider.md +++ b/docs/examples/messaging/create-ses-provider.md @@ -10,7 +10,7 @@ Client client = new Client() Messaging messaging = new Messaging(client); -Provider result = await messaging.CreateSesProvider( +Appwrite.Models.Provider result = await messaging.CreateSesProvider( providerId: "<PROVIDER_ID>", name: "<NAME>", accessKey: "<ACCESS_KEY>", // optional diff --git a/docs/examples/messaging/create-sms.md b/docs/examples/messaging/create-sms.md index 2756f28c..40844cac 100644 --- a/docs/examples/messaging/create-sms.md +++ b/docs/examples/messaging/create-sms.md @@ -10,7 +10,7 @@ Client client = new Client() Messaging messaging = new Messaging(client); -Message result = await messaging.CreateSMS( +Appwrite.Models.Message result = await messaging.CreateSMS( messageId: "<MESSAGE_ID>", content: "<CONTENT>", topics: new List<string>(), // optional diff --git a/docs/examples/messaging/create-smtp-provider.md b/docs/examples/messaging/create-smtp-provider.md index bbe34356..b7ac179e 100644 --- a/docs/examples/messaging/create-smtp-provider.md +++ b/docs/examples/messaging/create-smtp-provider.md @@ -11,7 +11,7 @@ Client client = new Client() Messaging messaging = new Messaging(client); -Provider result = await messaging.CreateSMTPProvider( +Appwrite.Models.Provider result = await messaging.CreateSMTPProvider( providerId: "<PROVIDER_ID>", name: "<NAME>", host: "<HOST>", diff --git a/docs/examples/messaging/create-subscriber.md b/docs/examples/messaging/create-subscriber.md index 619abf20..b48e6501 100644 --- a/docs/examples/messaging/create-subscriber.md +++ b/docs/examples/messaging/create-subscriber.md @@ -10,7 +10,7 @@ Client client = new Client() Messaging messaging = new Messaging(client); -Subscriber result = await messaging.CreateSubscriber( +Appwrite.Models.Subscriber result = await messaging.CreateSubscriber( topicId: "<TOPIC_ID>", subscriberId: "<SUBSCRIBER_ID>", targetId: "<TARGET_ID>" diff --git a/docs/examples/messaging/create-telesign-provider.md b/docs/examples/messaging/create-telesign-provider.md index 68c37c33..34feffd8 100644 --- a/docs/examples/messaging/create-telesign-provider.md +++ b/docs/examples/messaging/create-telesign-provider.md @@ -10,7 +10,7 @@ Client client = new Client() Messaging messaging = new Messaging(client); -Provider result = await messaging.CreateTelesignProvider( +Appwrite.Models.Provider result = await messaging.CreateTelesignProvider( providerId: "<PROVIDER_ID>", name: "<NAME>", from: "+12065550100", // optional diff --git a/docs/examples/messaging/create-textmagic-provider.md b/docs/examples/messaging/create-textmagic-provider.md index d549516c..9ba1b633 100644 --- a/docs/examples/messaging/create-textmagic-provider.md +++ b/docs/examples/messaging/create-textmagic-provider.md @@ -10,7 +10,7 @@ Client client = new Client() Messaging messaging = new Messaging(client); -Provider result = await messaging.CreateTextmagicProvider( +Appwrite.Models.Provider result = await messaging.CreateTextmagicProvider( providerId: "<PROVIDER_ID>", name: "<NAME>", from: "+12065550100", // optional diff --git a/docs/examples/messaging/create-topic.md b/docs/examples/messaging/create-topic.md index 9b4338dc..dc9f0338 100644 --- a/docs/examples/messaging/create-topic.md +++ b/docs/examples/messaging/create-topic.md @@ -10,10 +10,12 @@ Client client = new Client() Messaging messaging = new Messaging(client); -Topic result = await messaging.CreateTopic( +Appwrite.Models.Topic result = await messaging.CreateTopic( topicId: "<TOPIC_ID>", name: "<NAME>", - subscribe: ["any"] // optional + subscribe: ["any"], // optional + qos: 0, // optional + expiry: 0 // optional ); ``` diff --git a/docs/examples/messaging/create-twilio-provider.md b/docs/examples/messaging/create-twilio-provider.md index a8a5d8c9..21a87211 100644 --- a/docs/examples/messaging/create-twilio-provider.md +++ b/docs/examples/messaging/create-twilio-provider.md @@ -10,10 +10,10 @@ Client client = new Client() Messaging messaging = new Messaging(client); -Provider result = await messaging.CreateTwilioProvider( +Appwrite.Models.Provider result = await messaging.CreateTwilioProvider( providerId: "<PROVIDER_ID>", name: "<NAME>", - from: "+12065550100", // optional + from: "<FROM>", // optional accountSid: "<ACCOUNT_SID>", // optional authToken: "<AUTH_TOKEN>", // optional enabled: false // optional diff --git a/docs/examples/messaging/create-vonage-provider.md b/docs/examples/messaging/create-vonage-provider.md index 8fc8335b..6e559e1e 100644 --- a/docs/examples/messaging/create-vonage-provider.md +++ b/docs/examples/messaging/create-vonage-provider.md @@ -10,7 +10,7 @@ Client client = new Client() Messaging messaging = new Messaging(client); -Provider result = await messaging.CreateVonageProvider( +Appwrite.Models.Provider result = await messaging.CreateVonageProvider( providerId: "<PROVIDER_ID>", name: "<NAME>", from: "+12065550100", // optional diff --git a/docs/examples/messaging/get-message.md b/docs/examples/messaging/get-message.md index 53597127..506f4eec 100644 --- a/docs/examples/messaging/get-message.md +++ b/docs/examples/messaging/get-message.md @@ -10,7 +10,7 @@ Client client = new Client() Messaging messaging = new Messaging(client); -Message result = await messaging.GetMessage( +Appwrite.Models.Message result = await messaging.GetMessage( messageId: "<MESSAGE_ID>" ); diff --git a/docs/examples/messaging/get-provider.md b/docs/examples/messaging/get-provider.md index fb9c334e..a4105c92 100644 --- a/docs/examples/messaging/get-provider.md +++ b/docs/examples/messaging/get-provider.md @@ -10,7 +10,7 @@ Client client = new Client() Messaging messaging = new Messaging(client); -Provider result = await messaging.GetProvider( +Appwrite.Models.Provider result = await messaging.GetProvider( providerId: "<PROVIDER_ID>" ); diff --git a/docs/examples/messaging/get-subscriber.md b/docs/examples/messaging/get-subscriber.md index 79e6bb07..89906e50 100644 --- a/docs/examples/messaging/get-subscriber.md +++ b/docs/examples/messaging/get-subscriber.md @@ -10,7 +10,7 @@ Client client = new Client() Messaging messaging = new Messaging(client); -Subscriber result = await messaging.GetSubscriber( +Appwrite.Models.Subscriber result = await messaging.GetSubscriber( topicId: "<TOPIC_ID>", subscriberId: "<SUBSCRIBER_ID>" ); diff --git a/docs/examples/messaging/get-topic.md b/docs/examples/messaging/get-topic.md index 6fc890d0..cea35bf7 100644 --- a/docs/examples/messaging/get-topic.md +++ b/docs/examples/messaging/get-topic.md @@ -10,7 +10,7 @@ Client client = new Client() Messaging messaging = new Messaging(client); -Topic result = await messaging.GetTopic( +Appwrite.Models.Topic result = await messaging.GetTopic( topicId: "<TOPIC_ID>" ); diff --git a/docs/examples/messaging/list-messages.md b/docs/examples/messaging/list-messages.md index 6bc43ea9..4fb4f60f 100644 --- a/docs/examples/messaging/list-messages.md +++ b/docs/examples/messaging/list-messages.md @@ -10,7 +10,7 @@ Client client = new Client() Messaging messaging = new Messaging(client); -MessageList result = await messaging.ListMessages( +Appwrite.Models.MessageList result = await messaging.ListMessages( queries: new List<string>(), // optional search: "<SEARCH>", // optional total: false // optional diff --git a/docs/examples/messaging/list-providers.md b/docs/examples/messaging/list-providers.md index 5d286744..bef14a1e 100644 --- a/docs/examples/messaging/list-providers.md +++ b/docs/examples/messaging/list-providers.md @@ -10,7 +10,7 @@ Client client = new Client() Messaging messaging = new Messaging(client); -ProviderList result = await messaging.ListProviders( +Appwrite.Models.ProviderList result = await messaging.ListProviders( queries: new List<string>(), // optional search: "<SEARCH>", // optional total: false // optional diff --git a/docs/examples/messaging/list-subscribers.md b/docs/examples/messaging/list-subscribers.md index 15773d00..e9f1702b 100644 --- a/docs/examples/messaging/list-subscribers.md +++ b/docs/examples/messaging/list-subscribers.md @@ -10,7 +10,7 @@ Client client = new Client() Messaging messaging = new Messaging(client); -SubscriberList result = await messaging.ListSubscribers( +Appwrite.Models.SubscriberList result = await messaging.ListSubscribers( topicId: "<TOPIC_ID>", queries: new List<string>(), // optional search: "<SEARCH>", // optional diff --git a/docs/examples/messaging/list-targets.md b/docs/examples/messaging/list-targets.md index e5b2cd94..a6479232 100644 --- a/docs/examples/messaging/list-targets.md +++ b/docs/examples/messaging/list-targets.md @@ -10,7 +10,7 @@ Client client = new Client() Messaging messaging = new Messaging(client); -TargetList result = await messaging.ListTargets( +Appwrite.Models.TargetList result = await messaging.ListTargets( messageId: "<MESSAGE_ID>", queries: new List<string>(), // optional total: false // optional diff --git a/docs/examples/messaging/list-topics.md b/docs/examples/messaging/list-topics.md index 4fa6f4df..29f7d312 100644 --- a/docs/examples/messaging/list-topics.md +++ b/docs/examples/messaging/list-topics.md @@ -10,7 +10,7 @@ Client client = new Client() Messaging messaging = new Messaging(client); -TopicList result = await messaging.ListTopics( +Appwrite.Models.TopicList result = await messaging.ListTopics( queries: new List<string>(), // optional search: "<SEARCH>", // optional total: false // optional diff --git a/docs/examples/messaging/update-apns-provider.md b/docs/examples/messaging/update-apns-provider.md index d8a04a49..ae7df0d8 100644 --- a/docs/examples/messaging/update-apns-provider.md +++ b/docs/examples/messaging/update-apns-provider.md @@ -10,7 +10,7 @@ Client client = new Client() Messaging messaging = new Messaging(client); -Provider result = await messaging.UpdateAPNSProvider( +Appwrite.Models.Provider result = await messaging.UpdateAPNSProvider( providerId: "<PROVIDER_ID>", name: "<NAME>", // optional enabled: false, // optional diff --git a/docs/examples/messaging/update-appwrite-provider.md b/docs/examples/messaging/update-appwrite-provider.md new file mode 100644 index 00000000..54969ff6 --- /dev/null +++ b/docs/examples/messaging/update-appwrite-provider.md @@ -0,0 +1,21 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +Appwrite.Models.Provider result = await messaging.UpdateAppwriteProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", // optional + enabled: false, // optional + qos: 0, // optional + expiry: 0 // optional +); + +``` diff --git a/docs/examples/messaging/update-email.md b/docs/examples/messaging/update-email.md index 5e87deeb..4b268563 100644 --- a/docs/examples/messaging/update-email.md +++ b/docs/examples/messaging/update-email.md @@ -10,19 +10,21 @@ Client client = new Client() Messaging messaging = new Messaging(client); -Message result = await messaging.UpdateEmail( +Appwrite.Models.Message result = await messaging.UpdateEmail( messageId: "<MESSAGE_ID>", + subject: "<SUBJECT>", // optional + content: "<CONTENT>", // optional topics: new List<string>(), // optional users: new List<string>(), // optional targets: new List<string>(), // optional - subject: "<SUBJECT>", // optional - content: "<CONTENT>", // optional - draft: false, // optional - html: false, // optional cc: new List<string>(), // optional bcc: new List<string>(), // optional - scheduledAt: "2020-10-15T06:38:00.000+00:00", // optional - attachments: new List<string>() // optional + attachments: new List<string>(), // optional + replyToEmail: "email@example.com", // optional + replyToName: "<REPLY_TO_NAME>", // optional + draft: false, // optional + html: false, // optional + scheduledAt: "2020-10-15T06:38:00.000+00:00" // optional ); ``` diff --git a/docs/examples/messaging/update-fcm-provider.md b/docs/examples/messaging/update-fcm-provider.md index c7381ed2..2245d5a0 100644 --- a/docs/examples/messaging/update-fcm-provider.md +++ b/docs/examples/messaging/update-fcm-provider.md @@ -10,7 +10,7 @@ Client client = new Client() Messaging messaging = new Messaging(client); -Provider result = await messaging.UpdateFCMProvider( +Appwrite.Models.Provider result = await messaging.UpdateFCMProvider( providerId: "<PROVIDER_ID>", name: "<NAME>", // optional enabled: false, // optional diff --git a/docs/examples/messaging/update-mailgun-provider.md b/docs/examples/messaging/update-mailgun-provider.md index 95b8466d..fd46baf8 100644 --- a/docs/examples/messaging/update-mailgun-provider.md +++ b/docs/examples/messaging/update-mailgun-provider.md @@ -10,7 +10,7 @@ Client client = new Client() Messaging messaging = new Messaging(client); -Provider result = await messaging.UpdateMailgunProvider( +Appwrite.Models.Provider result = await messaging.UpdateMailgunProvider( providerId: "<PROVIDER_ID>", name: "<NAME>", // optional apiKey: "<API_KEY>", // optional diff --git a/docs/examples/messaging/update-msg-91-provider.md b/docs/examples/messaging/update-msg-91-provider.md index 3652c6a0..2e6382d5 100644 --- a/docs/examples/messaging/update-msg-91-provider.md +++ b/docs/examples/messaging/update-msg-91-provider.md @@ -10,7 +10,7 @@ Client client = new Client() Messaging messaging = new Messaging(client); -Provider result = await messaging.UpdateMsg91Provider( +Appwrite.Models.Provider result = await messaging.UpdateMsg91Provider( providerId: "<PROVIDER_ID>", name: "<NAME>", // optional enabled: false, // optional diff --git a/docs/examples/messaging/update-push.md b/docs/examples/messaging/update-push.md index 6a151cca..366c3f44 100644 --- a/docs/examples/messaging/update-push.md +++ b/docs/examples/messaging/update-push.md @@ -11,13 +11,13 @@ Client client = new Client() Messaging messaging = new Messaging(client); -Message result = await messaging.UpdatePush( +Appwrite.Models.Message result = await messaging.UpdatePush( messageId: "<MESSAGE_ID>", + title: "<TITLE>", // optional + body: "<BODY>", // optional topics: new List<string>(), // optional users: new List<string>(), // optional targets: new List<string>(), // optional - title: "<TITLE>", // optional - body: "<BODY>", // optional data: [object], // optional action: "<ACTION>", // optional image: "<ID1:ID2>", // optional @@ -30,7 +30,8 @@ Message result = await messaging.UpdatePush( scheduledAt: "2020-10-15T06:38:00.000+00:00", // optional contentAvailable: false, // optional critical: false, // optional - priority: MessagePriority.Normal // optional + priority: MessagePriority.Normal, // optional + channelId: "<CHANNEL_ID>" // optional ); ``` diff --git a/docs/examples/messaging/update-resend-provider.md b/docs/examples/messaging/update-resend-provider.md index 9bef411a..ea4f2e5d 100644 --- a/docs/examples/messaging/update-resend-provider.md +++ b/docs/examples/messaging/update-resend-provider.md @@ -10,7 +10,7 @@ Client client = new Client() Messaging messaging = new Messaging(client); -Provider result = await messaging.UpdateResendProvider( +Appwrite.Models.Provider result = await messaging.UpdateResendProvider( providerId: "<PROVIDER_ID>", name: "<NAME>", // optional enabled: false, // optional diff --git a/docs/examples/messaging/update-sendgrid-provider.md b/docs/examples/messaging/update-sendgrid-provider.md index b98feaa1..dbfe4d62 100644 --- a/docs/examples/messaging/update-sendgrid-provider.md +++ b/docs/examples/messaging/update-sendgrid-provider.md @@ -10,7 +10,7 @@ Client client = new Client() Messaging messaging = new Messaging(client); -Provider result = await messaging.UpdateSendgridProvider( +Appwrite.Models.Provider result = await messaging.UpdateSendgridProvider( providerId: "<PROVIDER_ID>", name: "<NAME>", // optional enabled: false, // optional diff --git a/docs/examples/messaging/update-ses-provider.md b/docs/examples/messaging/update-ses-provider.md index 982cd549..65350d1b 100644 --- a/docs/examples/messaging/update-ses-provider.md +++ b/docs/examples/messaging/update-ses-provider.md @@ -10,7 +10,7 @@ Client client = new Client() Messaging messaging = new Messaging(client); -Provider result = await messaging.UpdateSesProvider( +Appwrite.Models.Provider result = await messaging.UpdateSesProvider( providerId: "<PROVIDER_ID>", name: "<NAME>", // optional enabled: false, // optional diff --git a/docs/examples/messaging/update-sms.md b/docs/examples/messaging/update-sms.md index 3d38d9fb..3699a49e 100644 --- a/docs/examples/messaging/update-sms.md +++ b/docs/examples/messaging/update-sms.md @@ -10,12 +10,12 @@ Client client = new Client() Messaging messaging = new Messaging(client); -Message result = await messaging.UpdateSMS( +Appwrite.Models.Message result = await messaging.UpdateSMS( messageId: "<MESSAGE_ID>", + content: "<CONTENT>", // optional topics: new List<string>(), // optional users: new List<string>(), // optional targets: new List<string>(), // optional - content: "<CONTENT>", // optional draft: false, // optional scheduledAt: "2020-10-15T06:38:00.000+00:00" // optional ); diff --git a/docs/examples/messaging/update-smtp-provider.md b/docs/examples/messaging/update-smtp-provider.md index 2d9da6ca..70b427e0 100644 --- a/docs/examples/messaging/update-smtp-provider.md +++ b/docs/examples/messaging/update-smtp-provider.md @@ -11,7 +11,7 @@ Client client = new Client() Messaging messaging = new Messaging(client); -Provider result = await messaging.UpdateSMTPProvider( +Appwrite.Models.Provider result = await messaging.UpdateSMTPProvider( providerId: "<PROVIDER_ID>", name: "<NAME>", // optional host: "<HOST>", // optional diff --git a/docs/examples/messaging/update-telesign-provider.md b/docs/examples/messaging/update-telesign-provider.md index 5a7048b1..a285bc54 100644 --- a/docs/examples/messaging/update-telesign-provider.md +++ b/docs/examples/messaging/update-telesign-provider.md @@ -10,7 +10,7 @@ Client client = new Client() Messaging messaging = new Messaging(client); -Provider result = await messaging.UpdateTelesignProvider( +Appwrite.Models.Provider result = await messaging.UpdateTelesignProvider( providerId: "<PROVIDER_ID>", name: "<NAME>", // optional enabled: false, // optional diff --git a/docs/examples/messaging/update-textmagic-provider.md b/docs/examples/messaging/update-textmagic-provider.md index 4f0a7a0d..ce92a7f4 100644 --- a/docs/examples/messaging/update-textmagic-provider.md +++ b/docs/examples/messaging/update-textmagic-provider.md @@ -10,7 +10,7 @@ Client client = new Client() Messaging messaging = new Messaging(client); -Provider result = await messaging.UpdateTextmagicProvider( +Appwrite.Models.Provider result = await messaging.UpdateTextmagicProvider( providerId: "<PROVIDER_ID>", name: "<NAME>", // optional enabled: false, // optional diff --git a/docs/examples/messaging/update-topic.md b/docs/examples/messaging/update-topic.md index aa45f99b..aa80861b 100644 --- a/docs/examples/messaging/update-topic.md +++ b/docs/examples/messaging/update-topic.md @@ -10,10 +10,12 @@ Client client = new Client() Messaging messaging = new Messaging(client); -Topic result = await messaging.UpdateTopic( +Appwrite.Models.Topic result = await messaging.UpdateTopic( topicId: "<TOPIC_ID>", name: "<NAME>", // optional - subscribe: ["any"] // optional + subscribe: ["any"], // optional + qos: 0, // optional + expiry: 0 // optional ); ``` diff --git a/docs/examples/messaging/update-twilio-provider.md b/docs/examples/messaging/update-twilio-provider.md index a1d51e9e..2b161d26 100644 --- a/docs/examples/messaging/update-twilio-provider.md +++ b/docs/examples/messaging/update-twilio-provider.md @@ -10,7 +10,7 @@ Client client = new Client() Messaging messaging = new Messaging(client); -Provider result = await messaging.UpdateTwilioProvider( +Appwrite.Models.Provider result = await messaging.UpdateTwilioProvider( providerId: "<PROVIDER_ID>", name: "<NAME>", // optional enabled: false, // optional diff --git a/docs/examples/messaging/update-vonage-provider.md b/docs/examples/messaging/update-vonage-provider.md index d26a17dd..d154a90b 100644 --- a/docs/examples/messaging/update-vonage-provider.md +++ b/docs/examples/messaging/update-vonage-provider.md @@ -10,7 +10,7 @@ Client client = new Client() Messaging messaging = new Messaging(client); -Provider result = await messaging.UpdateVonageProvider( +Appwrite.Models.Provider result = await messaging.UpdateVonageProvider( providerId: "<PROVIDER_ID>", name: "<NAME>", // optional enabled: false, // optional diff --git a/docs/examples/mongo/create-backup-policy.md b/docs/examples/mongo/create-backup-policy.md index 41e2ed4b..a43b84b3 100644 --- a/docs/examples/mongo/create-backup-policy.md +++ b/docs/examples/mongo/create-backup-policy.md @@ -10,7 +10,7 @@ Client client = new Client() Mongo mongo = new Mongo(client); -BackupPolicy result = await mongo.CreateBackupPolicy( +Appwrite.Models.BackupPolicy result = await mongo.CreateBackupPolicy( databaseId: "<DATABASE_ID>", policyId: "<POLICY_ID>", name: "<NAME>", diff --git a/docs/examples/mongo/create-backup.md b/docs/examples/mongo/create-backup.md index e25efa99..96570471 100644 --- a/docs/examples/mongo/create-backup.md +++ b/docs/examples/mongo/create-backup.md @@ -10,7 +10,7 @@ Client client = new Client() Mongo mongo = new Mongo(client); -DedicatedDatabaseBackup result = await mongo.CreateBackup( +Appwrite.Models.DedicatedDatabaseBackup result = await mongo.CreateBackup( databaseId: "<DATABASE_ID>", type: "full" // optional ); diff --git a/docs/examples/mongo/create-branch.md b/docs/examples/mongo/create-branch.md index 8c01df43..f3190494 100644 --- a/docs/examples/mongo/create-branch.md +++ b/docs/examples/mongo/create-branch.md @@ -10,7 +10,7 @@ Client client = new Client() Mongo mongo = new Mongo(client); -DedicatedDatabase result = await mongo.CreateBranch( +Appwrite.Models.DedicatedDatabase result = await mongo.CreateBranch( databaseId: "<DATABASE_ID>", branchId: "<BRANCH_ID>", // optional ttl: 300 // optional diff --git a/docs/examples/mongo/create-failover.md b/docs/examples/mongo/create-failover.md index d4a6686e..1bde932e 100644 --- a/docs/examples/mongo/create-failover.md +++ b/docs/examples/mongo/create-failover.md @@ -10,7 +10,7 @@ Client client = new Client() Mongo mongo = new Mongo(client); -DedicatedDatabase result = await mongo.CreateFailover( +Appwrite.Models.DedicatedDatabase result = await mongo.CreateFailover( databaseId: "<DATABASE_ID>", targetReplicaId: "<TARGET_REPLICA_ID>" // optional ); diff --git a/docs/examples/mongo/create-migration.md b/docs/examples/mongo/create-migration.md index b7fbcc7a..7cc6a7c5 100644 --- a/docs/examples/mongo/create-migration.md +++ b/docs/examples/mongo/create-migration.md @@ -10,7 +10,7 @@ Client client = new Client() Mongo mongo = new Mongo(client); -DedicatedDatabase result = await mongo.CreateMigration( +Appwrite.Models.DedicatedDatabase result = await mongo.CreateMigration( databaseId: "<DATABASE_ID>", targetType: "shared", specification: "<SPECIFICATION>" // optional diff --git a/docs/examples/mongo/create-restoration.md b/docs/examples/mongo/create-restoration.md index 8e9358eb..999f0b09 100644 --- a/docs/examples/mongo/create-restoration.md +++ b/docs/examples/mongo/create-restoration.md @@ -10,7 +10,7 @@ Client client = new Client() Mongo mongo = new Mongo(client); -DedicatedDatabaseRestoration result = await mongo.CreateRestoration( +Appwrite.Models.DedicatedDatabaseRestoration result = await mongo.CreateRestoration( databaseId: "<DATABASE_ID>", type: "backup", // optional backupId: "<BACKUP_ID>", // optional diff --git a/docs/examples/mongo/create-upgrade.md b/docs/examples/mongo/create-upgrade.md index c18e2d62..a7d17cef 100644 --- a/docs/examples/mongo/create-upgrade.md +++ b/docs/examples/mongo/create-upgrade.md @@ -10,7 +10,7 @@ Client client = new Client() Mongo mongo = new Mongo(client); -DedicatedDatabase result = await mongo.CreateUpgrade( +Appwrite.Models.DedicatedDatabase result = await mongo.CreateUpgrade( databaseId: "<DATABASE_ID>", targetVersion: "<TARGET_VERSION>" ); diff --git a/docs/examples/mongo/create.md b/docs/examples/mongo/create.md index c6ef970c..a251a3dd 100644 --- a/docs/examples/mongo/create.md +++ b/docs/examples/mongo/create.md @@ -10,7 +10,7 @@ Client client = new Client() Mongo mongo = new Mongo(client); -DedicatedDatabase result = await mongo.Create( +Appwrite.Models.DedicatedDatabase result = await mongo.Create( databaseId: "<DATABASE_ID>", name: "<NAME>", version: "17", // optional diff --git a/docs/examples/mongo/get-backup-policy.md b/docs/examples/mongo/get-backup-policy.md index d05d979d..c2256ff5 100644 --- a/docs/examples/mongo/get-backup-policy.md +++ b/docs/examples/mongo/get-backup-policy.md @@ -10,7 +10,7 @@ Client client = new Client() Mongo mongo = new Mongo(client); -BackupPolicy result = await mongo.GetBackupPolicy( +Appwrite.Models.BackupPolicy result = await mongo.GetBackupPolicy( databaseId: "<DATABASE_ID>", policyId: "<POLICY_ID>" ); diff --git a/docs/examples/mongo/get-backup.md b/docs/examples/mongo/get-backup.md index ced57a21..7969404c 100644 --- a/docs/examples/mongo/get-backup.md +++ b/docs/examples/mongo/get-backup.md @@ -10,7 +10,7 @@ Client client = new Client() Mongo mongo = new Mongo(client); -DedicatedDatabaseBackup result = await mongo.GetBackup( +Appwrite.Models.DedicatedDatabaseBackup result = await mongo.GetBackup( databaseId: "<DATABASE_ID>", backupId: "<BACKUP_ID>" ); diff --git a/docs/examples/mongo/get-pitr.md b/docs/examples/mongo/get-pitr.md index 55a1e64e..28172a8b 100644 --- a/docs/examples/mongo/get-pitr.md +++ b/docs/examples/mongo/get-pitr.md @@ -10,7 +10,7 @@ Client client = new Client() Mongo mongo = new Mongo(client); -DedicatedDatabasePITRWindows result = await mongo.GetPitr( +Appwrite.Models.DedicatedDatabasePITRWindows result = await mongo.GetPitr( databaseId: "<DATABASE_ID>" ); diff --git a/docs/examples/mongo/get-replicas.md b/docs/examples/mongo/get-replicas.md index 7c52ecee..530186f2 100644 --- a/docs/examples/mongo/get-replicas.md +++ b/docs/examples/mongo/get-replicas.md @@ -10,7 +10,7 @@ Client client = new Client() Mongo mongo = new Mongo(client); -DedicatedDatabaseReplicas result = await mongo.GetReplicas( +Appwrite.Models.DedicatedDatabaseReplicas result = await mongo.GetReplicas( databaseId: "<DATABASE_ID>" ); diff --git a/docs/examples/mongo/get-restoration.md b/docs/examples/mongo/get-restoration.md index 32e83008..42de6a4a 100644 --- a/docs/examples/mongo/get-restoration.md +++ b/docs/examples/mongo/get-restoration.md @@ -10,7 +10,7 @@ Client client = new Client() Mongo mongo = new Mongo(client); -DedicatedDatabaseRestoration result = await mongo.GetRestoration( +Appwrite.Models.DedicatedDatabaseRestoration result = await mongo.GetRestoration( databaseId: "<DATABASE_ID>", restorationId: "<RESTORATION_ID>" ); diff --git a/docs/examples/mongo/get-status.md b/docs/examples/mongo/get-status.md index 883f3b97..f10d3b88 100644 --- a/docs/examples/mongo/get-status.md +++ b/docs/examples/mongo/get-status.md @@ -10,7 +10,7 @@ Client client = new Client() Mongo mongo = new Mongo(client); -DatabaseStatus result = await mongo.GetStatus( +Appwrite.Models.DatabaseStatus result = await mongo.GetStatus( databaseId: "<DATABASE_ID>" ); diff --git a/docs/examples/mongo/get.md b/docs/examples/mongo/get.md index 86e0b80c..a5a98afb 100644 --- a/docs/examples/mongo/get.md +++ b/docs/examples/mongo/get.md @@ -10,7 +10,7 @@ Client client = new Client() Mongo mongo = new Mongo(client); -DedicatedDatabase result = await mongo.Get( +Appwrite.Models.DedicatedDatabase result = await mongo.Get( databaseId: "<DATABASE_ID>" ); diff --git a/docs/examples/mongo/list-backup-policies.md b/docs/examples/mongo/list-backup-policies.md index 9b56913a..00b0781b 100644 --- a/docs/examples/mongo/list-backup-policies.md +++ b/docs/examples/mongo/list-backup-policies.md @@ -10,7 +10,7 @@ Client client = new Client() Mongo mongo = new Mongo(client); -BackupPolicyList result = await mongo.ListBackupPolicies( +Appwrite.Models.BackupPolicyList result = await mongo.ListBackupPolicies( databaseId: "<DATABASE_ID>", queries: new List<string>() // optional ); diff --git a/docs/examples/mongo/list-backups.md b/docs/examples/mongo/list-backups.md index 6da449f8..5a026834 100644 --- a/docs/examples/mongo/list-backups.md +++ b/docs/examples/mongo/list-backups.md @@ -10,7 +10,7 @@ Client client = new Client() Mongo mongo = new Mongo(client); -DedicatedDatabaseBackupList result = await mongo.ListBackups( +Appwrite.Models.DedicatedDatabaseBackupList result = await mongo.ListBackups( databaseId: "<DATABASE_ID>", queries: new List<string>() // optional ); diff --git a/docs/examples/mongo/list-branches.md b/docs/examples/mongo/list-branches.md index f68102dc..40086f77 100644 --- a/docs/examples/mongo/list-branches.md +++ b/docs/examples/mongo/list-branches.md @@ -10,7 +10,7 @@ Client client = new Client() Mongo mongo = new Mongo(client); -DedicatedDatabaseBranchList result = await mongo.ListBranches( +Appwrite.Models.DedicatedDatabaseBranchList result = await mongo.ListBranches( databaseId: "<DATABASE_ID>" ); diff --git a/docs/examples/mongo/list-operations.md b/docs/examples/mongo/list-operations.md index c2dc679f..dfea0921 100644 --- a/docs/examples/mongo/list-operations.md +++ b/docs/examples/mongo/list-operations.md @@ -10,7 +10,7 @@ Client client = new Client() Mongo mongo = new Mongo(client); -DedicatedDatabaseOperationList result = await mongo.ListOperations( +Appwrite.Models.DedicatedDatabaseOperationList result = await mongo.ListOperations( databaseId: "<DATABASE_ID>", status: "queued", // optional limit: 1, // optional diff --git a/docs/examples/mongo/list-restorations.md b/docs/examples/mongo/list-restorations.md index b5655c37..4ee274b9 100644 --- a/docs/examples/mongo/list-restorations.md +++ b/docs/examples/mongo/list-restorations.md @@ -10,7 +10,7 @@ Client client = new Client() Mongo mongo = new Mongo(client); -DedicatedDatabaseRestorationList result = await mongo.ListRestorations( +Appwrite.Models.DedicatedDatabaseRestorationList result = await mongo.ListRestorations( databaseId: "<DATABASE_ID>", status: "pending", // optional type: "backup", // optional diff --git a/docs/examples/mongo/list-specifications.md b/docs/examples/mongo/list-specifications.md index 474e6123..77b66296 100644 --- a/docs/examples/mongo/list-specifications.md +++ b/docs/examples/mongo/list-specifications.md @@ -10,7 +10,7 @@ Client client = new Client() Mongo mongo = new Mongo(client); -DedicatedDatabaseSpecificationList result = await mongo.ListSpecifications(); +Appwrite.Models.DedicatedDatabaseSpecificationList result = await mongo.ListSpecifications(); ``` diff --git a/docs/examples/mongo/list.md b/docs/examples/mongo/list.md index bd222419..6f7eae35 100644 --- a/docs/examples/mongo/list.md +++ b/docs/examples/mongo/list.md @@ -10,7 +10,7 @@ Client client = new Client() Mongo mongo = new Mongo(client); -DedicatedDatabaseList result = await mongo.List( +Appwrite.Models.DedicatedDatabaseList result = await mongo.List( queries: new List<string>() // optional ); diff --git a/docs/examples/mongo/update-backup-policy.md b/docs/examples/mongo/update-backup-policy.md index 7bec7bf3..b58ad266 100644 --- a/docs/examples/mongo/update-backup-policy.md +++ b/docs/examples/mongo/update-backup-policy.md @@ -10,7 +10,7 @@ Client client = new Client() Mongo mongo = new Mongo(client); -BackupPolicy result = await mongo.UpdateBackupPolicy( +Appwrite.Models.BackupPolicy result = await mongo.UpdateBackupPolicy( databaseId: "<DATABASE_ID>", policyId: "<POLICY_ID>", name: "<NAME>", // optional diff --git a/docs/examples/mongo/update-backup-storage.md b/docs/examples/mongo/update-backup-storage.md index 27f365d4..24954f1a 100644 --- a/docs/examples/mongo/update-backup-storage.md +++ b/docs/examples/mongo/update-backup-storage.md @@ -10,7 +10,7 @@ Client client = new Client() Mongo mongo = new Mongo(client); -DedicatedDatabaseBackupStorage result = await mongo.UpdateBackupStorage( +Appwrite.Models.DedicatedDatabaseBackupStorage result = await mongo.UpdateBackupStorage( databaseId: "<DATABASE_ID>", provider: "s3", bucket: "<BUCKET>", diff --git a/docs/examples/mongo/update-credentials.md b/docs/examples/mongo/update-credentials.md index 9dafd042..c28f6277 100644 --- a/docs/examples/mongo/update-credentials.md +++ b/docs/examples/mongo/update-credentials.md @@ -10,7 +10,7 @@ Client client = new Client() Mongo mongo = new Mongo(client); -DedicatedDatabaseOperation result = await mongo.UpdateCredentials( +Appwrite.Models.DedicatedDatabaseOperation result = await mongo.UpdateCredentials( databaseId: "<DATABASE_ID>" ); diff --git a/docs/examples/mongo/update-maintenance.md b/docs/examples/mongo/update-maintenance.md index e64faec6..a8fd32ba 100644 --- a/docs/examples/mongo/update-maintenance.md +++ b/docs/examples/mongo/update-maintenance.md @@ -10,7 +10,7 @@ Client client = new Client() Mongo mongo = new Mongo(client); -DedicatedDatabase result = await mongo.UpdateMaintenance( +Appwrite.Models.DedicatedDatabase result = await mongo.UpdateMaintenance( databaseId: "<DATABASE_ID>", day: "sun", hourUtc: 0 diff --git a/docs/examples/mongo/update.md b/docs/examples/mongo/update.md index 6c9b8d0a..fea909c0 100644 --- a/docs/examples/mongo/update.md +++ b/docs/examples/mongo/update.md @@ -10,7 +10,7 @@ Client client = new Client() Mongo mongo = new Mongo(client); -DedicatedDatabase result = await mongo.Update( +Appwrite.Models.DedicatedDatabase result = await mongo.Update( databaseId: "<DATABASE_ID>", name: "<NAME>", // optional status: "ready", // optional diff --git a/docs/examples/mysql/create-backup-policy.md b/docs/examples/mysql/create-backup-policy.md index ca410dc0..0239bf17 100644 --- a/docs/examples/mysql/create-backup-policy.md +++ b/docs/examples/mysql/create-backup-policy.md @@ -10,7 +10,7 @@ Client client = new Client() Mysql mysql = new Mysql(client); -BackupPolicy result = await mysql.CreateBackupPolicy( +Appwrite.Models.BackupPolicy result = await mysql.CreateBackupPolicy( databaseId: "<DATABASE_ID>", policyId: "<POLICY_ID>", name: "<NAME>", diff --git a/docs/examples/mysql/create-backup.md b/docs/examples/mysql/create-backup.md index f5e271df..a2ecf9c2 100644 --- a/docs/examples/mysql/create-backup.md +++ b/docs/examples/mysql/create-backup.md @@ -10,7 +10,7 @@ Client client = new Client() Mysql mysql = new Mysql(client); -DedicatedDatabaseBackup result = await mysql.CreateBackup( +Appwrite.Models.DedicatedDatabaseBackup result = await mysql.CreateBackup( databaseId: "<DATABASE_ID>", type: "full" // optional ); diff --git a/docs/examples/mysql/create-branch.md b/docs/examples/mysql/create-branch.md index a4d9283f..1862572d 100644 --- a/docs/examples/mysql/create-branch.md +++ b/docs/examples/mysql/create-branch.md @@ -10,7 +10,7 @@ Client client = new Client() Mysql mysql = new Mysql(client); -DedicatedDatabase result = await mysql.CreateBranch( +Appwrite.Models.DedicatedDatabase result = await mysql.CreateBranch( databaseId: "<DATABASE_ID>", branchId: "<BRANCH_ID>", // optional ttl: 300 // optional diff --git a/docs/examples/mysql/create-execution.md b/docs/examples/mysql/create-execution.md index 364fd302..1f6362ed 100644 --- a/docs/examples/mysql/create-execution.md +++ b/docs/examples/mysql/create-execution.md @@ -10,7 +10,7 @@ Client client = new Client() Mysql mysql = new Mysql(client); -DedicatedDatabaseExecution result = await mysql.CreateExecution( +Appwrite.Models.DedicatedDatabaseExecution result = await mysql.CreateExecution( databaseId: "<DATABASE_ID>", sql: "<SQL>", bindings: [object], // optional diff --git a/docs/examples/mysql/create-failover.md b/docs/examples/mysql/create-failover.md index e30720ba..6cf22706 100644 --- a/docs/examples/mysql/create-failover.md +++ b/docs/examples/mysql/create-failover.md @@ -10,7 +10,7 @@ Client client = new Client() Mysql mysql = new Mysql(client); -DedicatedDatabase result = await mysql.CreateFailover( +Appwrite.Models.DedicatedDatabase result = await mysql.CreateFailover( databaseId: "<DATABASE_ID>", targetReplicaId: "<TARGET_REPLICA_ID>" // optional ); diff --git a/docs/examples/mysql/create-migration.md b/docs/examples/mysql/create-migration.md index c0b943c8..38a4e807 100644 --- a/docs/examples/mysql/create-migration.md +++ b/docs/examples/mysql/create-migration.md @@ -10,7 +10,7 @@ Client client = new Client() Mysql mysql = new Mysql(client); -DedicatedDatabase result = await mysql.CreateMigration( +Appwrite.Models.DedicatedDatabase result = await mysql.CreateMigration( databaseId: "<DATABASE_ID>", targetType: "shared", specification: "<SPECIFICATION>" // optional diff --git a/docs/examples/mysql/create-restoration.md b/docs/examples/mysql/create-restoration.md index d6f1fa35..a240fc77 100644 --- a/docs/examples/mysql/create-restoration.md +++ b/docs/examples/mysql/create-restoration.md @@ -10,7 +10,7 @@ Client client = new Client() Mysql mysql = new Mysql(client); -DedicatedDatabaseRestoration result = await mysql.CreateRestoration( +Appwrite.Models.DedicatedDatabaseRestoration result = await mysql.CreateRestoration( databaseId: "<DATABASE_ID>", type: "backup", // optional backupId: "<BACKUP_ID>", // optional diff --git a/docs/examples/mysql/create-upgrade.md b/docs/examples/mysql/create-upgrade.md index 4b408cee..cafd4c0b 100644 --- a/docs/examples/mysql/create-upgrade.md +++ b/docs/examples/mysql/create-upgrade.md @@ -10,7 +10,7 @@ Client client = new Client() Mysql mysql = new Mysql(client); -DedicatedDatabase result = await mysql.CreateUpgrade( +Appwrite.Models.DedicatedDatabase result = await mysql.CreateUpgrade( databaseId: "<DATABASE_ID>", targetVersion: "<TARGET_VERSION>" ); diff --git a/docs/examples/mysql/create.md b/docs/examples/mysql/create.md index 23bcc79e..d679464f 100644 --- a/docs/examples/mysql/create.md +++ b/docs/examples/mysql/create.md @@ -10,7 +10,7 @@ Client client = new Client() Mysql mysql = new Mysql(client); -DedicatedDatabase result = await mysql.Create( +Appwrite.Models.DedicatedDatabase result = await mysql.Create( databaseId: "<DATABASE_ID>", name: "<NAME>", version: "17", // optional diff --git a/docs/examples/mysql/get-backup-policy.md b/docs/examples/mysql/get-backup-policy.md index 524bd066..9ffda902 100644 --- a/docs/examples/mysql/get-backup-policy.md +++ b/docs/examples/mysql/get-backup-policy.md @@ -10,7 +10,7 @@ Client client = new Client() Mysql mysql = new Mysql(client); -BackupPolicy result = await mysql.GetBackupPolicy( +Appwrite.Models.BackupPolicy result = await mysql.GetBackupPolicy( databaseId: "<DATABASE_ID>", policyId: "<POLICY_ID>" ); diff --git a/docs/examples/mysql/get-backup.md b/docs/examples/mysql/get-backup.md index 1c81ffc4..ae5792a1 100644 --- a/docs/examples/mysql/get-backup.md +++ b/docs/examples/mysql/get-backup.md @@ -10,7 +10,7 @@ Client client = new Client() Mysql mysql = new Mysql(client); -DedicatedDatabaseBackup result = await mysql.GetBackup( +Appwrite.Models.DedicatedDatabaseBackup result = await mysql.GetBackup( databaseId: "<DATABASE_ID>", backupId: "<BACKUP_ID>" ); diff --git a/docs/examples/mysql/get-pitr.md b/docs/examples/mysql/get-pitr.md index 3f1d3fcc..81fbad52 100644 --- a/docs/examples/mysql/get-pitr.md +++ b/docs/examples/mysql/get-pitr.md @@ -10,7 +10,7 @@ Client client = new Client() Mysql mysql = new Mysql(client); -DedicatedDatabasePITRWindows result = await mysql.GetPitr( +Appwrite.Models.DedicatedDatabasePITRWindows result = await mysql.GetPitr( databaseId: "<DATABASE_ID>" ); diff --git a/docs/examples/mysql/get-pooler.md b/docs/examples/mysql/get-pooler.md index c88ec9c8..ac0433bf 100644 --- a/docs/examples/mysql/get-pooler.md +++ b/docs/examples/mysql/get-pooler.md @@ -10,7 +10,7 @@ Client client = new Client() Mysql mysql = new Mysql(client); -DedicatedDatabasePooler result = await mysql.GetPooler( +Appwrite.Models.DedicatedDatabasePooler result = await mysql.GetPooler( databaseId: "<DATABASE_ID>" ); diff --git a/docs/examples/mysql/get-replicas.md b/docs/examples/mysql/get-replicas.md index 4033dc58..76bb2aff 100644 --- a/docs/examples/mysql/get-replicas.md +++ b/docs/examples/mysql/get-replicas.md @@ -10,7 +10,7 @@ Client client = new Client() Mysql mysql = new Mysql(client); -DedicatedDatabaseReplicas result = await mysql.GetReplicas( +Appwrite.Models.DedicatedDatabaseReplicas result = await mysql.GetReplicas( databaseId: "<DATABASE_ID>" ); diff --git a/docs/examples/mysql/get-restoration.md b/docs/examples/mysql/get-restoration.md index 11f18fc1..84964a59 100644 --- a/docs/examples/mysql/get-restoration.md +++ b/docs/examples/mysql/get-restoration.md @@ -10,7 +10,7 @@ Client client = new Client() Mysql mysql = new Mysql(client); -DedicatedDatabaseRestoration result = await mysql.GetRestoration( +Appwrite.Models.DedicatedDatabaseRestoration result = await mysql.GetRestoration( databaseId: "<DATABASE_ID>", restorationId: "<RESTORATION_ID>" ); diff --git a/docs/examples/mysql/get-status.md b/docs/examples/mysql/get-status.md index a6adb9a2..89bf24e6 100644 --- a/docs/examples/mysql/get-status.md +++ b/docs/examples/mysql/get-status.md @@ -10,7 +10,7 @@ Client client = new Client() Mysql mysql = new Mysql(client); -DatabaseStatus result = await mysql.GetStatus( +Appwrite.Models.DatabaseStatus result = await mysql.GetStatus( databaseId: "<DATABASE_ID>" ); diff --git a/docs/examples/mysql/get.md b/docs/examples/mysql/get.md index 0ae1db33..5f475751 100644 --- a/docs/examples/mysql/get.md +++ b/docs/examples/mysql/get.md @@ -10,7 +10,7 @@ Client client = new Client() Mysql mysql = new Mysql(client); -DedicatedDatabase result = await mysql.Get( +Appwrite.Models.DedicatedDatabase result = await mysql.Get( databaseId: "<DATABASE_ID>" ); diff --git a/docs/examples/mysql/list-backup-policies.md b/docs/examples/mysql/list-backup-policies.md index 546c276a..8993fdd4 100644 --- a/docs/examples/mysql/list-backup-policies.md +++ b/docs/examples/mysql/list-backup-policies.md @@ -10,7 +10,7 @@ Client client = new Client() Mysql mysql = new Mysql(client); -BackupPolicyList result = await mysql.ListBackupPolicies( +Appwrite.Models.BackupPolicyList result = await mysql.ListBackupPolicies( databaseId: "<DATABASE_ID>", queries: new List<string>() // optional ); diff --git a/docs/examples/mysql/list-backups.md b/docs/examples/mysql/list-backups.md index 11fda3e8..77d8aea7 100644 --- a/docs/examples/mysql/list-backups.md +++ b/docs/examples/mysql/list-backups.md @@ -10,7 +10,7 @@ Client client = new Client() Mysql mysql = new Mysql(client); -DedicatedDatabaseBackupList result = await mysql.ListBackups( +Appwrite.Models.DedicatedDatabaseBackupList result = await mysql.ListBackups( databaseId: "<DATABASE_ID>", queries: new List<string>() // optional ); diff --git a/docs/examples/mysql/list-branches.md b/docs/examples/mysql/list-branches.md index 471fecec..1003ac29 100644 --- a/docs/examples/mysql/list-branches.md +++ b/docs/examples/mysql/list-branches.md @@ -10,7 +10,7 @@ Client client = new Client() Mysql mysql = new Mysql(client); -DedicatedDatabaseBranchList result = await mysql.ListBranches( +Appwrite.Models.DedicatedDatabaseBranchList result = await mysql.ListBranches( databaseId: "<DATABASE_ID>" ); diff --git a/docs/examples/mysql/list-operations.md b/docs/examples/mysql/list-operations.md index 5b3f342a..2b3c60b3 100644 --- a/docs/examples/mysql/list-operations.md +++ b/docs/examples/mysql/list-operations.md @@ -10,7 +10,7 @@ Client client = new Client() Mysql mysql = new Mysql(client); -DedicatedDatabaseOperationList result = await mysql.ListOperations( +Appwrite.Models.DedicatedDatabaseOperationList result = await mysql.ListOperations( databaseId: "<DATABASE_ID>", status: "queued", // optional limit: 1, // optional diff --git a/docs/examples/mysql/list-restorations.md b/docs/examples/mysql/list-restorations.md index 0238c2ce..3153c4b6 100644 --- a/docs/examples/mysql/list-restorations.md +++ b/docs/examples/mysql/list-restorations.md @@ -10,7 +10,7 @@ Client client = new Client() Mysql mysql = new Mysql(client); -DedicatedDatabaseRestorationList result = await mysql.ListRestorations( +Appwrite.Models.DedicatedDatabaseRestorationList result = await mysql.ListRestorations( databaseId: "<DATABASE_ID>", status: "pending", // optional type: "backup", // optional diff --git a/docs/examples/mysql/list-specifications.md b/docs/examples/mysql/list-specifications.md index a469ff04..38153e47 100644 --- a/docs/examples/mysql/list-specifications.md +++ b/docs/examples/mysql/list-specifications.md @@ -10,7 +10,7 @@ Client client = new Client() Mysql mysql = new Mysql(client); -DedicatedDatabaseSpecificationList result = await mysql.ListSpecifications(); +Appwrite.Models.DedicatedDatabaseSpecificationList result = await mysql.ListSpecifications(); ``` diff --git a/docs/examples/mysql/list.md b/docs/examples/mysql/list.md index f49707d1..bac47570 100644 --- a/docs/examples/mysql/list.md +++ b/docs/examples/mysql/list.md @@ -10,7 +10,7 @@ Client client = new Client() Mysql mysql = new Mysql(client); -DedicatedDatabaseList result = await mysql.List( +Appwrite.Models.DedicatedDatabaseList result = await mysql.List( queries: new List<string>() // optional ); diff --git a/docs/examples/mysql/update-backup-policy.md b/docs/examples/mysql/update-backup-policy.md index c812e9ea..bb0c9683 100644 --- a/docs/examples/mysql/update-backup-policy.md +++ b/docs/examples/mysql/update-backup-policy.md @@ -10,7 +10,7 @@ Client client = new Client() Mysql mysql = new Mysql(client); -BackupPolicy result = await mysql.UpdateBackupPolicy( +Appwrite.Models.BackupPolicy result = await mysql.UpdateBackupPolicy( databaseId: "<DATABASE_ID>", policyId: "<POLICY_ID>", name: "<NAME>", // optional diff --git a/docs/examples/mysql/update-backup-storage.md b/docs/examples/mysql/update-backup-storage.md index 6efbdc49..35eaf8fd 100644 --- a/docs/examples/mysql/update-backup-storage.md +++ b/docs/examples/mysql/update-backup-storage.md @@ -10,7 +10,7 @@ Client client = new Client() Mysql mysql = new Mysql(client); -DedicatedDatabaseBackupStorage result = await mysql.UpdateBackupStorage( +Appwrite.Models.DedicatedDatabaseBackupStorage result = await mysql.UpdateBackupStorage( databaseId: "<DATABASE_ID>", provider: "s3", bucket: "<BUCKET>", diff --git a/docs/examples/mysql/update-credentials.md b/docs/examples/mysql/update-credentials.md index 7bf74cb3..4e027804 100644 --- a/docs/examples/mysql/update-credentials.md +++ b/docs/examples/mysql/update-credentials.md @@ -10,7 +10,7 @@ Client client = new Client() Mysql mysql = new Mysql(client); -DedicatedDatabaseOperation result = await mysql.UpdateCredentials( +Appwrite.Models.DedicatedDatabaseOperation result = await mysql.UpdateCredentials( databaseId: "<DATABASE_ID>" ); diff --git a/docs/examples/mysql/update-maintenance.md b/docs/examples/mysql/update-maintenance.md index 4a28819a..447c78cf 100644 --- a/docs/examples/mysql/update-maintenance.md +++ b/docs/examples/mysql/update-maintenance.md @@ -10,7 +10,7 @@ Client client = new Client() Mysql mysql = new Mysql(client); -DedicatedDatabase result = await mysql.UpdateMaintenance( +Appwrite.Models.DedicatedDatabase result = await mysql.UpdateMaintenance( databaseId: "<DATABASE_ID>", day: "sun", hourUtc: 0 diff --git a/docs/examples/mysql/update-pooler.md b/docs/examples/mysql/update-pooler.md index 455b6d2b..585ff5a7 100644 --- a/docs/examples/mysql/update-pooler.md +++ b/docs/examples/mysql/update-pooler.md @@ -10,7 +10,7 @@ Client client = new Client() Mysql mysql = new Mysql(client); -DedicatedDatabasePooler result = await mysql.UpdatePooler( +Appwrite.Models.DedicatedDatabasePooler result = await mysql.UpdatePooler( databaseId: "<DATABASE_ID>", mode: "transaction", // optional maxConnections: 10, // optional diff --git a/docs/examples/mysql/update.md b/docs/examples/mysql/update.md index 4e9e8adb..287ca113 100644 --- a/docs/examples/mysql/update.md +++ b/docs/examples/mysql/update.md @@ -10,7 +10,7 @@ Client client = new Client() Mysql mysql = new Mysql(client); -DedicatedDatabase result = await mysql.Update( +Appwrite.Models.DedicatedDatabase result = await mysql.Update( databaseId: "<DATABASE_ID>", name: "<NAME>", // optional status: "ready", // optional diff --git a/docs/examples/oauth2/approve.md b/docs/examples/oauth2/approve.md index b59de4dd..64ba33e6 100644 --- a/docs/examples/oauth2/approve.md +++ b/docs/examples/oauth2/approve.md @@ -5,12 +5,12 @@ using Appwrite.Services; Client client = new Client() .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - .SetSession("") // The user session to authenticate with - .SetProject("<YOUR_PROJECT_ID>"); // Your project ID + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with Oauth2 oauth2 = new Oauth2(client); -Oauth2Approve result = await oauth2.Approve( +Appwrite.Models.Oauth2Approve result = await oauth2.Approve( grant_id: "<GRANT_ID>", authorization_details: "<AUTHORIZATION_DETAILS>", // optional scope: "<SCOPE>" // optional diff --git a/docs/examples/oauth2/authorize-post.md b/docs/examples/oauth2/authorize-post.md index b2269a0e..fbafee64 100644 --- a/docs/examples/oauth2/authorize-post.md +++ b/docs/examples/oauth2/authorize-post.md @@ -5,12 +5,12 @@ using Appwrite.Services; Client client = new Client() .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - .SetSession("") // The user session to authenticate with - .SetProject("<YOUR_PROJECT_ID>"); // Your project ID + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with Oauth2 oauth2 = new Oauth2(client); -Oauth2Authorize result = await oauth2.AuthorizePost( +Appwrite.Models.Oauth2Authorize result = await oauth2.AuthorizePost( client_id: "<CLIENT_ID>", // optional redirect_uri: "https://example.com", // optional response_type: "", // optional @@ -22,7 +22,7 @@ Oauth2Authorize result = await oauth2.AuthorizePost( prompt: "<PROMPT>", // optional max_age: 0, // optional authorization_details: "<AUTHORIZATION_DETAILS>", // optional - resource: "", // optional + resource: new List<string>(), // optional audience: "<AUDIENCE>", // optional request_uri: "<REQUEST_URI>" // optional ); diff --git a/docs/examples/oauth2/authorize.md b/docs/examples/oauth2/authorize.md index 056859ea..124894c3 100644 --- a/docs/examples/oauth2/authorize.md +++ b/docs/examples/oauth2/authorize.md @@ -5,12 +5,12 @@ using Appwrite.Services; Client client = new Client() .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - .SetSession("") // The user session to authenticate with - .SetProject("<YOUR_PROJECT_ID>"); // Your project ID + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with Oauth2 oauth2 = new Oauth2(client); -Oauth2Authorize result = await oauth2.Authorize( +Appwrite.Models.Oauth2Authorize result = await oauth2.Authorize( client_id: "<CLIENT_ID>", // optional redirect_uri: "https://example.com", // optional response_type: "", // optional @@ -22,7 +22,7 @@ Oauth2Authorize result = await oauth2.Authorize( prompt: "<PROMPT>", // optional max_age: 0, // optional authorization_details: "<AUTHORIZATION_DETAILS>", // optional - resource: "", // optional + resource: new List<string>(), // optional audience: "<AUDIENCE>", // optional request_uri: "<REQUEST_URI>" // optional ); diff --git a/docs/examples/oauth2/create-device-authorization.md b/docs/examples/oauth2/create-device-authorization.md index a6697fe0..3413ca86 100644 --- a/docs/examples/oauth2/create-device-authorization.md +++ b/docs/examples/oauth2/create-device-authorization.md @@ -5,16 +5,16 @@ using Appwrite.Services; Client client = new Client() .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - .SetSession("") // The user session to authenticate with - .SetProject("<YOUR_PROJECT_ID>"); // Your project ID + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with Oauth2 oauth2 = new Oauth2(client); -Oauth2DeviceAuthorization result = await oauth2.CreateDeviceAuthorization( +Appwrite.Models.Oauth2DeviceAuthorization result = await oauth2.CreateDeviceAuthorization( client_id: "<CLIENT_ID>", // optional scope: "<SCOPE>", // optional authorization_details: "<AUTHORIZATION_DETAILS>", // optional - resource: "", // optional + resource: new List<string>(), // optional audience: "<AUDIENCE>" // optional ); diff --git a/docs/examples/oauth2/create-grant.md b/docs/examples/oauth2/create-grant.md index 856a8815..5f987551 100644 --- a/docs/examples/oauth2/create-grant.md +++ b/docs/examples/oauth2/create-grant.md @@ -5,12 +5,12 @@ using Appwrite.Services; Client client = new Client() .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - .SetSession("") // The user session to authenticate with - .SetProject("<YOUR_PROJECT_ID>"); // Your project ID + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with Oauth2 oauth2 = new Oauth2(client); -Oauth2Grant result = await oauth2.CreateGrant( +Appwrite.Models.Oauth2Grant result = await oauth2.CreateGrant( user_code: "<USER_CODE>" ); diff --git a/docs/examples/oauth2/create-par.md b/docs/examples/oauth2/create-par.md index 2d8827f3..5d236462 100644 --- a/docs/examples/oauth2/create-par.md +++ b/docs/examples/oauth2/create-par.md @@ -5,12 +5,12 @@ using Appwrite.Services; Client client = new Client() .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - .SetSession("") // The user session to authenticate with - .SetProject("<YOUR_PROJECT_ID>"); // Your project ID + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with Oauth2 oauth2 = new Oauth2(client); -Oauth2PAR result = await oauth2.CreatePAR( +Appwrite.Models.Oauth2PAR result = await oauth2.CreatePAR( client_id: "<CLIENT_ID>", redirect_uri: "https://example.com", response_type: "code", @@ -22,7 +22,7 @@ Oauth2PAR result = await oauth2.CreatePAR( prompt: "<PROMPT>", // optional max_age: 0, // optional authorization_details: "<AUTHORIZATION_DETAILS>", // optional - resource: "", // optional + resource: new List<string>(), // optional audience: "<AUDIENCE>" // optional ); diff --git a/docs/examples/oauth2/create-token.md b/docs/examples/oauth2/create-token.md index a4b2d762..974793c1 100644 --- a/docs/examples/oauth2/create-token.md +++ b/docs/examples/oauth2/create-token.md @@ -5,12 +5,12 @@ using Appwrite.Services; Client client = new Client() .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - .SetSession("") // The user session to authenticate with - .SetProject("<YOUR_PROJECT_ID>"); // Your project ID + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with Oauth2 oauth2 = new Oauth2(client); -Oauth2Token result = await oauth2.CreateToken( +Appwrite.Models.Oauth2Token result = await oauth2.CreateToken( grant_type: "<GRANT_TYPE>", code: "<CODE>", // optional refresh_token: "<REFRESH_TOKEN>", // optional @@ -19,7 +19,7 @@ Oauth2Token result = await oauth2.CreateToken( client_secret: "<CLIENT_SECRET>", // optional code_verifier: "<CODE_VERIFIER>", // optional redirect_uri: "https://example.com", // optional - resource: "", // optional + resource: new List<string>(), // optional audience: "<AUDIENCE>" // optional ); diff --git a/docs/examples/oauth2/get-grant.md b/docs/examples/oauth2/get-grant.md index 389e5005..a64ac007 100644 --- a/docs/examples/oauth2/get-grant.md +++ b/docs/examples/oauth2/get-grant.md @@ -5,12 +5,12 @@ using Appwrite.Services; Client client = new Client() .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - .SetSession("") // The user session to authenticate with - .SetProject("<YOUR_PROJECT_ID>"); // Your project ID + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with Oauth2 oauth2 = new Oauth2(client); -Oauth2Grant result = await oauth2.GetGrant( +Appwrite.Models.Oauth2Grant result = await oauth2.GetGrant( grant_id: "<GRANT_ID>" ); diff --git a/docs/examples/oauth2/introspect.md b/docs/examples/oauth2/introspect.md new file mode 100644 index 00000000..f74b57d6 --- /dev/null +++ b/docs/examples/oauth2/introspect.md @@ -0,0 +1,20 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Oauth2 oauth2 = new Oauth2(client); + +Appwrite.Models.Oauth2Introspection result = await oauth2.Introspect( + token: "<TOKEN>", + token_type_hint: "access_token", // optional + client_id: "<CLIENT_ID>", // optional + client_secret: "<CLIENT_SECRET>" // optional +); + +``` diff --git a/docs/examples/oauth2/list-organizations.md b/docs/examples/oauth2/list-organizations.md index d2787675..b710dc6e 100644 --- a/docs/examples/oauth2/list-organizations.md +++ b/docs/examples/oauth2/list-organizations.md @@ -5,12 +5,12 @@ using Appwrite.Services; Client client = new Client() .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - .SetSession("") // The user session to authenticate with - .SetProject("<YOUR_PROJECT_ID>"); // Your project ID + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with Oauth2 oauth2 = new Oauth2(client); -Oauth2OrganizationList result = await oauth2.ListOrganizations( +Appwrite.Models.Oauth2OrganizationList result = await oauth2.ListOrganizations( limit: 1, // optional offset: 0, // optional search: "<SEARCH>" // optional diff --git a/docs/examples/oauth2/list-projects.md b/docs/examples/oauth2/list-projects.md index cff6d2a9..c5760c13 100644 --- a/docs/examples/oauth2/list-projects.md +++ b/docs/examples/oauth2/list-projects.md @@ -5,12 +5,12 @@ using Appwrite.Services; Client client = new Client() .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - .SetSession("") // The user session to authenticate with - .SetProject("<YOUR_PROJECT_ID>"); // Your project ID + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with Oauth2 oauth2 = new Oauth2(client); -Oauth2ProjectList result = await oauth2.ListProjects( +Appwrite.Models.Oauth2ProjectList result = await oauth2.ListProjects( limit: 1, // optional offset: 0, // optional search: "<SEARCH>" // optional diff --git a/docs/examples/oauth2/reject.md b/docs/examples/oauth2/reject.md index 9a92b2c7..9347771f 100644 --- a/docs/examples/oauth2/reject.md +++ b/docs/examples/oauth2/reject.md @@ -5,12 +5,12 @@ using Appwrite.Services; Client client = new Client() .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - .SetSession("") // The user session to authenticate with - .SetProject("<YOUR_PROJECT_ID>"); // Your project ID + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with Oauth2 oauth2 = new Oauth2(client); -Oauth2Reject result = await oauth2.Reject( +Appwrite.Models.Oauth2Reject result = await oauth2.Reject( grant_id: "<GRANT_ID>" ); diff --git a/docs/examples/oauth2/revoke.md b/docs/examples/oauth2/revoke.md index eb902a05..f75a85b5 100644 --- a/docs/examples/oauth2/revoke.md +++ b/docs/examples/oauth2/revoke.md @@ -5,12 +5,12 @@ using Appwrite.Services; Client client = new Client() .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - .SetSession("") // The user session to authenticate with - .SetProject("<YOUR_PROJECT_ID>"); // Your project ID + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with Oauth2 oauth2 = new Oauth2(client); - result = await oauth2.Revoke( +Appwrite.Models. result = await oauth2.Revoke( token: "<TOKEN>", token_type_hint: "access_token", // optional client_id: "<CLIENT_ID>", // optional diff --git a/docs/examples/organization/create-key.md b/docs/examples/organization/create-ephemeral-project-key.md similarity index 62% rename from docs/examples/organization/create-key.md rename to docs/examples/organization/create-ephemeral-project-key.md index 85288ad8..d26654af 100644 --- a/docs/examples/organization/create-key.md +++ b/docs/examples/organization/create-ephemeral-project-key.md @@ -11,11 +11,10 @@ Client client = new Client() Organization organization = new Organization(client); -Key result = await organization.CreateKey( - keyId: "<KEY_ID>", - name: "<NAME>", - scopes: new List<OrganizationKeyScopes> { OrganizationKeyScopes.ProjectsRead }, - expire: "2020-10-15T06:38:00.000+00:00" // optional +Appwrite.Models.EphemeralKey result = await organization.CreateEphemeralProjectKey( + projectId: "<PROJECT_ID>", + scopes: new List<ProjectKeyScopes> { ProjectKeyScopes.UsersRead }, + duration: 600 ); ``` diff --git a/docs/examples/organization/create-installation.md b/docs/examples/organization/create-installation.md index 78aa2c38..75abe99a 100644 --- a/docs/examples/organization/create-installation.md +++ b/docs/examples/organization/create-installation.md @@ -10,7 +10,7 @@ Client client = new Client() Organization organization = new Organization(client); -AppInstallation result = await organization.CreateInstallation( +Appwrite.Models.AppInstallation result = await organization.CreateInstallation( appId: "<APP_ID>", authorizationDetails: "<AUTHORIZATION_DETAILS>" // optional ); diff --git a/docs/examples/organization/create-membership.md b/docs/examples/organization/create-membership.md index bbeb4a1f..863e78b5 100644 --- a/docs/examples/organization/create-membership.md +++ b/docs/examples/organization/create-membership.md @@ -10,7 +10,7 @@ Client client = new Client() Organization organization = new Organization(client); -Membership result = await organization.CreateMembership( +Appwrite.Models.Membership result = await organization.CreateMembership( roles: new List<string>(), email: "email@example.com", // optional userId: "<USER_ID>", // optional diff --git a/docs/examples/organization/create-project.md b/docs/examples/organization/create-project.md index c4f2e627..956b7b5c 100644 --- a/docs/examples/organization/create-project.md +++ b/docs/examples/organization/create-project.md @@ -11,7 +11,7 @@ Client client = new Client() Organization organization = new Organization(client); -Project result = await organization.CreateProject( +Appwrite.Models.Project result = await organization.CreateProject( projectId: "<PROJECT_ID>", name: "<NAME>", region: Region.Fra // optional diff --git a/docs/examples/organization/delete-key.md b/docs/examples/organization/delete-project-key.md similarity index 84% rename from docs/examples/organization/delete-key.md rename to docs/examples/organization/delete-project-key.md index 78ff5b81..ff48b13f 100644 --- a/docs/examples/organization/delete-key.md +++ b/docs/examples/organization/delete-project-key.md @@ -10,7 +10,8 @@ Client client = new Client() Organization organization = new Organization(client); -await organization.DeleteKey( +await organization.DeleteProjectKey( + projectId: "<PROJECT_ID>", keyId: "<KEY_ID>" ); diff --git a/docs/examples/organization/get-installation.md b/docs/examples/organization/get-installation.md index c324528b..a9ea1c66 100644 --- a/docs/examples/organization/get-installation.md +++ b/docs/examples/organization/get-installation.md @@ -10,7 +10,7 @@ Client client = new Client() Organization organization = new Organization(client); -AppInstallation result = await organization.GetInstallation( +Appwrite.Models.AppInstallation result = await organization.GetInstallation( installationId: "<INSTALLATION_ID>" ); diff --git a/docs/examples/organization/get-membership.md b/docs/examples/organization/get-membership.md index 44d6363e..561fa51b 100644 --- a/docs/examples/organization/get-membership.md +++ b/docs/examples/organization/get-membership.md @@ -10,7 +10,7 @@ Client client = new Client() Organization organization = new Organization(client); -Membership result = await organization.GetMembership( +Appwrite.Models.Membership result = await organization.GetMembership( membershipId: "<MEMBERSHIP_ID>" ); diff --git a/docs/examples/organization/get-key.md b/docs/examples/organization/get-project-key.md similarity index 80% rename from docs/examples/organization/get-key.md rename to docs/examples/organization/get-project-key.md index c240dbc0..af2b38dd 100644 --- a/docs/examples/organization/get-key.md +++ b/docs/examples/organization/get-project-key.md @@ -10,7 +10,8 @@ Client client = new Client() Organization organization = new Organization(client); -Key result = await organization.GetKey( +Appwrite.Models.Key result = await organization.GetProjectKey( + projectId: "<PROJECT_ID>", keyId: "<KEY_ID>" ); diff --git a/docs/examples/organization/get-project.md b/docs/examples/organization/get-project.md index 3d64fe0c..eb45c7c9 100644 --- a/docs/examples/organization/get-project.md +++ b/docs/examples/organization/get-project.md @@ -10,7 +10,7 @@ Client client = new Client() Organization organization = new Organization(client); -Project result = await organization.GetProject( +Appwrite.Models.Project result = await organization.GetProject( projectId: "<PROJECT_ID>" ); diff --git a/docs/examples/organization/get.md b/docs/examples/organization/get.md index 4c3c2b76..99163f30 100644 --- a/docs/examples/organization/get.md +++ b/docs/examples/organization/get.md @@ -10,7 +10,7 @@ Client client = new Client() Organization organization = new Organization(client); -Organization result = await organization.Get(); +Appwrite.Models.Organization result = await organization.Get(); ``` diff --git a/docs/examples/organization/list-installations.md b/docs/examples/organization/list-installations.md index 2890e336..e802baa3 100644 --- a/docs/examples/organization/list-installations.md +++ b/docs/examples/organization/list-installations.md @@ -10,7 +10,7 @@ Client client = new Client() Organization organization = new Organization(client); -AppInstallationList result = await organization.ListInstallations( +Appwrite.Models.AppInstallationList result = await organization.ListInstallations( queries: new List<string>(), // optional total: false // optional ); diff --git a/docs/examples/organization/list-memberships.md b/docs/examples/organization/list-memberships.md index 69c357b7..fc95861a 100644 --- a/docs/examples/organization/list-memberships.md +++ b/docs/examples/organization/list-memberships.md @@ -10,7 +10,7 @@ Client client = new Client() Organization organization = new Organization(client); -MembershipList result = await organization.ListMemberships( +Appwrite.Models.MembershipList result = await organization.ListMemberships( queries: new List<string>(), // optional search: "<SEARCH>", // optional total: false // optional diff --git a/docs/examples/organization/list-keys.md b/docs/examples/organization/list-project-keys.md similarity index 81% rename from docs/examples/organization/list-keys.md rename to docs/examples/organization/list-project-keys.md index 4671782d..07b36f2d 100644 --- a/docs/examples/organization/list-keys.md +++ b/docs/examples/organization/list-project-keys.md @@ -10,7 +10,8 @@ Client client = new Client() Organization organization = new Organization(client); -KeyList result = await organization.ListKeys( +Appwrite.Models.KeyList result = await organization.ListProjectKeys( + projectId: "<PROJECT_ID>", queries: new List<string>(), // optional total: false // optional ); diff --git a/docs/examples/organization/list-projects.md b/docs/examples/organization/list-projects.md index c61a3341..c1d9b20f 100644 --- a/docs/examples/organization/list-projects.md +++ b/docs/examples/organization/list-projects.md @@ -10,7 +10,7 @@ Client client = new Client() Organization organization = new Organization(client); -ProjectList result = await organization.ListProjects( +Appwrite.Models.ProjectList result = await organization.ListProjects( queries: new List<string>(), // optional search: "<SEARCH>", // optional total: false // optional diff --git a/docs/examples/organization/update-installation.md b/docs/examples/organization/update-installation.md index c79ee8b5..d78ba101 100644 --- a/docs/examples/organization/update-installation.md +++ b/docs/examples/organization/update-installation.md @@ -10,7 +10,7 @@ Client client = new Client() Organization organization = new Organization(client); -AppInstallation result = await organization.UpdateInstallation( +Appwrite.Models.AppInstallation result = await organization.UpdateInstallation( installationId: "<INSTALLATION_ID>", authorizationDetails: "<AUTHORIZATION_DETAILS>" // optional ); diff --git a/docs/examples/organization/update-membership.md b/docs/examples/organization/update-membership.md index d1faf7f0..33105d9a 100644 --- a/docs/examples/organization/update-membership.md +++ b/docs/examples/organization/update-membership.md @@ -10,7 +10,7 @@ Client client = new Client() Organization organization = new Organization(client); -Membership result = await organization.UpdateMembership( +Appwrite.Models.Membership result = await organization.UpdateMembership( membershipId: "<MEMBERSHIP_ID>", roles: new List<string>() ); diff --git a/docs/examples/organization/update-key.md b/docs/examples/organization/update-project-key.md similarity index 73% rename from docs/examples/organization/update-key.md rename to docs/examples/organization/update-project-key.md index d22ee7f6..541343b3 100644 --- a/docs/examples/organization/update-key.md +++ b/docs/examples/organization/update-project-key.md @@ -11,10 +11,11 @@ Client client = new Client() Organization organization = new Organization(client); -Key result = await organization.UpdateKey( +Appwrite.Models.Key result = await organization.UpdateProjectKey( + projectId: "<PROJECT_ID>", keyId: "<KEY_ID>", name: "<NAME>", - scopes: new List<OrganizationKeyScopes> { OrganizationKeyScopes.ProjectsRead }, + scopes: new List<ProjectKeyScopes> { ProjectKeyScopes.UsersRead }, expire: "2020-10-15T06:38:00.000+00:00" // optional ); diff --git a/docs/examples/organization/update-project.md b/docs/examples/organization/update-project.md index ae8e2664..42abd547 100644 --- a/docs/examples/organization/update-project.md +++ b/docs/examples/organization/update-project.md @@ -10,7 +10,7 @@ Client client = new Client() Organization organization = new Organization(client); -Project result = await organization.UpdateProject( +Appwrite.Models.Project result = await organization.UpdateProject( projectId: "<PROJECT_ID>", name: "<NAME>" ); diff --git a/docs/examples/organization/update.md b/docs/examples/organization/update.md index 8b559ce1..8ba851ea 100644 --- a/docs/examples/organization/update.md +++ b/docs/examples/organization/update.md @@ -10,7 +10,7 @@ Client client = new Client() Organization organization = new Organization(client); -Organization result = await organization.Update( +Appwrite.Models.Organization result = await organization.Update( name: "<NAME>" ); diff --git a/docs/examples/postgresql/create-backup-policy.md b/docs/examples/postgresql/create-backup-policy.md index ba827ae7..80f7abc1 100644 --- a/docs/examples/postgresql/create-backup-policy.md +++ b/docs/examples/postgresql/create-backup-policy.md @@ -10,7 +10,7 @@ Client client = new Client() Postgresql postgresql = new Postgresql(client); -BackupPolicy result = await postgresql.CreateBackupPolicy( +Appwrite.Models.BackupPolicy result = await postgresql.CreateBackupPolicy( databaseId: "<DATABASE_ID>", policyId: "<POLICY_ID>", name: "<NAME>", diff --git a/docs/examples/postgresql/create-backup.md b/docs/examples/postgresql/create-backup.md index de70d5c5..6e49fcc3 100644 --- a/docs/examples/postgresql/create-backup.md +++ b/docs/examples/postgresql/create-backup.md @@ -10,7 +10,7 @@ Client client = new Client() Postgresql postgresql = new Postgresql(client); -DedicatedDatabaseBackup result = await postgresql.CreateBackup( +Appwrite.Models.DedicatedDatabaseBackup result = await postgresql.CreateBackup( databaseId: "<DATABASE_ID>", type: "full" // optional ); diff --git a/docs/examples/postgresql/create-branch.md b/docs/examples/postgresql/create-branch.md index f4e8d566..29d694b4 100644 --- a/docs/examples/postgresql/create-branch.md +++ b/docs/examples/postgresql/create-branch.md @@ -10,7 +10,7 @@ Client client = new Client() Postgresql postgresql = new Postgresql(client); -DedicatedDatabase result = await postgresql.CreateBranch( +Appwrite.Models.DedicatedDatabase result = await postgresql.CreateBranch( databaseId: "<DATABASE_ID>", branchId: "<BRANCH_ID>", // optional ttl: 300 // optional diff --git a/docs/examples/postgresql/create-execution.md b/docs/examples/postgresql/create-execution.md index 14804cc0..688714b1 100644 --- a/docs/examples/postgresql/create-execution.md +++ b/docs/examples/postgresql/create-execution.md @@ -10,7 +10,7 @@ Client client = new Client() Postgresql postgresql = new Postgresql(client); -DedicatedDatabaseExecution result = await postgresql.CreateExecution( +Appwrite.Models.DedicatedDatabaseExecution result = await postgresql.CreateExecution( databaseId: "<DATABASE_ID>", sql: "<SQL>", bindings: [object], // optional diff --git a/docs/examples/postgresql/create-extension.md b/docs/examples/postgresql/create-extension.md index d7a6e6fd..574f720e 100644 --- a/docs/examples/postgresql/create-extension.md +++ b/docs/examples/postgresql/create-extension.md @@ -10,7 +10,7 @@ Client client = new Client() Postgresql postgresql = new Postgresql(client); -DedicatedDatabase result = await postgresql.CreateExtension( +Appwrite.Models.DedicatedDatabase result = await postgresql.CreateExtension( databaseId: "<DATABASE_ID>", name: "<NAME>" ); diff --git a/docs/examples/postgresql/create-failover.md b/docs/examples/postgresql/create-failover.md index b798844f..f6019e77 100644 --- a/docs/examples/postgresql/create-failover.md +++ b/docs/examples/postgresql/create-failover.md @@ -10,7 +10,7 @@ Client client = new Client() Postgresql postgresql = new Postgresql(client); -DedicatedDatabase result = await postgresql.CreateFailover( +Appwrite.Models.DedicatedDatabase result = await postgresql.CreateFailover( databaseId: "<DATABASE_ID>", targetReplicaId: "<TARGET_REPLICA_ID>" // optional ); diff --git a/docs/examples/postgresql/create-migration.md b/docs/examples/postgresql/create-migration.md index 1868ba84..0aa6d252 100644 --- a/docs/examples/postgresql/create-migration.md +++ b/docs/examples/postgresql/create-migration.md @@ -10,7 +10,7 @@ Client client = new Client() Postgresql postgresql = new Postgresql(client); -DedicatedDatabase result = await postgresql.CreateMigration( +Appwrite.Models.DedicatedDatabase result = await postgresql.CreateMigration( databaseId: "<DATABASE_ID>", targetType: "shared", specification: "<SPECIFICATION>" // optional diff --git a/docs/examples/postgresql/create-restoration.md b/docs/examples/postgresql/create-restoration.md index fdd09484..ab018c30 100644 --- a/docs/examples/postgresql/create-restoration.md +++ b/docs/examples/postgresql/create-restoration.md @@ -10,7 +10,7 @@ Client client = new Client() Postgresql postgresql = new Postgresql(client); -DedicatedDatabaseRestoration result = await postgresql.CreateRestoration( +Appwrite.Models.DedicatedDatabaseRestoration result = await postgresql.CreateRestoration( databaseId: "<DATABASE_ID>", type: "backup", // optional backupId: "<BACKUP_ID>", // optional diff --git a/docs/examples/postgresql/create-upgrade.md b/docs/examples/postgresql/create-upgrade.md index c81ca922..18cf2369 100644 --- a/docs/examples/postgresql/create-upgrade.md +++ b/docs/examples/postgresql/create-upgrade.md @@ -10,7 +10,7 @@ Client client = new Client() Postgresql postgresql = new Postgresql(client); -DedicatedDatabase result = await postgresql.CreateUpgrade( +Appwrite.Models.DedicatedDatabase result = await postgresql.CreateUpgrade( databaseId: "<DATABASE_ID>", targetVersion: "<TARGET_VERSION>" ); diff --git a/docs/examples/postgresql/create.md b/docs/examples/postgresql/create.md index b4c3a49b..7177b424 100644 --- a/docs/examples/postgresql/create.md +++ b/docs/examples/postgresql/create.md @@ -10,7 +10,7 @@ Client client = new Client() Postgresql postgresql = new Postgresql(client); -DedicatedDatabase result = await postgresql.Create( +Appwrite.Models.DedicatedDatabase result = await postgresql.Create( databaseId: "<DATABASE_ID>", name: "<NAME>", version: "17", // optional diff --git a/docs/examples/postgresql/get-backup-policy.md b/docs/examples/postgresql/get-backup-policy.md index e58d4e21..e13bcc3f 100644 --- a/docs/examples/postgresql/get-backup-policy.md +++ b/docs/examples/postgresql/get-backup-policy.md @@ -10,7 +10,7 @@ Client client = new Client() Postgresql postgresql = new Postgresql(client); -BackupPolicy result = await postgresql.GetBackupPolicy( +Appwrite.Models.BackupPolicy result = await postgresql.GetBackupPolicy( databaseId: "<DATABASE_ID>", policyId: "<POLICY_ID>" ); diff --git a/docs/examples/postgresql/get-backup.md b/docs/examples/postgresql/get-backup.md index 4091ac39..44af120c 100644 --- a/docs/examples/postgresql/get-backup.md +++ b/docs/examples/postgresql/get-backup.md @@ -10,7 +10,7 @@ Client client = new Client() Postgresql postgresql = new Postgresql(client); -DedicatedDatabaseBackup result = await postgresql.GetBackup( +Appwrite.Models.DedicatedDatabaseBackup result = await postgresql.GetBackup( databaseId: "<DATABASE_ID>", backupId: "<BACKUP_ID>" ); diff --git a/docs/examples/postgresql/get-pitr.md b/docs/examples/postgresql/get-pitr.md index aaabade0..aa56fbff 100644 --- a/docs/examples/postgresql/get-pitr.md +++ b/docs/examples/postgresql/get-pitr.md @@ -10,7 +10,7 @@ Client client = new Client() Postgresql postgresql = new Postgresql(client); -DedicatedDatabasePITRWindows result = await postgresql.GetPitr( +Appwrite.Models.DedicatedDatabasePITRWindows result = await postgresql.GetPitr( databaseId: "<DATABASE_ID>" ); diff --git a/docs/examples/postgresql/get-pooler.md b/docs/examples/postgresql/get-pooler.md index b42fd780..1f930179 100644 --- a/docs/examples/postgresql/get-pooler.md +++ b/docs/examples/postgresql/get-pooler.md @@ -10,7 +10,7 @@ Client client = new Client() Postgresql postgresql = new Postgresql(client); -DedicatedDatabasePooler result = await postgresql.GetPooler( +Appwrite.Models.DedicatedDatabasePooler result = await postgresql.GetPooler( databaseId: "<DATABASE_ID>" ); diff --git a/docs/examples/postgresql/get-replicas.md b/docs/examples/postgresql/get-replicas.md index 62475f36..be8a461d 100644 --- a/docs/examples/postgresql/get-replicas.md +++ b/docs/examples/postgresql/get-replicas.md @@ -10,7 +10,7 @@ Client client = new Client() Postgresql postgresql = new Postgresql(client); -DedicatedDatabaseReplicas result = await postgresql.GetReplicas( +Appwrite.Models.DedicatedDatabaseReplicas result = await postgresql.GetReplicas( databaseId: "<DATABASE_ID>" ); diff --git a/docs/examples/postgresql/get-restoration.md b/docs/examples/postgresql/get-restoration.md index 40a23f03..cafd3613 100644 --- a/docs/examples/postgresql/get-restoration.md +++ b/docs/examples/postgresql/get-restoration.md @@ -10,7 +10,7 @@ Client client = new Client() Postgresql postgresql = new Postgresql(client); -DedicatedDatabaseRestoration result = await postgresql.GetRestoration( +Appwrite.Models.DedicatedDatabaseRestoration result = await postgresql.GetRestoration( databaseId: "<DATABASE_ID>", restorationId: "<RESTORATION_ID>" ); diff --git a/docs/examples/postgresql/get-status.md b/docs/examples/postgresql/get-status.md index 0101abcb..423f902e 100644 --- a/docs/examples/postgresql/get-status.md +++ b/docs/examples/postgresql/get-status.md @@ -10,7 +10,7 @@ Client client = new Client() Postgresql postgresql = new Postgresql(client); -DatabaseStatus result = await postgresql.GetStatus( +Appwrite.Models.DatabaseStatus result = await postgresql.GetStatus( databaseId: "<DATABASE_ID>" ); diff --git a/docs/examples/postgresql/get.md b/docs/examples/postgresql/get.md index 67bd780f..351c81df 100644 --- a/docs/examples/postgresql/get.md +++ b/docs/examples/postgresql/get.md @@ -10,7 +10,7 @@ Client client = new Client() Postgresql postgresql = new Postgresql(client); -DedicatedDatabase result = await postgresql.Get( +Appwrite.Models.DedicatedDatabase result = await postgresql.Get( databaseId: "<DATABASE_ID>" ); diff --git a/docs/examples/postgresql/list-backup-policies.md b/docs/examples/postgresql/list-backup-policies.md index 7fe5d3f7..93a26c18 100644 --- a/docs/examples/postgresql/list-backup-policies.md +++ b/docs/examples/postgresql/list-backup-policies.md @@ -10,7 +10,7 @@ Client client = new Client() Postgresql postgresql = new Postgresql(client); -BackupPolicyList result = await postgresql.ListBackupPolicies( +Appwrite.Models.BackupPolicyList result = await postgresql.ListBackupPolicies( databaseId: "<DATABASE_ID>", queries: new List<string>() // optional ); diff --git a/docs/examples/postgresql/list-backups.md b/docs/examples/postgresql/list-backups.md index f3b66895..9fd5f8b7 100644 --- a/docs/examples/postgresql/list-backups.md +++ b/docs/examples/postgresql/list-backups.md @@ -10,7 +10,7 @@ Client client = new Client() Postgresql postgresql = new Postgresql(client); -DedicatedDatabaseBackupList result = await postgresql.ListBackups( +Appwrite.Models.DedicatedDatabaseBackupList result = await postgresql.ListBackups( databaseId: "<DATABASE_ID>", queries: new List<string>() // optional ); diff --git a/docs/examples/postgresql/list-branches.md b/docs/examples/postgresql/list-branches.md index 1c092d45..b8572e60 100644 --- a/docs/examples/postgresql/list-branches.md +++ b/docs/examples/postgresql/list-branches.md @@ -10,7 +10,7 @@ Client client = new Client() Postgresql postgresql = new Postgresql(client); -DedicatedDatabaseBranchList result = await postgresql.ListBranches( +Appwrite.Models.DedicatedDatabaseBranchList result = await postgresql.ListBranches( databaseId: "<DATABASE_ID>" ); diff --git a/docs/examples/postgresql/list-extensions.md b/docs/examples/postgresql/list-extensions.md index a7ca3908..b2a744fd 100644 --- a/docs/examples/postgresql/list-extensions.md +++ b/docs/examples/postgresql/list-extensions.md @@ -10,7 +10,7 @@ Client client = new Client() Postgresql postgresql = new Postgresql(client); -DedicatedDatabaseExtensions result = await postgresql.ListExtensions( +Appwrite.Models.DedicatedDatabaseExtensions result = await postgresql.ListExtensions( databaseId: "<DATABASE_ID>" ); diff --git a/docs/examples/postgresql/list-operations.md b/docs/examples/postgresql/list-operations.md index cb745eaa..7494343c 100644 --- a/docs/examples/postgresql/list-operations.md +++ b/docs/examples/postgresql/list-operations.md @@ -10,7 +10,7 @@ Client client = new Client() Postgresql postgresql = new Postgresql(client); -DedicatedDatabaseOperationList result = await postgresql.ListOperations( +Appwrite.Models.DedicatedDatabaseOperationList result = await postgresql.ListOperations( databaseId: "<DATABASE_ID>", status: "queued", // optional limit: 1, // optional diff --git a/docs/examples/postgresql/list-restorations.md b/docs/examples/postgresql/list-restorations.md index 2663a1f8..b94f14d3 100644 --- a/docs/examples/postgresql/list-restorations.md +++ b/docs/examples/postgresql/list-restorations.md @@ -10,7 +10,7 @@ Client client = new Client() Postgresql postgresql = new Postgresql(client); -DedicatedDatabaseRestorationList result = await postgresql.ListRestorations( +Appwrite.Models.DedicatedDatabaseRestorationList result = await postgresql.ListRestorations( databaseId: "<DATABASE_ID>", status: "pending", // optional type: "backup", // optional diff --git a/docs/examples/postgresql/list-specifications.md b/docs/examples/postgresql/list-specifications.md index da1539be..e6117b11 100644 --- a/docs/examples/postgresql/list-specifications.md +++ b/docs/examples/postgresql/list-specifications.md @@ -10,7 +10,7 @@ Client client = new Client() Postgresql postgresql = new Postgresql(client); -DedicatedDatabaseSpecificationList result = await postgresql.ListSpecifications(); +Appwrite.Models.DedicatedDatabaseSpecificationList result = await postgresql.ListSpecifications(); ``` diff --git a/docs/examples/postgresql/list.md b/docs/examples/postgresql/list.md index eb2e0e06..ba8b1ef3 100644 --- a/docs/examples/postgresql/list.md +++ b/docs/examples/postgresql/list.md @@ -10,7 +10,7 @@ Client client = new Client() Postgresql postgresql = new Postgresql(client); -DedicatedDatabaseList result = await postgresql.List( +Appwrite.Models.DedicatedDatabaseList result = await postgresql.List( queries: new List<string>() // optional ); diff --git a/docs/examples/postgresql/update-backup-policy.md b/docs/examples/postgresql/update-backup-policy.md index c1faaa09..f132a200 100644 --- a/docs/examples/postgresql/update-backup-policy.md +++ b/docs/examples/postgresql/update-backup-policy.md @@ -10,7 +10,7 @@ Client client = new Client() Postgresql postgresql = new Postgresql(client); -BackupPolicy result = await postgresql.UpdateBackupPolicy( +Appwrite.Models.BackupPolicy result = await postgresql.UpdateBackupPolicy( databaseId: "<DATABASE_ID>", policyId: "<POLICY_ID>", name: "<NAME>", // optional diff --git a/docs/examples/postgresql/update-backup-storage.md b/docs/examples/postgresql/update-backup-storage.md index 88d946e1..88e84f1f 100644 --- a/docs/examples/postgresql/update-backup-storage.md +++ b/docs/examples/postgresql/update-backup-storage.md @@ -10,7 +10,7 @@ Client client = new Client() Postgresql postgresql = new Postgresql(client); -DedicatedDatabaseBackupStorage result = await postgresql.UpdateBackupStorage( +Appwrite.Models.DedicatedDatabaseBackupStorage result = await postgresql.UpdateBackupStorage( databaseId: "<DATABASE_ID>", provider: "s3", bucket: "<BUCKET>", diff --git a/docs/examples/postgresql/update-credentials.md b/docs/examples/postgresql/update-credentials.md index 75f8f338..bb714ecb 100644 --- a/docs/examples/postgresql/update-credentials.md +++ b/docs/examples/postgresql/update-credentials.md @@ -10,7 +10,7 @@ Client client = new Client() Postgresql postgresql = new Postgresql(client); -DedicatedDatabaseOperation result = await postgresql.UpdateCredentials( +Appwrite.Models.DedicatedDatabaseOperation result = await postgresql.UpdateCredentials( databaseId: "<DATABASE_ID>" ); diff --git a/docs/examples/postgresql/update-maintenance.md b/docs/examples/postgresql/update-maintenance.md index ed6fa91a..01f682c7 100644 --- a/docs/examples/postgresql/update-maintenance.md +++ b/docs/examples/postgresql/update-maintenance.md @@ -10,7 +10,7 @@ Client client = new Client() Postgresql postgresql = new Postgresql(client); -DedicatedDatabase result = await postgresql.UpdateMaintenance( +Appwrite.Models.DedicatedDatabase result = await postgresql.UpdateMaintenance( databaseId: "<DATABASE_ID>", day: "sun", hourUtc: 0 diff --git a/docs/examples/postgresql/update-pooler.md b/docs/examples/postgresql/update-pooler.md index bc77771f..202dd354 100644 --- a/docs/examples/postgresql/update-pooler.md +++ b/docs/examples/postgresql/update-pooler.md @@ -10,7 +10,7 @@ Client client = new Client() Postgresql postgresql = new Postgresql(client); -DedicatedDatabasePooler result = await postgresql.UpdatePooler( +Appwrite.Models.DedicatedDatabasePooler result = await postgresql.UpdatePooler( databaseId: "<DATABASE_ID>", mode: "transaction", // optional maxConnections: 10, // optional diff --git a/docs/examples/postgresql/update.md b/docs/examples/postgresql/update.md index c6e5d48a..c942e330 100644 --- a/docs/examples/postgresql/update.md +++ b/docs/examples/postgresql/update.md @@ -10,7 +10,7 @@ Client client = new Client() Postgresql postgresql = new Postgresql(client); -DedicatedDatabase result = await postgresql.Update( +Appwrite.Models.DedicatedDatabase result = await postgresql.Update( databaseId: "<DATABASE_ID>", name: "<NAME>", // optional status: "ready", // optional diff --git a/docs/examples/presences/get.md b/docs/examples/presences/get.md index 85e7287e..b1c42215 100644 --- a/docs/examples/presences/get.md +++ b/docs/examples/presences/get.md @@ -10,7 +10,7 @@ Client client = new Client() Presences presences = new Presences(client); -Presence result = await presences.Get( +Appwrite.Models.Presence result = await presences.Get( presenceId: "<PRESENCE_ID>" ); diff --git a/docs/examples/presences/list.md b/docs/examples/presences/list.md index 8285644e..7e46168c 100644 --- a/docs/examples/presences/list.md +++ b/docs/examples/presences/list.md @@ -10,7 +10,7 @@ Client client = new Client() Presences presences = new Presences(client); -PresenceList result = await presences.List( +Appwrite.Models.PresenceList result = await presences.List( queries: new List<string>(), // optional total: false, // optional ttl: 0 // optional diff --git a/docs/examples/presences/update.md b/docs/examples/presences/update.md index ed55483b..3efa3244 100644 --- a/docs/examples/presences/update.md +++ b/docs/examples/presences/update.md @@ -10,7 +10,7 @@ Client client = new Client() Presences presences = new Presences(client); -Presence result = await presences.Update( +Appwrite.Models.Presence result = await presences.Update( presenceId: "<PRESENCE_ID>", userId: "<USER_ID>", status: "<STATUS>", // optional diff --git a/docs/examples/presences/upsert.md b/docs/examples/presences/upsert.md index b7868248..b87c35ec 100644 --- a/docs/examples/presences/upsert.md +++ b/docs/examples/presences/upsert.md @@ -10,7 +10,7 @@ Client client = new Client() Presences presences = new Presences(client); -Presence result = await presences.Upsert( +Appwrite.Models.Presence result = await presences.Upsert( presenceId: "<PRESENCE_ID>", userId: "<USER_ID>", status: "<STATUS>", diff --git a/docs/examples/project/create-android-platform.md b/docs/examples/project/create-android-platform.md index df8dd6e0..34c55aec 100644 --- a/docs/examples/project/create-android-platform.md +++ b/docs/examples/project/create-android-platform.md @@ -10,10 +10,11 @@ Client client = new Client() Project project = new Project(client); -PlatformAndroid result = await project.CreateAndroidPlatform( +Appwrite.Models.PlatformAndroid result = await project.CreateAndroidPlatform( platformId: "<PLATFORM_ID>", name: "<NAME>", - applicationId: "<APPLICATION_ID>" + applicationId: "<APPLICATION_ID>", + fingerprints: new List<string>() // optional ); ``` diff --git a/docs/examples/project/create-apple-platform.md b/docs/examples/project/create-apple-platform.md index 10dc58da..fa2bcc49 100644 --- a/docs/examples/project/create-apple-platform.md +++ b/docs/examples/project/create-apple-platform.md @@ -10,7 +10,7 @@ Client client = new Client() Project project = new Project(client); -PlatformApple result = await project.CreateApplePlatform( +Appwrite.Models.PlatformApple result = await project.CreateApplePlatform( platformId: "<PLATFORM_ID>", name: "<NAME>", bundleIdentifier: "<BUNDLE_IDENTIFIER>" diff --git a/docs/examples/project/create-ephemeral-key.md b/docs/examples/project/create-ephemeral-key.md index 5b6226bb..683241c3 100644 --- a/docs/examples/project/create-ephemeral-key.md +++ b/docs/examples/project/create-ephemeral-key.md @@ -11,8 +11,8 @@ Client client = new Client() Project project = new Project(client); -EphemeralKey result = await project.CreateEphemeralKey( - scopes: new List<ProjectKeyScopes> { ProjectKeyScopes.ProjectRead }, +Appwrite.Models.EphemeralKey result = await project.CreateEphemeralKey( + scopes: new List<ProjectKeyScopes> { ProjectKeyScopes.UsersRead }, duration: 600 ); diff --git a/docs/examples/project/create-linux-platform.md b/docs/examples/project/create-linux-platform.md index 7037a09c..ee52c8de 100644 --- a/docs/examples/project/create-linux-platform.md +++ b/docs/examples/project/create-linux-platform.md @@ -10,7 +10,7 @@ Client client = new Client() Project project = new Project(client); -PlatformLinux result = await project.CreateLinuxPlatform( +Appwrite.Models.PlatformLinux result = await project.CreateLinuxPlatform( platformId: "<PLATFORM_ID>", name: "<NAME>", packageName: "<PACKAGE_NAME>" diff --git a/docs/examples/project/create-mock-phone.md b/docs/examples/project/create-mock-phone.md index f8bb1bf5..b907e263 100644 --- a/docs/examples/project/create-mock-phone.md +++ b/docs/examples/project/create-mock-phone.md @@ -10,7 +10,7 @@ Client client = new Client() Project project = new Project(client); -MockNumber result = await project.CreateMockPhone( +Appwrite.Models.MockNumber result = await project.CreateMockPhone( number: "+12065550100", otp: "<OTP>" ); diff --git a/docs/examples/project/create-smtp-test.md b/docs/examples/project/create-smtp-test.md index d461c0cd..1070cfdf 100644 --- a/docs/examples/project/create-smtp-test.md +++ b/docs/examples/project/create-smtp-test.md @@ -10,8 +10,8 @@ Client client = new Client() Project project = new Project(client); - result = await project.CreateSMTPTest( - emails: new List<string>() +Appwrite.Models. result = await project.CreateSMTPTest( + emails: ["recipient@example.com"] ); ``` diff --git a/docs/examples/project/create-variable.md b/docs/examples/project/create-variable.md index 1e361c54..118c12ba 100644 --- a/docs/examples/project/create-variable.md +++ b/docs/examples/project/create-variable.md @@ -10,7 +10,7 @@ Client client = new Client() Project project = new Project(client); -Variable result = await project.CreateVariable( +Appwrite.Models.Variable result = await project.CreateVariable( variableId: "<VARIABLE_ID>", key: "<KEY>", value: "<VALUE>", diff --git a/docs/examples/project/create-web-platform.md b/docs/examples/project/create-web-platform.md index 83f148a0..3a77a014 100644 --- a/docs/examples/project/create-web-platform.md +++ b/docs/examples/project/create-web-platform.md @@ -10,7 +10,7 @@ Client client = new Client() Project project = new Project(client); -PlatformWeb result = await project.CreateWebPlatform( +Appwrite.Models.PlatformWeb result = await project.CreateWebPlatform( platformId: "<PLATFORM_ID>", name: "<NAME>", hostname: "app.example.com" diff --git a/docs/examples/project/create-windows-platform.md b/docs/examples/project/create-windows-platform.md index 01eb5b90..851b10e7 100644 --- a/docs/examples/project/create-windows-platform.md +++ b/docs/examples/project/create-windows-platform.md @@ -10,7 +10,7 @@ Client client = new Client() Project project = new Project(client); -PlatformWindows result = await project.CreateWindowsPlatform( +Appwrite.Models.PlatformWindows result = await project.CreateWindowsPlatform( platformId: "<PLATFORM_ID>", name: "<NAME>", packageIdentifierName: "<PACKAGE_IDENTIFIER_NAME>" diff --git a/docs/examples/project/get-email-template.md b/docs/examples/project/get-email-template.md index 11a331a2..ca99baed 100644 --- a/docs/examples/project/get-email-template.md +++ b/docs/examples/project/get-email-template.md @@ -11,7 +11,7 @@ Client client = new Client() Project project = new Project(client); -EmailTemplate result = await project.GetEmailTemplate( +Appwrite.Models.EmailTemplate result = await project.GetEmailTemplate( templateId: ProjectEmailTemplateId.Verification, locale: ProjectEmailTemplateLocale.Af // optional ); diff --git a/docs/examples/project/get-key.md b/docs/examples/project/get-key.md index a84c4602..c672e1a5 100644 --- a/docs/examples/project/get-key.md +++ b/docs/examples/project/get-key.md @@ -10,7 +10,7 @@ Client client = new Client() Project project = new Project(client); -Key result = await project.GetKey( +Appwrite.Models.Key result = await project.GetKey( keyId: "<KEY_ID>" ); diff --git a/docs/examples/project/get-mock-phone.md b/docs/examples/project/get-mock-phone.md index 43fea545..33e64f11 100644 --- a/docs/examples/project/get-mock-phone.md +++ b/docs/examples/project/get-mock-phone.md @@ -10,7 +10,7 @@ Client client = new Client() Project project = new Project(client); -MockNumber result = await project.GetMockPhone( +Appwrite.Models.MockNumber result = await project.GetMockPhone( number: "+12065550100" ); diff --git a/docs/examples/project/get-variable.md b/docs/examples/project/get-variable.md index bda49739..13f24c43 100644 --- a/docs/examples/project/get-variable.md +++ b/docs/examples/project/get-variable.md @@ -10,7 +10,7 @@ Client client = new Client() Project project = new Project(client); -Variable result = await project.GetVariable( +Appwrite.Models.Variable result = await project.GetVariable( variableId: "<VARIABLE_ID>" ); diff --git a/docs/examples/project/get.md b/docs/examples/project/get.md index 8dbf5a58..e1cb0637 100644 --- a/docs/examples/project/get.md +++ b/docs/examples/project/get.md @@ -10,7 +10,7 @@ Client client = new Client() Project project = new Project(client); -Project result = await project.Get(); +Appwrite.Models.Project result = await project.Get(); ``` diff --git a/docs/examples/project/list-email-templates.md b/docs/examples/project/list-email-templates.md index 0cd3cad1..e8ebd1aa 100644 --- a/docs/examples/project/list-email-templates.md +++ b/docs/examples/project/list-email-templates.md @@ -10,7 +10,7 @@ Client client = new Client() Project project = new Project(client); -EmailTemplateList result = await project.ListEmailTemplates( +Appwrite.Models.EmailTemplateList result = await project.ListEmailTemplates( queries: new List<string>(), // optional total: false // optional ); diff --git a/docs/examples/project/list-keys.md b/docs/examples/project/list-keys.md index f006dd19..45111a31 100644 --- a/docs/examples/project/list-keys.md +++ b/docs/examples/project/list-keys.md @@ -10,7 +10,7 @@ Client client = new Client() Project project = new Project(client); -KeyList result = await project.ListKeys( +Appwrite.Models.KeyList result = await project.ListKeys( queries: new List<string>(), // optional total: false // optional ); diff --git a/docs/examples/project/list-mock-phones.md b/docs/examples/project/list-mock-phones.md index 3fa07bdc..d323abb7 100644 --- a/docs/examples/project/list-mock-phones.md +++ b/docs/examples/project/list-mock-phones.md @@ -10,7 +10,7 @@ Client client = new Client() Project project = new Project(client); -MockNumberList result = await project.ListMockPhones( +Appwrite.Models.MockNumberList result = await project.ListMockPhones( queries: new List<string>(), // optional total: false // optional ); diff --git a/docs/examples/project/list-o-auth-2-providers.md b/docs/examples/project/list-o-auth-2-providers.md index 9d0e7eae..f27c64dc 100644 --- a/docs/examples/project/list-o-auth-2-providers.md +++ b/docs/examples/project/list-o-auth-2-providers.md @@ -10,7 +10,7 @@ Client client = new Client() Project project = new Project(client); -OAuth2ProviderList result = await project.ListOAuth2Providers( +Appwrite.Models.OAuth2ProviderList result = await project.ListOAuth2Providers( queries: new List<string>(), // optional total: false // optional ); diff --git a/docs/examples/project/list-platforms.md b/docs/examples/project/list-platforms.md index 2a507c27..2cd00be5 100644 --- a/docs/examples/project/list-platforms.md +++ b/docs/examples/project/list-platforms.md @@ -10,7 +10,7 @@ Client client = new Client() Project project = new Project(client); -PlatformList result = await project.ListPlatforms( +Appwrite.Models.PlatformList result = await project.ListPlatforms( queries: new List<string>(), // optional total: false // optional ); diff --git a/docs/examples/project/list-policies.md b/docs/examples/project/list-policies.md index bbd49b4c..6c22f716 100644 --- a/docs/examples/project/list-policies.md +++ b/docs/examples/project/list-policies.md @@ -10,7 +10,7 @@ Client client = new Client() Project project = new Project(client); -PolicyList result = await project.ListPolicies( +Appwrite.Models.PolicyList result = await project.ListPolicies( queries: new List<string>(), // optional total: false // optional ); diff --git a/docs/examples/project/list-variables.md b/docs/examples/project/list-variables.md index e8107ab6..8fc25037 100644 --- a/docs/examples/project/list-variables.md +++ b/docs/examples/project/list-variables.md @@ -10,7 +10,7 @@ Client client = new Client() Project project = new Project(client); -VariableList result = await project.ListVariables( +Appwrite.Models.VariableList result = await project.ListVariables( queries: new List<string>(), // optional total: false // optional ); diff --git a/docs/examples/project/update-android-platform.md b/docs/examples/project/update-android-platform.md index 77b78b57..549f11c9 100644 --- a/docs/examples/project/update-android-platform.md +++ b/docs/examples/project/update-android-platform.md @@ -10,10 +10,11 @@ Client client = new Client() Project project = new Project(client); -PlatformAndroid result = await project.UpdateAndroidPlatform( +Appwrite.Models.PlatformAndroid result = await project.UpdateAndroidPlatform( platformId: "<PLATFORM_ID>", name: "<NAME>", - applicationId: "<APPLICATION_ID>" + applicationId: "<APPLICATION_ID>", + fingerprints: new List<string>() // optional ); ``` diff --git a/docs/examples/project/update-apple-platform.md b/docs/examples/project/update-apple-platform.md index fa9ec462..d48e1a2d 100644 --- a/docs/examples/project/update-apple-platform.md +++ b/docs/examples/project/update-apple-platform.md @@ -10,7 +10,7 @@ Client client = new Client() Project project = new Project(client); -PlatformApple result = await project.UpdateApplePlatform( +Appwrite.Models.PlatformApple result = await project.UpdateApplePlatform( platformId: "<PLATFORM_ID>", name: "<NAME>", bundleIdentifier: "<BUNDLE_IDENTIFIER>" diff --git a/docs/examples/project/update-auth-method.md b/docs/examples/project/update-auth-method.md index 0b180be2..90981477 100644 --- a/docs/examples/project/update-auth-method.md +++ b/docs/examples/project/update-auth-method.md @@ -11,7 +11,7 @@ Client client = new Client() Project project = new Project(client); -Project result = await project.UpdateAuthMethod( +Appwrite.Models.Project result = await project.UpdateAuthMethod( methodId: ProjectAuthMethodId.EmailPassword, enabled: false ); diff --git a/docs/examples/project/update-deny-aliased-email-policy.md b/docs/examples/project/update-deny-aliased-email-policy.md index 50d622ea..aacc2017 100644 --- a/docs/examples/project/update-deny-aliased-email-policy.md +++ b/docs/examples/project/update-deny-aliased-email-policy.md @@ -10,7 +10,7 @@ Client client = new Client() Project project = new Project(client); -Project result = await project.UpdateDenyAliasedEmailPolicy( +Appwrite.Models.Project result = await project.UpdateDenyAliasedEmailPolicy( enabled: false ); diff --git a/docs/examples/project/update-deny-corporate-email-policy.md b/docs/examples/project/update-deny-corporate-email-policy.md index 13e204eb..169f8e02 100644 --- a/docs/examples/project/update-deny-corporate-email-policy.md +++ b/docs/examples/project/update-deny-corporate-email-policy.md @@ -10,7 +10,7 @@ Client client = new Client() Project project = new Project(client); -Project result = await project.UpdateDenyCorporateEmailPolicy( +Appwrite.Models.Project result = await project.UpdateDenyCorporateEmailPolicy( enabled: false ); diff --git a/docs/examples/project/update-deny-disposable-email-policy.md b/docs/examples/project/update-deny-disposable-email-policy.md index 7e22b31a..d1f6122b 100644 --- a/docs/examples/project/update-deny-disposable-email-policy.md +++ b/docs/examples/project/update-deny-disposable-email-policy.md @@ -10,7 +10,7 @@ Client client = new Client() Project project = new Project(client); -Project result = await project.UpdateDenyDisposableEmailPolicy( +Appwrite.Models.Project result = await project.UpdateDenyDisposableEmailPolicy( enabled: false ); diff --git a/docs/examples/project/update-deny-free-email-policy.md b/docs/examples/project/update-deny-free-email-policy.md index 49ba6767..6da6853d 100644 --- a/docs/examples/project/update-deny-free-email-policy.md +++ b/docs/examples/project/update-deny-free-email-policy.md @@ -10,7 +10,7 @@ Client client = new Client() Project project = new Project(client); -Project result = await project.UpdateDenyFreeEmailPolicy( +Appwrite.Models.Project result = await project.UpdateDenyFreeEmailPolicy( enabled: false ); diff --git a/docs/examples/project/update-email-template.md b/docs/examples/project/update-email-template.md index 2c4c747d..dd1ae5d6 100644 --- a/docs/examples/project/update-email-template.md +++ b/docs/examples/project/update-email-template.md @@ -11,7 +11,7 @@ Client client = new Client() Project project = new Project(client); -EmailTemplate result = await project.UpdateEmailTemplate( +Appwrite.Models.EmailTemplate result = await project.UpdateEmailTemplate( templateId: ProjectEmailTemplateId.Verification, locale: ProjectEmailTemplateLocale.Af, // optional subject: "<SUBJECT>", // optional diff --git a/docs/examples/project/update-key.md b/docs/examples/project/update-key.md index 619fca4b..6097e49a 100644 --- a/docs/examples/project/update-key.md +++ b/docs/examples/project/update-key.md @@ -11,10 +11,10 @@ Client client = new Client() Project project = new Project(client); -Key result = await project.UpdateKey( +Appwrite.Models.Key result = await project.UpdateKey( keyId: "<KEY_ID>", name: "<NAME>", - scopes: new List<ProjectKeyScopes> { ProjectKeyScopes.ProjectRead }, + scopes: new List<ProjectKeyScopes> { ProjectKeyScopes.UsersRead }, expire: "2020-10-15T06:38:00.000+00:00" // optional ); diff --git a/docs/examples/project/update-labels.md b/docs/examples/project/update-labels.md index 2dfe3ea8..76e8304d 100644 --- a/docs/examples/project/update-labels.md +++ b/docs/examples/project/update-labels.md @@ -10,8 +10,8 @@ Client client = new Client() Project project = new Project(client); -Project result = await project.UpdateLabels( - labels: new List<string>() +Appwrite.Models.Project result = await project.UpdateLabels( + labels: ["production"] ); ``` diff --git a/docs/examples/project/update-linux-platform.md b/docs/examples/project/update-linux-platform.md index 0e0be47d..b0a4e359 100644 --- a/docs/examples/project/update-linux-platform.md +++ b/docs/examples/project/update-linux-platform.md @@ -10,7 +10,7 @@ Client client = new Client() Project project = new Project(client); -PlatformLinux result = await project.UpdateLinuxPlatform( +Appwrite.Models.PlatformLinux result = await project.UpdateLinuxPlatform( platformId: "<PLATFORM_ID>", name: "<NAME>", packageName: "<PACKAGE_NAME>" diff --git a/docs/examples/project/update-membership-privacy-policy.md b/docs/examples/project/update-membership-privacy-policy.md index 3e6102f6..8f508a40 100644 --- a/docs/examples/project/update-membership-privacy-policy.md +++ b/docs/examples/project/update-membership-privacy-policy.md @@ -10,7 +10,7 @@ Client client = new Client() Project project = new Project(client); -Project result = await project.UpdateMembershipPrivacyPolicy( +Appwrite.Models.Project result = await project.UpdateMembershipPrivacyPolicy( userId: false, // optional userEmail: false, // optional userPhone: false, // optional diff --git a/docs/examples/project/update-mfa-factors-policy.md b/docs/examples/project/update-mfa-factors-policy.md index aa9ed2a5..8521251e 100644 --- a/docs/examples/project/update-mfa-factors-policy.md +++ b/docs/examples/project/update-mfa-factors-policy.md @@ -10,7 +10,7 @@ Client client = new Client() Project project = new Project(client); -Project result = await project.UpdateMFAFactorsPolicy( +Appwrite.Models.Project result = await project.UpdateMFAFactorsPolicy( totp: false, // optional email: false, // optional phone: false, // optional diff --git a/docs/examples/project/update-mock-phone.md b/docs/examples/project/update-mock-phone.md index e2c699e2..c7f7c82e 100644 --- a/docs/examples/project/update-mock-phone.md +++ b/docs/examples/project/update-mock-phone.md @@ -10,7 +10,7 @@ Client client = new Client() Project project = new Project(client); -MockNumber result = await project.UpdateMockPhone( +Appwrite.Models.MockNumber result = await project.UpdateMockPhone( number: "+12065550100", otp: "<OTP>" ); diff --git a/docs/examples/project/update-o-auth-2-amazon.md b/docs/examples/project/update-o-auth-2-amazon.md index b104edf0..08d858f1 100644 --- a/docs/examples/project/update-o-auth-2-amazon.md +++ b/docs/examples/project/update-o-auth-2-amazon.md @@ -10,7 +10,7 @@ Client client = new Client() Project project = new Project(client); -OAuth2Amazon result = await project.UpdateOAuth2Amazon( +Appwrite.Models.OAuth2Amazon result = await project.UpdateOAuth2Amazon( clientId: "<CLIENT_ID>", // optional clientSecret: "<CLIENT_SECRET>", // optional enabled: false // optional diff --git a/docs/examples/project/update-o-auth-2-apple.md b/docs/examples/project/update-o-auth-2-apple.md index d36a2b98..09a03e3a 100644 --- a/docs/examples/project/update-o-auth-2-apple.md +++ b/docs/examples/project/update-o-auth-2-apple.md @@ -10,12 +10,14 @@ Client client = new Client() Project project = new Project(client); -OAuth2Apple result = await project.UpdateOAuth2Apple( +Appwrite.Models.OAuth2Apple result = await project.UpdateOAuth2Apple( serviceId: "<SERVICE_ID>", // optional keyId: "<KEY_ID>", // optional teamId: "<TEAM_ID>", // optional p8File: "<P8_FILE>", // optional - enabled: false // optional + nativeClientIds: new List<string>(), // optional + enabled: false, // optional + nativeEnabled: false // optional ); ``` diff --git a/docs/examples/project/update-o-auth-2-appwrite.md b/docs/examples/project/update-o-auth-2-appwrite.md index cb38c52d..181cd806 100644 --- a/docs/examples/project/update-o-auth-2-appwrite.md +++ b/docs/examples/project/update-o-auth-2-appwrite.md @@ -10,7 +10,7 @@ Client client = new Client() Project project = new Project(client); -OAuth2Appwrite result = await project.UpdateOAuth2Appwrite( +Appwrite.Models.OAuth2Appwrite result = await project.UpdateOAuth2Appwrite( clientId: "<CLIENT_ID>", // optional clientSecret: "<CLIENT_SECRET>", // optional enabled: false // optional diff --git a/docs/examples/project/update-o-auth-2-auth-0.md b/docs/examples/project/update-o-auth-2-auth-0.md index 081f8323..f9e3c83a 100644 --- a/docs/examples/project/update-o-auth-2-auth-0.md +++ b/docs/examples/project/update-o-auth-2-auth-0.md @@ -1,5 +1,6 @@ ```csharp using Appwrite; +using Appwrite.Enums; using Appwrite.Models; using Appwrite.Services; @@ -10,10 +11,11 @@ Client client = new Client() Project project = new Project(client); -OAuth2Auth0 result = await project.UpdateOAuth2Auth0( +Appwrite.Models.OAuth2Auth0 result = await project.UpdateOAuth2Auth0( clientId: "<CLIENT_ID>", // optional clientSecret: "<CLIENT_SECRET>", // optional endpoint: "<ENDPOINT>", // optional + prompt: new List<ProjectOAuth2Auth0Prompt> { ProjectOAuth2Auth0Prompt.None }, // optional enabled: false // optional ); diff --git a/docs/examples/project/update-o-auth-2-authentik.md b/docs/examples/project/update-o-auth-2-authentik.md index 75107594..a03f9fc5 100644 --- a/docs/examples/project/update-o-auth-2-authentik.md +++ b/docs/examples/project/update-o-auth-2-authentik.md @@ -10,7 +10,7 @@ Client client = new Client() Project project = new Project(client); -OAuth2Authentik result = await project.UpdateOAuth2Authentik( +Appwrite.Models.OAuth2Authentik result = await project.UpdateOAuth2Authentik( clientId: "<CLIENT_ID>", // optional clientSecret: "<CLIENT_SECRET>", // optional endpoint: "<ENDPOINT>", // optional diff --git a/docs/examples/project/update-o-auth-2-autodesk.md b/docs/examples/project/update-o-auth-2-autodesk.md index 836fcc55..07414486 100644 --- a/docs/examples/project/update-o-auth-2-autodesk.md +++ b/docs/examples/project/update-o-auth-2-autodesk.md @@ -10,7 +10,7 @@ Client client = new Client() Project project = new Project(client); -OAuth2Autodesk result = await project.UpdateOAuth2Autodesk( +Appwrite.Models.OAuth2Autodesk result = await project.UpdateOAuth2Autodesk( clientId: "<CLIENT_ID>", // optional clientSecret: "<CLIENT_SECRET>", // optional enabled: false // optional diff --git a/docs/examples/project/update-o-auth-2-bitbucket.md b/docs/examples/project/update-o-auth-2-bitbucket.md index 6a72900d..a24936b8 100644 --- a/docs/examples/project/update-o-auth-2-bitbucket.md +++ b/docs/examples/project/update-o-auth-2-bitbucket.md @@ -10,7 +10,7 @@ Client client = new Client() Project project = new Project(client); -OAuth2Bitbucket result = await project.UpdateOAuth2Bitbucket( +Appwrite.Models.OAuth2Bitbucket result = await project.UpdateOAuth2Bitbucket( key: "<KEY>", // optional secret: "<SECRET>", // optional enabled: false // optional diff --git a/docs/examples/project/update-o-auth-2-bitly.md b/docs/examples/project/update-o-auth-2-bitly.md index f46dd35a..6d874e42 100644 --- a/docs/examples/project/update-o-auth-2-bitly.md +++ b/docs/examples/project/update-o-auth-2-bitly.md @@ -10,7 +10,7 @@ Client client = new Client() Project project = new Project(client); -OAuth2Bitly result = await project.UpdateOAuth2Bitly( +Appwrite.Models.OAuth2Bitly result = await project.UpdateOAuth2Bitly( clientId: "<CLIENT_ID>", // optional clientSecret: "<CLIENT_SECRET>", // optional enabled: false // optional diff --git a/docs/examples/project/update-o-auth-2-box.md b/docs/examples/project/update-o-auth-2-box.md index 1f331e2c..55b77479 100644 --- a/docs/examples/project/update-o-auth-2-box.md +++ b/docs/examples/project/update-o-auth-2-box.md @@ -10,7 +10,7 @@ Client client = new Client() Project project = new Project(client); -OAuth2Box result = await project.UpdateOAuth2Box( +Appwrite.Models.OAuth2Box result = await project.UpdateOAuth2Box( clientId: "<CLIENT_ID>", // optional clientSecret: "<CLIENT_SECRET>", // optional enabled: false // optional diff --git a/docs/examples/project/update-o-auth-2-cloudflare.md b/docs/examples/project/update-o-auth-2-cloudflare.md index 2c7fd809..d2c5b6c7 100644 --- a/docs/examples/project/update-o-auth-2-cloudflare.md +++ b/docs/examples/project/update-o-auth-2-cloudflare.md @@ -10,7 +10,7 @@ Client client = new Client() Project project = new Project(client); -OAuth2Cloudflare result = await project.UpdateOAuth2Cloudflare( +Appwrite.Models.OAuth2Cloudflare result = await project.UpdateOAuth2Cloudflare( clientId: "<CLIENT_ID>", // optional clientSecret: "<CLIENT_SECRET>", // optional enabled: false // optional diff --git a/docs/examples/project/update-o-auth-2-dailymotion.md b/docs/examples/project/update-o-auth-2-dailymotion.md index 87c2c478..bdb91bb8 100644 --- a/docs/examples/project/update-o-auth-2-dailymotion.md +++ b/docs/examples/project/update-o-auth-2-dailymotion.md @@ -10,7 +10,7 @@ Client client = new Client() Project project = new Project(client); -OAuth2Dailymotion result = await project.UpdateOAuth2Dailymotion( +Appwrite.Models.OAuth2Dailymotion result = await project.UpdateOAuth2Dailymotion( apiKey: "<API_KEY>", // optional apiSecret: "<API_SECRET>", // optional enabled: false // optional diff --git a/docs/examples/project/update-o-auth-2-discord.md b/docs/examples/project/update-o-auth-2-discord.md index b6a92dbe..847c1a8a 100644 --- a/docs/examples/project/update-o-auth-2-discord.md +++ b/docs/examples/project/update-o-auth-2-discord.md @@ -1,5 +1,6 @@ ```csharp using Appwrite; +using Appwrite.Enums; using Appwrite.Models; using Appwrite.Services; @@ -10,9 +11,10 @@ Client client = new Client() Project project = new Project(client); -OAuth2Discord result = await project.UpdateOAuth2Discord( +Appwrite.Models.OAuth2Discord result = await project.UpdateOAuth2Discord( clientId: "<CLIENT_ID>", // optional clientSecret: "<CLIENT_SECRET>", // optional + prompt: new List<ProjectOAuth2DiscordPrompt> { ProjectOAuth2DiscordPrompt.None }, // optional enabled: false // optional ); diff --git a/docs/examples/project/update-o-auth-2-disqus.md b/docs/examples/project/update-o-auth-2-disqus.md index a7235621..7095681a 100644 --- a/docs/examples/project/update-o-auth-2-disqus.md +++ b/docs/examples/project/update-o-auth-2-disqus.md @@ -10,7 +10,7 @@ Client client = new Client() Project project = new Project(client); -OAuth2Disqus result = await project.UpdateOAuth2Disqus( +Appwrite.Models.OAuth2Disqus result = await project.UpdateOAuth2Disqus( publicKey: "<PUBLIC_KEY>", // optional secretKey: "<SECRET_KEY>", // optional enabled: false // optional diff --git a/docs/examples/project/update-o-auth-2-dropbox.md b/docs/examples/project/update-o-auth-2-dropbox.md index 16dd0f99..fcf1b826 100644 --- a/docs/examples/project/update-o-auth-2-dropbox.md +++ b/docs/examples/project/update-o-auth-2-dropbox.md @@ -10,7 +10,7 @@ Client client = new Client() Project project = new Project(client); -OAuth2Dropbox result = await project.UpdateOAuth2Dropbox( +Appwrite.Models.OAuth2Dropbox result = await project.UpdateOAuth2Dropbox( appKey: "<APP_KEY>", // optional appSecret: "<APP_SECRET>", // optional enabled: false // optional diff --git a/docs/examples/project/update-o-auth-2-etsy.md b/docs/examples/project/update-o-auth-2-etsy.md index 7ffcb53f..70805c33 100644 --- a/docs/examples/project/update-o-auth-2-etsy.md +++ b/docs/examples/project/update-o-auth-2-etsy.md @@ -10,7 +10,7 @@ Client client = new Client() Project project = new Project(client); -OAuth2Etsy result = await project.UpdateOAuth2Etsy( +Appwrite.Models.OAuth2Etsy result = await project.UpdateOAuth2Etsy( keyString: "<KEY_STRING>", // optional sharedSecret: "<SHARED_SECRET>", // optional enabled: false // optional diff --git a/docs/examples/project/update-o-auth-2-facebook.md b/docs/examples/project/update-o-auth-2-facebook.md index a1549973..ff6ddbc8 100644 --- a/docs/examples/project/update-o-auth-2-facebook.md +++ b/docs/examples/project/update-o-auth-2-facebook.md @@ -10,7 +10,7 @@ Client client = new Client() Project project = new Project(client); -OAuth2Facebook result = await project.UpdateOAuth2Facebook( +Appwrite.Models.OAuth2Facebook result = await project.UpdateOAuth2Facebook( appId: "<APP_ID>", // optional appSecret: "<APP_SECRET>", // optional enabled: false // optional diff --git a/docs/examples/project/update-o-auth-2-figma.md b/docs/examples/project/update-o-auth-2-figma.md index 4c2e8bcd..2ac8f9ee 100644 --- a/docs/examples/project/update-o-auth-2-figma.md +++ b/docs/examples/project/update-o-auth-2-figma.md @@ -10,7 +10,7 @@ Client client = new Client() Project project = new Project(client); -OAuth2Figma result = await project.UpdateOAuth2Figma( +Appwrite.Models.OAuth2Figma result = await project.UpdateOAuth2Figma( clientId: "<CLIENT_ID>", // optional clientSecret: "<CLIENT_SECRET>", // optional enabled: false // optional diff --git a/docs/examples/project/update-o-auth-2-fusion-auth.md b/docs/examples/project/update-o-auth-2-fusion-auth.md index d8515eea..d21156c2 100644 --- a/docs/examples/project/update-o-auth-2-fusion-auth.md +++ b/docs/examples/project/update-o-auth-2-fusion-auth.md @@ -10,7 +10,7 @@ Client client = new Client() Project project = new Project(client); -OAuth2FusionAuth result = await project.UpdateOAuth2FusionAuth( +Appwrite.Models.OAuth2FusionAuth result = await project.UpdateOAuth2FusionAuth( clientId: "<CLIENT_ID>", // optional clientSecret: "<CLIENT_SECRET>", // optional endpoint: "<ENDPOINT>", // optional diff --git a/docs/examples/project/update-o-auth-2-git-hub.md b/docs/examples/project/update-o-auth-2-git-hub.md index f57712e3..fed0b19c 100644 --- a/docs/examples/project/update-o-auth-2-git-hub.md +++ b/docs/examples/project/update-o-auth-2-git-hub.md @@ -1,5 +1,6 @@ ```csharp using Appwrite; +using Appwrite.Enums; using Appwrite.Models; using Appwrite.Services; @@ -10,9 +11,10 @@ Client client = new Client() Project project = new Project(client); -OAuth2Github result = await project.UpdateOAuth2GitHub( +Appwrite.Models.OAuth2Github result = await project.UpdateOAuth2GitHub( clientId: "<CLIENT_ID>", // optional clientSecret: "<CLIENT_SECRET>", // optional + prompt: new List<ProjectOAuth2GitHubPrompt> { ProjectOAuth2GitHubPrompt.SelectAccount }, // optional enabled: false // optional ); diff --git a/docs/examples/project/update-o-auth-2-gitlab.md b/docs/examples/project/update-o-auth-2-gitlab.md index 169b2ec8..9324d68d 100644 --- a/docs/examples/project/update-o-auth-2-gitlab.md +++ b/docs/examples/project/update-o-auth-2-gitlab.md @@ -10,7 +10,7 @@ Client client = new Client() Project project = new Project(client); -OAuth2Gitlab result = await project.UpdateOAuth2Gitlab( +Appwrite.Models.OAuth2Gitlab result = await project.UpdateOAuth2Gitlab( applicationId: "<APPLICATION_ID>", // optional secret: "<SECRET>", // optional endpoint: "https://example.com", // optional diff --git a/docs/examples/project/update-o-auth-2-google.md b/docs/examples/project/update-o-auth-2-google.md index ca498940..e5062c2c 100644 --- a/docs/examples/project/update-o-auth-2-google.md +++ b/docs/examples/project/update-o-auth-2-google.md @@ -11,11 +11,13 @@ Client client = new Client() Project project = new Project(client); -OAuth2Google result = await project.UpdateOAuth2Google( +Appwrite.Models.OAuth2Google result = await project.UpdateOAuth2Google( clientId: "<CLIENT_ID>", // optional clientSecret: "<CLIENT_SECRET>", // optional prompt: new List<ProjectOAuth2GooglePrompt> { ProjectOAuth2GooglePrompt.None }, // optional - enabled: false // optional + nativeClientIds: new List<string>(), // optional + enabled: false, // optional + nativeEnabled: false // optional ); ``` diff --git a/docs/examples/project/update-o-auth-2-hugging-face.md b/docs/examples/project/update-o-auth-2-hugging-face.md index 350640d4..dda17b9f 100644 --- a/docs/examples/project/update-o-auth-2-hugging-face.md +++ b/docs/examples/project/update-o-auth-2-hugging-face.md @@ -10,7 +10,7 @@ Client client = new Client() Project project = new Project(client); -OAuth2HuggingFace result = await project.UpdateOAuth2HuggingFace( +Appwrite.Models.OAuth2HuggingFace result = await project.UpdateOAuth2HuggingFace( clientId: "<CLIENT_ID>", // optional clientSecret: "<CLIENT_SECRET>", // optional enabled: false // optional diff --git a/docs/examples/project/update-o-auth-2-kakao.md b/docs/examples/project/update-o-auth-2-kakao.md new file mode 100644 index 00000000..f03cdf19 --- /dev/null +++ b/docs/examples/project/update-o-auth-2-kakao.md @@ -0,0 +1,21 @@ +```csharp +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +Appwrite.Models.OAuth2Kakao result = await project.UpdateOAuth2Kakao( + clientId: "<CLIENT_ID>", // optional + clientSecret: "<CLIENT_SECRET>", // optional + prompt: new List<ProjectOAuth2KakaoPrompt> { ProjectOAuth2KakaoPrompt.None }, // optional + enabled: false // optional +); + +``` diff --git a/docs/examples/project/update-o-auth-2-keycloak.md b/docs/examples/project/update-o-auth-2-keycloak.md index 67b03697..a91d66e1 100644 --- a/docs/examples/project/update-o-auth-2-keycloak.md +++ b/docs/examples/project/update-o-auth-2-keycloak.md @@ -10,7 +10,7 @@ Client client = new Client() Project project = new Project(client); -OAuth2Keycloak result = await project.UpdateOAuth2Keycloak( +Appwrite.Models.OAuth2Keycloak result = await project.UpdateOAuth2Keycloak( clientId: "<CLIENT_ID>", // optional clientSecret: "<CLIENT_SECRET>", // optional endpoint: "<ENDPOINT>", // optional diff --git a/docs/examples/project/update-o-auth-2-kick.md b/docs/examples/project/update-o-auth-2-kick.md index 56cbef85..0d2e6d7b 100644 --- a/docs/examples/project/update-o-auth-2-kick.md +++ b/docs/examples/project/update-o-auth-2-kick.md @@ -10,7 +10,7 @@ Client client = new Client() Project project = new Project(client); -OAuth2Kick result = await project.UpdateOAuth2Kick( +Appwrite.Models.OAuth2Kick result = await project.UpdateOAuth2Kick( clientId: "<CLIENT_ID>", // optional clientSecret: "<CLIENT_SECRET>", // optional enabled: false // optional diff --git a/docs/examples/project/update-o-auth-2-linkedin.md b/docs/examples/project/update-o-auth-2-linkedin.md index 72c13842..6f762e0c 100644 --- a/docs/examples/project/update-o-auth-2-linkedin.md +++ b/docs/examples/project/update-o-auth-2-linkedin.md @@ -10,7 +10,7 @@ Client client = new Client() Project project = new Project(client); -OAuth2Linkedin result = await project.UpdateOAuth2Linkedin( +Appwrite.Models.OAuth2Linkedin result = await project.UpdateOAuth2Linkedin( clientId: "<CLIENT_ID>", // optional primaryClientSecret: "<PRIMARY_CLIENT_SECRET>", // optional enabled: false // optional diff --git a/docs/examples/project/update-o-auth-2-microsoft.md b/docs/examples/project/update-o-auth-2-microsoft.md index 8e5afa31..55363078 100644 --- a/docs/examples/project/update-o-auth-2-microsoft.md +++ b/docs/examples/project/update-o-auth-2-microsoft.md @@ -1,5 +1,6 @@ ```csharp using Appwrite; +using Appwrite.Enums; using Appwrite.Models; using Appwrite.Services; @@ -10,10 +11,11 @@ Client client = new Client() Project project = new Project(client); -OAuth2Microsoft result = await project.UpdateOAuth2Microsoft( +Appwrite.Models.OAuth2Microsoft result = await project.UpdateOAuth2Microsoft( applicationId: "<APPLICATION_ID>", // optional applicationSecret: "<APPLICATION_SECRET>", // optional tenant: "<TENANT>", // optional + prompt: new List<ProjectOAuth2MicrosoftPrompt> { ProjectOAuth2MicrosoftPrompt.None }, // optional enabled: false // optional ); diff --git a/docs/examples/project/update-o-auth-2-notion.md b/docs/examples/project/update-o-auth-2-notion.md index a3cb7763..abcd6930 100644 --- a/docs/examples/project/update-o-auth-2-notion.md +++ b/docs/examples/project/update-o-auth-2-notion.md @@ -10,7 +10,7 @@ Client client = new Client() Project project = new Project(client); -OAuth2Notion result = await project.UpdateOAuth2Notion( +Appwrite.Models.OAuth2Notion result = await project.UpdateOAuth2Notion( oauthClientId: "<OAUTH_CLIENT_ID>", // optional oauthClientSecret: "<OAUTH_CLIENT_SECRET>", // optional enabled: false // optional diff --git a/docs/examples/project/update-o-auth-2-oidc.md b/docs/examples/project/update-o-auth-2-oidc.md index 5abb4932..c85099f2 100644 --- a/docs/examples/project/update-o-auth-2-oidc.md +++ b/docs/examples/project/update-o-auth-2-oidc.md @@ -11,7 +11,7 @@ Client client = new Client() Project project = new Project(client); -OAuth2Oidc result = await project.UpdateOAuth2Oidc( +Appwrite.Models.OAuth2Oidc result = await project.UpdateOAuth2Oidc( clientId: "<CLIENT_ID>", // optional clientSecret: "<CLIENT_SECRET>", // optional wellKnownURL: "https://example.com", // optional diff --git a/docs/examples/project/update-o-auth-2-okta.md b/docs/examples/project/update-o-auth-2-okta.md index fa2a1151..850b47ca 100644 --- a/docs/examples/project/update-o-auth-2-okta.md +++ b/docs/examples/project/update-o-auth-2-okta.md @@ -1,5 +1,6 @@ ```csharp using Appwrite; +using Appwrite.Enums; using Appwrite.Models; using Appwrite.Services; @@ -10,11 +11,12 @@ Client client = new Client() Project project = new Project(client); -OAuth2Okta result = await project.UpdateOAuth2Okta( +Appwrite.Models.OAuth2Okta result = await project.UpdateOAuth2Okta( clientId: "<CLIENT_ID>", // optional clientSecret: "<CLIENT_SECRET>", // optional domain: "example.com", // optional authorizationServerId: "<AUTHORIZATION_SERVER_ID>", // optional + prompt: new List<ProjectOAuth2OktaPrompt> { ProjectOAuth2OktaPrompt.None }, // optional enabled: false // optional ); diff --git a/docs/examples/project/update-o-auth-2-paypal-sandbox.md b/docs/examples/project/update-o-auth-2-paypal-sandbox.md index 1cbc8c57..3045dc4f 100644 --- a/docs/examples/project/update-o-auth-2-paypal-sandbox.md +++ b/docs/examples/project/update-o-auth-2-paypal-sandbox.md @@ -10,7 +10,7 @@ Client client = new Client() Project project = new Project(client); -OAuth2Paypal result = await project.UpdateOAuth2PaypalSandbox( +Appwrite.Models.OAuth2Paypal result = await project.UpdateOAuth2PaypalSandbox( clientId: "<CLIENT_ID>", // optional secretKey: "<SECRET_KEY>", // optional enabled: false // optional diff --git a/docs/examples/project/update-o-auth-2-paypal.md b/docs/examples/project/update-o-auth-2-paypal.md index 03fc6659..3324c712 100644 --- a/docs/examples/project/update-o-auth-2-paypal.md +++ b/docs/examples/project/update-o-auth-2-paypal.md @@ -10,7 +10,7 @@ Client client = new Client() Project project = new Project(client); -OAuth2Paypal result = await project.UpdateOAuth2Paypal( +Appwrite.Models.OAuth2Paypal result = await project.UpdateOAuth2Paypal( clientId: "<CLIENT_ID>", // optional secretKey: "<SECRET_KEY>", // optional enabled: false // optional diff --git a/docs/examples/project/update-o-auth-2-podio.md b/docs/examples/project/update-o-auth-2-podio.md index 9e8b31f6..f92d3713 100644 --- a/docs/examples/project/update-o-auth-2-podio.md +++ b/docs/examples/project/update-o-auth-2-podio.md @@ -10,7 +10,7 @@ Client client = new Client() Project project = new Project(client); -OAuth2Podio result = await project.UpdateOAuth2Podio( +Appwrite.Models.OAuth2Podio result = await project.UpdateOAuth2Podio( clientId: "<CLIENT_ID>", // optional clientSecret: "<CLIENT_SECRET>", // optional enabled: false // optional diff --git a/docs/examples/project/update-o-auth-2-resend.md b/docs/examples/project/update-o-auth-2-resend.md index 3fd79922..81fc6f0d 100644 --- a/docs/examples/project/update-o-auth-2-resend.md +++ b/docs/examples/project/update-o-auth-2-resend.md @@ -10,7 +10,7 @@ Client client = new Client() Project project = new Project(client); -OAuth2Resend result = await project.UpdateOAuth2Resend( +Appwrite.Models.OAuth2Resend result = await project.UpdateOAuth2Resend( clientId: "<CLIENT_ID>", // optional clientSecret: "<CLIENT_SECRET>", // optional enabled: false // optional diff --git a/docs/examples/project/update-o-auth-2-salesforce.md b/docs/examples/project/update-o-auth-2-salesforce.md index e4b6629c..7a1d3d9c 100644 --- a/docs/examples/project/update-o-auth-2-salesforce.md +++ b/docs/examples/project/update-o-auth-2-salesforce.md @@ -1,5 +1,6 @@ ```csharp using Appwrite; +using Appwrite.Enums; using Appwrite.Models; using Appwrite.Services; @@ -10,9 +11,10 @@ Client client = new Client() Project project = new Project(client); -OAuth2Salesforce result = await project.UpdateOAuth2Salesforce( +Appwrite.Models.OAuth2Salesforce result = await project.UpdateOAuth2Salesforce( customerKey: "<CUSTOMER_KEY>", // optional customerSecret: "<CUSTOMER_SECRET>", // optional + prompt: new List<ProjectOAuth2SalesforcePrompt> { ProjectOAuth2SalesforcePrompt.Login }, // optional enabled: false // optional ); diff --git a/docs/examples/project/update-o-auth-2-server.md b/docs/examples/project/update-o-auth-2-server.md index c43efa26..3b3c2ef8 100644 --- a/docs/examples/project/update-o-auth-2-server.md +++ b/docs/examples/project/update-o-auth-2-server.md @@ -10,7 +10,7 @@ Client client = new Client() Project project = new Project(client); -Project result = await project.UpdateOAuth2Server( +Appwrite.Models.Project result = await project.UpdateOAuth2Server( enabled: false, authorizationUrl: "https://example.com", scopes: new List<string>(), // optional diff --git a/docs/examples/project/update-o-auth-2-slack.md b/docs/examples/project/update-o-auth-2-slack.md index 1d7cc149..fc838191 100644 --- a/docs/examples/project/update-o-auth-2-slack.md +++ b/docs/examples/project/update-o-auth-2-slack.md @@ -10,7 +10,7 @@ Client client = new Client() Project project = new Project(client); -OAuth2Slack result = await project.UpdateOAuth2Slack( +Appwrite.Models.OAuth2Slack result = await project.UpdateOAuth2Slack( clientId: "<CLIENT_ID>", // optional clientSecret: "<CLIENT_SECRET>", // optional enabled: false // optional diff --git a/docs/examples/project/update-o-auth-2-spotify.md b/docs/examples/project/update-o-auth-2-spotify.md index 481634e4..d4795540 100644 --- a/docs/examples/project/update-o-auth-2-spotify.md +++ b/docs/examples/project/update-o-auth-2-spotify.md @@ -10,7 +10,7 @@ Client client = new Client() Project project = new Project(client); -OAuth2Spotify result = await project.UpdateOAuth2Spotify( +Appwrite.Models.OAuth2Spotify result = await project.UpdateOAuth2Spotify( clientId: "<CLIENT_ID>", // optional clientSecret: "<CLIENT_SECRET>", // optional enabled: false // optional diff --git a/docs/examples/project/update-o-auth-2-stripe.md b/docs/examples/project/update-o-auth-2-stripe.md index 97ce54a1..382d641e 100644 --- a/docs/examples/project/update-o-auth-2-stripe.md +++ b/docs/examples/project/update-o-auth-2-stripe.md @@ -10,7 +10,7 @@ Client client = new Client() Project project = new Project(client); -OAuth2Stripe result = await project.UpdateOAuth2Stripe( +Appwrite.Models.OAuth2Stripe result = await project.UpdateOAuth2Stripe( clientId: "<CLIENT_ID>", // optional apiSecretKey: "<API_SECRET_KEY>", // optional enabled: false // optional diff --git a/docs/examples/project/update-o-auth-2-tik-tok.md b/docs/examples/project/update-o-auth-2-tik-tok.md new file mode 100644 index 00000000..b6ac35ca --- /dev/null +++ b/docs/examples/project/update-o-auth-2-tik-tok.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +Appwrite.Models.OAuth2TikTok result = await project.UpdateOAuth2TikTok( + clientId: "<CLIENT_ID>", // optional + clientSecret: "<CLIENT_SECRET>", // optional + enabled: false // optional +); + +``` diff --git a/docs/examples/project/update-o-auth-2-tradeshift-sandbox.md b/docs/examples/project/update-o-auth-2-tradeshift-sandbox.md index 72ab7c5a..8721d213 100644 --- a/docs/examples/project/update-o-auth-2-tradeshift-sandbox.md +++ b/docs/examples/project/update-o-auth-2-tradeshift-sandbox.md @@ -10,7 +10,7 @@ Client client = new Client() Project project = new Project(client); -OAuth2Tradeshift result = await project.UpdateOAuth2TradeshiftSandbox( +Appwrite.Models.OAuth2Tradeshift result = await project.UpdateOAuth2TradeshiftSandbox( oauth2ClientId: "<OAUTH2_CLIENT_ID>", // optional oauth2ClientSecret: "<OAUTH2_CLIENT_SECRET>", // optional enabled: false // optional diff --git a/docs/examples/project/update-o-auth-2-tradeshift.md b/docs/examples/project/update-o-auth-2-tradeshift.md index 01edc689..431b0aa6 100644 --- a/docs/examples/project/update-o-auth-2-tradeshift.md +++ b/docs/examples/project/update-o-auth-2-tradeshift.md @@ -10,7 +10,7 @@ Client client = new Client() Project project = new Project(client); -OAuth2Tradeshift result = await project.UpdateOAuth2Tradeshift( +Appwrite.Models.OAuth2Tradeshift result = await project.UpdateOAuth2Tradeshift( oauth2ClientId: "<OAUTH2_CLIENT_ID>", // optional oauth2ClientSecret: "<OAUTH2_CLIENT_SECRET>", // optional enabled: false // optional diff --git a/docs/examples/project/update-o-auth-2-twitch.md b/docs/examples/project/update-o-auth-2-twitch.md index 405b7dc7..843e855c 100644 --- a/docs/examples/project/update-o-auth-2-twitch.md +++ b/docs/examples/project/update-o-auth-2-twitch.md @@ -10,7 +10,7 @@ Client client = new Client() Project project = new Project(client); -OAuth2Twitch result = await project.UpdateOAuth2Twitch( +Appwrite.Models.OAuth2Twitch result = await project.UpdateOAuth2Twitch( clientId: "<CLIENT_ID>", // optional clientSecret: "<CLIENT_SECRET>", // optional enabled: false // optional diff --git a/docs/examples/project/update-o-auth-2-webflow.md b/docs/examples/project/update-o-auth-2-webflow.md new file mode 100644 index 00000000..266322f5 --- /dev/null +++ b/docs/examples/project/update-o-auth-2-webflow.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +Appwrite.Models.OAuth2Webflow result = await project.UpdateOAuth2Webflow( + clientId: "<CLIENT_ID>", // optional + clientSecret: "<CLIENT_SECRET>", // optional + enabled: false // optional +); + +``` diff --git a/docs/examples/project/update-o-auth-2-word-press.md b/docs/examples/project/update-o-auth-2-word-press.md index 60bbdfcf..b381ebee 100644 --- a/docs/examples/project/update-o-auth-2-word-press.md +++ b/docs/examples/project/update-o-auth-2-word-press.md @@ -10,7 +10,7 @@ Client client = new Client() Project project = new Project(client); -OAuth2WordPress result = await project.UpdateOAuth2WordPress( +Appwrite.Models.OAuth2WordPress result = await project.UpdateOAuth2WordPress( clientId: "<CLIENT_ID>", // optional clientSecret: "<CLIENT_SECRET>", // optional enabled: false // optional diff --git a/docs/examples/project/update-o-auth-2-yahoo.md b/docs/examples/project/update-o-auth-2-yahoo.md index 127f9786..76bd9ff7 100644 --- a/docs/examples/project/update-o-auth-2-yahoo.md +++ b/docs/examples/project/update-o-auth-2-yahoo.md @@ -10,7 +10,7 @@ Client client = new Client() Project project = new Project(client); -OAuth2Yahoo result = await project.UpdateOAuth2Yahoo( +Appwrite.Models.OAuth2Yahoo result = await project.UpdateOAuth2Yahoo( clientId: "<CLIENT_ID>", // optional clientSecret: "<CLIENT_SECRET>", // optional enabled: false // optional diff --git a/docs/examples/project/update-o-auth-2-yandex.md b/docs/examples/project/update-o-auth-2-yandex.md index 0fcc0dc7..c9f6a488 100644 --- a/docs/examples/project/update-o-auth-2-yandex.md +++ b/docs/examples/project/update-o-auth-2-yandex.md @@ -10,7 +10,7 @@ Client client = new Client() Project project = new Project(client); -OAuth2Yandex result = await project.UpdateOAuth2Yandex( +Appwrite.Models.OAuth2Yandex result = await project.UpdateOAuth2Yandex( clientId: "<CLIENT_ID>", // optional clientSecret: "<CLIENT_SECRET>", // optional enabled: false // optional diff --git a/docs/examples/project/update-o-auth-2-zoho.md b/docs/examples/project/update-o-auth-2-zoho.md index 6347cb2b..3a822d5d 100644 --- a/docs/examples/project/update-o-auth-2-zoho.md +++ b/docs/examples/project/update-o-auth-2-zoho.md @@ -1,5 +1,6 @@ ```csharp using Appwrite; +using Appwrite.Enums; using Appwrite.Models; using Appwrite.Services; @@ -10,9 +11,10 @@ Client client = new Client() Project project = new Project(client); -OAuth2Zoho result = await project.UpdateOAuth2Zoho( +Appwrite.Models.OAuth2Zoho result = await project.UpdateOAuth2Zoho( clientId: "<CLIENT_ID>", // optional clientSecret: "<CLIENT_SECRET>", // optional + prompt: new List<ProjectOAuth2ZohoPrompt> { ProjectOAuth2ZohoPrompt.Consent }, // optional enabled: false // optional ); diff --git a/docs/examples/project/update-o-auth-2-zoom.md b/docs/examples/project/update-o-auth-2-zoom.md index 2b9d60dd..b75d71d0 100644 --- a/docs/examples/project/update-o-auth-2-zoom.md +++ b/docs/examples/project/update-o-auth-2-zoom.md @@ -10,7 +10,7 @@ Client client = new Client() Project project = new Project(client); -OAuth2Zoom result = await project.UpdateOAuth2Zoom( +Appwrite.Models.OAuth2Zoom result = await project.UpdateOAuth2Zoom( clientId: "<CLIENT_ID>", // optional clientSecret: "<CLIENT_SECRET>", // optional enabled: false // optional diff --git a/docs/examples/project/update-o-auth-2x.md b/docs/examples/project/update-o-auth-2x.md index 01bab140..e5041a94 100644 --- a/docs/examples/project/update-o-auth-2x.md +++ b/docs/examples/project/update-o-auth-2x.md @@ -10,7 +10,7 @@ Client client = new Client() Project project = new Project(client); -OAuth2X result = await project.UpdateOAuth2X( +Appwrite.Models.OAuth2X result = await project.UpdateOAuth2X( customerKey: "<CUSTOMER_KEY>", // optional secretKey: "<SECRET_KEY>", // optional enabled: false // optional diff --git a/docs/examples/project/update-passkey-policy.md b/docs/examples/project/update-passkey-policy.md new file mode 100644 index 00000000..3cebcd9d --- /dev/null +++ b/docs/examples/project/update-passkey-policy.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +Appwrite.Models.Project result = await project.UpdatePasskeyPolicy( + rpId: "<RP_ID>" +); + +``` diff --git a/docs/examples/project/update-password-dictionary-policy.md b/docs/examples/project/update-password-dictionary-policy.md index bfcf1c3d..f40df719 100644 --- a/docs/examples/project/update-password-dictionary-policy.md +++ b/docs/examples/project/update-password-dictionary-policy.md @@ -10,7 +10,7 @@ Client client = new Client() Project project = new Project(client); -Project result = await project.UpdatePasswordDictionaryPolicy( +Appwrite.Models.Project result = await project.UpdatePasswordDictionaryPolicy( enabled: false ); diff --git a/docs/examples/project/update-password-history-policy.md b/docs/examples/project/update-password-history-policy.md index 83876154..362c30c3 100644 --- a/docs/examples/project/update-password-history-policy.md +++ b/docs/examples/project/update-password-history-policy.md @@ -10,7 +10,7 @@ Client client = new Client() Project project = new Project(client); -Project result = await project.UpdatePasswordHistoryPolicy( +Appwrite.Models.Project result = await project.UpdatePasswordHistoryPolicy( total: 1 ); diff --git a/docs/examples/project/update-password-personal-data-policy.md b/docs/examples/project/update-password-personal-data-policy.md index e79919f2..79d01b5b 100644 --- a/docs/examples/project/update-password-personal-data-policy.md +++ b/docs/examples/project/update-password-personal-data-policy.md @@ -10,7 +10,7 @@ Client client = new Client() Project project = new Project(client); -Project result = await project.UpdatePasswordPersonalDataPolicy( +Appwrite.Models.Project result = await project.UpdatePasswordPersonalDataPolicy( enabled: false ); diff --git a/docs/examples/project/update-password-pwned-policy.md b/docs/examples/project/update-password-pwned-policy.md new file mode 100644 index 00000000..05a8b9be --- /dev/null +++ b/docs/examples/project/update-password-pwned-policy.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +Appwrite.Models.Project result = await project.UpdatePasswordPwnedPolicy( + enabled: false, // optional + sessions: false, // optional + users: false // optional +); + +``` diff --git a/docs/examples/project/update-password-rotation-policy.md b/docs/examples/project/update-password-rotation-policy.md new file mode 100644 index 00000000..d341a680 --- /dev/null +++ b/docs/examples/project/update-password-rotation-policy.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +Appwrite.Models.Project result = await project.UpdatePasswordRotationPolicy( + enabled: false, // optional + maxAge: 86400 // optional +); + +``` diff --git a/docs/examples/project/update-password-strength-policy.md b/docs/examples/project/update-password-strength-policy.md index 7edf3050..99639349 100644 --- a/docs/examples/project/update-password-strength-policy.md +++ b/docs/examples/project/update-password-strength-policy.md @@ -10,7 +10,7 @@ Client client = new Client() Project project = new Project(client); -PolicyPasswordStrength result = await project.UpdatePasswordStrengthPolicy( +Appwrite.Models.PolicyPasswordStrength result = await project.UpdatePasswordStrengthPolicy( min: 8, // optional uppercase: false, // optional lowercase: false, // optional diff --git a/docs/examples/project/update-protocol.md b/docs/examples/project/update-protocol.md index 9a53240a..ddb7e893 100644 --- a/docs/examples/project/update-protocol.md +++ b/docs/examples/project/update-protocol.md @@ -11,7 +11,7 @@ Client client = new Client() Project project = new Project(client); -Project result = await project.UpdateProtocol( +Appwrite.Models.Project result = await project.UpdateProtocol( protocolId: ProjectProtocolId.Rest, enabled: false ); diff --git a/docs/examples/project/update-service.md b/docs/examples/project/update-service.md index 8463028b..f8a94d34 100644 --- a/docs/examples/project/update-service.md +++ b/docs/examples/project/update-service.md @@ -11,7 +11,7 @@ Client client = new Client() Project project = new Project(client); -Project result = await project.UpdateService( +Appwrite.Models.Project result = await project.UpdateService( serviceId: ProjectServiceId.Account, enabled: false ); diff --git a/docs/examples/project/update-session-alert-policy.md b/docs/examples/project/update-session-alert-policy.md index 247fe3ce..fc5627ef 100644 --- a/docs/examples/project/update-session-alert-policy.md +++ b/docs/examples/project/update-session-alert-policy.md @@ -10,7 +10,7 @@ Client client = new Client() Project project = new Project(client); -Project result = await project.UpdateSessionAlertPolicy( +Appwrite.Models.Project result = await project.UpdateSessionAlertPolicy( enabled: false ); diff --git a/docs/examples/project/update-session-duration-policy.md b/docs/examples/project/update-session-duration-policy.md index 1c66cc20..066f964a 100644 --- a/docs/examples/project/update-session-duration-policy.md +++ b/docs/examples/project/update-session-duration-policy.md @@ -10,7 +10,7 @@ Client client = new Client() Project project = new Project(client); -Project result = await project.UpdateSessionDurationPolicy( +Appwrite.Models.Project result = await project.UpdateSessionDurationPolicy( duration: 60 ); diff --git a/docs/examples/project/update-session-invalidation-policy.md b/docs/examples/project/update-session-invalidation-policy.md index e354b471..3b32e2b3 100644 --- a/docs/examples/project/update-session-invalidation-policy.md +++ b/docs/examples/project/update-session-invalidation-policy.md @@ -10,7 +10,7 @@ Client client = new Client() Project project = new Project(client); -Project result = await project.UpdateSessionInvalidationPolicy( +Appwrite.Models.Project result = await project.UpdateSessionInvalidationPolicy( enabled: false ); diff --git a/docs/examples/project/update-session-limit-policy.md b/docs/examples/project/update-session-limit-policy.md index 11434253..0837a98c 100644 --- a/docs/examples/project/update-session-limit-policy.md +++ b/docs/examples/project/update-session-limit-policy.md @@ -10,7 +10,7 @@ Client client = new Client() Project project = new Project(client); -Project result = await project.UpdateSessionLimitPolicy( +Appwrite.Models.Project result = await project.UpdateSessionLimitPolicy( total: 1 ); diff --git a/docs/examples/project/update-smtp.md b/docs/examples/project/update-smtp.md index 4af1ceee..d7ee2caa 100644 --- a/docs/examples/project/update-smtp.md +++ b/docs/examples/project/update-smtp.md @@ -11,7 +11,7 @@ Client client = new Client() Project project = new Project(client); -Project result = await project.UpdateSMTP( +Appwrite.Models.Project result = await project.UpdateSMTP( host: "example.com", // optional port: 587, // optional username: "<USERNAME>", // optional diff --git a/docs/examples/project/update-user-limit-policy.md b/docs/examples/project/update-user-limit-policy.md index d24957e0..562ccca4 100644 --- a/docs/examples/project/update-user-limit-policy.md +++ b/docs/examples/project/update-user-limit-policy.md @@ -10,7 +10,7 @@ Client client = new Client() Project project = new Project(client); -Project result = await project.UpdateUserLimitPolicy( +Appwrite.Models.Project result = await project.UpdateUserLimitPolicy( total: 0 ); diff --git a/docs/examples/project/update-variable.md b/docs/examples/project/update-variable.md index b612ed86..d60e68d6 100644 --- a/docs/examples/project/update-variable.md +++ b/docs/examples/project/update-variable.md @@ -10,7 +10,7 @@ Client client = new Client() Project project = new Project(client); -Variable result = await project.UpdateVariable( +Appwrite.Models.Variable result = await project.UpdateVariable( variableId: "<VARIABLE_ID>", key: "<KEY>", // optional value: "<VALUE>", // optional diff --git a/docs/examples/project/update-web-platform.md b/docs/examples/project/update-web-platform.md index 3d03f26d..a9686e56 100644 --- a/docs/examples/project/update-web-platform.md +++ b/docs/examples/project/update-web-platform.md @@ -10,7 +10,7 @@ Client client = new Client() Project project = new Project(client); -PlatformWeb result = await project.UpdateWebPlatform( +Appwrite.Models.PlatformWeb result = await project.UpdateWebPlatform( platformId: "<PLATFORM_ID>", name: "<NAME>", hostname: "app.example.com" diff --git a/docs/examples/project/update-windows-platform.md b/docs/examples/project/update-windows-platform.md index 64e21998..ff519046 100644 --- a/docs/examples/project/update-windows-platform.md +++ b/docs/examples/project/update-windows-platform.md @@ -10,7 +10,7 @@ Client client = new Client() Project project = new Project(client); -PlatformWindows result = await project.UpdateWindowsPlatform( +Appwrite.Models.PlatformWindows result = await project.UpdateWindowsPlatform( platformId: "<PLATFORM_ID>", name: "<NAME>", packageIdentifierName: "<PACKAGE_IDENTIFIER_NAME>" diff --git a/docs/examples/proxy/create-api-rule.md b/docs/examples/proxy/create-api-rule.md index a5511bd3..2928db87 100644 --- a/docs/examples/proxy/create-api-rule.md +++ b/docs/examples/proxy/create-api-rule.md @@ -10,7 +10,7 @@ Client client = new Client() Proxy proxy = new Proxy(client); -ProxyRule result = await proxy.CreateAPIRule( +Appwrite.Models.ProxyRule result = await proxy.CreateAPIRule( domain: "example.com" ); diff --git a/docs/examples/proxy/create-function-rule.md b/docs/examples/proxy/create-function-rule.md index fe1fd906..fd275ba1 100644 --- a/docs/examples/proxy/create-function-rule.md +++ b/docs/examples/proxy/create-function-rule.md @@ -10,7 +10,7 @@ Client client = new Client() Proxy proxy = new Proxy(client); -ProxyRule result = await proxy.CreateFunctionRule( +Appwrite.Models.ProxyRule result = await proxy.CreateFunctionRule( domain: "example.com", functionId: "<FUNCTION_ID>", branch: "<BRANCH>" // optional diff --git a/docs/examples/proxy/create-invalidation.md b/docs/examples/proxy/create-invalidation.md index 0b51ed48..13a97223 100644 --- a/docs/examples/proxy/create-invalidation.md +++ b/docs/examples/proxy/create-invalidation.md @@ -11,7 +11,7 @@ Client client = new Client() Proxy proxy = new Proxy(client); -ProxyInvalidation result = await proxy.CreateInvalidation( +Appwrite.Models.ProxyInvalidation result = await proxy.CreateInvalidation( domain: "example.com", type: InvalidationType.Tag, reference: "<REFERENCE>" // optional diff --git a/docs/examples/proxy/create-redirect-rule.md b/docs/examples/proxy/create-redirect-rule.md index 71ffbefe..62a51ee5 100644 --- a/docs/examples/proxy/create-redirect-rule.md +++ b/docs/examples/proxy/create-redirect-rule.md @@ -11,7 +11,7 @@ Client client = new Client() Proxy proxy = new Proxy(client); -ProxyRule result = await proxy.CreateRedirectRule( +Appwrite.Models.ProxyRule result = await proxy.CreateRedirectRule( domain: "example.com", url: "https://example.com", statusCode: StatusCode.MovedPermanently, diff --git a/docs/examples/proxy/create-site-rule.md b/docs/examples/proxy/create-site-rule.md index 52b6b60e..6d8bb07b 100644 --- a/docs/examples/proxy/create-site-rule.md +++ b/docs/examples/proxy/create-site-rule.md @@ -10,7 +10,7 @@ Client client = new Client() Proxy proxy = new Proxy(client); -ProxyRule result = await proxy.CreateSiteRule( +Appwrite.Models.ProxyRule result = await proxy.CreateSiteRule( domain: "example.com", siteId: "<SITE_ID>", branch: "<BRANCH>" // optional diff --git a/docs/examples/proxy/get-rule.md b/docs/examples/proxy/get-rule.md index 6834db74..80e8aef5 100644 --- a/docs/examples/proxy/get-rule.md +++ b/docs/examples/proxy/get-rule.md @@ -10,7 +10,7 @@ Client client = new Client() Proxy proxy = new Proxy(client); -ProxyRule result = await proxy.GetRule( +Appwrite.Models.ProxyRule result = await proxy.GetRule( ruleId: "<RULE_ID>" ); diff --git a/docs/examples/proxy/list-rules.md b/docs/examples/proxy/list-rules.md index 4a962d30..da132346 100644 --- a/docs/examples/proxy/list-rules.md +++ b/docs/examples/proxy/list-rules.md @@ -10,7 +10,7 @@ Client client = new Client() Proxy proxy = new Proxy(client); -ProxyRuleList result = await proxy.ListRules( +Appwrite.Models.ProxyRuleList result = await proxy.ListRules( queries: new List<string>(), // optional total: false // optional ); diff --git a/docs/examples/proxy/update-rule-status.md b/docs/examples/proxy/update-rule-status.md index da3efe37..18df5507 100644 --- a/docs/examples/proxy/update-rule-status.md +++ b/docs/examples/proxy/update-rule-status.md @@ -10,7 +10,7 @@ Client client = new Client() Proxy proxy = new Proxy(client); -ProxyRule result = await proxy.UpdateRuleStatus( +Appwrite.Models.ProxyRule result = await proxy.UpdateRuleStatus( ruleId: "<RULE_ID>" ); diff --git a/docs/examples/sites/create-deployment.md b/docs/examples/sites/create-deployment.md index 61b56268..32fe01ea 100644 --- a/docs/examples/sites/create-deployment.md +++ b/docs/examples/sites/create-deployment.md @@ -10,7 +10,7 @@ Client client = new Client() Sites sites = new Sites(client); -Deployment result = await sites.CreateDeployment( +Appwrite.Models.Deployment result = await sites.CreateDeployment( siteId: "<SITE_ID>", code: InputFile.FromPath("./path-to-files/image.jpg"), installCommand: "<INSTALL_COMMAND>", // optional diff --git a/docs/examples/sites/create-duplicate-deployment.md b/docs/examples/sites/create-duplicate-deployment.md index 22c70c1d..43fd2567 100644 --- a/docs/examples/sites/create-duplicate-deployment.md +++ b/docs/examples/sites/create-duplicate-deployment.md @@ -10,7 +10,7 @@ Client client = new Client() Sites sites = new Sites(client); -Deployment result = await sites.CreateDuplicateDeployment( +Appwrite.Models.Deployment result = await sites.CreateDuplicateDeployment( siteId: "<SITE_ID>", deploymentId: "<DEPLOYMENT_ID>" ); diff --git a/docs/examples/sites/create-template-deployment.md b/docs/examples/sites/create-template-deployment.md index 769fcc1c..06d42400 100644 --- a/docs/examples/sites/create-template-deployment.md +++ b/docs/examples/sites/create-template-deployment.md @@ -11,7 +11,7 @@ Client client = new Client() Sites sites = new Sites(client); -Deployment result = await sites.CreateTemplateDeployment( +Appwrite.Models.Deployment result = await sites.CreateTemplateDeployment( siteId: "<SITE_ID>", repository: "<REPOSITORY>", owner: "<OWNER>", diff --git a/docs/examples/sites/create-variable.md b/docs/examples/sites/create-variable.md index 9e9d1ef7..d84e2490 100644 --- a/docs/examples/sites/create-variable.md +++ b/docs/examples/sites/create-variable.md @@ -10,7 +10,7 @@ Client client = new Client() Sites sites = new Sites(client); -Variable result = await sites.CreateVariable( +Appwrite.Models.Variable result = await sites.CreateVariable( siteId: "<SITE_ID>", variableId: "<VARIABLE_ID>", key: "<KEY>", diff --git a/docs/examples/sites/create-vcs-deployment.md b/docs/examples/sites/create-vcs-deployment.md index 42ec3756..206fd72e 100644 --- a/docs/examples/sites/create-vcs-deployment.md +++ b/docs/examples/sites/create-vcs-deployment.md @@ -11,7 +11,7 @@ Client client = new Client() Sites sites = new Sites(client); -Deployment result = await sites.CreateVcsDeployment( +Appwrite.Models.Deployment result = await sites.CreateVcsDeployment( siteId: "<SITE_ID>", type: VCSReferenceType.Branch, reference: "<REFERENCE>", diff --git a/docs/examples/sites/create.md b/docs/examples/sites/create.md index 9b2d5b52..1d6c1239 100644 --- a/docs/examples/sites/create.md +++ b/docs/examples/sites/create.md @@ -11,7 +11,7 @@ Client client = new Client() Sites sites = new Sites(client); -Site result = await sites.Create( +Appwrite.Models.Site result = await sites.Create( siteId: "<SITE_ID>", name: "<NAME>", framework: Framework.Analog, diff --git a/docs/examples/sites/get-deployment.md b/docs/examples/sites/get-deployment.md index dfd86dfc..9ada2908 100644 --- a/docs/examples/sites/get-deployment.md +++ b/docs/examples/sites/get-deployment.md @@ -10,7 +10,7 @@ Client client = new Client() Sites sites = new Sites(client); -Deployment result = await sites.GetDeployment( +Appwrite.Models.Deployment result = await sites.GetDeployment( siteId: "<SITE_ID>", deploymentId: "<DEPLOYMENT_ID>" ); diff --git a/docs/examples/sites/get-log.md b/docs/examples/sites/get-log.md index caa38be7..daebb52b 100644 --- a/docs/examples/sites/get-log.md +++ b/docs/examples/sites/get-log.md @@ -10,7 +10,7 @@ Client client = new Client() Sites sites = new Sites(client); -Execution result = await sites.GetLog( +Appwrite.Models.Execution result = await sites.GetLog( siteId: "<SITE_ID>", logId: "<LOG_ID>" ); diff --git a/docs/examples/sites/get-variable.md b/docs/examples/sites/get-variable.md index 9a68b661..604c519b 100644 --- a/docs/examples/sites/get-variable.md +++ b/docs/examples/sites/get-variable.md @@ -10,7 +10,7 @@ Client client = new Client() Sites sites = new Sites(client); -Variable result = await sites.GetVariable( +Appwrite.Models.Variable result = await sites.GetVariable( siteId: "<SITE_ID>", variableId: "<VARIABLE_ID>" ); diff --git a/docs/examples/sites/get.md b/docs/examples/sites/get.md index 7c1885cb..e971b90d 100644 --- a/docs/examples/sites/get.md +++ b/docs/examples/sites/get.md @@ -10,7 +10,7 @@ Client client = new Client() Sites sites = new Sites(client); -Site result = await sites.Get( +Appwrite.Models.Site result = await sites.Get( siteId: "<SITE_ID>" ); diff --git a/docs/examples/sites/list-deployments.md b/docs/examples/sites/list-deployments.md index b25172e2..73733362 100644 --- a/docs/examples/sites/list-deployments.md +++ b/docs/examples/sites/list-deployments.md @@ -10,7 +10,7 @@ Client client = new Client() Sites sites = new Sites(client); -DeploymentList result = await sites.ListDeployments( +Appwrite.Models.DeploymentList result = await sites.ListDeployments( siteId: "<SITE_ID>", queries: new List<string>(), // optional search: "<SEARCH>", // optional diff --git a/docs/examples/sites/list-frameworks.md b/docs/examples/sites/list-frameworks.md index 7a3165f9..80859048 100644 --- a/docs/examples/sites/list-frameworks.md +++ b/docs/examples/sites/list-frameworks.md @@ -10,7 +10,8 @@ Client client = new Client() Sites sites = new Sites(client); -FrameworkList result = await sites.ListFrameworks(); - +Appwrite.Models.FrameworkList result = await sites.ListFrameworks( + total: false // optional +); ``` diff --git a/docs/examples/sites/list-logs.md b/docs/examples/sites/list-logs.md index baee6c91..063de9a8 100644 --- a/docs/examples/sites/list-logs.md +++ b/docs/examples/sites/list-logs.md @@ -10,7 +10,7 @@ Client client = new Client() Sites sites = new Sites(client); -ExecutionList result = await sites.ListLogs( +Appwrite.Models.ExecutionList result = await sites.ListLogs( siteId: "<SITE_ID>", queries: new List<string>(), // optional total: false // optional diff --git a/docs/examples/sites/list-specifications.md b/docs/examples/sites/list-specifications.md index 12d18408..745077ed 100644 --- a/docs/examples/sites/list-specifications.md +++ b/docs/examples/sites/list-specifications.md @@ -10,8 +10,9 @@ Client client = new Client() Sites sites = new Sites(client); -SpecificationList result = await sites.ListSpecifications( - type: "runtimes" // optional +Appwrite.Models.SpecificationList result = await sites.ListSpecifications( + type: "runtimes", // optional + total: false // optional ); ``` diff --git a/docs/examples/sites/list-variables.md b/docs/examples/sites/list-variables.md index 8f546817..55aa3a3c 100644 --- a/docs/examples/sites/list-variables.md +++ b/docs/examples/sites/list-variables.md @@ -10,7 +10,7 @@ Client client = new Client() Sites sites = new Sites(client); -VariableList result = await sites.ListVariables( +Appwrite.Models.VariableList result = await sites.ListVariables( siteId: "<SITE_ID>", queries: new List<string>(), // optional total: false // optional diff --git a/docs/examples/sites/list.md b/docs/examples/sites/list.md index 27c4f659..2bf65b27 100644 --- a/docs/examples/sites/list.md +++ b/docs/examples/sites/list.md @@ -10,7 +10,7 @@ Client client = new Client() Sites sites = new Sites(client); -SiteList result = await sites.List( +Appwrite.Models.SiteList result = await sites.List( queries: new List<string>(), // optional search: "<SEARCH>", // optional total: false // optional diff --git a/docs/examples/sites/update-deployment-status.md b/docs/examples/sites/update-deployment-status.md index 0a6bf240..c4269a93 100644 --- a/docs/examples/sites/update-deployment-status.md +++ b/docs/examples/sites/update-deployment-status.md @@ -10,7 +10,7 @@ Client client = new Client() Sites sites = new Sites(client); -Deployment result = await sites.UpdateDeploymentStatus( +Appwrite.Models.Deployment result = await sites.UpdateDeploymentStatus( siteId: "<SITE_ID>", deploymentId: "<DEPLOYMENT_ID>" ); diff --git a/docs/examples/sites/update-site-deployment.md b/docs/examples/sites/update-site-deployment.md index 8633ab7e..cf3f1a1e 100644 --- a/docs/examples/sites/update-site-deployment.md +++ b/docs/examples/sites/update-site-deployment.md @@ -10,7 +10,7 @@ Client client = new Client() Sites sites = new Sites(client); -Site result = await sites.UpdateSiteDeployment( +Appwrite.Models.Site result = await sites.UpdateSiteDeployment( siteId: "<SITE_ID>", deploymentId: "<DEPLOYMENT_ID>" ); diff --git a/docs/examples/sites/update-variable.md b/docs/examples/sites/update-variable.md index e7236cef..7abe9298 100644 --- a/docs/examples/sites/update-variable.md +++ b/docs/examples/sites/update-variable.md @@ -10,7 +10,7 @@ Client client = new Client() Sites sites = new Sites(client); -Variable result = await sites.UpdateVariable( +Appwrite.Models.Variable result = await sites.UpdateVariable( siteId: "<SITE_ID>", variableId: "<VARIABLE_ID>", key: "<KEY>", // optional diff --git a/docs/examples/sites/update.md b/docs/examples/sites/update.md index 8c812841..e258d383 100644 --- a/docs/examples/sites/update.md +++ b/docs/examples/sites/update.md @@ -11,7 +11,7 @@ Client client = new Client() Sites sites = new Sites(client); -Site result = await sites.Update( +Appwrite.Models.Site result = await sites.Update( siteId: "<SITE_ID>", name: "<NAME>", framework: Framework.Analog, diff --git a/docs/examples/storage/create-bucket.md b/docs/examples/storage/create-bucket.md index bdbd46a9..6fc744e0 100644 --- a/docs/examples/storage/create-bucket.md +++ b/docs/examples/storage/create-bucket.md @@ -11,7 +11,7 @@ Client client = new Client() Storage storage = new Storage(client); -Bucket result = await storage.CreateBucket( +Appwrite.Models.Bucket result = await storage.CreateBucket( bucketId: "<BUCKET_ID>", name: "<NAME>", permissions: new List<string> { Permission.Read(Role.Any()) }, // optional diff --git a/docs/examples/storage/create-file.md b/docs/examples/storage/create-file.md index 32cbd1d3..98fcc9df 100644 --- a/docs/examples/storage/create-file.md +++ b/docs/examples/storage/create-file.md @@ -10,7 +10,7 @@ Client client = new Client() Storage storage = new Storage(client); -File result = await storage.CreateFile( +Appwrite.Models.File result = await storage.CreateFile( bucketId: "<BUCKET_ID>", fileId: "<FILE_ID>", file: InputFile.FromPath("./path-to-files/image.jpg"), diff --git a/docs/examples/storage/get-bucket.md b/docs/examples/storage/get-bucket.md index 8c1edda2..5f39e48b 100644 --- a/docs/examples/storage/get-bucket.md +++ b/docs/examples/storage/get-bucket.md @@ -10,7 +10,7 @@ Client client = new Client() Storage storage = new Storage(client); -Bucket result = await storage.GetBucket( +Appwrite.Models.Bucket result = await storage.GetBucket( bucketId: "<BUCKET_ID>" ); diff --git a/docs/examples/storage/get-file-preview.md b/docs/examples/storage/get-file-preview.md index 0f8ae58d..cf266719 100644 --- a/docs/examples/storage/get-file-preview.md +++ b/docs/examples/storage/get-file-preview.md @@ -16,7 +16,7 @@ byte[] result = await storage.GetFilePreview( fileId: "<FILE_ID>", width: 0, // optional height: 0, // optional - gravity: ImageGravity.Center, // optional + gravity: ImageGravity.Auto, // optional quality: -1, // optional borderWidth: 0, // optional borderColor: "FFFFFF", // optional diff --git a/docs/examples/storage/get-file.md b/docs/examples/storage/get-file.md index 925a7b5d..a975539a 100644 --- a/docs/examples/storage/get-file.md +++ b/docs/examples/storage/get-file.md @@ -10,7 +10,7 @@ Client client = new Client() Storage storage = new Storage(client); -File result = await storage.GetFile( +Appwrite.Models.File result = await storage.GetFile( bucketId: "<BUCKET_ID>", fileId: "<FILE_ID>" ); diff --git a/docs/examples/storage/list-buckets.md b/docs/examples/storage/list-buckets.md index df214567..ad1067d6 100644 --- a/docs/examples/storage/list-buckets.md +++ b/docs/examples/storage/list-buckets.md @@ -10,7 +10,7 @@ Client client = new Client() Storage storage = new Storage(client); -BucketList result = await storage.ListBuckets( +Appwrite.Models.BucketList result = await storage.ListBuckets( queries: new List<string>(), // optional search: "<SEARCH>", // optional total: false // optional diff --git a/docs/examples/storage/list-files.md b/docs/examples/storage/list-files.md index 756aeb9f..995a6a31 100644 --- a/docs/examples/storage/list-files.md +++ b/docs/examples/storage/list-files.md @@ -10,7 +10,7 @@ Client client = new Client() Storage storage = new Storage(client); -FileList result = await storage.ListFiles( +Appwrite.Models.FileList result = await storage.ListFiles( bucketId: "<BUCKET_ID>", queries: new List<string>(), // optional search: "<SEARCH>", // optional diff --git a/docs/examples/storage/update-bucket.md b/docs/examples/storage/update-bucket.md index 6e31cb35..043ff893 100644 --- a/docs/examples/storage/update-bucket.md +++ b/docs/examples/storage/update-bucket.md @@ -11,7 +11,7 @@ Client client = new Client() Storage storage = new Storage(client); -Bucket result = await storage.UpdateBucket( +Appwrite.Models.Bucket result = await storage.UpdateBucket( bucketId: "<BUCKET_ID>", name: "<NAME>", permissions: new List<string> { Permission.Read(Role.Any()) }, // optional diff --git a/docs/examples/storage/update-file.md b/docs/examples/storage/update-file.md index a2b7013c..cab60ebd 100644 --- a/docs/examples/storage/update-file.md +++ b/docs/examples/storage/update-file.md @@ -10,7 +10,7 @@ Client client = new Client() Storage storage = new Storage(client); -File result = await storage.UpdateFile( +Appwrite.Models.File result = await storage.UpdateFile( bucketId: "<BUCKET_ID>", fileId: "<FILE_ID>", name: "<NAME>", // optional diff --git a/docs/examples/tablesdb/create-big-int-column.md b/docs/examples/tablesdb/create-big-int-column.md index 9849dc44..54edf9b5 100644 --- a/docs/examples/tablesdb/create-big-int-column.md +++ b/docs/examples/tablesdb/create-big-int-column.md @@ -10,7 +10,7 @@ Client client = new Client() TablesDB tablesDB = new TablesDB(client); -ColumnBigint result = await tablesDB.CreateBigIntColumn( +Appwrite.Models.ColumnBigint result = await tablesDB.CreateBigIntColumn( databaseId: "<DATABASE_ID>", tableId: "<TABLE_ID>", key: "<KEY>", diff --git a/docs/examples/tablesdb/create-boolean-column.md b/docs/examples/tablesdb/create-boolean-column.md index d4d17767..7e21e27d 100644 --- a/docs/examples/tablesdb/create-boolean-column.md +++ b/docs/examples/tablesdb/create-boolean-column.md @@ -10,7 +10,7 @@ Client client = new Client() TablesDB tablesDB = new TablesDB(client); -ColumnBoolean result = await tablesDB.CreateBooleanColumn( +Appwrite.Models.ColumnBoolean result = await tablesDB.CreateBooleanColumn( databaseId: "<DATABASE_ID>", tableId: "<TABLE_ID>", key: "<KEY>", diff --git a/docs/examples/tablesdb/create-cutover.md b/docs/examples/tablesdb/create-cutover.md index 522ed948..5bed5adb 100644 --- a/docs/examples/tablesdb/create-cutover.md +++ b/docs/examples/tablesdb/create-cutover.md @@ -10,7 +10,7 @@ Client client = new Client() TablesDB tablesDB = new TablesDB(client); -DatabaseMigration result = await tablesDB.CreateCutover( +Appwrite.Models.DatabaseMigration result = await tablesDB.CreateCutover( databaseId: "<DATABASE_ID>", migrationId: "<MIGRATION_ID>" ); diff --git a/docs/examples/tablesdb/create-datetime-column.md b/docs/examples/tablesdb/create-datetime-column.md index 0739c6cf..0f80c7eb 100644 --- a/docs/examples/tablesdb/create-datetime-column.md +++ b/docs/examples/tablesdb/create-datetime-column.md @@ -10,7 +10,7 @@ Client client = new Client() TablesDB tablesDB = new TablesDB(client); -ColumnDatetime result = await tablesDB.CreateDatetimeColumn( +Appwrite.Models.ColumnDatetime result = await tablesDB.CreateDatetimeColumn( databaseId: "<DATABASE_ID>", tableId: "<TABLE_ID>", key: "<KEY>", diff --git a/docs/examples/tablesdb/create-email-column.md b/docs/examples/tablesdb/create-email-column.md index b5879ca4..e786773e 100644 --- a/docs/examples/tablesdb/create-email-column.md +++ b/docs/examples/tablesdb/create-email-column.md @@ -10,7 +10,7 @@ Client client = new Client() TablesDB tablesDB = new TablesDB(client); -ColumnEmail result = await tablesDB.CreateEmailColumn( +Appwrite.Models.ColumnEmail result = await tablesDB.CreateEmailColumn( databaseId: "<DATABASE_ID>", tableId: "<TABLE_ID>", key: "<KEY>", diff --git a/docs/examples/tablesdb/create-enum-column.md b/docs/examples/tablesdb/create-enum-column.md index 7a855e5d..b9e7c827 100644 --- a/docs/examples/tablesdb/create-enum-column.md +++ b/docs/examples/tablesdb/create-enum-column.md @@ -10,7 +10,7 @@ Client client = new Client() TablesDB tablesDB = new TablesDB(client); -ColumnEnum result = await tablesDB.CreateEnumColumn( +Appwrite.Models.ColumnEnum result = await tablesDB.CreateEnumColumn( databaseId: "<DATABASE_ID>", tableId: "<TABLE_ID>", key: "<KEY>", diff --git a/docs/examples/tablesdb/create-failover.md b/docs/examples/tablesdb/create-failover.md index 8eee23f4..6b826227 100644 --- a/docs/examples/tablesdb/create-failover.md +++ b/docs/examples/tablesdb/create-failover.md @@ -10,7 +10,7 @@ Client client = new Client() TablesDB tablesDB = new TablesDB(client); -DedicatedDatabase result = await tablesDB.CreateFailover( +Appwrite.Models.DedicatedDatabase result = await tablesDB.CreateFailover( databaseId: "<DATABASE_ID>", targetReplicaId: "<TARGET_REPLICA_ID>" // optional ); diff --git a/docs/examples/tablesdb/create-float-column.md b/docs/examples/tablesdb/create-float-column.md index 8d7293a5..fd75c984 100644 --- a/docs/examples/tablesdb/create-float-column.md +++ b/docs/examples/tablesdb/create-float-column.md @@ -10,7 +10,7 @@ Client client = new Client() TablesDB tablesDB = new TablesDB(client); -ColumnFloat result = await tablesDB.CreateFloatColumn( +Appwrite.Models.ColumnFloat result = await tablesDB.CreateFloatColumn( databaseId: "<DATABASE_ID>", tableId: "<TABLE_ID>", key: "<KEY>", diff --git a/docs/examples/tablesdb/create-index.md b/docs/examples/tablesdb/create-index.md index df5d61e3..569a8bea 100644 --- a/docs/examples/tablesdb/create-index.md +++ b/docs/examples/tablesdb/create-index.md @@ -11,12 +11,12 @@ Client client = new Client() TablesDB tablesDB = new TablesDB(client); -ColumnIndex result = await tablesDB.CreateIndex( +Appwrite.Models.ColumnIndex result = await tablesDB.CreateIndex( databaseId: "<DATABASE_ID>", tableId: "<TABLE_ID>", key: "<KEY>", type: TablesDBIndexType.Key, - columns: new List<string>(), + columns: ["username"], orders: new List<OrderBy> { OrderBy.Asc }, // optional lengths: new List<long>() // optional ); diff --git a/docs/examples/tablesdb/create-integer-column.md b/docs/examples/tablesdb/create-integer-column.md index 60ecc4c1..7f501803 100644 --- a/docs/examples/tablesdb/create-integer-column.md +++ b/docs/examples/tablesdb/create-integer-column.md @@ -10,7 +10,7 @@ Client client = new Client() TablesDB tablesDB = new TablesDB(client); -ColumnInteger result = await tablesDB.CreateIntegerColumn( +Appwrite.Models.ColumnInteger result = await tablesDB.CreateIntegerColumn( databaseId: "<DATABASE_ID>", tableId: "<TABLE_ID>", key: "<KEY>", diff --git a/docs/examples/tablesdb/create-ip-column.md b/docs/examples/tablesdb/create-ip-column.md index dea6f8a0..1488a771 100644 --- a/docs/examples/tablesdb/create-ip-column.md +++ b/docs/examples/tablesdb/create-ip-column.md @@ -10,7 +10,7 @@ Client client = new Client() TablesDB tablesDB = new TablesDB(client); -ColumnIp result = await tablesDB.CreateIpColumn( +Appwrite.Models.ColumnIp result = await tablesDB.CreateIpColumn( databaseId: "<DATABASE_ID>", tableId: "<TABLE_ID>", key: "<KEY>", diff --git a/docs/examples/tablesdb/create-line-column.md b/docs/examples/tablesdb/create-line-column.md index 3f7ae338..9262eeaf 100644 --- a/docs/examples/tablesdb/create-line-column.md +++ b/docs/examples/tablesdb/create-line-column.md @@ -10,7 +10,7 @@ Client client = new Client() TablesDB tablesDB = new TablesDB(client); -ColumnLine result = await tablesDB.CreateLineColumn( +Appwrite.Models.ColumnLine result = await tablesDB.CreateLineColumn( databaseId: "<DATABASE_ID>", tableId: "<TABLE_ID>", key: "<KEY>", diff --git a/docs/examples/tablesdb/create-longtext-column.md b/docs/examples/tablesdb/create-longtext-column.md index 7f63f462..a009fbeb 100644 --- a/docs/examples/tablesdb/create-longtext-column.md +++ b/docs/examples/tablesdb/create-longtext-column.md @@ -10,7 +10,7 @@ Client client = new Client() TablesDB tablesDB = new TablesDB(client); -ColumnLongtext result = await tablesDB.CreateLongtextColumn( +Appwrite.Models.ColumnLongtext result = await tablesDB.CreateLongtextColumn( databaseId: "<DATABASE_ID>", tableId: "<TABLE_ID>", key: "<KEY>", diff --git a/docs/examples/tablesdb/create-mediumtext-column.md b/docs/examples/tablesdb/create-mediumtext-column.md index f834cf24..2dc5454e 100644 --- a/docs/examples/tablesdb/create-mediumtext-column.md +++ b/docs/examples/tablesdb/create-mediumtext-column.md @@ -10,7 +10,7 @@ Client client = new Client() TablesDB tablesDB = new TablesDB(client); -ColumnMediumtext result = await tablesDB.CreateMediumtextColumn( +Appwrite.Models.ColumnMediumtext result = await tablesDB.CreateMediumtextColumn( databaseId: "<DATABASE_ID>", tableId: "<TABLE_ID>", key: "<KEY>", diff --git a/docs/examples/tablesdb/create-migration.md b/docs/examples/tablesdb/create-migration.md index 863f223c..3e3c4eb1 100644 --- a/docs/examples/tablesdb/create-migration.md +++ b/docs/examples/tablesdb/create-migration.md @@ -10,7 +10,7 @@ Client client = new Client() TablesDB tablesDB = new TablesDB(client); -DatabaseMigration result = await tablesDB.CreateMigration( +Appwrite.Models.DatabaseMigration result = await tablesDB.CreateMigration( databaseId: "<DATABASE_ID>", specification: "s-1vcpu-1gb", autoCutover: false // optional diff --git a/docs/examples/tablesdb/create-operations.md b/docs/examples/tablesdb/create-operations.md index e7e92df1..41c04dc6 100644 --- a/docs/examples/tablesdb/create-operations.md +++ b/docs/examples/tablesdb/create-operations.md @@ -10,7 +10,7 @@ Client client = new Client() TablesDB tablesDB = new TablesDB(client); -Transaction result = await tablesDB.CreateOperations( +Appwrite.Models.Transaction result = await tablesDB.CreateOperations( transactionId: "<TRANSACTION_ID>", operations: [ { diff --git a/docs/examples/tablesdb/create-point-column.md b/docs/examples/tablesdb/create-point-column.md index aa787a48..c27586cb 100644 --- a/docs/examples/tablesdb/create-point-column.md +++ b/docs/examples/tablesdb/create-point-column.md @@ -10,7 +10,7 @@ Client client = new Client() TablesDB tablesDB = new TablesDB(client); -ColumnPoint result = await tablesDB.CreatePointColumn( +Appwrite.Models.ColumnPoint result = await tablesDB.CreatePointColumn( databaseId: "<DATABASE_ID>", tableId: "<TABLE_ID>", key: "<KEY>", diff --git a/docs/examples/tablesdb/create-polygon-column.md b/docs/examples/tablesdb/create-polygon-column.md index c667492f..6b4ac04d 100644 --- a/docs/examples/tablesdb/create-polygon-column.md +++ b/docs/examples/tablesdb/create-polygon-column.md @@ -10,7 +10,7 @@ Client client = new Client() TablesDB tablesDB = new TablesDB(client); -ColumnPolygon result = await tablesDB.CreatePolygonColumn( +Appwrite.Models.ColumnPolygon result = await tablesDB.CreatePolygonColumn( databaseId: "<DATABASE_ID>", tableId: "<TABLE_ID>", key: "<KEY>", diff --git a/docs/examples/tablesdb/create-relationship-column.md b/docs/examples/tablesdb/create-relationship-column.md index 2ad3e365..bfeb4f4f 100644 --- a/docs/examples/tablesdb/create-relationship-column.md +++ b/docs/examples/tablesdb/create-relationship-column.md @@ -11,7 +11,7 @@ Client client = new Client() TablesDB tablesDB = new TablesDB(client); -ColumnRelationship result = await tablesDB.CreateRelationshipColumn( +Appwrite.Models.ColumnRelationship result = await tablesDB.CreateRelationshipColumn( databaseId: "<DATABASE_ID>", tableId: "<TABLE_ID>", relatedTableId: "<RELATED_TABLE_ID>", diff --git a/docs/examples/tablesdb/create-row.md b/docs/examples/tablesdb/create-row.md index 05cbe3ce..353c92be 100644 --- a/docs/examples/tablesdb/create-row.md +++ b/docs/examples/tablesdb/create-row.md @@ -10,7 +10,7 @@ Client client = new Client() TablesDB tablesDB = new TablesDB(client); -Row result = await tablesDB.CreateRow( +Appwrite.Models.Row result = await tablesDB.CreateRow( databaseId: "<DATABASE_ID>", tableId: "<TABLE_ID>", rowId: "<ROW_ID>", diff --git a/docs/examples/tablesdb/create-rows.md b/docs/examples/tablesdb/create-rows.md index 868c515a..f1fd9731 100644 --- a/docs/examples/tablesdb/create-rows.md +++ b/docs/examples/tablesdb/create-rows.md @@ -10,10 +10,19 @@ Client client = new Client() TablesDB tablesDB = new TablesDB(client); -RowList result = await tablesDB.CreateRows( +Appwrite.Models.RowList result = await tablesDB.CreateRows( databaseId: "<DATABASE_ID>", tableId: "<TABLE_ID>", - rows: new List<object>(), + rows: [ + { + "$id": "example1", + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 30, + "isAdmin": false + } + ], transactionId: "<TRANSACTION_ID>" // optional ); diff --git a/docs/examples/tablesdb/create-string-column.md b/docs/examples/tablesdb/create-string-column.md index 70d55283..8b98954b 100644 --- a/docs/examples/tablesdb/create-string-column.md +++ b/docs/examples/tablesdb/create-string-column.md @@ -10,7 +10,7 @@ Client client = new Client() TablesDB tablesDB = new TablesDB(client); -ColumnString result = await tablesDB.CreateStringColumn( +Appwrite.Models.ColumnString result = await tablesDB.CreateStringColumn( databaseId: "<DATABASE_ID>", tableId: "<TABLE_ID>", key: "<KEY>", diff --git a/docs/examples/tablesdb/create-table.md b/docs/examples/tablesdb/create-table.md index f7781fc7..3657fc34 100644 --- a/docs/examples/tablesdb/create-table.md +++ b/docs/examples/tablesdb/create-table.md @@ -10,7 +10,7 @@ Client client = new Client() TablesDB tablesDB = new TablesDB(client); -Table result = await tablesDB.CreateTable( +Appwrite.Models.Table result = await tablesDB.CreateTable( databaseId: "<DATABASE_ID>", tableId: "<TABLE_ID>", name: "<NAME>", diff --git a/docs/examples/tablesdb/create-text-column.md b/docs/examples/tablesdb/create-text-column.md index ae046a6a..860bbd40 100644 --- a/docs/examples/tablesdb/create-text-column.md +++ b/docs/examples/tablesdb/create-text-column.md @@ -10,7 +10,7 @@ Client client = new Client() TablesDB tablesDB = new TablesDB(client); -ColumnText result = await tablesDB.CreateTextColumn( +Appwrite.Models.ColumnText result = await tablesDB.CreateTextColumn( databaseId: "<DATABASE_ID>", tableId: "<TABLE_ID>", key: "<KEY>", diff --git a/docs/examples/tablesdb/create-transaction.md b/docs/examples/tablesdb/create-transaction.md index cc3845f0..9d890fbf 100644 --- a/docs/examples/tablesdb/create-transaction.md +++ b/docs/examples/tablesdb/create-transaction.md @@ -10,7 +10,7 @@ Client client = new Client() TablesDB tablesDB = new TablesDB(client); -Transaction result = await tablesDB.CreateTransaction( +Appwrite.Models.Transaction result = await tablesDB.CreateTransaction( ttl: 60 // optional ); diff --git a/docs/examples/tablesdb/create-url-column.md b/docs/examples/tablesdb/create-url-column.md index de79303f..1ad8c149 100644 --- a/docs/examples/tablesdb/create-url-column.md +++ b/docs/examples/tablesdb/create-url-column.md @@ -10,7 +10,7 @@ Client client = new Client() TablesDB tablesDB = new TablesDB(client); -ColumnUrl result = await tablesDB.CreateUrlColumn( +Appwrite.Models.ColumnUrl result = await tablesDB.CreateUrlColumn( databaseId: "<DATABASE_ID>", tableId: "<TABLE_ID>", key: "<KEY>", diff --git a/docs/examples/tablesdb/create-varchar-column.md b/docs/examples/tablesdb/create-varchar-column.md index 507c8dd4..d6d9e2d8 100644 --- a/docs/examples/tablesdb/create-varchar-column.md +++ b/docs/examples/tablesdb/create-varchar-column.md @@ -10,7 +10,7 @@ Client client = new Client() TablesDB tablesDB = new TablesDB(client); -ColumnVarchar result = await tablesDB.CreateVarcharColumn( +Appwrite.Models.ColumnVarchar result = await tablesDB.CreateVarcharColumn( databaseId: "<DATABASE_ID>", tableId: "<TABLE_ID>", key: "<KEY>", diff --git a/docs/examples/tablesdb/create.md b/docs/examples/tablesdb/create.md index 8175c0eb..79232878 100644 --- a/docs/examples/tablesdb/create.md +++ b/docs/examples/tablesdb/create.md @@ -10,7 +10,7 @@ Client client = new Client() TablesDB tablesDB = new TablesDB(client); -Database result = await tablesDB.Create( +Appwrite.Models.Database result = await tablesDB.Create( databaseId: "<DATABASE_ID>", name: "<NAME>", enabled: false, // optional diff --git a/docs/examples/tablesdb/decrement-row-column.md b/docs/examples/tablesdb/decrement-row-column.md index c7a97020..92319dbb 100644 --- a/docs/examples/tablesdb/decrement-row-column.md +++ b/docs/examples/tablesdb/decrement-row-column.md @@ -10,7 +10,7 @@ Client client = new Client() TablesDB tablesDB = new TablesDB(client); -Row result = await tablesDB.DecrementRowColumn( +Appwrite.Models.Row result = await tablesDB.DecrementRowColumn( databaseId: "<DATABASE_ID>", tableId: "<TABLE_ID>", rowId: "<ROW_ID>", diff --git a/docs/examples/tablesdb/delete-rows.md b/docs/examples/tablesdb/delete-rows.md index 1cfdfe72..428c5c48 100644 --- a/docs/examples/tablesdb/delete-rows.md +++ b/docs/examples/tablesdb/delete-rows.md @@ -13,7 +13,7 @@ TablesDB tablesDB = new TablesDB(client); await tablesDB.DeleteRows( databaseId: "<DATABASE_ID>", tableId: "<TABLE_ID>", - queries: new List<string>(), // optional + queries: ["{\"method\":\"equal\", \"attribute\":\"$id\", \"values\":[\"<ROW_ID>\"]}"], // optional transactionId: "<TRANSACTION_ID>" // optional ); diff --git a/docs/examples/tablesdb/get-index.md b/docs/examples/tablesdb/get-index.md index 45cb4826..d0747b91 100644 --- a/docs/examples/tablesdb/get-index.md +++ b/docs/examples/tablesdb/get-index.md @@ -10,7 +10,7 @@ Client client = new Client() TablesDB tablesDB = new TablesDB(client); -ColumnIndex result = await tablesDB.GetIndex( +Appwrite.Models.ColumnIndex result = await tablesDB.GetIndex( databaseId: "<DATABASE_ID>", tableId: "<TABLE_ID>", key: "<KEY>" diff --git a/docs/examples/tablesdb/get-migration.md b/docs/examples/tablesdb/get-migration.md index de4d85e3..49c9170c 100644 --- a/docs/examples/tablesdb/get-migration.md +++ b/docs/examples/tablesdb/get-migration.md @@ -10,7 +10,7 @@ Client client = new Client() TablesDB tablesDB = new TablesDB(client); -DatabaseMigration result = await tablesDB.GetMigration( +Appwrite.Models.DatabaseMigration result = await tablesDB.GetMigration( databaseId: "<DATABASE_ID>", migrationId: "<MIGRATION_ID>" ); diff --git a/docs/examples/tablesdb/get-replicas.md b/docs/examples/tablesdb/get-replicas.md index 1053522f..5919bdb1 100644 --- a/docs/examples/tablesdb/get-replicas.md +++ b/docs/examples/tablesdb/get-replicas.md @@ -10,7 +10,7 @@ Client client = new Client() TablesDB tablesDB = new TablesDB(client); -DedicatedDatabaseReplicas result = await tablesDB.GetReplicas( +Appwrite.Models.DedicatedDatabaseReplicas result = await tablesDB.GetReplicas( databaseId: "<DATABASE_ID>" ); diff --git a/docs/examples/tablesdb/get-row.md b/docs/examples/tablesdb/get-row.md index 83c1f61e..acae6566 100644 --- a/docs/examples/tablesdb/get-row.md +++ b/docs/examples/tablesdb/get-row.md @@ -10,7 +10,7 @@ Client client = new Client() TablesDB tablesDB = new TablesDB(client); -Row result = await tablesDB.GetRow( +Appwrite.Models.Row result = await tablesDB.GetRow( databaseId: "<DATABASE_ID>", tableId: "<TABLE_ID>", rowId: "<ROW_ID>", diff --git a/docs/examples/tablesdb/get-status.md b/docs/examples/tablesdb/get-status.md index 5cc588fb..b3c81945 100644 --- a/docs/examples/tablesdb/get-status.md +++ b/docs/examples/tablesdb/get-status.md @@ -10,7 +10,7 @@ Client client = new Client() TablesDB tablesDB = new TablesDB(client); -DatabaseStatus result = await tablesDB.GetStatus( +Appwrite.Models.DatabaseStatus result = await tablesDB.GetStatus( databaseId: "<DATABASE_ID>" ); diff --git a/docs/examples/tablesdb/get-table.md b/docs/examples/tablesdb/get-table.md index e5f5c4e4..2844a388 100644 --- a/docs/examples/tablesdb/get-table.md +++ b/docs/examples/tablesdb/get-table.md @@ -10,7 +10,7 @@ Client client = new Client() TablesDB tablesDB = new TablesDB(client); -Table result = await tablesDB.GetTable( +Appwrite.Models.Table result = await tablesDB.GetTable( databaseId: "<DATABASE_ID>", tableId: "<TABLE_ID>" ); diff --git a/docs/examples/tablesdb/get-transaction.md b/docs/examples/tablesdb/get-transaction.md index 9bfeeb63..5d11d553 100644 --- a/docs/examples/tablesdb/get-transaction.md +++ b/docs/examples/tablesdb/get-transaction.md @@ -10,7 +10,7 @@ Client client = new Client() TablesDB tablesDB = new TablesDB(client); -Transaction result = await tablesDB.GetTransaction( +Appwrite.Models.Transaction result = await tablesDB.GetTransaction( transactionId: "<TRANSACTION_ID>" ); diff --git a/docs/examples/tablesdb/get.md b/docs/examples/tablesdb/get.md index daa759ab..15c8fd67 100644 --- a/docs/examples/tablesdb/get.md +++ b/docs/examples/tablesdb/get.md @@ -10,7 +10,7 @@ Client client = new Client() TablesDB tablesDB = new TablesDB(client); -Database result = await tablesDB.Get( +Appwrite.Models.Database result = await tablesDB.Get( databaseId: "<DATABASE_ID>" ); diff --git a/docs/examples/tablesdb/increment-row-column.md b/docs/examples/tablesdb/increment-row-column.md index 16d13fbc..28533f75 100644 --- a/docs/examples/tablesdb/increment-row-column.md +++ b/docs/examples/tablesdb/increment-row-column.md @@ -10,7 +10,7 @@ Client client = new Client() TablesDB tablesDB = new TablesDB(client); -Row result = await tablesDB.IncrementRowColumn( +Appwrite.Models.Row result = await tablesDB.IncrementRowColumn( databaseId: "<DATABASE_ID>", tableId: "<TABLE_ID>", rowId: "<ROW_ID>", diff --git a/docs/examples/tablesdb/list-columns.md b/docs/examples/tablesdb/list-columns.md index fdb00a25..01fd5e7d 100644 --- a/docs/examples/tablesdb/list-columns.md +++ b/docs/examples/tablesdb/list-columns.md @@ -10,7 +10,7 @@ Client client = new Client() TablesDB tablesDB = new TablesDB(client); -ColumnList result = await tablesDB.ListColumns( +Appwrite.Models.ColumnList result = await tablesDB.ListColumns( databaseId: "<DATABASE_ID>", tableId: "<TABLE_ID>", queries: new List<string>(), // optional diff --git a/docs/examples/tablesdb/list-indexes.md b/docs/examples/tablesdb/list-indexes.md index f2b039a4..71b61d2f 100644 --- a/docs/examples/tablesdb/list-indexes.md +++ b/docs/examples/tablesdb/list-indexes.md @@ -10,7 +10,7 @@ Client client = new Client() TablesDB tablesDB = new TablesDB(client); -ColumnIndexList result = await tablesDB.ListIndexes( +Appwrite.Models.ColumnIndexList result = await tablesDB.ListIndexes( databaseId: "<DATABASE_ID>", tableId: "<TABLE_ID>", queries: new List<string>(), // optional diff --git a/docs/examples/tablesdb/list-migrations.md b/docs/examples/tablesdb/list-migrations.md index a7b88cb9..7c4cdb6a 100644 --- a/docs/examples/tablesdb/list-migrations.md +++ b/docs/examples/tablesdb/list-migrations.md @@ -10,7 +10,7 @@ Client client = new Client() TablesDB tablesDB = new TablesDB(client); -DatabaseMigrationList result = await tablesDB.ListMigrations( +Appwrite.Models.DatabaseMigrationList result = await tablesDB.ListMigrations( databaseId: "<DATABASE_ID>" ); diff --git a/docs/examples/tablesdb/list-operations.md b/docs/examples/tablesdb/list-operations.md index daaa2868..e02a9396 100644 --- a/docs/examples/tablesdb/list-operations.md +++ b/docs/examples/tablesdb/list-operations.md @@ -10,7 +10,7 @@ Client client = new Client() TablesDB tablesDB = new TablesDB(client); -DedicatedDatabaseOperationList result = await tablesDB.ListOperations( +Appwrite.Models.DedicatedDatabaseOperationList result = await tablesDB.ListOperations( databaseId: "<DATABASE_ID>", status: "queued", // optional limit: 1, // optional diff --git a/docs/examples/tablesdb/list-rows.md b/docs/examples/tablesdb/list-rows.md index 66e085fd..4972902b 100644 --- a/docs/examples/tablesdb/list-rows.md +++ b/docs/examples/tablesdb/list-rows.md @@ -10,7 +10,7 @@ Client client = new Client() TablesDB tablesDB = new TablesDB(client); -RowList result = await tablesDB.ListRows( +Appwrite.Models.RowList result = await tablesDB.ListRows( databaseId: "<DATABASE_ID>", tableId: "<TABLE_ID>", queries: new List<string>(), // optional diff --git a/docs/examples/tablesdb/list-specifications.md b/docs/examples/tablesdb/list-specifications.md index 262b9fd3..1c0779ce 100644 --- a/docs/examples/tablesdb/list-specifications.md +++ b/docs/examples/tablesdb/list-specifications.md @@ -10,7 +10,7 @@ Client client = new Client() TablesDB tablesDB = new TablesDB(client); -DedicatedDatabaseSpecificationList result = await tablesDB.ListSpecifications(); +Appwrite.Models.DedicatedDatabaseSpecificationList result = await tablesDB.ListSpecifications(); ``` diff --git a/docs/examples/tablesdb/list-tables.md b/docs/examples/tablesdb/list-tables.md index 89c2e7b5..0de79b37 100644 --- a/docs/examples/tablesdb/list-tables.md +++ b/docs/examples/tablesdb/list-tables.md @@ -10,7 +10,7 @@ Client client = new Client() TablesDB tablesDB = new TablesDB(client); -TableList result = await tablesDB.ListTables( +Appwrite.Models.TableList result = await tablesDB.ListTables( databaseId: "<DATABASE_ID>", queries: new List<string>(), // optional search: "<SEARCH>", // optional diff --git a/docs/examples/tablesdb/list-transactions.md b/docs/examples/tablesdb/list-transactions.md index 6d7db9ab..4a9b882a 100644 --- a/docs/examples/tablesdb/list-transactions.md +++ b/docs/examples/tablesdb/list-transactions.md @@ -10,8 +10,9 @@ Client client = new Client() TablesDB tablesDB = new TablesDB(client); -TransactionList result = await tablesDB.ListTransactions( - queries: new List<string>() // optional +Appwrite.Models.TransactionList result = await tablesDB.ListTransactions( + queries: new List<string>(), // optional + total: false // optional ); ``` diff --git a/docs/examples/tablesdb/list.md b/docs/examples/tablesdb/list.md index 6f082930..bd25fdfb 100644 --- a/docs/examples/tablesdb/list.md +++ b/docs/examples/tablesdb/list.md @@ -10,7 +10,7 @@ Client client = new Client() TablesDB tablesDB = new TablesDB(client); -DatabaseList result = await tablesDB.List( +Appwrite.Models.DatabaseList result = await tablesDB.List( queries: new List<string>(), // optional search: "<SEARCH>", // optional total: false // optional diff --git a/docs/examples/tablesdb/update-big-int-column.md b/docs/examples/tablesdb/update-big-int-column.md index 381d02b2..c71e3f18 100644 --- a/docs/examples/tablesdb/update-big-int-column.md +++ b/docs/examples/tablesdb/update-big-int-column.md @@ -10,7 +10,7 @@ Client client = new Client() TablesDB tablesDB = new TablesDB(client); -ColumnBigint result = await tablesDB.UpdateBigIntColumn( +Appwrite.Models.ColumnBigint result = await tablesDB.UpdateBigIntColumn( databaseId: "<DATABASE_ID>", tableId: "<TABLE_ID>", key: "<KEY>", diff --git a/docs/examples/tablesdb/update-boolean-column.md b/docs/examples/tablesdb/update-boolean-column.md index 5f7685ec..faca887b 100644 --- a/docs/examples/tablesdb/update-boolean-column.md +++ b/docs/examples/tablesdb/update-boolean-column.md @@ -10,7 +10,7 @@ Client client = new Client() TablesDB tablesDB = new TablesDB(client); -ColumnBoolean result = await tablesDB.UpdateBooleanColumn( +Appwrite.Models.ColumnBoolean result = await tablesDB.UpdateBooleanColumn( databaseId: "<DATABASE_ID>", tableId: "<TABLE_ID>", key: "<KEY>", diff --git a/docs/examples/tablesdb/update-datetime-column.md b/docs/examples/tablesdb/update-datetime-column.md index f659279c..7fbdbae9 100644 --- a/docs/examples/tablesdb/update-datetime-column.md +++ b/docs/examples/tablesdb/update-datetime-column.md @@ -10,7 +10,7 @@ Client client = new Client() TablesDB tablesDB = new TablesDB(client); -ColumnDatetime result = await tablesDB.UpdateDatetimeColumn( +Appwrite.Models.ColumnDatetime result = await tablesDB.UpdateDatetimeColumn( databaseId: "<DATABASE_ID>", tableId: "<TABLE_ID>", key: "<KEY>", diff --git a/docs/examples/tablesdb/update-email-column.md b/docs/examples/tablesdb/update-email-column.md index c8f5d912..c26eda40 100644 --- a/docs/examples/tablesdb/update-email-column.md +++ b/docs/examples/tablesdb/update-email-column.md @@ -10,7 +10,7 @@ Client client = new Client() TablesDB tablesDB = new TablesDB(client); -ColumnEmail result = await tablesDB.UpdateEmailColumn( +Appwrite.Models.ColumnEmail result = await tablesDB.UpdateEmailColumn( databaseId: "<DATABASE_ID>", tableId: "<TABLE_ID>", key: "<KEY>", diff --git a/docs/examples/tablesdb/update-enum-column.md b/docs/examples/tablesdb/update-enum-column.md index 404fc413..b135a8e1 100644 --- a/docs/examples/tablesdb/update-enum-column.md +++ b/docs/examples/tablesdb/update-enum-column.md @@ -10,7 +10,7 @@ Client client = new Client() TablesDB tablesDB = new TablesDB(client); -ColumnEnum result = await tablesDB.UpdateEnumColumn( +Appwrite.Models.ColumnEnum result = await tablesDB.UpdateEnumColumn( databaseId: "<DATABASE_ID>", tableId: "<TABLE_ID>", key: "<KEY>", diff --git a/docs/examples/tablesdb/update-float-column.md b/docs/examples/tablesdb/update-float-column.md index 7983743e..7e54e743 100644 --- a/docs/examples/tablesdb/update-float-column.md +++ b/docs/examples/tablesdb/update-float-column.md @@ -10,7 +10,7 @@ Client client = new Client() TablesDB tablesDB = new TablesDB(client); -ColumnFloat result = await tablesDB.UpdateFloatColumn( +Appwrite.Models.ColumnFloat result = await tablesDB.UpdateFloatColumn( databaseId: "<DATABASE_ID>", tableId: "<TABLE_ID>", key: "<KEY>", diff --git a/docs/examples/tablesdb/update-integer-column.md b/docs/examples/tablesdb/update-integer-column.md index 22b8ab20..0b9e3a2a 100644 --- a/docs/examples/tablesdb/update-integer-column.md +++ b/docs/examples/tablesdb/update-integer-column.md @@ -10,7 +10,7 @@ Client client = new Client() TablesDB tablesDB = new TablesDB(client); -ColumnInteger result = await tablesDB.UpdateIntegerColumn( +Appwrite.Models.ColumnInteger result = await tablesDB.UpdateIntegerColumn( databaseId: "<DATABASE_ID>", tableId: "<TABLE_ID>", key: "<KEY>", diff --git a/docs/examples/tablesdb/update-ip-column.md b/docs/examples/tablesdb/update-ip-column.md index 30a9c595..9e5c70b3 100644 --- a/docs/examples/tablesdb/update-ip-column.md +++ b/docs/examples/tablesdb/update-ip-column.md @@ -10,7 +10,7 @@ Client client = new Client() TablesDB tablesDB = new TablesDB(client); -ColumnIp result = await tablesDB.UpdateIpColumn( +Appwrite.Models.ColumnIp result = await tablesDB.UpdateIpColumn( databaseId: "<DATABASE_ID>", tableId: "<TABLE_ID>", key: "<KEY>", diff --git a/docs/examples/tablesdb/update-line-column.md b/docs/examples/tablesdb/update-line-column.md index 91291e3f..b4345e41 100644 --- a/docs/examples/tablesdb/update-line-column.md +++ b/docs/examples/tablesdb/update-line-column.md @@ -10,7 +10,7 @@ Client client = new Client() TablesDB tablesDB = new TablesDB(client); -ColumnLine result = await tablesDB.UpdateLineColumn( +Appwrite.Models.ColumnLine result = await tablesDB.UpdateLineColumn( databaseId: "<DATABASE_ID>", tableId: "<TABLE_ID>", key: "<KEY>", diff --git a/docs/examples/tablesdb/update-longtext-column.md b/docs/examples/tablesdb/update-longtext-column.md index c240a496..45835ecd 100644 --- a/docs/examples/tablesdb/update-longtext-column.md +++ b/docs/examples/tablesdb/update-longtext-column.md @@ -10,7 +10,7 @@ Client client = new Client() TablesDB tablesDB = new TablesDB(client); -ColumnLongtext result = await tablesDB.UpdateLongtextColumn( +Appwrite.Models.ColumnLongtext result = await tablesDB.UpdateLongtextColumn( databaseId: "<DATABASE_ID>", tableId: "<TABLE_ID>", key: "<KEY>", diff --git a/docs/examples/tablesdb/update-mediumtext-column.md b/docs/examples/tablesdb/update-mediumtext-column.md index 592d8afa..1d030815 100644 --- a/docs/examples/tablesdb/update-mediumtext-column.md +++ b/docs/examples/tablesdb/update-mediumtext-column.md @@ -10,7 +10,7 @@ Client client = new Client() TablesDB tablesDB = new TablesDB(client); -ColumnMediumtext result = await tablesDB.UpdateMediumtextColumn( +Appwrite.Models.ColumnMediumtext result = await tablesDB.UpdateMediumtextColumn( databaseId: "<DATABASE_ID>", tableId: "<TABLE_ID>", key: "<KEY>", diff --git a/docs/examples/tablesdb/update-point-column.md b/docs/examples/tablesdb/update-point-column.md index 4e2dcc07..77abccbd 100644 --- a/docs/examples/tablesdb/update-point-column.md +++ b/docs/examples/tablesdb/update-point-column.md @@ -10,7 +10,7 @@ Client client = new Client() TablesDB tablesDB = new TablesDB(client); -ColumnPoint result = await tablesDB.UpdatePointColumn( +Appwrite.Models.ColumnPoint result = await tablesDB.UpdatePointColumn( databaseId: "<DATABASE_ID>", tableId: "<TABLE_ID>", key: "<KEY>", diff --git a/docs/examples/tablesdb/update-polygon-column.md b/docs/examples/tablesdb/update-polygon-column.md index 5ecd1b80..2ca0f43d 100644 --- a/docs/examples/tablesdb/update-polygon-column.md +++ b/docs/examples/tablesdb/update-polygon-column.md @@ -10,7 +10,7 @@ Client client = new Client() TablesDB tablesDB = new TablesDB(client); -ColumnPolygon result = await tablesDB.UpdatePolygonColumn( +Appwrite.Models.ColumnPolygon result = await tablesDB.UpdatePolygonColumn( databaseId: "<DATABASE_ID>", tableId: "<TABLE_ID>", key: "<KEY>", diff --git a/docs/examples/tablesdb/update-relationship-column.md b/docs/examples/tablesdb/update-relationship-column.md index 8d75dd0a..d22ece79 100644 --- a/docs/examples/tablesdb/update-relationship-column.md +++ b/docs/examples/tablesdb/update-relationship-column.md @@ -11,7 +11,7 @@ Client client = new Client() TablesDB tablesDB = new TablesDB(client); -ColumnRelationship result = await tablesDB.UpdateRelationshipColumn( +Appwrite.Models.ColumnRelationship result = await tablesDB.UpdateRelationshipColumn( databaseId: "<DATABASE_ID>", tableId: "<TABLE_ID>", key: "<KEY>", diff --git a/docs/examples/tablesdb/update-row.md b/docs/examples/tablesdb/update-row.md index 03f71f61..1b5a5a7e 100644 --- a/docs/examples/tablesdb/update-row.md +++ b/docs/examples/tablesdb/update-row.md @@ -10,7 +10,7 @@ Client client = new Client() TablesDB tablesDB = new TablesDB(client); -Row result = await tablesDB.UpdateRow( +Appwrite.Models.Row result = await tablesDB.UpdateRow( databaseId: "<DATABASE_ID>", tableId: "<TABLE_ID>", rowId: "<ROW_ID>", diff --git a/docs/examples/tablesdb/update-rows.md b/docs/examples/tablesdb/update-rows.md index 9e4c497b..4e69f0b8 100644 --- a/docs/examples/tablesdb/update-rows.md +++ b/docs/examples/tablesdb/update-rows.md @@ -10,7 +10,7 @@ Client client = new Client() TablesDB tablesDB = new TablesDB(client); -RowList result = await tablesDB.UpdateRows( +Appwrite.Models.RowList result = await tablesDB.UpdateRows( databaseId: "<DATABASE_ID>", tableId: "<TABLE_ID>", data: new { diff --git a/docs/examples/tablesdb/update-string-column.md b/docs/examples/tablesdb/update-string-column.md index bf0849e2..eccf9117 100644 --- a/docs/examples/tablesdb/update-string-column.md +++ b/docs/examples/tablesdb/update-string-column.md @@ -10,7 +10,7 @@ Client client = new Client() TablesDB tablesDB = new TablesDB(client); -ColumnString result = await tablesDB.UpdateStringColumn( +Appwrite.Models.ColumnString result = await tablesDB.UpdateStringColumn( databaseId: "<DATABASE_ID>", tableId: "<TABLE_ID>", key: "<KEY>", diff --git a/docs/examples/tablesdb/update-table.md b/docs/examples/tablesdb/update-table.md index e7a22821..d3547d91 100644 --- a/docs/examples/tablesdb/update-table.md +++ b/docs/examples/tablesdb/update-table.md @@ -10,7 +10,7 @@ Client client = new Client() TablesDB tablesDB = new TablesDB(client); -Table result = await tablesDB.UpdateTable( +Appwrite.Models.Table result = await tablesDB.UpdateTable( databaseId: "<DATABASE_ID>", tableId: "<TABLE_ID>", name: "<NAME>", // optional diff --git a/docs/examples/tablesdb/update-text-column.md b/docs/examples/tablesdb/update-text-column.md index 0ee26e04..c2f9e064 100644 --- a/docs/examples/tablesdb/update-text-column.md +++ b/docs/examples/tablesdb/update-text-column.md @@ -10,7 +10,7 @@ Client client = new Client() TablesDB tablesDB = new TablesDB(client); -ColumnText result = await tablesDB.UpdateTextColumn( +Appwrite.Models.ColumnText result = await tablesDB.UpdateTextColumn( databaseId: "<DATABASE_ID>", tableId: "<TABLE_ID>", key: "<KEY>", diff --git a/docs/examples/tablesdb/update-transaction.md b/docs/examples/tablesdb/update-transaction.md index 2010f673..a6e69526 100644 --- a/docs/examples/tablesdb/update-transaction.md +++ b/docs/examples/tablesdb/update-transaction.md @@ -10,7 +10,7 @@ Client client = new Client() TablesDB tablesDB = new TablesDB(client); -Transaction result = await tablesDB.UpdateTransaction( +Appwrite.Models.Transaction result = await tablesDB.UpdateTransaction( transactionId: "<TRANSACTION_ID>", commit: false, // optional rollback: false // optional diff --git a/docs/examples/tablesdb/update-url-column.md b/docs/examples/tablesdb/update-url-column.md index f32ce01a..c4c3d4d3 100644 --- a/docs/examples/tablesdb/update-url-column.md +++ b/docs/examples/tablesdb/update-url-column.md @@ -10,7 +10,7 @@ Client client = new Client() TablesDB tablesDB = new TablesDB(client); -ColumnUrl result = await tablesDB.UpdateUrlColumn( +Appwrite.Models.ColumnUrl result = await tablesDB.UpdateUrlColumn( databaseId: "<DATABASE_ID>", tableId: "<TABLE_ID>", key: "<KEY>", diff --git a/docs/examples/tablesdb/update-varchar-column.md b/docs/examples/tablesdb/update-varchar-column.md index 3cd1f9c0..914ddedf 100644 --- a/docs/examples/tablesdb/update-varchar-column.md +++ b/docs/examples/tablesdb/update-varchar-column.md @@ -10,7 +10,7 @@ Client client = new Client() TablesDB tablesDB = new TablesDB(client); -ColumnVarchar result = await tablesDB.UpdateVarcharColumn( +Appwrite.Models.ColumnVarchar result = await tablesDB.UpdateVarcharColumn( databaseId: "<DATABASE_ID>", tableId: "<TABLE_ID>", key: "<KEY>", diff --git a/docs/examples/tablesdb/update.md b/docs/examples/tablesdb/update.md index 8b28a996..009afcdf 100644 --- a/docs/examples/tablesdb/update.md +++ b/docs/examples/tablesdb/update.md @@ -10,7 +10,7 @@ Client client = new Client() TablesDB tablesDB = new TablesDB(client); -Database result = await tablesDB.Update( +Appwrite.Models.Database result = await tablesDB.Update( databaseId: "<DATABASE_ID>", name: "<NAME>", // optional enabled: false, // optional diff --git a/docs/examples/tablesdb/upsert-row.md b/docs/examples/tablesdb/upsert-row.md index ef38e305..140e6be0 100644 --- a/docs/examples/tablesdb/upsert-row.md +++ b/docs/examples/tablesdb/upsert-row.md @@ -10,7 +10,7 @@ Client client = new Client() TablesDB tablesDB = new TablesDB(client); -Row result = await tablesDB.UpsertRow( +Appwrite.Models.Row result = await tablesDB.UpsertRow( databaseId: "<DATABASE_ID>", tableId: "<TABLE_ID>", rowId: "<ROW_ID>", diff --git a/docs/examples/tablesdb/upsert-rows.md b/docs/examples/tablesdb/upsert-rows.md index 41d3bcd8..a4809e55 100644 --- a/docs/examples/tablesdb/upsert-rows.md +++ b/docs/examples/tablesdb/upsert-rows.md @@ -10,10 +10,19 @@ Client client = new Client() TablesDB tablesDB = new TablesDB(client); -RowList result = await tablesDB.UpsertRows( +Appwrite.Models.RowList result = await tablesDB.UpsertRows( databaseId: "<DATABASE_ID>", tableId: "<TABLE_ID>", - rows: new List<object>(), + rows: [ + { + "$id": "example1", + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 30, + "isAdmin": false + } + ], transactionId: "<TRANSACTION_ID>" // optional ); diff --git a/docs/examples/teams/create-installation.md b/docs/examples/teams/create-installation.md index 217d0a23..3c64b386 100644 --- a/docs/examples/teams/create-installation.md +++ b/docs/examples/teams/create-installation.md @@ -10,7 +10,7 @@ Client client = new Client() Teams teams = new Teams(client); -AppInstallation result = await teams.CreateInstallation( +Appwrite.Models.AppInstallation result = await teams.CreateInstallation( teamId: "<TEAM_ID>", appId: "<APP_ID>", authorizationDetails: "<AUTHORIZATION_DETAILS>" // optional diff --git a/docs/examples/teams/create-membership.md b/docs/examples/teams/create-membership.md index 1092050b..c711d3f2 100644 --- a/docs/examples/teams/create-membership.md +++ b/docs/examples/teams/create-membership.md @@ -10,9 +10,10 @@ Client client = new Client() Teams teams = new Teams(client); -Membership result = await teams.CreateMembership( +Appwrite.Models.Membership result = await teams.CreateMembership( teamId: "<TEAM_ID>", - roles: new List<string>(), + roles: ["editor"], + membershipId: "<MEMBERSHIP_ID>", // optional email: "email@example.com", // optional userId: "<USER_ID>", // optional phone: "+12065550100", // optional diff --git a/docs/examples/teams/create.md b/docs/examples/teams/create.md index fdc1e09c..e9832646 100644 --- a/docs/examples/teams/create.md +++ b/docs/examples/teams/create.md @@ -10,7 +10,7 @@ Client client = new Client() Teams teams = new Teams(client); -Team result = await teams.Create( +Appwrite.Models.Team result = await teams.Create( teamId: "<TEAM_ID>", name: "<NAME>", roles: new List<string>() // optional diff --git a/docs/examples/teams/get-installation.md b/docs/examples/teams/get-installation.md index e23c4781..82387442 100644 --- a/docs/examples/teams/get-installation.md +++ b/docs/examples/teams/get-installation.md @@ -10,7 +10,7 @@ Client client = new Client() Teams teams = new Teams(client); -AppInstallation result = await teams.GetInstallation( +Appwrite.Models.AppInstallation result = await teams.GetInstallation( teamId: "<TEAM_ID>", installationId: "<INSTALLATION_ID>" ); diff --git a/docs/examples/teams/get-membership.md b/docs/examples/teams/get-membership.md index f359df1a..dff88aa9 100644 --- a/docs/examples/teams/get-membership.md +++ b/docs/examples/teams/get-membership.md @@ -10,7 +10,7 @@ Client client = new Client() Teams teams = new Teams(client); -Membership result = await teams.GetMembership( +Appwrite.Models.Membership result = await teams.GetMembership( teamId: "<TEAM_ID>", membershipId: "<MEMBERSHIP_ID>" ); diff --git a/docs/examples/teams/get-prefs.md b/docs/examples/teams/get-prefs.md index 95a8c288..a1b408d2 100644 --- a/docs/examples/teams/get-prefs.md +++ b/docs/examples/teams/get-prefs.md @@ -10,7 +10,7 @@ Client client = new Client() Teams teams = new Teams(client); -Preferences result = await teams.GetPrefs( +Appwrite.Models.Preferences result = await teams.GetPrefs( teamId: "<TEAM_ID>" ); diff --git a/docs/examples/teams/get.md b/docs/examples/teams/get.md index 900d932d..d93d5fdc 100644 --- a/docs/examples/teams/get.md +++ b/docs/examples/teams/get.md @@ -10,7 +10,7 @@ Client client = new Client() Teams teams = new Teams(client); -Team result = await teams.Get( +Appwrite.Models.Team result = await teams.Get( teamId: "<TEAM_ID>" ); diff --git a/docs/examples/teams/list-installations.md b/docs/examples/teams/list-installations.md index 133f4278..3c8ff9c3 100644 --- a/docs/examples/teams/list-installations.md +++ b/docs/examples/teams/list-installations.md @@ -10,7 +10,7 @@ Client client = new Client() Teams teams = new Teams(client); -AppInstallationList result = await teams.ListInstallations( +Appwrite.Models.AppInstallationList result = await teams.ListInstallations( teamId: "<TEAM_ID>", queries: new List<string>(), // optional total: false // optional diff --git a/docs/examples/teams/list-memberships.md b/docs/examples/teams/list-memberships.md index 64c25747..bd070ae7 100644 --- a/docs/examples/teams/list-memberships.md +++ b/docs/examples/teams/list-memberships.md @@ -10,7 +10,7 @@ Client client = new Client() Teams teams = new Teams(client); -MembershipList result = await teams.ListMemberships( +Appwrite.Models.MembershipList result = await teams.ListMemberships( teamId: "<TEAM_ID>", queries: new List<string>(), // optional search: "<SEARCH>", // optional diff --git a/docs/examples/teams/list.md b/docs/examples/teams/list.md index 571c8663..f52c61c5 100644 --- a/docs/examples/teams/list.md +++ b/docs/examples/teams/list.md @@ -10,7 +10,7 @@ Client client = new Client() Teams teams = new Teams(client); -TeamList result = await teams.List( +Appwrite.Models.TeamList result = await teams.List( queries: new List<string>(), // optional search: "<SEARCH>", // optional total: false // optional diff --git a/docs/examples/teams/update-installation.md b/docs/examples/teams/update-installation.md index 7fa98101..57913d69 100644 --- a/docs/examples/teams/update-installation.md +++ b/docs/examples/teams/update-installation.md @@ -10,7 +10,7 @@ Client client = new Client() Teams teams = new Teams(client); -AppInstallation result = await teams.UpdateInstallation( +Appwrite.Models.AppInstallation result = await teams.UpdateInstallation( teamId: "<TEAM_ID>", installationId: "<INSTALLATION_ID>", authorizationDetails: "<AUTHORIZATION_DETAILS>" // optional diff --git a/docs/examples/teams/update-membership-status.md b/docs/examples/teams/update-membership-status.md index 1f172dab..ee4b8971 100644 --- a/docs/examples/teams/update-membership-status.md +++ b/docs/examples/teams/update-membership-status.md @@ -10,7 +10,7 @@ Client client = new Client() Teams teams = new Teams(client); -Membership result = await teams.UpdateMembershipStatus( +Appwrite.Models.Membership result = await teams.UpdateMembershipStatus( teamId: "<TEAM_ID>", membershipId: "<MEMBERSHIP_ID>", userId: "<USER_ID>", diff --git a/docs/examples/teams/update-membership.md b/docs/examples/teams/update-membership.md index ff4ad455..64c95d63 100644 --- a/docs/examples/teams/update-membership.md +++ b/docs/examples/teams/update-membership.md @@ -10,10 +10,10 @@ Client client = new Client() Teams teams = new Teams(client); -Membership result = await teams.UpdateMembership( +Appwrite.Models.Membership result = await teams.UpdateMembership( teamId: "<TEAM_ID>", membershipId: "<MEMBERSHIP_ID>", - roles: new List<string>() + roles: ["editor"] ); ``` diff --git a/docs/examples/teams/update-name.md b/docs/examples/teams/update-name.md index 6f42ce5c..776b38b7 100644 --- a/docs/examples/teams/update-name.md +++ b/docs/examples/teams/update-name.md @@ -10,7 +10,7 @@ Client client = new Client() Teams teams = new Teams(client); -Team result = await teams.UpdateName( +Appwrite.Models.Team result = await teams.UpdateName( teamId: "<TEAM_ID>", name: "<NAME>" ); diff --git a/docs/examples/teams/update-prefs.md b/docs/examples/teams/update-prefs.md index b2dbac7a..698f669a 100644 --- a/docs/examples/teams/update-prefs.md +++ b/docs/examples/teams/update-prefs.md @@ -10,7 +10,7 @@ Client client = new Client() Teams teams = new Teams(client); -Preferences result = await teams.UpdatePrefs( +Appwrite.Models.Preferences result = await teams.UpdatePrefs( teamId: "<TEAM_ID>", prefs: [object] ); diff --git a/docs/examples/tokens/create-file-token.md b/docs/examples/tokens/create-file-token.md index baf4c376..04053fe9 100644 --- a/docs/examples/tokens/create-file-token.md +++ b/docs/examples/tokens/create-file-token.md @@ -10,7 +10,7 @@ Client client = new Client() Tokens tokens = new Tokens(client); -ResourceToken result = await tokens.CreateFileToken( +Appwrite.Models.ResourceToken result = await tokens.CreateFileToken( bucketId: "<BUCKET_ID>", fileId: "<FILE_ID>", expire: "2020-10-15T06:38:00.000+00:00" // optional diff --git a/docs/examples/tokens/get.md b/docs/examples/tokens/get.md index 5466ae87..6884921b 100644 --- a/docs/examples/tokens/get.md +++ b/docs/examples/tokens/get.md @@ -10,7 +10,7 @@ Client client = new Client() Tokens tokens = new Tokens(client); -ResourceToken result = await tokens.Get( +Appwrite.Models.ResourceToken result = await tokens.Get( tokenId: "<TOKEN_ID>" ); diff --git a/docs/examples/tokens/list.md b/docs/examples/tokens/list.md index 45e027d4..bd9476d9 100644 --- a/docs/examples/tokens/list.md +++ b/docs/examples/tokens/list.md @@ -10,7 +10,7 @@ Client client = new Client() Tokens tokens = new Tokens(client); -ResourceTokenList result = await tokens.List( +Appwrite.Models.ResourceTokenList result = await tokens.List( bucketId: "<BUCKET_ID>", fileId: "<FILE_ID>", queries: new List<string>(), // optional diff --git a/docs/examples/tokens/update.md b/docs/examples/tokens/update.md index 041dce97..67d0f3bd 100644 --- a/docs/examples/tokens/update.md +++ b/docs/examples/tokens/update.md @@ -10,7 +10,7 @@ Client client = new Client() Tokens tokens = new Tokens(client); -ResourceToken result = await tokens.Update( +Appwrite.Models.ResourceToken result = await tokens.Update( tokenId: "<TOKEN_ID>", expire: "2020-10-15T06:38:00.000+00:00" // optional ); diff --git a/docs/examples/users/create-argon-2-user.md b/docs/examples/users/create-argon-2-user.md index 6c4ba635..88d44843 100644 --- a/docs/examples/users/create-argon-2-user.md +++ b/docs/examples/users/create-argon-2-user.md @@ -10,7 +10,7 @@ Client client = new Client() Users users = new Users(client); -User result = await users.CreateArgon2User( +Appwrite.Models.User result = await users.CreateArgon2User( userId: "<USER_ID>", email: "email@example.com", password: "password", diff --git a/docs/examples/users/create-bcrypt-user.md b/docs/examples/users/create-bcrypt-user.md index d4a70e5b..d32cff5f 100644 --- a/docs/examples/users/create-bcrypt-user.md +++ b/docs/examples/users/create-bcrypt-user.md @@ -10,7 +10,7 @@ Client client = new Client() Users users = new Users(client); -User result = await users.CreateBcryptUser( +Appwrite.Models.User result = await users.CreateBcryptUser( userId: "<USER_ID>", email: "email@example.com", password: "password", diff --git a/docs/examples/users/create-jwt.md b/docs/examples/users/create-jwt.md index 0841f4ea..890bab42 100644 --- a/docs/examples/users/create-jwt.md +++ b/docs/examples/users/create-jwt.md @@ -10,7 +10,7 @@ Client client = new Client() Users users = new Users(client); -JWT result = await users.CreateJWT( +Appwrite.Models.JWT result = await users.CreateJWT( userId: "<USER_ID>", sessionId: "recent()", // optional duration: 0 // optional diff --git a/docs/examples/users/create-md-5-user.md b/docs/examples/users/create-md-5-user.md index 26825711..6f3c8eae 100644 --- a/docs/examples/users/create-md-5-user.md +++ b/docs/examples/users/create-md-5-user.md @@ -10,7 +10,7 @@ Client client = new Client() Users users = new Users(client); -User result = await users.CreateMD5User( +Appwrite.Models.User result = await users.CreateMD5User( userId: "<USER_ID>", email: "email@example.com", password: "password", diff --git a/docs/examples/users/create-mfa-recovery-codes.md b/docs/examples/users/create-mfa-recovery-codes.md index 02a34ab9..901ba3fb 100644 --- a/docs/examples/users/create-mfa-recovery-codes.md +++ b/docs/examples/users/create-mfa-recovery-codes.md @@ -10,7 +10,7 @@ Client client = new Client() Users users = new Users(client); -MfaRecoveryCodes result = await users.CreateMFARecoveryCodes( +Appwrite.Models.MfaRecoveryCodes result = await users.CreateMFARecoveryCodes( userId: "<USER_ID>" ); diff --git a/docs/examples/users/create-ph-pass-user.md b/docs/examples/users/create-ph-pass-user.md index efcc9f27..77ebe01b 100644 --- a/docs/examples/users/create-ph-pass-user.md +++ b/docs/examples/users/create-ph-pass-user.md @@ -10,7 +10,7 @@ Client client = new Client() Users users = new Users(client); -User result = await users.CreatePHPassUser( +Appwrite.Models.User result = await users.CreatePHPassUser( userId: "<USER_ID>", email: "email@example.com", password: "password", diff --git a/docs/examples/users/create-scrypt-modified-user.md b/docs/examples/users/create-scrypt-modified-user.md index 687282b2..8b3becb8 100644 --- a/docs/examples/users/create-scrypt-modified-user.md +++ b/docs/examples/users/create-scrypt-modified-user.md @@ -10,7 +10,7 @@ Client client = new Client() Users users = new Users(client); -User result = await users.CreateScryptModifiedUser( +Appwrite.Models.User result = await users.CreateScryptModifiedUser( userId: "<USER_ID>", email: "email@example.com", password: "password", diff --git a/docs/examples/users/create-scrypt-user.md b/docs/examples/users/create-scrypt-user.md index ee7e61a1..1560c7be 100644 --- a/docs/examples/users/create-scrypt-user.md +++ b/docs/examples/users/create-scrypt-user.md @@ -10,7 +10,7 @@ Client client = new Client() Users users = new Users(client); -User result = await users.CreateScryptUser( +Appwrite.Models.User result = await users.CreateScryptUser( userId: "<USER_ID>", email: "email@example.com", password: "password", diff --git a/docs/examples/users/create-session.md b/docs/examples/users/create-session.md index 5ca7121f..03c23a0e 100644 --- a/docs/examples/users/create-session.md +++ b/docs/examples/users/create-session.md @@ -10,7 +10,7 @@ Client client = new Client() Users users = new Users(client); -Session result = await users.CreateSession( +Appwrite.Models.Session result = await users.CreateSession( userId: "<USER_ID>" ); diff --git a/docs/examples/users/create-sha-user.md b/docs/examples/users/create-sha-user.md index 8dd3a160..dcb8f750 100644 --- a/docs/examples/users/create-sha-user.md +++ b/docs/examples/users/create-sha-user.md @@ -11,7 +11,7 @@ Client client = new Client() Users users = new Users(client); -User result = await users.CreateSHAUser( +Appwrite.Models.User result = await users.CreateSHAUser( userId: "<USER_ID>", email: "email@example.com", password: "password", diff --git a/docs/examples/users/create-target.md b/docs/examples/users/create-target.md index 281996df..aaccc365 100644 --- a/docs/examples/users/create-target.md +++ b/docs/examples/users/create-target.md @@ -11,7 +11,7 @@ Client client = new Client() Users users = new Users(client); -Target result = await users.CreateTarget( +Appwrite.Models.Target result = await users.CreateTarget( userId: "<USER_ID>", targetId: "<TARGET_ID>", providerType: MessagingProviderType.Email, diff --git a/docs/examples/users/create-token.md b/docs/examples/users/create-token.md index 3d929346..1cf1954f 100644 --- a/docs/examples/users/create-token.md +++ b/docs/examples/users/create-token.md @@ -10,7 +10,7 @@ Client client = new Client() Users users = new Users(client); -Token result = await users.CreateToken( +Appwrite.Models.Token result = await users.CreateToken( userId: "<USER_ID>", length: 4, // optional expire: 60 // optional diff --git a/docs/examples/users/create.md b/docs/examples/users/create.md index fb2a8095..b29233f8 100644 --- a/docs/examples/users/create.md +++ b/docs/examples/users/create.md @@ -10,7 +10,7 @@ Client client = new Client() Users users = new Users(client); -User result = await users.Create( +Appwrite.Models.User result = await users.Create( userId: "<USER_ID>", email: "email@example.com", // optional phone: "+12065550100", // optional diff --git a/docs/examples/users/delete-passkey.md b/docs/examples/users/delete-passkey.md new file mode 100644 index 00000000..0a01c267 --- /dev/null +++ b/docs/examples/users/delete-passkey.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +await users.DeletePasskey( + userId: "<USER_ID>", + passkeyId: "<PASSKEY_ID>" +); + +``` diff --git a/docs/examples/users/get-mfa-challenge.md b/docs/examples/users/get-mfa-challenge.md index 98f2131b..0562758d 100644 --- a/docs/examples/users/get-mfa-challenge.md +++ b/docs/examples/users/get-mfa-challenge.md @@ -10,7 +10,7 @@ Client client = new Client() Users users = new Users(client); -MfaChallengeSecret result = await users.GetMFAChallenge( +Appwrite.Models.MfaChallengeSecret result = await users.GetMFAChallenge( userId: "<USER_ID>", challengeId: "<CHALLENGE_ID>" ); diff --git a/docs/examples/users/get-mfa-recovery-codes.md b/docs/examples/users/get-mfa-recovery-codes.md index b2c1e98a..e26e6703 100644 --- a/docs/examples/users/get-mfa-recovery-codes.md +++ b/docs/examples/users/get-mfa-recovery-codes.md @@ -10,7 +10,7 @@ Client client = new Client() Users users = new Users(client); -MfaRecoveryCodes result = await users.GetMFARecoveryCodes( +Appwrite.Models.MfaRecoveryCodes result = await users.GetMFARecoveryCodes( userId: "<USER_ID>" ); diff --git a/docs/examples/users/get-passkey.md b/docs/examples/users/get-passkey.md new file mode 100644 index 00000000..186046bd --- /dev/null +++ b/docs/examples/users/get-passkey.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +Appwrite.Models.Passkey result = await users.GetPasskey( + userId: "<USER_ID>", + passkeyId: "<PASSKEY_ID>" +); + +``` diff --git a/docs/examples/users/get-prefs.md b/docs/examples/users/get-prefs.md index 70f55411..e6a0784c 100644 --- a/docs/examples/users/get-prefs.md +++ b/docs/examples/users/get-prefs.md @@ -10,7 +10,7 @@ Client client = new Client() Users users = new Users(client); -Preferences result = await users.GetPrefs( +Appwrite.Models.Preferences result = await users.GetPrefs( userId: "<USER_ID>" ); diff --git a/docs/examples/users/get-target.md b/docs/examples/users/get-target.md index 3011e569..65f3eca6 100644 --- a/docs/examples/users/get-target.md +++ b/docs/examples/users/get-target.md @@ -10,7 +10,7 @@ Client client = new Client() Users users = new Users(client); -Target result = await users.GetTarget( +Appwrite.Models.Target result = await users.GetTarget( userId: "<USER_ID>", targetId: "<TARGET_ID>" ); diff --git a/docs/examples/users/get.md b/docs/examples/users/get.md index 047ed83c..69c18441 100644 --- a/docs/examples/users/get.md +++ b/docs/examples/users/get.md @@ -10,7 +10,7 @@ Client client = new Client() Users users = new Users(client); -User result = await users.Get( +Appwrite.Models.User result = await users.Get( userId: "<USER_ID>" ); diff --git a/docs/examples/users/list-identities.md b/docs/examples/users/list-identities.md index 08ee96bd..d5a501a9 100644 --- a/docs/examples/users/list-identities.md +++ b/docs/examples/users/list-identities.md @@ -10,7 +10,7 @@ Client client = new Client() Users users = new Users(client); -IdentityList result = await users.ListIdentities( +Appwrite.Models.IdentityList result = await users.ListIdentities( queries: new List<string>(), // optional search: "<SEARCH>", // optional total: false // optional diff --git a/docs/examples/users/list-memberships.md b/docs/examples/users/list-memberships.md index ad3e77a2..ddac4f9d 100644 --- a/docs/examples/users/list-memberships.md +++ b/docs/examples/users/list-memberships.md @@ -10,7 +10,7 @@ Client client = new Client() Users users = new Users(client); -MembershipList result = await users.ListMemberships( +Appwrite.Models.MembershipList result = await users.ListMemberships( userId: "<USER_ID>", queries: new List<string>(), // optional search: "<SEARCH>", // optional diff --git a/docs/examples/users/list-mfa-factors.md b/docs/examples/users/list-mfa-factors.md index c1f7365e..4522f630 100644 --- a/docs/examples/users/list-mfa-factors.md +++ b/docs/examples/users/list-mfa-factors.md @@ -10,7 +10,7 @@ Client client = new Client() Users users = new Users(client); -MfaFactors result = await users.ListMFAFactors( +Appwrite.Models.MfaFactors result = await users.ListMFAFactors( userId: "<USER_ID>" ); diff --git a/docs/examples/users/list-logs.md b/docs/examples/users/list-passkeys.md similarity index 87% rename from docs/examples/users/list-logs.md rename to docs/examples/users/list-passkeys.md index ec0ff9ac..d0964ba8 100644 --- a/docs/examples/users/list-logs.md +++ b/docs/examples/users/list-passkeys.md @@ -10,7 +10,7 @@ Client client = new Client() Users users = new Users(client); -LogList result = await users.ListLogs( +Appwrite.Models.PasskeyList result = await users.ListPasskeys( userId: "<USER_ID>", queries: new List<string>(), // optional total: false // optional diff --git a/docs/examples/users/list-sessions.md b/docs/examples/users/list-sessions.md index 49593956..1a0510bb 100644 --- a/docs/examples/users/list-sessions.md +++ b/docs/examples/users/list-sessions.md @@ -10,7 +10,7 @@ Client client = new Client() Users users = new Users(client); -SessionList result = await users.ListSessions( +Appwrite.Models.SessionList result = await users.ListSessions( userId: "<USER_ID>", total: false // optional ); diff --git a/docs/examples/users/list-targets.md b/docs/examples/users/list-targets.md index d867b06f..3e0c0084 100644 --- a/docs/examples/users/list-targets.md +++ b/docs/examples/users/list-targets.md @@ -10,7 +10,7 @@ Client client = new Client() Users users = new Users(client); -TargetList result = await users.ListTargets( +Appwrite.Models.TargetList result = await users.ListTargets( userId: "<USER_ID>", queries: new List<string>(), // optional total: false // optional diff --git a/docs/examples/users/list.md b/docs/examples/users/list.md index 8f0ad9d5..e4ecf8c9 100644 --- a/docs/examples/users/list.md +++ b/docs/examples/users/list.md @@ -10,7 +10,7 @@ Client client = new Client() Users users = new Users(client); -UserList result = await users.List( +Appwrite.Models.UserList result = await users.List( queries: new List<string>(), // optional search: "<SEARCH>", // optional total: false // optional diff --git a/docs/examples/users/update-email-verification.md b/docs/examples/users/update-email-verification.md index 0f6233c3..886722b1 100644 --- a/docs/examples/users/update-email-verification.md +++ b/docs/examples/users/update-email-verification.md @@ -10,7 +10,7 @@ Client client = new Client() Users users = new Users(client); -User result = await users.UpdateEmailVerification( +Appwrite.Models.User result = await users.UpdateEmailVerification( userId: "<USER_ID>", emailVerification: false ); diff --git a/docs/examples/users/update-email.md b/docs/examples/users/update-email.md index be7bc521..4a90b7e5 100644 --- a/docs/examples/users/update-email.md +++ b/docs/examples/users/update-email.md @@ -10,7 +10,7 @@ Client client = new Client() Users users = new Users(client); -User result = await users.UpdateEmail( +Appwrite.Models.User result = await users.UpdateEmail( userId: "<USER_ID>", email: "email@example.com" ); diff --git a/docs/examples/users/update-impersonator.md b/docs/examples/users/update-impersonator.md index 91d94e78..afdad7ff 100644 --- a/docs/examples/users/update-impersonator.md +++ b/docs/examples/users/update-impersonator.md @@ -10,7 +10,7 @@ Client client = new Client() Users users = new Users(client); -User result = await users.UpdateImpersonator( +Appwrite.Models.User result = await users.UpdateImpersonator( userId: "<USER_ID>", impersonator: false ); diff --git a/docs/examples/users/update-labels.md b/docs/examples/users/update-labels.md index f6c0b554..e02a14e9 100644 --- a/docs/examples/users/update-labels.md +++ b/docs/examples/users/update-labels.md @@ -10,9 +10,9 @@ Client client = new Client() Users users = new Users(client); -User result = await users.UpdateLabels( +Appwrite.Models.User result = await users.UpdateLabels( userId: "<USER_ID>", - labels: new List<string>() + labels: ["subscriber"] ); ``` diff --git a/docs/examples/users/update-mfa-recovery-codes.md b/docs/examples/users/update-mfa-recovery-codes.md index 78018690..24dbd92f 100644 --- a/docs/examples/users/update-mfa-recovery-codes.md +++ b/docs/examples/users/update-mfa-recovery-codes.md @@ -10,7 +10,7 @@ Client client = new Client() Users users = new Users(client); -MfaRecoveryCodes result = await users.UpdateMFARecoveryCodes( +Appwrite.Models.MfaRecoveryCodes result = await users.UpdateMFARecoveryCodes( userId: "<USER_ID>" ); diff --git a/docs/examples/users/update-mfa.md b/docs/examples/users/update-mfa.md index 4e51f9f1..e5ae2daa 100644 --- a/docs/examples/users/update-mfa.md +++ b/docs/examples/users/update-mfa.md @@ -10,7 +10,7 @@ Client client = new Client() Users users = new Users(client); -User result = await users.UpdateMFA( +Appwrite.Models.User result = await users.UpdateMFA( userId: "<USER_ID>", mfa: false ); diff --git a/docs/examples/users/update-name.md b/docs/examples/users/update-name.md index 4a58aa86..e5b84cd5 100644 --- a/docs/examples/users/update-name.md +++ b/docs/examples/users/update-name.md @@ -10,7 +10,7 @@ Client client = new Client() Users users = new Users(client); -User result = await users.UpdateName( +Appwrite.Models.User result = await users.UpdateName( userId: "<USER_ID>", name: "<NAME>" ); diff --git a/docs/examples/users/update-passkey.md b/docs/examples/users/update-passkey.md new file mode 100644 index 00000000..7551eddf --- /dev/null +++ b/docs/examples/users/update-passkey.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +Appwrite.Models.Passkey result = await users.UpdatePasskey( + userId: "<USER_ID>", + passkeyId: "<PASSKEY_ID>", + name: "<NAME>" +); + +``` diff --git a/docs/examples/users/update-password.md b/docs/examples/users/update-password.md index 4306cd73..d9f355cc 100644 --- a/docs/examples/users/update-password.md +++ b/docs/examples/users/update-password.md @@ -10,7 +10,7 @@ Client client = new Client() Users users = new Users(client); -User result = await users.UpdatePassword( +Appwrite.Models.User result = await users.UpdatePassword( userId: "<USER_ID>", password: "password" ); diff --git a/docs/examples/users/update-phone-verification.md b/docs/examples/users/update-phone-verification.md index 81fedf8a..a0c73561 100644 --- a/docs/examples/users/update-phone-verification.md +++ b/docs/examples/users/update-phone-verification.md @@ -10,7 +10,7 @@ Client client = new Client() Users users = new Users(client); -User result = await users.UpdatePhoneVerification( +Appwrite.Models.User result = await users.UpdatePhoneVerification( userId: "<USER_ID>", phoneVerification: false ); diff --git a/docs/examples/users/update-phone.md b/docs/examples/users/update-phone.md index de2a0723..fdcb6a73 100644 --- a/docs/examples/users/update-phone.md +++ b/docs/examples/users/update-phone.md @@ -10,7 +10,7 @@ Client client = new Client() Users users = new Users(client); -User result = await users.UpdatePhone( +Appwrite.Models.User result = await users.UpdatePhone( userId: "<USER_ID>", number: "+12065550100" ); diff --git a/docs/examples/users/update-prefs.md b/docs/examples/users/update-prefs.md index db20bfc8..a4a6498e 100644 --- a/docs/examples/users/update-prefs.md +++ b/docs/examples/users/update-prefs.md @@ -10,7 +10,7 @@ Client client = new Client() Users users = new Users(client); -Preferences result = await users.UpdatePrefs( +Appwrite.Models.Preferences result = await users.UpdatePrefs( userId: "<USER_ID>", prefs: [object] ); diff --git a/docs/examples/users/update-status.md b/docs/examples/users/update-status.md index bd9f4839..1e4b2393 100644 --- a/docs/examples/users/update-status.md +++ b/docs/examples/users/update-status.md @@ -10,7 +10,7 @@ Client client = new Client() Users users = new Users(client); -User result = await users.UpdateStatus( +Appwrite.Models.User result = await users.UpdateStatus( userId: "<USER_ID>", status: false ); diff --git a/docs/examples/users/update-target.md b/docs/examples/users/update-target.md index a2c18419..e6436b80 100644 --- a/docs/examples/users/update-target.md +++ b/docs/examples/users/update-target.md @@ -10,7 +10,7 @@ Client client = new Client() Users users = new Users(client); -Target result = await users.UpdateTarget( +Appwrite.Models.Target result = await users.UpdateTarget( userId: "<USER_ID>", targetId: "<TARGET_ID>", identifier: "<IDENTIFIER>", // optional diff --git a/docs/examples/vectorsdb/create-collection.md b/docs/examples/vectorsdb/create-collection.md index b0cebcd4..4d7f5327 100644 --- a/docs/examples/vectorsdb/create-collection.md +++ b/docs/examples/vectorsdb/create-collection.md @@ -10,11 +10,11 @@ Client client = new Client() VectorsDB vectorsDB = new VectorsDB(client); -VectorsdbCollection result = await vectorsDB.CreateCollection( +Appwrite.Models.VectorsdbCollection result = await vectorsDB.CreateCollection( databaseId: "<DATABASE_ID>", collectionId: "<COLLECTION_ID>", name: "<NAME>", - dimension: 1, + dimension: 4, permissions: new List<string> { Permission.Read(Role.Any()) }, // optional documentSecurity: false, // optional enabled: false // optional diff --git a/docs/examples/vectorsdb/create-document.md b/docs/examples/vectorsdb/create-document.md index 54260d78..c197e8a9 100644 --- a/docs/examples/vectorsdb/create-document.md +++ b/docs/examples/vectorsdb/create-document.md @@ -10,7 +10,7 @@ Client client = new Client() VectorsDB vectorsDB = new VectorsDB(client); -Document result = await vectorsDB.CreateDocument( +Appwrite.Models.Document result = await vectorsDB.CreateDocument( databaseId: "<DATABASE_ID>", collectionId: "<COLLECTION_ID>", documentId: "<DOCUMENT_ID>", diff --git a/docs/examples/vectorsdb/create-documents.md b/docs/examples/vectorsdb/create-documents.md index af00ea00..39ba7fb3 100644 --- a/docs/examples/vectorsdb/create-documents.md +++ b/docs/examples/vectorsdb/create-documents.md @@ -10,10 +10,23 @@ Client client = new Client() VectorsDB vectorsDB = new VectorsDB(client); -DocumentList result = await vectorsDB.CreateDocuments( +Appwrite.Models.DocumentList result = await vectorsDB.CreateDocuments( databaseId: "<DATABASE_ID>", collectionId: "<COLLECTION_ID>", - documents: new List<object>(), + documents: [ + { + "$id": "example1", + "embeddings": [ + 0.12, + -0.55, + 0.88, + 1.02 + ], + "metadata": { + "name": "First document" + } + } + ], transactionId: "<TRANSACTION_ID>" // optional ); diff --git a/docs/examples/vectorsdb/create-failover.md b/docs/examples/vectorsdb/create-failover.md index dd50d8dc..169af8ee 100644 --- a/docs/examples/vectorsdb/create-failover.md +++ b/docs/examples/vectorsdb/create-failover.md @@ -10,7 +10,7 @@ Client client = new Client() VectorsDB vectorsDB = new VectorsDB(client); -DedicatedDatabase result = await vectorsDB.CreateFailover( +Appwrite.Models.DedicatedDatabase result = await vectorsDB.CreateFailover( databaseId: "<DATABASE_ID>", targetReplicaId: "<TARGET_REPLICA_ID>" // optional ); diff --git a/docs/examples/vectorsdb/create-index.md b/docs/examples/vectorsdb/create-index.md index 5adac04c..9e803226 100644 --- a/docs/examples/vectorsdb/create-index.md +++ b/docs/examples/vectorsdb/create-index.md @@ -11,12 +11,12 @@ Client client = new Client() VectorsDB vectorsDB = new VectorsDB(client); -Index result = await vectorsDB.CreateIndex( +Appwrite.Models.Index result = await vectorsDB.CreateIndex( databaseId: "<DATABASE_ID>", collectionId: "<COLLECTION_ID>", key: "<KEY>", type: VectorsDBIndexType.HnswEuclidean, - attributes: new List<string>(), + attributes: ["embeddings"], orders: new List<OrderBy> { OrderBy.Asc }, // optional lengths: new List<long>() // optional ); diff --git a/docs/examples/vectorsdb/create-operations.md b/docs/examples/vectorsdb/create-operations.md index 346c7d24..0aea2b5d 100644 --- a/docs/examples/vectorsdb/create-operations.md +++ b/docs/examples/vectorsdb/create-operations.md @@ -10,7 +10,7 @@ Client client = new Client() VectorsDB vectorsDB = new VectorsDB(client); -Transaction result = await vectorsDB.CreateOperations( +Appwrite.Models.Transaction result = await vectorsDB.CreateOperations( transactionId: "<TRANSACTION_ID>", operations: [ { @@ -19,7 +19,15 @@ Transaction result = await vectorsDB.CreateOperations( "collectionId": "<COLLECTION_ID>", "documentId": "<DOCUMENT_ID>", "data": { - "name": "Walter O'Brien" + "embeddings": [ + 0.12, + -0.55, + 0.88, + 1.02 + ], + "metadata": { + "name": "First document" + } } } ] // optional diff --git a/docs/examples/vectorsdb/create-query.md b/docs/examples/vectorsdb/create-query.md index bcc28eda..b09e0fa7 100644 --- a/docs/examples/vectorsdb/create-query.md +++ b/docs/examples/vectorsdb/create-query.md @@ -10,7 +10,7 @@ Client client = new Client() VectorsDB vectorsDB = new VectorsDB(client); -DocumentList result = await vectorsDB.CreateQuery( +Appwrite.Models.DocumentList result = await vectorsDB.CreateQuery( databaseId: "<DATABASE_ID>", collectionId: "<COLLECTION_ID>", queries: new List<string>(), // optional diff --git a/docs/examples/vectorsdb/create-transaction.md b/docs/examples/vectorsdb/create-transaction.md index 133e6bbd..27cdbacf 100644 --- a/docs/examples/vectorsdb/create-transaction.md +++ b/docs/examples/vectorsdb/create-transaction.md @@ -10,7 +10,7 @@ Client client = new Client() VectorsDB vectorsDB = new VectorsDB(client); -Transaction result = await vectorsDB.CreateTransaction( +Appwrite.Models.Transaction result = await vectorsDB.CreateTransaction( ttl: 60 // optional ); diff --git a/docs/examples/vectorsdb/create.md b/docs/examples/vectorsdb/create.md index 5ef6db08..8783086b 100644 --- a/docs/examples/vectorsdb/create.md +++ b/docs/examples/vectorsdb/create.md @@ -10,7 +10,7 @@ Client client = new Client() VectorsDB vectorsDB = new VectorsDB(client); -Database result = await vectorsDB.Create( +Appwrite.Models.Database result = await vectorsDB.Create( databaseId: "<DATABASE_ID>", name: "<NAME>", enabled: false, // optional diff --git a/docs/examples/vectorsdb/delete-documents.md b/docs/examples/vectorsdb/delete-documents.md index e7d21a4b..3a75c78a 100644 --- a/docs/examples/vectorsdb/delete-documents.md +++ b/docs/examples/vectorsdb/delete-documents.md @@ -13,7 +13,7 @@ VectorsDB vectorsDB = new VectorsDB(client); await vectorsDB.DeleteDocuments( databaseId: "<DATABASE_ID>", collectionId: "<COLLECTION_ID>", - queries: new List<string>(), // optional + queries: ["{\"method\":\"equal\", \"attribute\":\"$id\", \"values\":[\"<DOCUMENT_ID>\"]}"], // optional transactionId: "<TRANSACTION_ID>" // optional ); diff --git a/docs/examples/vectorsdb/get-collection.md b/docs/examples/vectorsdb/get-collection.md index 9111b740..b0970dd7 100644 --- a/docs/examples/vectorsdb/get-collection.md +++ b/docs/examples/vectorsdb/get-collection.md @@ -10,7 +10,7 @@ Client client = new Client() VectorsDB vectorsDB = new VectorsDB(client); -VectorsdbCollection result = await vectorsDB.GetCollection( +Appwrite.Models.VectorsdbCollection result = await vectorsDB.GetCollection( databaseId: "<DATABASE_ID>", collectionId: "<COLLECTION_ID>" ); diff --git a/docs/examples/vectorsdb/get-document.md b/docs/examples/vectorsdb/get-document.md index 98762a93..9c838894 100644 --- a/docs/examples/vectorsdb/get-document.md +++ b/docs/examples/vectorsdb/get-document.md @@ -10,7 +10,7 @@ Client client = new Client() VectorsDB vectorsDB = new VectorsDB(client); -Document result = await vectorsDB.GetDocument( +Appwrite.Models.Document result = await vectorsDB.GetDocument( databaseId: "<DATABASE_ID>", collectionId: "<COLLECTION_ID>", documentId: "<DOCUMENT_ID>", diff --git a/docs/examples/vectorsdb/get-index.md b/docs/examples/vectorsdb/get-index.md index 6c2d1dfb..3030531f 100644 --- a/docs/examples/vectorsdb/get-index.md +++ b/docs/examples/vectorsdb/get-index.md @@ -10,7 +10,7 @@ Client client = new Client() VectorsDB vectorsDB = new VectorsDB(client); -Index result = await vectorsDB.GetIndex( +Appwrite.Models.Index result = await vectorsDB.GetIndex( databaseId: "<DATABASE_ID>", collectionId: "<COLLECTION_ID>", key: "<KEY>" diff --git a/docs/examples/vectorsdb/get-replicas.md b/docs/examples/vectorsdb/get-replicas.md index b1a849f3..e0025483 100644 --- a/docs/examples/vectorsdb/get-replicas.md +++ b/docs/examples/vectorsdb/get-replicas.md @@ -10,7 +10,7 @@ Client client = new Client() VectorsDB vectorsDB = new VectorsDB(client); -DedicatedDatabaseReplicas result = await vectorsDB.GetReplicas( +Appwrite.Models.DedicatedDatabaseReplicas result = await vectorsDB.GetReplicas( databaseId: "<DATABASE_ID>" ); diff --git a/docs/examples/vectorsdb/get-status.md b/docs/examples/vectorsdb/get-status.md index e019656d..5295da9e 100644 --- a/docs/examples/vectorsdb/get-status.md +++ b/docs/examples/vectorsdb/get-status.md @@ -10,7 +10,7 @@ Client client = new Client() VectorsDB vectorsDB = new VectorsDB(client); -DatabaseStatus result = await vectorsDB.GetStatus( +Appwrite.Models.DatabaseStatus result = await vectorsDB.GetStatus( databaseId: "<DATABASE_ID>" ); diff --git a/docs/examples/vectorsdb/get-transaction.md b/docs/examples/vectorsdb/get-transaction.md index 4cd0b3fd..382e02c3 100644 --- a/docs/examples/vectorsdb/get-transaction.md +++ b/docs/examples/vectorsdb/get-transaction.md @@ -10,7 +10,7 @@ Client client = new Client() VectorsDB vectorsDB = new VectorsDB(client); -Transaction result = await vectorsDB.GetTransaction( +Appwrite.Models.Transaction result = await vectorsDB.GetTransaction( transactionId: "<TRANSACTION_ID>" ); diff --git a/docs/examples/vectorsdb/get.md b/docs/examples/vectorsdb/get.md index 5b605e57..e7725971 100644 --- a/docs/examples/vectorsdb/get.md +++ b/docs/examples/vectorsdb/get.md @@ -10,7 +10,7 @@ Client client = new Client() VectorsDB vectorsDB = new VectorsDB(client); -Database result = await vectorsDB.Get( +Appwrite.Models.Database result = await vectorsDB.Get( databaseId: "<DATABASE_ID>" ); diff --git a/docs/examples/vectorsdb/list-collections.md b/docs/examples/vectorsdb/list-collections.md index 5e9f2737..b6986932 100644 --- a/docs/examples/vectorsdb/list-collections.md +++ b/docs/examples/vectorsdb/list-collections.md @@ -10,7 +10,7 @@ Client client = new Client() VectorsDB vectorsDB = new VectorsDB(client); -VectorsdbCollectionList result = await vectorsDB.ListCollections( +Appwrite.Models.VectorsdbCollectionList result = await vectorsDB.ListCollections( databaseId: "<DATABASE_ID>", queries: new List<string>(), // optional search: "<SEARCH>", // optional diff --git a/docs/examples/vectorsdb/list-documents.md b/docs/examples/vectorsdb/list-documents.md index 93411673..64405f46 100644 --- a/docs/examples/vectorsdb/list-documents.md +++ b/docs/examples/vectorsdb/list-documents.md @@ -10,7 +10,7 @@ Client client = new Client() VectorsDB vectorsDB = new VectorsDB(client); -DocumentList result = await vectorsDB.ListDocuments( +Appwrite.Models.DocumentList result = await vectorsDB.ListDocuments( databaseId: "<DATABASE_ID>", collectionId: "<COLLECTION_ID>", queries: new List<string>(), // optional diff --git a/docs/examples/vectorsdb/list-indexes.md b/docs/examples/vectorsdb/list-indexes.md index acf0af7a..accc8dee 100644 --- a/docs/examples/vectorsdb/list-indexes.md +++ b/docs/examples/vectorsdb/list-indexes.md @@ -10,7 +10,7 @@ Client client = new Client() VectorsDB vectorsDB = new VectorsDB(client); -IndexList result = await vectorsDB.ListIndexes( +Appwrite.Models.IndexList result = await vectorsDB.ListIndexes( databaseId: "<DATABASE_ID>", collectionId: "<COLLECTION_ID>", queries: new List<string>(), // optional diff --git a/docs/examples/vectorsdb/list-operations.md b/docs/examples/vectorsdb/list-operations.md index 90a4327f..7d700454 100644 --- a/docs/examples/vectorsdb/list-operations.md +++ b/docs/examples/vectorsdb/list-operations.md @@ -10,7 +10,7 @@ Client client = new Client() VectorsDB vectorsDB = new VectorsDB(client); -DedicatedDatabaseOperationList result = await vectorsDB.ListOperations( +Appwrite.Models.DedicatedDatabaseOperationList result = await vectorsDB.ListOperations( databaseId: "<DATABASE_ID>", status: "queued", // optional limit: 1, // optional diff --git a/docs/examples/vectorsdb/list-specifications.md b/docs/examples/vectorsdb/list-specifications.md index 652d2324..906b8bfd 100644 --- a/docs/examples/vectorsdb/list-specifications.md +++ b/docs/examples/vectorsdb/list-specifications.md @@ -10,7 +10,7 @@ Client client = new Client() VectorsDB vectorsDB = new VectorsDB(client); -DedicatedDatabaseSpecificationList result = await vectorsDB.ListSpecifications(); +Appwrite.Models.DedicatedDatabaseSpecificationList result = await vectorsDB.ListSpecifications(); ``` diff --git a/docs/examples/vectorsdb/list-transactions.md b/docs/examples/vectorsdb/list-transactions.md index 54ada0e6..11b1323b 100644 --- a/docs/examples/vectorsdb/list-transactions.md +++ b/docs/examples/vectorsdb/list-transactions.md @@ -10,8 +10,9 @@ Client client = new Client() VectorsDB vectorsDB = new VectorsDB(client); -TransactionList result = await vectorsDB.ListTransactions( - queries: new List<string>() // optional +Appwrite.Models.TransactionList result = await vectorsDB.ListTransactions( + queries: new List<string>(), // optional + total: false // optional ); ``` diff --git a/docs/examples/vectorsdb/list.md b/docs/examples/vectorsdb/list.md index f2c0e930..ca952fa8 100644 --- a/docs/examples/vectorsdb/list.md +++ b/docs/examples/vectorsdb/list.md @@ -10,7 +10,7 @@ Client client = new Client() VectorsDB vectorsDB = new VectorsDB(client); -DatabaseList result = await vectorsDB.List( +Appwrite.Models.DatabaseList result = await vectorsDB.List( queries: new List<string>(), // optional total: false // optional ); diff --git a/docs/examples/vectorsdb/update-collection.md b/docs/examples/vectorsdb/update-collection.md index bcadbda2..dad4b311 100644 --- a/docs/examples/vectorsdb/update-collection.md +++ b/docs/examples/vectorsdb/update-collection.md @@ -10,11 +10,11 @@ Client client = new Client() VectorsDB vectorsDB = new VectorsDB(client); -VectorsdbCollection result = await vectorsDB.UpdateCollection( +Appwrite.Models.VectorsdbCollection result = await vectorsDB.UpdateCollection( databaseId: "<DATABASE_ID>", collectionId: "<COLLECTION_ID>", name: "<NAME>", - dimension: 1, // optional + dimension: 4, // optional permissions: new List<string> { Permission.Read(Role.Any()) }, // optional documentSecurity: false, // optional enabled: false // optional diff --git a/docs/examples/vectorsdb/update-document.md b/docs/examples/vectorsdb/update-document.md index d1d0d078..232f5d44 100644 --- a/docs/examples/vectorsdb/update-document.md +++ b/docs/examples/vectorsdb/update-document.md @@ -10,7 +10,7 @@ Client client = new Client() VectorsDB vectorsDB = new VectorsDB(client); -Document result = await vectorsDB.UpdateDocument( +Appwrite.Models.Document result = await vectorsDB.UpdateDocument( databaseId: "<DATABASE_ID>", collectionId: "<COLLECTION_ID>", documentId: "<DOCUMENT_ID>", diff --git a/docs/examples/vectorsdb/update-documents.md b/docs/examples/vectorsdb/update-documents.md index 5833aac1..71f5d50f 100644 --- a/docs/examples/vectorsdb/update-documents.md +++ b/docs/examples/vectorsdb/update-documents.md @@ -10,7 +10,7 @@ Client client = new Client() VectorsDB vectorsDB = new VectorsDB(client); -DocumentList result = await vectorsDB.UpdateDocuments( +Appwrite.Models.DocumentList result = await vectorsDB.UpdateDocuments( databaseId: "<DATABASE_ID>", collectionId: "<COLLECTION_ID>", data: [object], // optional diff --git a/docs/examples/vectorsdb/update-transaction.md b/docs/examples/vectorsdb/update-transaction.md index 65320cc2..3f747a23 100644 --- a/docs/examples/vectorsdb/update-transaction.md +++ b/docs/examples/vectorsdb/update-transaction.md @@ -10,7 +10,7 @@ Client client = new Client() VectorsDB vectorsDB = new VectorsDB(client); -Transaction result = await vectorsDB.UpdateTransaction( +Appwrite.Models.Transaction result = await vectorsDB.UpdateTransaction( transactionId: "<TRANSACTION_ID>", commit: false, // optional rollback: false // optional diff --git a/docs/examples/vectorsdb/update.md b/docs/examples/vectorsdb/update.md index c8184ece..f55aa6d3 100644 --- a/docs/examples/vectorsdb/update.md +++ b/docs/examples/vectorsdb/update.md @@ -10,7 +10,7 @@ Client client = new Client() VectorsDB vectorsDB = new VectorsDB(client); -Database result = await vectorsDB.Update( +Appwrite.Models.Database result = await vectorsDB.Update( databaseId: "<DATABASE_ID>", name: "<NAME>", enabled: false, // optional diff --git a/docs/examples/vectorsdb/upsert-document.md b/docs/examples/vectorsdb/upsert-document.md index edb18673..ccd995c6 100644 --- a/docs/examples/vectorsdb/upsert-document.md +++ b/docs/examples/vectorsdb/upsert-document.md @@ -10,7 +10,7 @@ Client client = new Client() VectorsDB vectorsDB = new VectorsDB(client); -Document result = await vectorsDB.UpsertDocument( +Appwrite.Models.Document result = await vectorsDB.UpsertDocument( databaseId: "<DATABASE_ID>", collectionId: "<COLLECTION_ID>", documentId: "<DOCUMENT_ID>", diff --git a/docs/examples/vectorsdb/upsert-documents.md b/docs/examples/vectorsdb/upsert-documents.md index d9209fd9..b466b087 100644 --- a/docs/examples/vectorsdb/upsert-documents.md +++ b/docs/examples/vectorsdb/upsert-documents.md @@ -10,10 +10,23 @@ Client client = new Client() VectorsDB vectorsDB = new VectorsDB(client); -DocumentList result = await vectorsDB.UpsertDocuments( +Appwrite.Models.DocumentList result = await vectorsDB.UpsertDocuments( databaseId: "<DATABASE_ID>", collectionId: "<COLLECTION_ID>", - documents: new List<object>(), + documents: [ + { + "$id": "example1", + "embeddings": [ + 0.12, + -0.55, + 0.88, + 1.02 + ], + "metadata": { + "name": "First document" + } + } + ], transactionId: "<TRANSACTION_ID>" // optional ); diff --git a/docs/examples/waf/create-bypass-rule.md b/docs/examples/waf/create-bypass-rule.md new file mode 100644 index 00000000..571cea1e --- /dev/null +++ b/docs/examples/waf/create-bypass-rule.md @@ -0,0 +1,24 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Waf waf = new Waf(client); + +Appwrite.Models.WafRuleBypass result = await waf.CreateBypassRule( + ruleId: "<RULE_ID>", + resourceType: "api", + name: "<NAME>", + resourceId: "<RESOURCE_ID>", // optional + description: "<DESCRIPTION>", // optional + priority: -100000, // optional + enabled: false, // optional + conditions: new List<string>() // optional +); + +``` diff --git a/docs/examples/waf/create-challenge-rule.md b/docs/examples/waf/create-challenge-rule.md new file mode 100644 index 00000000..6f58074a --- /dev/null +++ b/docs/examples/waf/create-challenge-rule.md @@ -0,0 +1,27 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Waf waf = new Waf(client); + +Appwrite.Models.WafRuleChallenge result = await waf.CreateChallengeRule( + ruleId: "<RULE_ID>", + resourceType: "api", + name: "<NAME>", + resourceId: "<RESOURCE_ID>", // optional + description: "<DESCRIPTION>", // optional + challengeType: "compute", // optional + priority: -100000, // optional + enabled: false, // optional + conditions: new List<string>(), // optional + difficulty: 1, // optional + ttl: 900 // optional +); + +``` diff --git a/docs/examples/waf/create-deny-rule.md b/docs/examples/waf/create-deny-rule.md new file mode 100644 index 00000000..efc8295c --- /dev/null +++ b/docs/examples/waf/create-deny-rule.md @@ -0,0 +1,24 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Waf waf = new Waf(client); + +Appwrite.Models.WafRuleDeny result = await waf.CreateDenyRule( + ruleId: "<RULE_ID>", + resourceType: "api", + name: "<NAME>", + resourceId: "<RESOURCE_ID>", // optional + description: "<DESCRIPTION>", // optional + priority: -100000, // optional + enabled: false, // optional + conditions: new List<string>() // optional +); + +``` diff --git a/docs/examples/waf/create-rate-limit-rule.md b/docs/examples/waf/create-rate-limit-rule.md new file mode 100644 index 00000000..24d0b60e --- /dev/null +++ b/docs/examples/waf/create-rate-limit-rule.md @@ -0,0 +1,29 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Waf waf = new Waf(client); + +Appwrite.Models.WafRuleRateLimit result = await waf.CreateRateLimitRule( + ruleId: "<RULE_ID>", + resourceType: "api", + name: "<NAME>", + limit: 1, + interval: 1, + resourceId: "<RESOURCE_ID>", // optional + description: "<DESCRIPTION>", // optional + key: "ip", // optional + strategy: "fixedWindow", // optional + maxBucketSize: 1, // optional + priority: -100000, // optional + enabled: false, // optional + conditions: new List<string>() // optional +); + +``` diff --git a/docs/examples/waf/create-redirect-rule.md b/docs/examples/waf/create-redirect-rule.md new file mode 100644 index 00000000..e6615d2c --- /dev/null +++ b/docs/examples/waf/create-redirect-rule.md @@ -0,0 +1,26 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Waf waf = new Waf(client); + +Appwrite.Models.WafRuleRedirect result = await waf.CreateRedirectRule( + ruleId: "<RULE_ID>", + resourceType: "api", + name: "<NAME>", + location: "<LOCATION>", + statusCode: 300, + resourceId: "<RESOURCE_ID>", // optional + description: "<DESCRIPTION>", // optional + priority: -100000, // optional + enabled: false, // optional + conditions: new List<string>() // optional +); + +``` diff --git a/docs/examples/waf/delete-rule.md b/docs/examples/waf/delete-rule.md new file mode 100644 index 00000000..7cf05f3c --- /dev/null +++ b/docs/examples/waf/delete-rule.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Waf waf = new Waf(client); + +await waf.DeleteRule( + ruleId: "<RULE_ID>" +); + +``` diff --git a/docs/examples/waf/get-rule.md b/docs/examples/waf/get-rule.md new file mode 100644 index 00000000..33fba0fe --- /dev/null +++ b/docs/examples/waf/get-rule.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Waf waf = new Waf(client); + +object result = await waf.GetRule( + ruleId: "<RULE_ID>" +); + +``` diff --git a/docs/examples/waf/list-rules.md b/docs/examples/waf/list-rules.md new file mode 100644 index 00000000..7f5ce393 --- /dev/null +++ b/docs/examples/waf/list-rules.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Waf waf = new Waf(client); + +Appwrite.Models.WafRuleList result = await waf.ListRules( + queries: new List<string>(), // optional + search: "<SEARCH>", // optional + total: false // optional +); + +``` diff --git a/docs/examples/waf/update-bypass-rule.md b/docs/examples/waf/update-bypass-rule.md new file mode 100644 index 00000000..c7ab6586 --- /dev/null +++ b/docs/examples/waf/update-bypass-rule.md @@ -0,0 +1,24 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Waf waf = new Waf(client); + +Appwrite.Models.WafRuleBypass result = await waf.UpdateBypassRule( + ruleId: "<RULE_ID>", + resourceType: "api", // optional + resourceId: "<RESOURCE_ID>", // optional + name: "<NAME>", // optional + description: "<DESCRIPTION>", // optional + priority: -100000, // optional + enabled: false, // optional + conditions: new List<string>() // optional +); + +``` diff --git a/docs/examples/waf/update-challenge-rule.md b/docs/examples/waf/update-challenge-rule.md new file mode 100644 index 00000000..b4073fd6 --- /dev/null +++ b/docs/examples/waf/update-challenge-rule.md @@ -0,0 +1,27 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Waf waf = new Waf(client); + +Appwrite.Models.WafRuleChallenge result = await waf.UpdateChallengeRule( + ruleId: "<RULE_ID>", + resourceType: "api", // optional + resourceId: "<RESOURCE_ID>", // optional + name: "<NAME>", // optional + description: "<DESCRIPTION>", // optional + challengeType: "compute", // optional + priority: -100000, // optional + enabled: false, // optional + conditions: new List<string>(), // optional + difficulty: 1, // optional + ttl: 900 // optional +); + +``` diff --git a/docs/examples/waf/update-deny-rule.md b/docs/examples/waf/update-deny-rule.md new file mode 100644 index 00000000..c1885849 --- /dev/null +++ b/docs/examples/waf/update-deny-rule.md @@ -0,0 +1,24 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Waf waf = new Waf(client); + +Appwrite.Models.WafRuleDeny result = await waf.UpdateDenyRule( + ruleId: "<RULE_ID>", + resourceType: "api", // optional + resourceId: "<RESOURCE_ID>", // optional + name: "<NAME>", // optional + description: "<DESCRIPTION>", // optional + priority: -100000, // optional + enabled: false, // optional + conditions: new List<string>() // optional +); + +``` diff --git a/docs/examples/waf/update-rate-limit-rule.md b/docs/examples/waf/update-rate-limit-rule.md new file mode 100644 index 00000000..3b8f1b91 --- /dev/null +++ b/docs/examples/waf/update-rate-limit-rule.md @@ -0,0 +1,28 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Waf waf = new Waf(client); + +Appwrite.Models.WafRuleRateLimit result = await waf.UpdateRateLimitRule( + ruleId: "<RULE_ID>", + resourceType: "api", // optional + resourceId: "<RESOURCE_ID>", // optional + name: "<NAME>", // optional + description: "<DESCRIPTION>", // optional + limit: 1, // optional + interval: 1, // optional + key: "ip", // optional + maxBucketSize: 1, // optional + priority: -100000, // optional + enabled: false, // optional + conditions: new List<string>() // optional +); + +``` diff --git a/docs/examples/waf/update-redirect-rule.md b/docs/examples/waf/update-redirect-rule.md new file mode 100644 index 00000000..900bb81a --- /dev/null +++ b/docs/examples/waf/update-redirect-rule.md @@ -0,0 +1,26 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Waf waf = new Waf(client); + +Appwrite.Models.WafRuleRedirect result = await waf.UpdateRedirectRule( + ruleId: "<RULE_ID>", + resourceType: "api", // optional + resourceId: "<RESOURCE_ID>", // optional + name: "<NAME>", // optional + description: "<DESCRIPTION>", // optional + location: "<LOCATION>", // optional + statusCode: 300, // optional + priority: -100000, // optional + enabled: false, // optional + conditions: new List<string>() // optional +); + +``` diff --git a/docs/examples/webhooks/create.md b/docs/examples/webhooks/create.md index 28a5222f..6956a490 100644 --- a/docs/examples/webhooks/create.md +++ b/docs/examples/webhooks/create.md @@ -10,11 +10,11 @@ Client client = new Client() Webhooks webhooks = new Webhooks(client); -Webhook result = await webhooks.Create( +Appwrite.Models.Webhook result = await webhooks.Create( webhookId: "<WEBHOOK_ID>", url: "https://example.com/webhook", name: "<NAME>", - events: new List<string>(), + events: ["users.*.create"], enabled: false, // optional tls: false, // optional authUsername: "<AUTH_USERNAME>", // optional diff --git a/docs/examples/webhooks/get.md b/docs/examples/webhooks/get.md index 2b6ce7dd..ab24d06a 100644 --- a/docs/examples/webhooks/get.md +++ b/docs/examples/webhooks/get.md @@ -10,7 +10,7 @@ Client client = new Client() Webhooks webhooks = new Webhooks(client); -Webhook result = await webhooks.Get( +Appwrite.Models.Webhook result = await webhooks.Get( webhookId: "<WEBHOOK_ID>" ); diff --git a/docs/examples/webhooks/list.md b/docs/examples/webhooks/list.md index c8c4b065..ef7d2402 100644 --- a/docs/examples/webhooks/list.md +++ b/docs/examples/webhooks/list.md @@ -10,7 +10,7 @@ Client client = new Client() Webhooks webhooks = new Webhooks(client); -WebhookList result = await webhooks.List( +Appwrite.Models.WebhookList result = await webhooks.List( queries: new List<string>(), // optional total: false // optional ); diff --git a/docs/examples/webhooks/update-secret.md b/docs/examples/webhooks/update-secret.md index c6d94551..520b4cef 100644 --- a/docs/examples/webhooks/update-secret.md +++ b/docs/examples/webhooks/update-secret.md @@ -10,7 +10,7 @@ Client client = new Client() Webhooks webhooks = new Webhooks(client); -Webhook result = await webhooks.UpdateSecret( +Appwrite.Models.Webhook result = await webhooks.UpdateSecret( webhookId: "<WEBHOOK_ID>", secret: "<SECRET>" // optional ); diff --git a/docs/examples/webhooks/update.md b/docs/examples/webhooks/update.md index 795cfafe..c24ac7ff 100644 --- a/docs/examples/webhooks/update.md +++ b/docs/examples/webhooks/update.md @@ -10,11 +10,11 @@ Client client = new Client() Webhooks webhooks = new Webhooks(client); -Webhook result = await webhooks.Update( +Appwrite.Models.Webhook result = await webhooks.Update( webhookId: "<WEBHOOK_ID>", name: "<NAME>", url: "https://example.com/webhook", - events: new List<string>(), + events: ["users.*.create"], enabled: false, // optional tls: false, // optional authUsername: "<AUTH_USERNAME>", // optional