diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..aac467e6 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,19 @@ +# EditorConfig for the generated .NET and Unity SDKs. +# `dotnet format whitespace` is the canonical formatter; this file records the +# layout that a clean generation must already match. +root = true + +[*] +indent_style = space +indent_size = 4 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.cs] +csharp_space_after_keywords_in_control_flow_statements = true +csharp_new_line_before_else = true +csharp_new_line_before_catch = true +csharp_new_line_before_finally = true +csharp_indent_preprocessor_directives = false diff --git a/Appwrite/Appwrite.csproj b/Appwrite/Appwrite.csproj index dcd11786..02d557a9 100644 --- a/Appwrite/Appwrite.csproj +++ b/Appwrite/Appwrite.csproj @@ -2,7 +2,7 @@ netstandard2.0;net462 Appwrite - 7.0.0 + 8.0.0-rc.1 Appwrite Team Appwrite Team diff --git a/Appwrite/Client.cs b/Appwrite/Client.cs index ec1fbd4a..35475d03 100644 --- a/Appwrite/Client.cs +++ b/Appwrite/Client.cs @@ -69,18 +69,19 @@ public Client( _http = http ?? new HttpClient(); _httpForRedirect = httpForRedirect ?? new HttpClient( - new HttpClientHandler(){ + new HttpClientHandler() + { AllowAutoRedirect = false }); _headers = new Dictionary() { { "content-type", "application/json" }, - { "user-agent" , $"AppwriteDotNetSDK/7.0.0 ({Environment.OSVersion.Platform}; {Environment.OSVersion.VersionString})"}, + { "user-agent", $"AppwriteDotNetSDK/8.0.0-rc.1 ({Environment.OSVersion.Platform}; {Environment.OSVersion.VersionString})"}, { "x-sdk-name", ".NET" }, { "x-sdk-platform", "server" }, { "x-sdk-language", "dotnet" }, - { "x-sdk-version", "7.0.0"}, + { "x-sdk-version", "8.0.0-rc.1"}, { "X-Appwrite-Response-Format", "1.9.6" } }; @@ -108,7 +109,8 @@ public Client SetSelfSigned(bool selfSigned) public Client SetEndpoint(string endpoint) { - if (!endpoint.StartsWith("http://") && !endpoint.StartsWith("https://")) { + if (!endpoint.StartsWith("http://") && !endpoint.StartsWith("https://")) + { throw new AppwriteException("Invalid endpoint URL: " + endpoint); } @@ -117,14 +119,16 @@ public Client SetEndpoint(string endpoint) } /// Your project ID - public Client SetProject(string value) { + public Client SetProject(string value) + { _config["project"] = value; return this; } /// Your secret API key - public Client SetKey(string value) { + public Client SetKey(string value) + { _config["key"] = value; AddHeader("X-Appwrite-Key", value); @@ -132,7 +136,8 @@ public Client SetKey(string value) { } /// Your organization ID - public Client SetOrganization(string value) { + public Client SetOrganization(string value) + { _config["organization"] = value; AddHeader("X-Appwrite-Organization", value); @@ -140,7 +145,8 @@ public Client SetOrganization(string value) { } /// Your secret JSON Web Token - public Client SetJWT(string value) { + public Client SetJWT(string value) + { _config["jWT"] = value; AddHeader("X-Appwrite-JWT", value); @@ -148,14 +154,16 @@ public Client SetJWT(string value) { } /// The OAuth access token to authenticate with - public Client SetBearer(string value) { + public Client SetBearer(string value) + { _config["bearer"] = value; AddHeader("Authorization", "Bearer " + value); return this; } - public Client SetLocale(string value) { + public Client SetLocale(string value) + { _config["locale"] = value; AddHeader("X-Appwrite-Locale", value); @@ -163,7 +171,8 @@ public Client SetLocale(string value) { } /// The user session to authenticate with - public Client SetSession(string value) { + public Client SetSession(string value) + { _config["session"] = value; AddHeader("X-Appwrite-Session", value); @@ -171,7 +180,8 @@ public Client SetSession(string value) { } /// The user agent string of the client that made the request - public Client SetForwardedUserAgent(string value) { + public Client SetForwardedUserAgent(string value) + { _config["forwardedUserAgent"] = value; AddHeader("X-Forwarded-User-Agent", value); @@ -179,7 +189,8 @@ public Client SetForwardedUserAgent(string value) { } /// Your secret dev API key - public Client SetDevKey(string value) { + public Client SetDevKey(string value) + { _config["devKey"] = value; AddHeader("X-Appwrite-Dev-Key", value); @@ -187,7 +198,8 @@ public Client SetDevKey(string value) { } /// The user cookie to authenticate with. Used by SDKs that forward an incoming Cookie header in server-side runtimes. - public Client SetCookie(string value) { + public Client SetCookie(string value) + { _config["cookie"] = value; AddHeader("Cookie", value); @@ -195,7 +207,8 @@ public Client SetCookie(string value) { } /// Impersonate a user by ID - public Client SetImpersonateUserId(string value) { + public Client SetImpersonateUserId(string value) + { _config["impersonateUserId"] = value; AddHeader("X-Appwrite-Impersonate-User-Id", value); @@ -203,7 +216,8 @@ public Client SetImpersonateUserId(string value) { } /// Impersonate a user by email - public Client SetImpersonateUserEmail(string value) { + public Client SetImpersonateUserEmail(string value) + { _config["impersonateUserEmail"] = value; AddHeader("X-Appwrite-Impersonate-User-Email", value); @@ -211,7 +225,8 @@ public Client SetImpersonateUserEmail(string value) { } /// Impersonate a user by phone - public Client SetImpersonateUserPhone(string value) { + public Client SetImpersonateUserPhone(string value) + { _config["impersonateUserPhone"] = value; AddHeader("X-Appwrite-Impersonate-User-Phone", value); @@ -246,7 +261,7 @@ private HttpRequestMessage PrepareRequest( new HttpMethod(method), _endpoint + path + queryString); - if (headers.TryGetValue("content-type", out var contentType) && + if (headers.TryGetValue("content-type", out var contentType) && "multipart/form-data".Equals(contentType, StringComparison.OrdinalIgnoreCase)) { var form = new MultipartFormDataContent(); @@ -293,7 +308,8 @@ private HttpRequestMessage PrepareRequest( } else { - if (request.Headers.Contains(header.Key)) { + if (request.Headers.Contains(header.Key)) + { request.Headers.Remove(header.Key); } request.Headers.Add(header.Key, header.Value); @@ -312,7 +328,8 @@ private HttpRequestMessage PrepareRequest( } else { - if (request.Headers.Contains(header.Key)) { + if (request.Headers.Contains(header.Key)) + { request.Headers.Remove(header.Key); } request.Headers.Add(header.Key, header.Value); @@ -333,7 +350,8 @@ public async Task Redirect( var response = await _httpForRedirect.SendAsync(request); var code = (int)response.StatusCode; - if (code >= 400) { + if (code >= 400) + { var text = await response.Content.ReadAsStringAsync(); var message = ""; var type = ""; @@ -344,8 +362,9 @@ public async Task Redirect( contentType = contentTypes.FirstOrDefault() ?? string.Empty; } - if (contentType.Contains("application/json")) { - try + if (contentType.Contains("application/json")) + { + try { using var errorDoc = JsonDocument.Parse(text); message = errorDoc.RootElement.GetProperty("message").GetString() ?? ""; @@ -358,7 +377,9 @@ public async Task Redirect( { message = text; } - } else { + } + else + { message = text; } @@ -405,13 +426,15 @@ public async Task Call( var isJson = contentType.Contains("application/json"); - if (code >= 400) { + if (code >= 400) + { var text = await response.Content.ReadAsStringAsync(); var message = ""; var type = ""; - if (isJson) { - try + if (isJson) + { + try { using var errorDoc = JsonDocument.Parse(text); message = errorDoc.RootElement.GetProperty("message").GetString() ?? ""; @@ -424,7 +447,9 @@ public async Task Call( { message = text; } - } else { + } + else + { message = text; } @@ -463,16 +488,16 @@ public async Task ChunkedUpload( { 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)); - + var input = parameters[paramName] as InputFile; if (input == null) throw new ArgumentException($"Parameter {paramName} must be an InputFile", nameof(paramName)); - + var size = 0L; - switch(input.SourceType) + switch (input.SourceType) { case "path": var info = new FileInfo(input.Path); @@ -490,7 +515,7 @@ public async Task ChunkedUpload( throw new InvalidOperationException("Byte array data is null"); size = bytes.Length; break; - }; + } var offset = 0L; var buffer = new byte[Math.Min(size, ChunkSize)]; @@ -498,7 +523,7 @@ public async Task ChunkedUpload( if (size < ChunkSize) { - switch(input.SourceType) + switch (input.SourceType) { case "path": buffer = System.IO.File.ReadAllBytes(input.Path); @@ -534,14 +559,18 @@ public async Task ChunkedUpload( var uploadId = string.Empty; - if (!string.IsNullOrEmpty(idParamName)) + if (idParamName is not null + && idParamName.Length > 0 + && parameters.TryGetValue(idParamName, out var uploadIdValue) + && uploadIdValue != null) { + uploadId = uploadIdValue.ToString() ?? string.Empty; try { // Make a request to check if a file already exists var current = await Call>( method: "GET", - path: $"{path}/{parameters[idParamName!]}", + path: $"{path}/{uploadId}", new Dictionary { { "content-type", "application/json" } }, parameters: new Dictionary() ); @@ -550,7 +579,6 @@ public async Task ChunkedUpload( offset = Convert.ToInt64(chunksUploadedValue) * ChunkSize; } result = current; - uploadId = parameters[idParamName!]?.ToString() ?? string.Empty; } catch { @@ -565,7 +593,7 @@ async Task ReadChunkAsync(long start, long end) var length = (int)(end - start); var chunk = new byte[length]; - switch(input.SourceType) + switch (input.SourceType) { case "path": using (var chunkStream = System.IO.File.OpenRead(input.Path)) @@ -744,7 +772,7 @@ bool IsUploadComplete(Dictionary chunkResult) // Convert to non-nullable dictionary for converter var nonNullableResult = result.Where(kvp => kvp.Value != null) .ToDictionary(kvp => kvp.Key, kvp => kvp.Value!); - + return converter(nonNullableResult); } } diff --git a/Appwrite/Enums/BuildRuntime.cs b/Appwrite/Enums/BuildRuntime.cs index 573e60f1..f2440976 100644 --- a/Appwrite/Enums/BuildRuntime.cs +++ b/Appwrite/Enums/BuildRuntime.cs @@ -89,6 +89,7 @@ public BuildRuntime(string value) public static BuildRuntime Bun11 => new BuildRuntime("bun-1.1"); public static BuildRuntime Bun12 => new BuildRuntime("bun-1.2"); public static BuildRuntime Bun13 => new BuildRuntime("bun-1.3"); + public static BuildRuntime Bun14 => new BuildRuntime("bun-1.4"); public static BuildRuntime Go123 => new BuildRuntime("go-1.23"); public static BuildRuntime Go124 => new BuildRuntime("go-1.24"); public static BuildRuntime Go125 => new BuildRuntime("go-1.25"); diff --git a/Appwrite/Enums/DocumentsDBIndexType.cs b/Appwrite/Enums/DocumentsDBIndexType.cs new file mode 100644 index 00000000..ac786c1d --- /dev/null +++ b/Appwrite/Enums/DocumentsDBIndexType.cs @@ -0,0 +1,18 @@ +using System; + +namespace Appwrite.Enums +{ + public class DocumentsDBIndexType : IEnum + { + public string Value { get; private set; } + + public DocumentsDBIndexType(string value) + { + Value = value; + } + + public static DocumentsDBIndexType Key => new DocumentsDBIndexType("key"); + public static DocumentsDBIndexType Fulltext => new DocumentsDBIndexType("fulltext"); + public static DocumentsDBIndexType Unique => new DocumentsDBIndexType("unique"); + } +} diff --git a/Appwrite/Enums/EmbeddingModel.cs b/Appwrite/Enums/EmbeddingModel.cs index d4d52921..a775a655 100644 --- a/Appwrite/Enums/EmbeddingModel.cs +++ b/Appwrite/Enums/EmbeddingModel.cs @@ -12,8 +12,6 @@ public EmbeddingModel(string value) } public static EmbeddingModel NomicEmbedText => new EmbeddingModel("nomic-embed-text"); - public static EmbeddingModel EmbeddingGemma => new EmbeddingModel("embedding-gemma"); public static EmbeddingModel AllMinilm => new EmbeddingModel("all-minilm"); - public static EmbeddingModel BgeSmall => new EmbeddingModel("bge-small"); } } diff --git a/Appwrite/Enums/ExecutionResourceType.cs b/Appwrite/Enums/ExecutionResourceType.cs new file mode 100644 index 00000000..22653ec4 --- /dev/null +++ b/Appwrite/Enums/ExecutionResourceType.cs @@ -0,0 +1,17 @@ +using System; + +namespace Appwrite.Enums +{ + public class ExecutionResourceType : IEnum + { + public string Value { get; private set; } + + public ExecutionResourceType(string value) + { + Value = value; + } + + public static ExecutionResourceType Functions => new ExecutionResourceType("functions"); + public static ExecutionResourceType Sites => new ExecutionResourceType("sites"); + } +} diff --git a/Appwrite/Enums/OAuthProvider.cs b/Appwrite/Enums/OAuthProvider.cs index 7fb67664..aa2a5ddd 100644 --- a/Appwrite/Enums/OAuthProvider.cs +++ b/Appwrite/Enums/OAuthProvider.cs @@ -31,6 +31,7 @@ public OAuthProvider(string value) public static OAuthProvider Github => new OAuthProvider("github"); public static OAuthProvider Gitlab => new OAuthProvider("gitlab"); public static OAuthProvider Google => new OAuthProvider("google"); + public static OAuthProvider Huggingface => new OAuthProvider("huggingface"); public static OAuthProvider Keycloak => new OAuthProvider("keycloak"); public static OAuthProvider Kick => new OAuthProvider("kick"); public static OAuthProvider Linkedin => new OAuthProvider("linkedin"); diff --git a/Appwrite/Enums/ProjectKeyScopes.cs b/Appwrite/Enums/ProjectKeyScopes.cs index 3ba4874b..be81354b 100644 --- a/Appwrite/Enums/ProjectKeyScopes.cs +++ b/Appwrite/Enums/ProjectKeyScopes.cs @@ -13,6 +13,7 @@ public ProjectKeyScopes(string value) public static ProjectKeyScopes ProjectRead => new ProjectKeyScopes("project.read"); public static ProjectKeyScopes ProjectWrite => new ProjectKeyScopes("project.write"); + public static ProjectKeyScopes UsageRead => new ProjectKeyScopes("usage.read"); public static ProjectKeyScopes KeysRead => new ProjectKeyScopes("keys.read"); public static ProjectKeyScopes KeysWrite => new ProjectKeyScopes("keys.write"); public static ProjectKeyScopes PlatformsRead => new ProjectKeyScopes("platforms.read"); @@ -52,6 +53,18 @@ public ProjectKeyScopes(string value) public static ProjectKeyScopes AttributesWrite => new ProjectKeyScopes("attributes.write"); public static ProjectKeyScopes DocumentsRead => new ProjectKeyScopes("documents.read"); public static ProjectKeyScopes DocumentsWrite => new ProjectKeyScopes("documents.write"); + public static ProjectKeyScopes DocumentsdbRead => new ProjectKeyScopes("documentsdb.read"); + public static ProjectKeyScopes DocumentsdbWrite => new ProjectKeyScopes("documentsdb.write"); + public static ProjectKeyScopes DocumentsdbCollectionsRead => new ProjectKeyScopes("documentsdb.collections.read"); + public static ProjectKeyScopes DocumentsdbCollectionsWrite => new ProjectKeyScopes("documentsdb.collections.write"); + public static ProjectKeyScopes DocumentsdbDocumentsRead => new ProjectKeyScopes("documentsdb.documents.read"); + public static ProjectKeyScopes DocumentsdbDocumentsWrite => new ProjectKeyScopes("documentsdb.documents.write"); + public static ProjectKeyScopes VectorsdbRead => new ProjectKeyScopes("vectorsdb.read"); + public static ProjectKeyScopes VectorsdbWrite => new ProjectKeyScopes("vectorsdb.write"); + public static ProjectKeyScopes VectorsdbCollectionsRead => new ProjectKeyScopes("vectorsdb.collections.read"); + public static ProjectKeyScopes VectorsdbCollectionsWrite => new ProjectKeyScopes("vectorsdb.collections.write"); + public static ProjectKeyScopes VectorsdbDocumentsRead => new ProjectKeyScopes("vectorsdb.documents.read"); + public static ProjectKeyScopes VectorsdbDocumentsWrite => new ProjectKeyScopes("vectorsdb.documents.write"); public static ProjectKeyScopes BucketsRead => new ProjectKeyScopes("buckets.read"); public static ProjectKeyScopes BucketsWrite => new ProjectKeyScopes("buckets.write"); public static ProjectKeyScopes FilesRead => new ProjectKeyScopes("files.read"); @@ -104,7 +117,6 @@ public ProjectKeyScopes(string value) public static ProjectKeyScopes ArchivesWrite => new ProjectKeyScopes("archives.write"); public static ProjectKeyScopes RestorationsRead => new ProjectKeyScopes("restorations.read"); public static ProjectKeyScopes RestorationsWrite => new ProjectKeyScopes("restorations.write"); - public static ProjectKeyScopes DedicatedDatabasesExecute => new ProjectKeyScopes("dedicatedDatabases.execute"); public static ProjectKeyScopes DomainsRead => new ProjectKeyScopes("domains.read"); public static ProjectKeyScopes DomainsWrite => new ProjectKeyScopes("domains.write"); public static ProjectKeyScopes WafRulesRead => new ProjectKeyScopes("wafRules.read"); @@ -116,6 +128,5 @@ 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 UsageRead => new ProjectKeyScopes("usage.read"); } } diff --git a/Appwrite/Enums/ProjectOAuthProviderId.cs b/Appwrite/Enums/ProjectOAuthProviderId.cs index 83c2af26..47ded698 100644 --- a/Appwrite/Enums/ProjectOAuthProviderId.cs +++ b/Appwrite/Enums/ProjectOAuthProviderId.cs @@ -31,6 +31,7 @@ public ProjectOAuthProviderId(string value) public static ProjectOAuthProviderId Github => new ProjectOAuthProviderId("github"); public static ProjectOAuthProviderId Gitlab => new ProjectOAuthProviderId("gitlab"); public static ProjectOAuthProviderId Google => new ProjectOAuthProviderId("google"); + public static ProjectOAuthProviderId Huggingface => new ProjectOAuthProviderId("huggingface"); public static ProjectOAuthProviderId Keycloak => new ProjectOAuthProviderId("keycloak"); public static ProjectOAuthProviderId Kick => new ProjectOAuthProviderId("kick"); public static ProjectOAuthProviderId Linkedin => new ProjectOAuthProviderId("linkedin"); diff --git a/Appwrite/Enums/Runtime.cs b/Appwrite/Enums/Runtime.cs index fe288085..6b3ddc0e 100644 --- a/Appwrite/Enums/Runtime.cs +++ b/Appwrite/Enums/Runtime.cs @@ -89,6 +89,7 @@ public Runtime(string value) public static Runtime Bun11 => new Runtime("bun-1.1"); public static Runtime Bun12 => new Runtime("bun-1.2"); public static Runtime Bun13 => new Runtime("bun-1.3"); + public static Runtime Bun14 => new Runtime("bun-1.4"); public static Runtime Go123 => new Runtime("go-1.23"); public static Runtime Go124 => new Runtime("go-1.24"); public static Runtime Go125 => new Runtime("go-1.25"); diff --git a/Appwrite/Enums/VectorsDBIndexType.cs b/Appwrite/Enums/VectorsDBIndexType.cs new file mode 100644 index 00000000..82a39739 --- /dev/null +++ b/Appwrite/Enums/VectorsDBIndexType.cs @@ -0,0 +1,21 @@ +using System; + +namespace Appwrite.Enums +{ + public class VectorsDBIndexType : IEnum + { + public string Value { get; private set; } + + public VectorsDBIndexType(string value) + { + Value = value; + } + + public static VectorsDBIndexType HnswEuclidean => new VectorsDBIndexType("hnsw_euclidean"); + public static VectorsDBIndexType HnswDot => new VectorsDBIndexType("hnsw_dot"); + public static VectorsDBIndexType HnswCosine => new VectorsDBIndexType("hnsw_cosine"); + public static VectorsDBIndexType Object => new VectorsDBIndexType("object"); + public static VectorsDBIndexType Key => new VectorsDBIndexType("key"); + public static VectorsDBIndexType Unique => new VectorsDBIndexType("unique"); + } +} diff --git a/Appwrite/Extensions/Extensions.cs b/Appwrite/Extensions/Extensions.cs index 9ca30f00..798cd932 100644 --- a/Appwrite/Extensions/Extensions.cs +++ b/Appwrite/Extensions/Extensions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections; using System.Collections.Generic; using System.Linq; diff --git a/Appwrite/Models/AppInstallation.cs b/Appwrite/Models/AppInstallation.cs index 3e80b8dd..d0849954 100644 --- a/Appwrite/Models/AppInstallation.cs +++ b/Appwrite/Models/AppInstallation.cs @@ -30,7 +30,7 @@ public class AppInstallation public List Scopes { get; private set; } [JsonPropertyName("authorizationDetails")] - public object AuthorizationDetails { get; private set; } + public List AuthorizationDetails { get; private set; } [JsonPropertyName("createdById")] public string CreatedById { get; private set; } @@ -48,7 +48,7 @@ public AppInstallation( string appId, string teamId, List scopes, - object authorizationDetails, + List authorizationDetails, string createdById, string createdByName, string? lastAccessedAt @@ -73,7 +73,7 @@ public AppInstallation( appId: map["appId"].ToString(), teamId: map["teamId"].ToString(), scopes: map["scopes"].ConvertToList(), - authorizationDetails: map["authorizationDetails"], + authorizationDetails: map["authorizationDetails"].ConvertToList(), createdById: map["createdById"].ToString(), createdByName: map["createdByName"].ToString(), lastAccessedAt: map.TryGetValue("lastAccessedAt", out var lastAccessedAt) ? lastAccessedAt?.ToString() : null diff --git a/Appwrite/Models/AttributeObject.cs b/Appwrite/Models/AttributeObject.cs new file mode 100644 index 00000000..844316ef --- /dev/null +++ b/Appwrite/Models/AttributeObject.cs @@ -0,0 +1,84 @@ + +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 AttributeObject + { + [JsonPropertyName("key")] + public string Key { get; private set; } + + [JsonPropertyName("type")] + public string Type { get; private set; } + + [JsonPropertyName("status")] + public Appwrite.Enums.AttributeStatus Status { get; private set; } + + [JsonPropertyName("error")] + public string Error { get; private set; } + + [JsonPropertyName("required")] + public bool Required { get; private set; } + + [JsonPropertyName("array")] + public bool? Array { get; private set; } + + [JsonPropertyName("$createdAt")] + public string CreatedAt { get; private set; } + + [JsonPropertyName("$updatedAt")] + public string UpdatedAt { get; private set; } + + public AttributeObject( + string key, + string type, + Appwrite.Enums.AttributeStatus status, + string error, + bool required, + bool? array, + string createdAt, + string updatedAt + ) + { + Key = key; + Type = type; + Status = status; + Error = error; + Required = required; + Array = array; + CreatedAt = createdAt; + UpdatedAt = updatedAt; + } + + public static AttributeObject From(Dictionary map) => new AttributeObject( + key: map["key"].ToString(), + type: map["type"].ToString(), + status: new Appwrite.Enums.AttributeStatus(map["status"].ToString()!), + error: map["error"].ToString(), + required: (bool)map["required"], + array: map.TryGetValue("array", out var boolRaw6) && boolRaw6 != null + ? (bool?)boolRaw6 + : null, + createdAt: map["$createdAt"].ToString(), + updatedAt: map["$updatedAt"].ToString() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "key", Key }, + { "type", Type }, + { "status", Status.Value }, + { "error", Error }, + { "required", Required }, + { "array", Array }, + { "$createdAt", CreatedAt }, + { "$updatedAt", UpdatedAt } + }; + } +} diff --git a/Appwrite/Models/AttributeVector.cs b/Appwrite/Models/AttributeVector.cs new file mode 100644 index 00000000..632fedb8 --- /dev/null +++ b/Appwrite/Models/AttributeVector.cs @@ -0,0 +1,91 @@ + +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 AttributeVector + { + [JsonPropertyName("key")] + public string Key { get; private set; } + + [JsonPropertyName("type")] + public string Type { get; private set; } + + [JsonPropertyName("status")] + public Appwrite.Enums.AttributeStatus Status { get; private set; } + + [JsonPropertyName("error")] + public string Error { get; private set; } + + [JsonPropertyName("required")] + public bool Required { get; private set; } + + [JsonPropertyName("array")] + public bool? Array { get; private set; } + + [JsonPropertyName("$createdAt")] + public string CreatedAt { get; private set; } + + [JsonPropertyName("$updatedAt")] + public string UpdatedAt { get; private set; } + + [JsonPropertyName("size")] + public long Size { get; private set; } + + public AttributeVector( + string key, + string type, + Appwrite.Enums.AttributeStatus status, + string error, + bool required, + bool? array, + string createdAt, + string updatedAt, + long size + ) + { + Key = key; + Type = type; + Status = status; + Error = error; + Required = required; + Array = array; + CreatedAt = createdAt; + UpdatedAt = updatedAt; + Size = size; + } + + public static AttributeVector From(Dictionary map) => new AttributeVector( + key: map["key"].ToString(), + type: map["type"].ToString(), + status: new Appwrite.Enums.AttributeStatus(map["status"].ToString()!), + error: map["error"].ToString(), + required: (bool)map["required"], + 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"]) + ); + + public Dictionary ToMap() => new Dictionary() + { + { "key", Key }, + { "type", Type }, + { "status", Status.Value }, + { "error", Error }, + { "required", Required }, + { "array", Array }, + { "$createdAt", CreatedAt }, + { "$updatedAt", UpdatedAt }, + { "size", Size } + }; + } +} diff --git a/Appwrite/Models/BillingPlan.cs b/Appwrite/Models/BillingPlan.cs index 3d7bd37f..a1532145 100644 --- a/Appwrite/Models/BillingPlan.cs +++ b/Appwrite/Models/BillingPlan.cs @@ -170,6 +170,9 @@ public class BillingPlan [JsonPropertyName("supportsCredits")] public bool SupportsCredits { get; private set; } + [JsonPropertyName("supportsDedicatedDatabases")] + public bool SupportsDedicatedDatabases { get; private set; } + [JsonPropertyName("supportsDisposableEmailValidation")] public bool SupportsDisposableEmailValidation { get; private set; } @@ -215,6 +218,9 @@ public class BillingPlan [JsonPropertyName("program")] public Program? Program { get; private set; } + [JsonPropertyName("databaseComputeCredit")] + public double DatabaseComputeCredit { get; private set; } + [JsonPropertyName("dedicatedDatabases")] public BillingPlanDedicatedDatabaseLimits? DedicatedDatabases { get; private set; } @@ -272,6 +278,7 @@ public BillingPlan( bool supportsMockNumbers, bool supportsOrganizationRoles, bool supportsCredits, + bool supportsDedicatedDatabases, bool supportsDisposableEmailValidation, bool supportsCanonicalEmailValidation, bool supportsFreeEmailValidation, @@ -287,6 +294,7 @@ public BillingPlan( BillingPlanLimits? limits, Appwrite.Enums.BillingPlanGroup @group, Program? program, + double databaseComputeCredit, BillingPlanDedicatedDatabaseLimits? dedicatedDatabases ) { @@ -343,6 +351,7 @@ public BillingPlan( SupportsMockNumbers = supportsMockNumbers; SupportsOrganizationRoles = supportsOrganizationRoles; SupportsCredits = supportsCredits; + SupportsDedicatedDatabases = supportsDedicatedDatabases; SupportsDisposableEmailValidation = supportsDisposableEmailValidation; SupportsCanonicalEmailValidation = supportsCanonicalEmailValidation; SupportsFreeEmailValidation = supportsFreeEmailValidation; @@ -358,6 +367,7 @@ public BillingPlan( Limits = limits; Group = @group; Program = program; + DatabaseComputeCredit = databaseComputeCredit; DedicatedDatabases = dedicatedDatabases; } @@ -421,31 +431,33 @@ public BillingPlan( 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 boolRaw59) && boolRaw59 != null - ? (bool?)boolRaw59 + backupsEnabled: map.TryGetValue("backupsEnabled", out var boolRaw60) && boolRaw60 != null + ? (bool?)boolRaw60 : null, usagePerProject: (bool)map["usagePerProject"], - supportedAddons: Appwrite.Models.BillingPlanSupportedAddons.From(map: map["supportedAddons"] is JsonElement jsonObj61 ? jsonObj61.Deserialize>()! : (Dictionary)map["supportedAddons"]), - backupPolicies: map.TryGetValue("backupPolicies", out var numberRaw62) && numberRaw62 != null - ? Convert.ToInt64(numberRaw62) + supportedAddons: Appwrite.Models.BillingPlanSupportedAddons.From(map: map["supportedAddons"] is JsonElement jsonObj62 ? jsonObj62.Deserialize>()! : (Dictionary)map["supportedAddons"]), + backupPolicies: map.TryGetValue("backupPolicies", out var numberRaw63) && numberRaw63 != null + ? Convert.ToInt64(numberRaw63) : null, deploymentSize: Convert.ToInt64(map["deploymentSize"]), buildSize: Convert.ToInt64(map["buildSize"]), databasesAllowEncrypt: (bool)map["databasesAllowEncrypt"], - limits: map.TryGetValue("limits", out var objectRaw66) && objectRaw66 != null - ? Appwrite.Models.BillingPlanLimits.From(map: objectRaw66 is JsonElement jsonObj66 ? jsonObj66.Deserialize>()! : (Dictionary)objectRaw66) + limits: map.TryGetValue("limits", out var objectRaw67) && objectRaw67 != null + ? Appwrite.Models.BillingPlanLimits.From(map: objectRaw67 is JsonElement jsonObj67 ? jsonObj67.Deserialize>()! : (Dictionary)objectRaw67) : null, @group: new Appwrite.Enums.BillingPlanGroup(map["group"].ToString()!), - program: map.TryGetValue("program", out var objectRaw68) && objectRaw68 != null - ? Appwrite.Models.Program.From(map: objectRaw68 is JsonElement jsonObj68 ? jsonObj68.Deserialize>()! : (Dictionary)objectRaw68) + program: map.TryGetValue("program", out var objectRaw69) && objectRaw69 != null + ? Appwrite.Models.Program.From(map: objectRaw69 is JsonElement jsonObj69 ? jsonObj69.Deserialize>()! : (Dictionary)objectRaw69) : null, - dedicatedDatabases: map.TryGetValue("dedicatedDatabases", out var objectRaw69) && objectRaw69 != null - ? Appwrite.Models.BillingPlanDedicatedDatabaseLimits.From(map: objectRaw69 is JsonElement jsonObj69 ? jsonObj69.Deserialize>()! : (Dictionary)objectRaw69) + databaseComputeCredit: Convert.ToDouble(map["databaseComputeCredit"]), + dedicatedDatabases: map.TryGetValue("dedicatedDatabases", out var objectRaw71) && objectRaw71 != null + ? Appwrite.Models.BillingPlanDedicatedDatabaseLimits.From(map: objectRaw71 is JsonElement jsonObj71 ? jsonObj71.Deserialize>()! : (Dictionary)objectRaw71) : null ); @@ -504,6 +516,7 @@ public BillingPlan( { "supportsMockNumbers", SupportsMockNumbers }, { "supportsOrganizationRoles", SupportsOrganizationRoles }, { "supportsCredits", SupportsCredits }, + { "supportsDedicatedDatabases", SupportsDedicatedDatabases }, { "supportsDisposableEmailValidation", SupportsDisposableEmailValidation }, { "supportsCanonicalEmailValidation", SupportsCanonicalEmailValidation }, { "supportsFreeEmailValidation", SupportsFreeEmailValidation }, @@ -519,6 +532,7 @@ public BillingPlan( { "limits", Limits?.ToMap() }, { "group", Group.Value }, { "program", Program?.ToMap() }, + { "databaseComputeCredit", DatabaseComputeCredit }, { "dedicatedDatabases", DedicatedDatabases?.ToMap() } }; } diff --git a/Appwrite/Models/Database.cs b/Appwrite/Models/Database.cs index c1ade276..419a1e6a 100644 --- a/Appwrite/Models/Database.cs +++ b/Appwrite/Models/Database.cs @@ -41,6 +41,15 @@ public class Database [JsonPropertyName("replicas")] public long? Replicas { get; private set; } + [JsonPropertyName("error")] + public string? Error { get; private set; } + + [JsonPropertyName("containerStatus")] + public string? ContainerStatus { get; private set; } + + [JsonPropertyName("lifecycleState")] + public string? LifecycleState { get; private set; } + [JsonPropertyName("policies")] public List? Policies { get; private set; } @@ -58,6 +67,9 @@ public Database( string? engine, string? specification, long? replicas, + string? error, + string? containerStatus, + string? lifecycleState, List? policies, List? archives ) @@ -72,6 +84,9 @@ public Database( Engine = engine; Specification = specification; Replicas = replicas; + Error = error; + ContainerStatus = containerStatus; + LifecycleState = lifecycleState; Policies = policies; Archives = archives; } @@ -93,11 +108,14 @@ public Database( replicas: map.TryGetValue("replicas", out var numberRaw10) && numberRaw10 != null ? Convert.ToInt64(numberRaw10) : null, - policies: map.TryGetValue("policies", out var arrayRaw11) && arrayRaw11 != null - ? arrayRaw11.ConvertToList>().Select(it => Appwrite.Models.BackupPolicy.From(map: it)).ToList() + error: map.TryGetValue("error", out var error) ? error?.ToString() : null, + containerStatus: map.TryGetValue("containerStatus", out var containerStatus) ? containerStatus?.ToString() : null, + lifecycleState: map.TryGetValue("lifecycleState", out var lifecycleState) ? lifecycleState?.ToString() : null, + policies: map.TryGetValue("policies", out var arrayRaw14) && arrayRaw14 != null + ? arrayRaw14.ConvertToList>().Select(it => Appwrite.Models.BackupPolicy.From(map: it)).ToList() : null, - archives: map.TryGetValue("archives", out var arrayRaw12) && arrayRaw12 != null - ? arrayRaw12.ConvertToList>().Select(it => Appwrite.Models.BackupArchive.From(map: it)).ToList() + archives: map.TryGetValue("archives", out var arrayRaw15) && arrayRaw15 != null + ? arrayRaw15.ConvertToList>().Select(it => Appwrite.Models.BackupArchive.From(map: it)).ToList() : null ); @@ -113,6 +131,9 @@ public Database( { "engine", Engine }, { "specification", Specification }, { "replicas", Replicas }, + { "error", Error }, + { "containerStatus", ContainerStatus }, + { "lifecycleState", LifecycleState }, { "policies", Policies?.Select(it => it.ToMap()).ToList() }, { "archives", Archives?.Select(it => it.ToMap()).ToList() } }; diff --git a/Appwrite/Models/DatabaseMigration.cs b/Appwrite/Models/DatabaseMigration.cs index f6132288..200e2bab 100644 --- a/Appwrite/Models/DatabaseMigration.cs +++ b/Appwrite/Models/DatabaseMigration.cs @@ -41,6 +41,9 @@ public class DatabaseMigration [JsonPropertyName("lagDocuments")] public long LagDocuments { get; private set; } + [JsonPropertyName("changelogWatermark")] + public long ChangelogWatermark { get; private set; } + [JsonPropertyName("verifiedAt")] public string VerifiedAt { get; private set; } @@ -70,6 +73,7 @@ public DatabaseMigration( long attempt, string lastError, long lagDocuments, + long changelogWatermark, string verifiedAt, string cutoverAt, string soakUntil, @@ -88,6 +92,7 @@ bool paused Attempt = attempt; LastError = lastError; LagDocuments = lagDocuments; + ChangelogWatermark = changelogWatermark; VerifiedAt = verifiedAt; CutoverAt = cutoverAt; SoakUntil = soakUntil; @@ -107,6 +112,7 @@ bool paused 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(), @@ -127,6 +133,7 @@ bool paused { "attempt", Attempt }, { "lastError", LastError }, { "lagDocuments", LagDocuments }, + { "changelogWatermark", ChangelogWatermark }, { "verifiedAt", VerifiedAt }, { "cutoverAt", CutoverAt }, { "soakUntil", SoakUntil }, diff --git a/Appwrite/Models/DatabaseStatusReplica.cs b/Appwrite/Models/DatabaseStatusReplica.cs index b5b8442b..c197c82f 100644 --- a/Appwrite/Models/DatabaseStatusReplica.cs +++ b/Appwrite/Models/DatabaseStatusReplica.cs @@ -20,6 +20,9 @@ public class DatabaseStatusReplica [JsonPropertyName("healthy")] public bool Healthy { get; private set; } + [JsonPropertyName("replicating")] + public bool? Replicating { get; private set; } + [JsonPropertyName("lagSeconds")] public double? LagSeconds { get; private set; } @@ -27,12 +30,14 @@ public DatabaseStatusReplica( long index, string role, bool healthy, + bool? replicating, double? lagSeconds ) { Index = index; Role = role; Healthy = healthy; + Replicating = replicating; LagSeconds = lagSeconds; } @@ -40,8 +45,11 @@ public DatabaseStatusReplica( index: Convert.ToInt64(map["index"]), role: map["role"].ToString(), healthy: (bool)map["healthy"], - lagSeconds: map.TryGetValue("lagSeconds", out var numberRaw4) && numberRaw4 != null - ? Convert.ToDouble(numberRaw4) + replicating: map.TryGetValue("replicating", out var boolRaw4) && boolRaw4 != null + ? (bool?)boolRaw4 + : null, + lagSeconds: map.TryGetValue("lagSeconds", out var numberRaw5) && numberRaw5 != null + ? Convert.ToDouble(numberRaw5) : null ); @@ -50,6 +58,7 @@ public DatabaseStatusReplica( { "index", Index }, { "role", Role }, { "healthy", Healthy }, + { "replicating", Replicating }, { "lagSeconds", LagSeconds } }; } diff --git a/Appwrite/Models/DedicatedDatabaseBackup.cs b/Appwrite/Models/DedicatedDatabaseBackup.cs new file mode 100644 index 00000000..ab7cb2af --- /dev/null +++ b/Appwrite/Models/DedicatedDatabaseBackup.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 DedicatedDatabaseBackup + { + [JsonPropertyName("$id")] + public string Id { get; private set; } + + [JsonPropertyName("$createdAt")] + public string CreatedAt { get; private set; } + + [JsonPropertyName("databaseId")] + public string DatabaseId { get; private set; } + + [JsonPropertyName("projectId")] + public string ProjectId { get; private set; } + + [JsonPropertyName("policyId")] + public string PolicyId { get; private set; } + + [JsonPropertyName("trigger")] + public string Trigger { get; private set; } + + [JsonPropertyName("type")] + public string Type { get; private set; } + + [JsonPropertyName("requestedType")] + public string RequestedType { get; private set; } + + [JsonPropertyName("fallbackReason")] + public string FallbackReason { get; private set; } + + [JsonPropertyName("status")] + public string Status { get; private set; } + + [JsonPropertyName("sizeBytes")] + public long SizeBytes { get; private set; } + + [JsonPropertyName("startedAt")] + public string? StartedAt { get; private set; } + + [JsonPropertyName("completedAt")] + public string? CompletedAt { get; private set; } + + [JsonPropertyName("verifiedAt")] + public string? VerifiedAt { get; private set; } + + [JsonPropertyName("expiresAt")] + public string? ExpiresAt { get; private set; } + + [JsonPropertyName("logPosition")] + public string? LogPosition { get; private set; } + + [JsonPropertyName("error")] + public string Error { get; private set; } + + public DedicatedDatabaseBackup( + string id, + string createdAt, + string databaseId, + string projectId, + string policyId, + string trigger, + string type, + string requestedType, + string fallbackReason, + string status, + long sizeBytes, + string? startedAt, + string? completedAt, + string? verifiedAt, + string? expiresAt, + string? logPosition, + string error + ) + { + Id = id; + CreatedAt = createdAt; + DatabaseId = databaseId; + ProjectId = projectId; + PolicyId = policyId; + Trigger = trigger; + Type = type; + RequestedType = requestedType; + FallbackReason = fallbackReason; + Status = status; + SizeBytes = sizeBytes; + StartedAt = startedAt; + CompletedAt = completedAt; + VerifiedAt = verifiedAt; + ExpiresAt = expiresAt; + LogPosition = logPosition; + Error = 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"]), + 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() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "$id", Id }, + { "$createdAt", CreatedAt }, + { "databaseId", DatabaseId }, + { "projectId", ProjectId }, + { "policyId", PolicyId }, + { "trigger", Trigger }, + { "type", Type }, + { "requestedType", RequestedType }, + { "fallbackReason", FallbackReason }, + { "status", Status }, + { "sizeBytes", SizeBytes }, + { "startedAt", StartedAt }, + { "completedAt", CompletedAt }, + { "verifiedAt", VerifiedAt }, + { "expiresAt", ExpiresAt }, + { "logPosition", LogPosition }, + { "error", Error } + }; + } +} diff --git a/Appwrite/Models/DedicatedDatabaseBackupList.cs b/Appwrite/Models/DedicatedDatabaseBackupList.cs new file mode 100644 index 00000000..8793bbe5 --- /dev/null +++ b/Appwrite/Models/DedicatedDatabaseBackupList.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 DedicatedDatabaseBackupList + { + [JsonPropertyName("total")] + public long Total { get; private set; } + + [JsonPropertyName("backups")] + public List Backups { get; private set; } + + public DedicatedDatabaseBackupList( + long total, + List backups + ) + { + Total = total; + Backups = backups; + } + + public static DedicatedDatabaseBackupList From(Dictionary map) => new DedicatedDatabaseBackupList( + total: Convert.ToInt64(map["total"]), + backups: map["backups"].ConvertToList>().Select(it => Appwrite.Models.DedicatedDatabaseBackup.From(map: it)).ToList() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "total", Total }, + { "backups", Backups?.Select(it => it.ToMap()).ToList() } + }; + } +} diff --git a/Appwrite/Models/DedicatedDatabaseBackupStorage.cs b/Appwrite/Models/DedicatedDatabaseBackupStorage.cs new file mode 100644 index 00000000..57b73f2f --- /dev/null +++ b/Appwrite/Models/DedicatedDatabaseBackupStorage.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 DedicatedDatabaseBackupStorage + { + [JsonPropertyName("provider")] + public string Provider { get; private set; } + + [JsonPropertyName("bucket")] + public string Bucket { get; private set; } + + [JsonPropertyName("region")] + public string Region { get; private set; } + + [JsonPropertyName("prefix")] + public string Prefix { get; private set; } + + [JsonPropertyName("endpoint")] + public string Endpoint { get; private set; } + + public DedicatedDatabaseBackupStorage( + string provider, + string bucket, + string region, + string prefix, + string endpoint + ) + { + Provider = provider; + Bucket = bucket; + Region = region; + Prefix = prefix; + Endpoint = 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() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "provider", Provider }, + { "bucket", Bucket }, + { "region", Region }, + { "prefix", Prefix }, + { "endpoint", Endpoint } + }; + } +} diff --git a/Appwrite/Models/DedicatedDatabaseBranch.cs b/Appwrite/Models/DedicatedDatabaseBranch.cs new file mode 100644 index 00000000..9b52b6e0 --- /dev/null +++ b/Appwrite/Models/DedicatedDatabaseBranch.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 DedicatedDatabaseBranch + { + [JsonPropertyName("branchId")] + public string BranchId { get; private set; } + + [JsonPropertyName("branchName")] + public string BranchName { get; private set; } + + [JsonPropertyName("namespace")] + public string Namespace { get; private set; } + + [JsonPropertyName("expiresAt")] + public long ExpiresAt { get; private set; } + + [JsonPropertyName("host")] + public string Host { get; private set; } + + [JsonPropertyName("port")] + public long Port { get; private set; } + + [JsonPropertyName("database")] + public string Database { get; private set; } + + [JsonPropertyName("username")] + public string Username { get; private set; } + + [JsonPropertyName("password")] + public string Password { get; private set; } + + [JsonPropertyName("ssl")] + public bool Ssl { get; private set; } + + [JsonPropertyName("engine")] + public string Engine { get; private set; } + + [JsonPropertyName("connectionString")] + public string ConnectionString { get; private set; } + + public DedicatedDatabaseBranch( + string branchId, + string branchName, + string @namespace, + long expiresAt, + string host, + long port, + string database, + string username, + string password, + bool ssl, + string engine, + string connectionString + ) + { + BranchId = branchId; + BranchName = branchName; + Namespace = @namespace; + ExpiresAt = expiresAt; + Host = host; + Port = port; + Database = database; + Username = username; + Password = password; + Ssl = ssl; + Engine = engine; + ConnectionString = 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() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "branchId", BranchId }, + { "branchName", BranchName }, + { "namespace", Namespace }, + { "expiresAt", ExpiresAt }, + { "host", Host }, + { "port", Port }, + { "database", Database }, + { "username", Username }, + { "password", Password }, + { "ssl", Ssl }, + { "engine", Engine }, + { "connectionString", ConnectionString } + }; + } +} diff --git a/Appwrite/Models/DedicatedDatabaseBranchList.cs b/Appwrite/Models/DedicatedDatabaseBranchList.cs new file mode 100644 index 00000000..353f68a6 --- /dev/null +++ b/Appwrite/Models/DedicatedDatabaseBranchList.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 DedicatedDatabaseBranchList + { + [JsonPropertyName("total")] + public long Total { get; private set; } + + [JsonPropertyName("branches")] + public List Branches { get; private set; } + + public DedicatedDatabaseBranchList( + long total, + List branches + ) + { + Total = total; + Branches = branches; + } + + public static DedicatedDatabaseBranchList From(Dictionary map) => new DedicatedDatabaseBranchList( + total: Convert.ToInt64(map["total"]), + branches: map["branches"].ConvertToList>().Select(it => Appwrite.Models.DedicatedDatabaseBranch.From(map: it)).ToList() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "total", Total }, + { "branches", Branches?.Select(it => it.ToMap()).ToList() } + }; + } +} diff --git a/Appwrite/Models/DedicatedDatabaseExecution.cs b/Appwrite/Models/DedicatedDatabaseExecution.cs new file mode 100644 index 00000000..295d9800 --- /dev/null +++ b/Appwrite/Models/DedicatedDatabaseExecution.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 DedicatedDatabaseExecution + { + [JsonPropertyName("rows")] + public List Rows { get; private set; } + + [JsonPropertyName("rowCount")] + public long RowCount { get; private set; } + + [JsonPropertyName("columns")] + public List Columns { get; private set; } + + [JsonPropertyName("durationMs")] + public long DurationMs { get; private set; } + + [JsonPropertyName("truncated")] + public bool Truncated { get; private set; } + + [JsonPropertyName("bytes")] + public long Bytes { get; private set; } + + public DedicatedDatabaseExecution( + List rows, + long rowCount, + List columns, + long durationMs, + bool truncated, + long bytes + ) + { + Rows = rows; + RowCount = rowCount; + Columns = columns; + DurationMs = durationMs; + Truncated = truncated; + Bytes = bytes; + } + + public static DedicatedDatabaseExecution From(Dictionary map) => new DedicatedDatabaseExecution( + rows: map["rows"].ConvertToList(), + rowCount: Convert.ToInt64(map["rowCount"]), + 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"]) + ); + + public Dictionary ToMap() => new Dictionary() + { + { "rows", Rows }, + { "rowCount", RowCount }, + { "columns", Columns?.Select(it => it.ToMap()).ToList() }, + { "durationMs", DurationMs }, + { "truncated", Truncated }, + { "bytes", Bytes } + }; + } +} diff --git a/Appwrite/Models/DedicatedDatabaseExecutionColumn.cs b/Appwrite/Models/DedicatedDatabaseExecutionColumn.cs new file mode 100644 index 00000000..14af6ade --- /dev/null +++ b/Appwrite/Models/DedicatedDatabaseExecutionColumn.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 DedicatedDatabaseExecutionColumn + { + [JsonPropertyName("name")] + public string Name { get; private set; } + + [JsonPropertyName("type")] + public string Type { get; private set; } + + public DedicatedDatabaseExecutionColumn( + string name, + string type + ) + { + Name = name; + Type = type; + } + + public static DedicatedDatabaseExecutionColumn From(Dictionary map) => new DedicatedDatabaseExecutionColumn( + name: map["name"].ToString(), + type: map["type"].ToString() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "name", Name }, + { "type", Type } + }; + } +} diff --git a/Appwrite/Models/DedicatedDatabaseExtensions.cs b/Appwrite/Models/DedicatedDatabaseExtensions.cs new file mode 100644 index 00000000..3a7fb94c --- /dev/null +++ b/Appwrite/Models/DedicatedDatabaseExtensions.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 DedicatedDatabaseExtensions + { + [JsonPropertyName("installed")] + public List Installed { get; private set; } + + [JsonPropertyName("available")] + public List Available { get; private set; } + + [JsonPropertyName("metadata")] + public List Metadata { get; private set; } + + public DedicatedDatabaseExtensions( + List installed, + List available, + List metadata + ) + { + Installed = installed; + Available = available; + Metadata = metadata; + } + + public static DedicatedDatabaseExtensions From(Dictionary map) => new DedicatedDatabaseExtensions( + installed: map["installed"].ConvertToList(), + available: map["available"].ConvertToList(), + metadata: map["metadata"].ConvertToList>().Select(it => Appwrite.Models.PostgresExtension.From(map: it)).ToList() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "installed", Installed }, + { "available", Available }, + { "metadata", Metadata?.Select(it => it.ToMap()).ToList() } + }; + } +} diff --git a/Appwrite/Models/DedicatedDatabaseList.cs b/Appwrite/Models/DedicatedDatabaseList.cs new file mode 100644 index 00000000..95c02b4f --- /dev/null +++ b/Appwrite/Models/DedicatedDatabaseList.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 DedicatedDatabaseList + { + [JsonPropertyName("total")] + public long Total { get; private set; } + + [JsonPropertyName("databases")] + public List Databases { get; private set; } + + public DedicatedDatabaseList( + long total, + List databases + ) + { + Total = total; + Databases = databases; + } + + public static DedicatedDatabaseList From(Dictionary map) => new DedicatedDatabaseList( + total: Convert.ToInt64(map["total"]), + databases: map["databases"].ConvertToList>().Select(it => Appwrite.Models.DedicatedDatabase.From(map: it)).ToList() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "total", Total }, + { "databases", Databases?.Select(it => it.ToMap()).ToList() } + }; + } +} diff --git a/Appwrite/Models/DedicatedDatabaseMember.cs b/Appwrite/Models/DedicatedDatabaseMember.cs index 942fc564..527633e3 100644 --- a/Appwrite/Models/DedicatedDatabaseMember.cs +++ b/Appwrite/Models/DedicatedDatabaseMember.cs @@ -20,6 +20,9 @@ public class DedicatedDatabaseMember [JsonPropertyName("status")] public string Status { get; private set; } + [JsonPropertyName("replicating")] + public bool? Replicating { get; private set; } + [JsonPropertyName("lagSeconds")] public double? LagSeconds { get; private set; } @@ -27,12 +30,14 @@ public DedicatedDatabaseMember( string id, string role, string status, + bool? replicating, double? lagSeconds ) { Id = id; Role = role; Status = status; + Replicating = replicating; LagSeconds = lagSeconds; } @@ -40,8 +45,11 @@ public DedicatedDatabaseMember( id: map["$id"].ToString(), role: map["role"].ToString(), status: map["status"].ToString(), - lagSeconds: map.TryGetValue("lagSeconds", out var numberRaw4) && numberRaw4 != null - ? Convert.ToDouble(numberRaw4) + replicating: map.TryGetValue("replicating", out var boolRaw4) && boolRaw4 != null + ? (bool?)boolRaw4 + : null, + lagSeconds: map.TryGetValue("lagSeconds", out var numberRaw5) && numberRaw5 != null + ? Convert.ToDouble(numberRaw5) : null ); @@ -50,6 +58,7 @@ public DedicatedDatabaseMember( { "$id", Id }, { "role", Role }, { "status", Status }, + { "replicating", Replicating }, { "lagSeconds", LagSeconds } }; } diff --git a/Appwrite/Models/DedicatedDatabasePITRWindows.cs b/Appwrite/Models/DedicatedDatabasePITRWindows.cs new file mode 100644 index 00000000..c28ecb80 --- /dev/null +++ b/Appwrite/Models/DedicatedDatabasePITRWindows.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 DedicatedDatabasePITRWindows + { + [JsonPropertyName("earliest")] + public string Earliest { get; private set; } + + [JsonPropertyName("latest")] + public string Latest { get; private set; } + + public DedicatedDatabasePITRWindows( + string earliest, + string latest + ) + { + Earliest = earliest; + Latest = latest; + } + + public static DedicatedDatabasePITRWindows From(Dictionary map) => new DedicatedDatabasePITRWindows( + earliest: map["earliest"].ToString(), + latest: map["latest"].ToString() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "earliest", Earliest }, + { "latest", Latest } + }; + } +} diff --git a/Appwrite/Models/DedicatedDatabasePooler.cs b/Appwrite/Models/DedicatedDatabasePooler.cs new file mode 100644 index 00000000..f68c0fd9 --- /dev/null +++ b/Appwrite/Models/DedicatedDatabasePooler.cs @@ -0,0 +1,96 @@ + +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 DedicatedDatabasePooler + { + [JsonPropertyName("enabled")] + public bool Enabled { get; private set; } + + [JsonPropertyName("mode")] + public string Mode { get; private set; } + + [JsonPropertyName("maxConnections")] + public long MaxConnections { get; private set; } + + [JsonPropertyName("defaultPoolSize")] + public long DefaultPoolSize { get; private set; } + + [JsonPropertyName("port")] + public long Port { get; private set; } + + [JsonPropertyName("readWriteSplitting")] + public bool ReadWriteSplitting { get; private set; } + + [JsonPropertyName("poolerCpuRequest")] + public string PoolerCpuRequest { get; private set; } + + [JsonPropertyName("poolerCpuLimit")] + public string PoolerCpuLimit { get; private set; } + + [JsonPropertyName("poolerMemoryRequest")] + public string PoolerMemoryRequest { get; private set; } + + [JsonPropertyName("poolerMemoryLimit")] + public string PoolerMemoryLimit { get; private set; } + + public DedicatedDatabasePooler( + bool enabled, + string mode, + long maxConnections, + long defaultPoolSize, + long port, + bool readWriteSplitting, + string poolerCpuRequest, + string poolerCpuLimit, + string poolerMemoryRequest, + string poolerMemoryLimit + ) + { + Enabled = enabled; + Mode = mode; + MaxConnections = maxConnections; + DefaultPoolSize = defaultPoolSize; + Port = port; + ReadWriteSplitting = readWriteSplitting; + PoolerCpuRequest = poolerCpuRequest; + PoolerCpuLimit = poolerCpuLimit; + PoolerMemoryRequest = poolerMemoryRequest; + PoolerMemoryLimit = 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() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "enabled", Enabled }, + { "mode", Mode }, + { "maxConnections", MaxConnections }, + { "defaultPoolSize", DefaultPoolSize }, + { "port", Port }, + { "readWriteSplitting", ReadWriteSplitting }, + { "poolerCpuRequest", PoolerCpuRequest }, + { "poolerCpuLimit", PoolerCpuLimit }, + { "poolerMemoryRequest", PoolerMemoryRequest }, + { "poolerMemoryLimit", PoolerMemoryLimit } + }; + } +} diff --git a/Appwrite/Models/DedicatedDatabaseRestoration.cs b/Appwrite/Models/DedicatedDatabaseRestoration.cs new file mode 100644 index 00000000..6ade83fb --- /dev/null +++ b/Appwrite/Models/DedicatedDatabaseRestoration.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 DedicatedDatabaseRestoration + { + [JsonPropertyName("$id")] + public string Id { get; private set; } + + [JsonPropertyName("$createdAt")] + public string CreatedAt { get; private set; } + + [JsonPropertyName("databaseId")] + public string DatabaseId { get; private set; } + + [JsonPropertyName("sourceDatabaseId")] + public string SourceDatabaseId { get; private set; } + + [JsonPropertyName("projectId")] + public string ProjectId { get; private set; } + + [JsonPropertyName("backupId")] + public string BackupId { get; private set; } + + [JsonPropertyName("type")] + public string Type { get; private set; } + + [JsonPropertyName("status")] + public string Status { get; private set; } + + [JsonPropertyName("targetTime")] + public string TargetTime { get; private set; } + + [JsonPropertyName("startedAt")] + public string StartedAt { get; private set; } + + [JsonPropertyName("completedAt")] + public string CompletedAt { get; private set; } + + [JsonPropertyName("error")] + public string Error { get; private set; } + + public DedicatedDatabaseRestoration( + string id, + string createdAt, + string databaseId, + string sourceDatabaseId, + string projectId, + string backupId, + string type, + string status, + string targetTime, + string startedAt, + string completedAt, + string error + ) + { + Id = id; + CreatedAt = createdAt; + DatabaseId = databaseId; + SourceDatabaseId = sourceDatabaseId; + ProjectId = projectId; + BackupId = backupId; + Type = type; + Status = status; + TargetTime = targetTime; + StartedAt = startedAt; + CompletedAt = completedAt; + Error = 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() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "$id", Id }, + { "$createdAt", CreatedAt }, + { "databaseId", DatabaseId }, + { "sourceDatabaseId", SourceDatabaseId }, + { "projectId", ProjectId }, + { "backupId", BackupId }, + { "type", Type }, + { "status", Status }, + { "targetTime", TargetTime }, + { "startedAt", StartedAt }, + { "completedAt", CompletedAt }, + { "error", Error } + }; + } +} diff --git a/Appwrite/Models/DedicatedDatabaseRestorationList.cs b/Appwrite/Models/DedicatedDatabaseRestorationList.cs new file mode 100644 index 00000000..fc23597c --- /dev/null +++ b/Appwrite/Models/DedicatedDatabaseRestorationList.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 DedicatedDatabaseRestorationList + { + [JsonPropertyName("total")] + public long Total { get; private set; } + + [JsonPropertyName("restorations")] + public List Restorations { get; private set; } + + public DedicatedDatabaseRestorationList( + long total, + List restorations + ) + { + Total = total; + Restorations = restorations; + } + + public static DedicatedDatabaseRestorationList From(Dictionary map) => new DedicatedDatabaseRestorationList( + total: Convert.ToInt64(map["total"]), + restorations: map["restorations"].ConvertToList>().Select(it => Appwrite.Models.DedicatedDatabaseRestoration.From(map: it)).ToList() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "total", Total }, + { "restorations", Restorations?.Select(it => it.ToMap()).ToList() } + }; + } +} diff --git a/Appwrite/Models/Execution.cs b/Appwrite/Models/Execution.cs index 2393dbc0..fb131efd 100644 --- a/Appwrite/Models/Execution.cs +++ b/Appwrite/Models/Execution.cs @@ -23,8 +23,11 @@ public class Execution [JsonPropertyName("$permissions")] public List Permissions { get; private set; } - [JsonPropertyName("functionId")] - public string FunctionId { get; private set; } + [JsonPropertyName("resourceId")] + public string ResourceId { get; private set; } + + [JsonPropertyName("resourceType")] + public Appwrite.Enums.ExecutionResourceType ResourceType { get; private set; } [JsonPropertyName("deploymentId")] public string DeploymentId { get; private set; } @@ -70,7 +73,8 @@ public Execution( string createdAt, string updatedAt, List permissions, - string functionId, + string resourceId, + Appwrite.Enums.ExecutionResourceType resourceType, string deploymentId, Appwrite.Enums.ExecutionTrigger trigger, Appwrite.Enums.ExecutionStatus status, @@ -90,7 +94,8 @@ public Execution( CreatedAt = createdAt; UpdatedAt = updatedAt; Permissions = permissions; - FunctionId = functionId; + ResourceId = resourceId; + ResourceType = resourceType; DeploymentId = deploymentId; Trigger = trigger; Status = status; @@ -111,7 +116,8 @@ public Execution( createdAt: map["$createdAt"].ToString(), updatedAt: map["$updatedAt"].ToString(), permissions: map["$permissions"].ConvertToList(), - functionId: map["functionId"].ToString(), + resourceId: map["resourceId"].ToString(), + resourceType: new Appwrite.Enums.ExecutionResourceType(map["resourceType"].ToString()!), deploymentId: map["deploymentId"].ToString(), trigger: new Appwrite.Enums.ExecutionTrigger(map["trigger"].ToString()!), status: new Appwrite.Enums.ExecutionStatus(map["status"].ToString()!), @@ -133,7 +139,8 @@ public Execution( { "$createdAt", CreatedAt }, { "$updatedAt", UpdatedAt }, { "$permissions", Permissions }, - { "functionId", FunctionId }, + { "resourceId", ResourceId }, + { "resourceType", ResourceType.Value }, { "deploymentId", DeploymentId }, { "trigger", Trigger.Value }, { "status", Status.Value }, diff --git a/Appwrite/Models/OAuth2Google.cs b/Appwrite/Models/OAuth2Google.cs index b8875a2e..cb8118da 100644 --- a/Appwrite/Models/OAuth2Google.cs +++ b/Appwrite/Models/OAuth2Google.cs @@ -55,7 +55,7 @@ public OAuth2Google( { "enabled", Enabled }, { "clientId", ClientId }, { "clientSecret", ClientSecret }, - { "prompt", Prompt } + { "prompt", Prompt.Select(it => it.Value).ToList() } }; } } diff --git a/Appwrite/Models/OAuth2HuggingFace.cs b/Appwrite/Models/OAuth2HuggingFace.cs new file mode 100644 index 00000000..a74c9546 --- /dev/null +++ b/Appwrite/Models/OAuth2HuggingFace.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 OAuth2HuggingFace + { + [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 OAuth2HuggingFace( + string id, + bool enabled, + string clientId, + string clientSecret + ) + { + Id = id; + Enabled = enabled; + ClientId = clientId; + ClientSecret = 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() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "$id", Id }, + { "enabled", Enabled }, + { "clientId", ClientId }, + { "clientSecret", ClientSecret } + }; + } +} diff --git a/Appwrite/Models/OAuth2Oidc.cs b/Appwrite/Models/OAuth2Oidc.cs index 89d5341a..4422ce6c 100644 --- a/Appwrite/Models/OAuth2Oidc.cs +++ b/Appwrite/Models/OAuth2Oidc.cs @@ -91,7 +91,7 @@ public OAuth2Oidc( { "authorizationURL", AuthorizationURL }, { "tokenURL", TokenURL }, { "userInfoURL", UserInfoURL }, - { "prompt", Prompt }, + { "prompt", Prompt.Select(it => it.Value).ToList() }, { "maxAge", MaxAge } }; } diff --git a/Appwrite/Models/OrderType.cs b/Appwrite/Models/OrderType.cs index 6b2e9f87..e8d93959 100644 --- a/Appwrite/Models/OrderType.cs +++ b/Appwrite/Models/OrderType.cs @@ -2,7 +2,7 @@ namespace Appwrite { public enum OrderType { - ASC, + ASC, DESC } } diff --git a/Appwrite/Models/PostgresExtension.cs b/Appwrite/Models/PostgresExtension.cs new file mode 100644 index 00000000..e3e7e02a --- /dev/null +++ b/Appwrite/Models/PostgresExtension.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 PostgresExtension + { + [JsonPropertyName("key")] + public string Key { get; private set; } + + [JsonPropertyName("name")] + public string Name { get; private set; } + + [JsonPropertyName("description")] + public string Description { get; private set; } + + [JsonPropertyName("category")] + public string Category { get; private set; } + + public PostgresExtension( + string key, + string name, + string description, + string category + ) + { + Key = key; + Name = name; + Description = description; + Category = 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() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "key", Key }, + { "name", Name }, + { "description", Description }, + { "category", Category } + }; + } +} diff --git a/Appwrite/Models/Project.cs b/Appwrite/Models/Project.cs index 40a48031..302fde8f 100644 --- a/Appwrite/Models/Project.cs +++ b/Appwrite/Models/Project.cs @@ -93,7 +93,7 @@ public class Project public string ConsoleAccessedAt { get; private set; } [JsonPropertyName("wafEnabled")] - public bool WafEnabled { get; private set; } + public bool? WafEnabled { get; private set; } [JsonPropertyName("billingLimits")] public BillingLimits? BillingLimits { get; private set; } @@ -177,7 +177,7 @@ public Project( List protocols, List blocks, string consoleAccessedAt, - bool wafEnabled, + bool? wafEnabled, BillingLimits? billingLimits, bool? oAuth2ServerEnabled, string? oAuth2ServerAuthorizationUrl, @@ -274,7 +274,9 @@ public Project( 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: (bool)map["wafEnabled"], + wafEnabled: map.TryGetValue("wafEnabled", out var boolRaw28) && boolRaw28 != null + ? (bool?)boolRaw28 + : null, billingLimits: map.TryGetValue("billingLimits", out var objectRaw29) && objectRaw29 != null ? Appwrite.Models.BillingLimits.From(map: objectRaw29 is JsonElement jsonObj29 ? jsonObj29.Deserialize>()! : (Dictionary)objectRaw29) : null, diff --git a/Appwrite/Models/Site.cs b/Appwrite/Models/Site.cs index 1d1a70c4..9ea61b3d 100644 --- a/Appwrite/Models/Site.cs +++ b/Appwrite/Models/Site.cs @@ -59,6 +59,9 @@ public class Site [JsonPropertyName("latestDeploymentStatus")] public string LatestDeploymentStatus { get; private set; } + [JsonPropertyName("scopes")] + public List Scopes { get; private set; } + [JsonPropertyName("vars")] public List Vars { get; private set; } @@ -130,6 +133,7 @@ public Site( string latestDeploymentId, string latestDeploymentCreatedAt, string latestDeploymentStatus, + List scopes, List vars, long timeout, string installCommand, @@ -166,6 +170,7 @@ string fallbackFile LatestDeploymentId = latestDeploymentId; LatestDeploymentCreatedAt = latestDeploymentCreatedAt; LatestDeploymentStatus = latestDeploymentStatus; + Scopes = scopes; Vars = vars; Timeout = timeout; InstallCommand = installCommand; @@ -203,6 +208,7 @@ string fallbackFile latestDeploymentId: map["latestDeploymentId"].ToString(), latestDeploymentCreatedAt: map["latestDeploymentCreatedAt"].ToString(), latestDeploymentStatus: map["latestDeploymentStatus"].ToString(), + scopes: map["scopes"].ConvertToList(), vars: map["vars"].ConvertToList>().Select(it => Appwrite.Models.Variable.From(map: it)).ToList(), timeout: Convert.ToInt64(map["timeout"]), installCommand: map["installCommand"].ToString(), @@ -241,6 +247,7 @@ string fallbackFile { "latestDeploymentId", LatestDeploymentId }, { "latestDeploymentCreatedAt", LatestDeploymentCreatedAt }, { "latestDeploymentStatus", LatestDeploymentStatus }, + { "scopes", Scopes }, { "vars", Vars?.Select(it => it.ToMap()).ToList() }, { "timeout", Timeout }, { "installCommand", InstallCommand }, diff --git a/Appwrite/Models/VectorsdbCollection.cs b/Appwrite/Models/VectorsdbCollection.cs new file mode 100644 index 00000000..0d54364b --- /dev/null +++ b/Appwrite/Models/VectorsdbCollection.cs @@ -0,0 +1,117 @@ + +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 VectorsdbCollection + { + [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("$permissions")] + public List Permissions { get; private set; } + + [JsonPropertyName("databaseId")] + public string DatabaseId { get; private set; } + + [JsonPropertyName("name")] + public string Name { get; private set; } + + [JsonPropertyName("enabled")] + public bool Enabled { get; private set; } + + [JsonPropertyName("documentSecurity")] + public bool DocumentSecurity { get; private set; } + + [JsonPropertyName("attributes")] + public List Attributes { get; private set; } + + [JsonPropertyName("indexes")] + public List Indexes { get; private set; } + + [JsonPropertyName("bytesMax")] + public long BytesMax { get; private set; } + + [JsonPropertyName("bytesUsed")] + public long BytesUsed { get; private set; } + + [JsonPropertyName("dimension")] + public long Dimension { get; private set; } + + public VectorsdbCollection( + string id, + string createdAt, + string updatedAt, + List permissions, + string databaseId, + string name, + bool enabled, + bool documentSecurity, + List attributes, + List indexes, + long bytesMax, + long bytesUsed, + long dimension + ) + { + Id = id; + CreatedAt = createdAt; + UpdatedAt = updatedAt; + Permissions = permissions; + DatabaseId = databaseId; + Name = name; + Enabled = enabled; + DocumentSecurity = documentSecurity; + Attributes = attributes; + Indexes = indexes; + BytesMax = bytesMax; + BytesUsed = bytesUsed; + Dimension = dimension; + } + + public static VectorsdbCollection From(Dictionary map) => new VectorsdbCollection( + id: map["$id"].ToString(), + createdAt: map["$createdAt"].ToString(), + updatedAt: map["$updatedAt"].ToString(), + permissions: map["$permissions"].ConvertToList(), + databaseId: map["databaseId"].ToString(), + name: map["name"].ToString(), + enabled: (bool)map["enabled"], + documentSecurity: (bool)map["documentSecurity"], + 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"]) + ); + + public Dictionary ToMap() => new Dictionary() + { + { "$id", Id }, + { "$createdAt", CreatedAt }, + { "$updatedAt", UpdatedAt }, + { "$permissions", Permissions }, + { "databaseId", DatabaseId }, + { "name", Name }, + { "enabled", Enabled }, + { "documentSecurity", DocumentSecurity }, + { "attributes", Attributes }, + { "indexes", Indexes?.Select(it => it.ToMap()).ToList() }, + { "bytesMax", BytesMax }, + { "bytesUsed", BytesUsed }, + { "dimension", Dimension } + }; + } +} diff --git a/Appwrite/Models/VectorsdbCollectionList.cs b/Appwrite/Models/VectorsdbCollectionList.cs new file mode 100644 index 00000000..3536d571 --- /dev/null +++ b/Appwrite/Models/VectorsdbCollectionList.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 VectorsdbCollectionList + { + [JsonPropertyName("total")] + public long Total { get; private set; } + + [JsonPropertyName("collections")] + public List Collections { get; private set; } + + public VectorsdbCollectionList( + long total, + List collections + ) + { + Total = total; + Collections = collections; + } + + public static VectorsdbCollectionList From(Dictionary map) => new VectorsdbCollectionList( + total: Convert.ToInt64(map["total"]), + collections: map["collections"].ConvertToList>().Select(it => Appwrite.Models.VectorsdbCollection.From(map: it)).ToList() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "total", Total }, + { "collections", Collections?.Select(it => it.ToMap()).ToList() } + }; + } +} diff --git a/Appwrite/Query.cs b/Appwrite/Query.cs index 9142a0de..caaacb75 100644 --- a/Appwrite/Query.cs +++ b/Appwrite/Query.cs @@ -10,10 +10,10 @@ public class Query { [JsonPropertyName("method")] public string Method { get; set; } = string.Empty; - + [JsonPropertyName("attribute")] public string? Attribute { get; set; } - + [JsonPropertyName("values")] public List? Values { get; set; } @@ -156,27 +156,33 @@ public static string CursorAfter(string documentId) return new Query("cursorAfter", null, documentId).ToString(); } - public static string CursorBefore(string documentId) { + public static string CursorBefore(string documentId) + { return new Query("cursorBefore", null, documentId).ToString(); } - public static string OrderAsc(string attribute) { + public static string OrderAsc(string attribute) + { return new Query("orderAsc", attribute, null).ToString(); } - public static string OrderDesc(string attribute) { + public static string OrderDesc(string attribute) + { return new Query("orderDesc", attribute, null).ToString(); } - public static string OrderRandom() { + public static string OrderRandom() + { return new Query("orderRandom", null, null).ToString(); } - public static string Limit(int limit) { + public static string Limit(int limit) + { return new Query("limit", null, limit).ToString(); } - public static string Offset(int offset) { + public static string Offset(int offset) + { return new Query("offset", null, offset).ToString(); } @@ -185,7 +191,8 @@ public static string Offset(int offset) { /// For string attributes, checks if the string contains the substring. /// /// For array attributes, use or instead. - public static string Contains(string attribute, object value) { + public static string Contains(string attribute, object value) + { return new Query("contains", attribute, value).ToString(); } @@ -194,7 +201,8 @@ public static string Contains(string attribute, object value) { /// For array and relationship attributes, matches documents where the attribute /// contains at least one of the given values. /// - public static string ContainsAny(string attribute, IList value) { + public static string ContainsAny(string attribute, IList value) + { return new Query("containsAny", attribute, value).ToString(); } @@ -203,67 +211,83 @@ public static string ContainsAny(string attribute, IList value) { /// For array and relationship attributes, matches documents where the attribute /// contains every one of the given values. /// - public static string ContainsAll(string attribute, IList value) { + public static string ContainsAll(string attribute, IList value) + { return new Query("containsAll", attribute, value).ToString(); } - public static string NotContains(string attribute, object value) { + public static string NotContains(string attribute, object value) + { return new Query("notContains", attribute, value).ToString(); } - public static string NotSearch(string attribute, string value) { + public static string NotSearch(string attribute, string value) + { return new Query("notSearch", attribute, value).ToString(); } - public static string NotBetween(string attribute, string start, string end) { + public static string NotBetween(string attribute, string start, string end) + { return new Query("notBetween", attribute, new List { start, end }).ToString(); } - public static string NotBetween(string attribute, int start, int end) { + public static string NotBetween(string attribute, int start, int end) + { return new Query("notBetween", attribute, new List { start, end }).ToString(); } - public static string NotBetween(string attribute, double start, double end) { + public static string NotBetween(string attribute, double start, double end) + { return new Query("notBetween", attribute, new List { start, end }).ToString(); } - public static string NotStartsWith(string attribute, string value) { + public static string NotStartsWith(string attribute, string value) + { return new Query("notStartsWith", attribute, value).ToString(); } - public static string NotEndsWith(string attribute, string value) { + public static string NotEndsWith(string attribute, string value) + { return new Query("notEndsWith", attribute, value).ToString(); } - public static string CreatedBefore(string value) { + public static string CreatedBefore(string value) + { return LessThan("$createdAt", value); } - public static string CreatedAfter(string value) { + public static string CreatedAfter(string value) + { return GreaterThan("$createdAt", value); } - public static string CreatedBetween(string start, string end) { + public static string CreatedBetween(string start, string end) + { return Between("$createdAt", start, end); } - public static string UpdatedBefore(string value) { + public static string UpdatedBefore(string value) + { return LessThan("$updatedAt", value); } - public static string UpdatedAfter(string value) { + public static string UpdatedAfter(string value) + { return GreaterThan("$updatedAt", value); } - public static string UpdatedBetween(string start, string end) { + public static string UpdatedBetween(string start, string end) + { return Between("$updatedAt", start, end); } - public static string Or(List queries) { + public static string Or(List queries) + { return new Query("or", null, queries.Select(q => JsonSerializer.Deserialize(q, Client.DeserializerOptions)).ToList()).ToString(); } - public static string And(List queries) { + public static string And(List queries) + { return new Query("and", null, queries.Select(q => JsonSerializer.Deserialize(q, Client.DeserializerOptions)).ToList()).ToString(); } @@ -273,7 +297,8 @@ public static string And(List queries) { /// The attribute containing the array to filter on. /// The list of query strings to match against array elements. /// The query string. - public static string ElemMatch(string attribute, List queries) { + public static string ElemMatch(string attribute, List queries) + { var parsed = queries .Select(q => JsonSerializer.Deserialize(q, Client.DeserializerOptions) as object) .ToList(); diff --git a/Appwrite/Services/Avatars.cs b/Appwrite/Services/Avatars.cs index 06deb177..af856579 100644 --- a/Appwrite/Services/Avatars.cs +++ b/Appwrite/Services/Avatars.cs @@ -247,6 +247,53 @@ public Task GetInitials(string? name = null, long? width = null, long? h + return _client.Call( + method: "GET", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!); + + } + + /// + /// 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. + /// + /// The photo resolves for the currently authenticated user unless `userId` + /// points at another user. Passing `emailHash` and/or `name` resolves the + /// avatar from those values alone: the hash is looked up on Gravatar and + /// Libravatar, the name is rendered as initials, and the user's own identity + /// photos, email, and name leave the chain so they never shadow the avatar + /// being asked for. Emails are only ever accepted pre-hashed, so no address + /// ends up in a URL. + /// + /// + public Task GetPhoto(long? width = null, long? height = null, long? quality = null, string? output = null, string? rating = null, string? userId = null, string? emailHash = null, string? name = null) + { + var apiPath = "/avatars/photo"; + + var apiParameters = new Dictionary() + { + { "width", width }, + { "height", height }, + { "quality", quality }, + { "output", output }, + { "rating", rating }, + { "userId", userId }, + { "emailHash", emailHash }, + { "name", name } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "image/*" } + }; + + + return _client.Call( method: "GET", path: apiPath, diff --git a/Appwrite/Services/DocumentsDB.cs b/Appwrite/Services/DocumentsDB.cs new file mode 100644 index 00000000..bf6c43d1 --- /dev/null +++ b/Appwrite/Services/DocumentsDB.cs @@ -0,0 +1,1413 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Appwrite.Models; +using Appwrite.Enums; + +namespace Appwrite.Services +{ + public class DocumentsDB : Service + { + public DocumentsDB(Client client) : base(client) + { + } + + /// + /// Get a list of all databases from the current Appwrite project. You can use + /// the search parameter to filter your results. + /// + /// + public Task List(List? queries = null, bool? total = null) + { + var apiPath = "/documentsdb"; + + var apiParameters = new Dictionary() + { + { "queries", queries }, + { "total", total } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DatabaseList Convert(Dictionary it) + { + return Models.DatabaseList.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 Database. + /// + /// + /// + public Task Create(string databaseId, string name, bool? enabled = null, string? specification = null, long? replicas = null, string? syncMode = null) + { + var apiPath = "/documentsdb"; + + var apiParameters = new Dictionary() + { + { "databaseId", databaseId }, + { "name", name }, + { "enabled", enabled }, + { "specification", specification }, + { "replicas", replicas }, + { "syncMode", syncMode } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.Database Convert(Dictionary it) + { + return Models.Database.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 dedicated database specifications available on the current plan. + /// Each specification reports its resource limits, pricing, and whether it is + /// enabled for the organization. + /// + /// + public Task ListSpecifications() + { + var apiPath = "/documentsdb/specifications"; + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseSpecificationList Convert(Dictionary it) + { + return Models.DedicatedDatabaseSpecificationList.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); + + } + + /// + /// List transactions across all databases. + /// + /// + public Task ListTransactions(List? queries = null) + { + var apiPath = "/documentsdb/transactions"; + + var apiParameters = new Dictionary() + { + { "queries", queries } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.TransactionList Convert(Dictionary it) + { + return Models.TransactionList.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 transaction. + /// + /// + public Task CreateTransaction(long? ttl = null) + { + var apiPath = "/documentsdb/transactions"; + + var apiParameters = new Dictionary() + { + { "ttl", ttl } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.Transaction Convert(Dictionary it) + { + return Models.Transaction.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 transaction by its unique ID. + /// + /// + public Task GetTransaction(string transactionId) + { + var apiPath = "/documentsdb/transactions/{transactionId}" + .Replace("{transactionId}", transactionId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.Transaction Convert(Dictionary it) + { + return Models.Transaction.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); + + } + + /// + /// Update a transaction, to either commit or roll back its operations. + /// + /// + public Task UpdateTransaction(string transactionId, bool? commit = null, bool? rollback = null) + { + var apiPath = "/documentsdb/transactions/{transactionId}" + .Replace("{transactionId}", transactionId); + + var apiParameters = new Dictionary() + { + { "commit", commit }, + { "rollback", rollback } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.Transaction Convert(Dictionary it) + { + return Models.Transaction.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 transaction by its unique ID. + /// + /// + public Task DeleteTransaction(string transactionId) + { + var apiPath = "/documentsdb/transactions/{transactionId}" + .Replace("{transactionId}", transactionId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "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)!); + + } + + /// + /// Create multiple operations in a single transaction. + /// + /// + public Task CreateOperations(string transactionId, List? operations = null) + { + var apiPath = "/documentsdb/transactions/{transactionId}/operations" + .Replace("{transactionId}", transactionId); + + var apiParameters = new Dictionary() + { + { "operations", operations } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.Transaction Convert(Dictionary it) + { + return Models.Transaction.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 database by its unique ID. This endpoint response returns a JSON + /// object with the database metadata. + /// + /// + public Task Get(string databaseId) + { + var apiPath = "/documentsdb/{databaseId}" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.Database Convert(Dictionary it) + { + return Models.Database.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); + + } + + /// + /// Update a database by its unique ID. + /// + /// + public Task Update(string databaseId, string name, bool? enabled = null, string? specification = null, long? replicas = null, string? syncMode = null) + { + var apiPath = "/documentsdb/{databaseId}" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "name", name }, + { "enabled", enabled }, + { "specification", specification }, + { "replicas", replicas }, + { "syncMode", syncMode } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.Database Convert(Dictionary it) + { + return Models.Database.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); + + } + + /// + /// Delete a database by its unique ID. Only API keys with with databases.write + /// scope can delete a database. + /// + /// + public Task Delete(string databaseId) + { + var apiPath = "/documentsdb/{databaseId}" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "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)!); + + } + + /// + /// Get a list of all collections that belong to the provided databaseId. You + /// can use the search parameter to filter your results. + /// + /// + public Task ListCollections(string databaseId, List? queries = null, string? search = null, bool? total = null) + { + var apiPath = "/documentsdb/{databaseId}/collections" + .Replace("{databaseId}", databaseId); + + 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.CollectionList Convert(Dictionary it) + { + return Models.CollectionList.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 Collection. Before using this route, you should create a new + /// database resource using either a [server + /// integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) + /// API or directly from your database console. + /// + /// + public Task CreateCollection(string databaseId, string collectionId, string name, List? permissions = null, bool? documentSecurity = null, bool? enabled = null, List? attributes = null, List? indexes = null) + { + var apiPath = "/documentsdb/{databaseId}/collections" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "collectionId", collectionId }, + { "name", name }, + { "permissions", permissions }, + { "documentSecurity", documentSecurity }, + { "enabled", enabled }, + { "attributes", attributes }, + { "indexes", indexes } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.Collection Convert(Dictionary it) + { + return Models.Collection.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 collection by its unique ID. This endpoint response returns a JSON + /// object with the collection metadata. + /// + /// + public Task GetCollection(string databaseId, string collectionId) + { + var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.Collection Convert(Dictionary it) + { + return Models.Collection.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); + + } + + /// + /// Update a collection by its unique ID. + /// + /// + public Task UpdateCollection(string databaseId, string collectionId, string name, List? permissions = null, bool? documentSecurity = null, bool? enabled = null, bool? purge = null) + { + var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId); + + var apiParameters = new Dictionary() + { + { "name", name }, + { "permissions", permissions }, + { "documentSecurity", documentSecurity }, + { "enabled", enabled }, + { "purge", purge } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.Collection Convert(Dictionary it) + { + return Models.Collection.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); + + } + + /// + /// Delete a collection by its unique ID. Only users with write permissions + /// have access to delete this resource. + /// + /// + public Task DeleteCollection(string databaseId, string collectionId) + { + var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "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)!); + + } + + /// + /// Get a list of all the user's documents in a given collection. You can use + /// the query params to filter your results. + /// + /// + public Task ListDocuments(string databaseId, string collectionId, List? queries = null, string? transactionId = null, bool? total = null, long? ttl = null) + { + var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId); + + var apiParameters = new Dictionary() + { + { "queries", queries }, + { "transactionId", transactionId }, + { "total", total }, + { "ttl", ttl } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DocumentList Convert(Dictionary it) + { + return Models.DocumentList.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 Document. Before using this route, you should create a new + /// collection resource using either a [server + /// integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) + /// API or directly from your database console. + /// + /// + public Task CreateDocument(string databaseId, string collectionId, string documentId, object data, List? permissions = null) + { + var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId); + + var apiParameters = new Dictionary() + { + { "documentId", documentId }, + { "data", data }, + { "permissions", permissions } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.Document Convert(Dictionary it) + { + return Models.Document.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); + + } + + /// + /// Create new Documents. Before using this route, you should create a new + /// collection resource using either a [server + /// integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) + /// API or directly from your database console. + /// + /// + public Task CreateDocuments(string databaseId, string collectionId, List documents) + { + var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId); + + var apiParameters = new Dictionary() + { + { "documents", documents } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DocumentList Convert(Dictionary it) + { + return Models.DocumentList.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); + + } + + /// + /// Create or update Documents. Before using this route, you should create a + /// new collection resource using either a [server + /// integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) + /// API or directly from your database console. + /// + /// + /// + public Task UpsertDocuments(string databaseId, string collectionId, List documents, string? transactionId = null) + { + var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId); + + var apiParameters = new Dictionary() + { + { "documents", documents }, + { "transactionId", transactionId } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DocumentList Convert(Dictionary it) + { + return Models.DocumentList.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 all documents that match your queries, if no queries are submitted + /// then all documents are updated. You can pass only specific fields to be + /// updated. + /// + /// + public Task UpdateDocuments(string databaseId, string collectionId, object? data = null, List? queries = null, string? transactionId = null) + { + var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId); + + var apiParameters = new Dictionary() + { + { "data", data }, + { "queries", queries }, + { "transactionId", transactionId } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DocumentList Convert(Dictionary it) + { + return Models.DocumentList.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); + + } + + /// + /// Bulk delete documents using queries, if no queries are passed then all + /// documents are deleted. + /// + /// + public Task DeleteDocuments(string databaseId, string collectionId, List? queries = null, string? transactionId = null) + { + var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId); + + var apiParameters = new Dictionary() + { + { "queries", queries }, + { "transactionId", transactionId } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DocumentList Convert(Dictionary it) + { + return Models.DocumentList.From(map: it); + } + + 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); + + } + + /// + /// Get a document by its unique ID. This endpoint response returns a JSON + /// object with the document data. + /// + /// + public Task GetDocument(string databaseId, string collectionId, string documentId, List? queries = null, string? transactionId = null) + { + var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents/{documentId}" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId) + .Replace("{documentId}", documentId); + + var apiParameters = new Dictionary() + { + { "queries", queries }, + { "transactionId", transactionId } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.Document Convert(Dictionary it) + { + return Models.Document.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 or update a Document. Before using this route, you should create a + /// new collection resource using either a [server + /// integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) + /// API or directly from your database console. + /// + /// + public Task UpsertDocument(string databaseId, string collectionId, string documentId, object? data = null, List? permissions = null, string? transactionId = null) + { + var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents/{documentId}" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId) + .Replace("{documentId}", documentId); + + var apiParameters = new Dictionary() + { + { "data", data }, + { "permissions", permissions }, + { "transactionId", transactionId } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.Document Convert(Dictionary it) + { + return Models.Document.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 a document by its unique ID. Using the patch method you can pass + /// only specific fields that will get updated. + /// + /// + public Task UpdateDocument(string databaseId, string collectionId, string documentId, object? data = null, List? permissions = null, string? transactionId = null) + { + var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents/{documentId}" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId) + .Replace("{documentId}", documentId); + + var apiParameters = new Dictionary() + { + { "data", data }, + { "permissions", permissions }, + { "transactionId", transactionId } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.Document Convert(Dictionary it) + { + return Models.Document.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 document by its unique ID. + /// + /// + public Task DeleteDocument(string databaseId, string collectionId, string documentId, string? transactionId = null) + { + var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents/{documentId}" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId) + .Replace("{documentId}", documentId); + + var apiParameters = new Dictionary() + { + { "transactionId", transactionId } + }; + + var apiHeaders = new Dictionary() + { + { "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)!); + + } + + /// + /// Decrement a specific column of a row by a given value. + /// + /// + public Task DecrementDocumentAttribute(string databaseId, string collectionId, string documentId, string attribute, double? @value = null, double? min = null, string? transactionId = null) + { + var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/decrement" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId) + .Replace("{documentId}", documentId) + .Replace("{attribute}", attribute); + + var apiParameters = new Dictionary() + { + { "value", @value }, + { "min", min }, + { "transactionId", transactionId } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.Document Convert(Dictionary it) + { + return Models.Document.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); + + } + + /// + /// Increment a specific column of a row by a given value. + /// + /// + public Task IncrementDocumentAttribute(string databaseId, string collectionId, string documentId, string attribute, double? @value = null, double? max = null, string? transactionId = null) + { + var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/increment" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId) + .Replace("{documentId}", documentId) + .Replace("{attribute}", attribute); + + var apiParameters = new Dictionary() + { + { "value", @value }, + { "max", max }, + { "transactionId", transactionId } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.Document Convert(Dictionary it) + { + return Models.Document.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 indexes in the collection. + /// + /// + public Task ListIndexes(string databaseId, string collectionId, List? queries = null, bool? total = null) + { + var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/indexes" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId); + + var apiParameters = new Dictionary() + { + { "queries", queries }, + { "total", total } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.IndexList Convert(Dictionary it) + { + return Models.IndexList.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); + + } + + /// + /// Creates an index on the attributes listed. Your index should include all + /// the attributes you will query in a single request. + /// Attributes can be `key`, `fulltext`, and `unique`. + /// + /// + public Task CreateIndex(string databaseId, string collectionId, string key, Appwrite.Enums.DocumentsDBIndexType type, List attributes, List? orders = null, List? lengths = null) + { + var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/indexes" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId); + + var apiParameters = new Dictionary() + { + { "key", key }, + { "type", type?.Value }, + { "attributes", attributes }, + { "orders", orders?.Select(e => e.Value).ToList() }, + { "lengths", lengths } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.Index Convert(Dictionary it) + { + return Models.Index.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 index by ID. + /// + /// + public Task GetIndex(string databaseId, string collectionId, string key) + { + var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/indexes/{key}" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId) + .Replace("{key}", key); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.Index Convert(Dictionary it) + { + return Models.Index.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 an index. + /// + /// + public Task DeleteIndex(string databaseId, string collectionId, string key) + { + var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/indexes/{key}" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId) + .Replace("{key}", key); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "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)!); + + } + + /// + /// Trigger a manual failover for a dedicated database with high availability + /// enabled. Promotes a replica to primary. The failover runs asynchronously; + /// poll the database document for status updates. A database left + /// mid-operation also accepts this call as a repair once nothing is driving + /// the operation it is stuck in. Repairing a failover that did not finish, a + /// `failed` database, a stranded upgrade or migrate, or a stranded compute + /// resize additionally requires `targetReplicaId` to name the member to + /// promote, because the default target may be the member that operation + /// already promoted. + /// + /// + public Task CreateFailover(string databaseId, string? targetReplicaId = null) + { + var apiPath = "/documentsdb/{databaseId}/failovers" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "targetReplicaId", targetReplicaId } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabase Convert(Dictionary it) + { + return Models.DedicatedDatabase.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 lifecycle operations recorded for a dedicated database, newest + /// first. Every provision, update, restore, backup and replication action is + /// recorded here with its outcome, including an attempt that was abandoned + /// because another worker took over the database. + /// + /// + public Task ListOperations(string databaseId, string? status = null, long? limit = null, long? offset = null) + { + var apiPath = "/documentsdb/{databaseId}/operations" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "status", status }, + { "limit", limit }, + { "offset", offset } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseOperationList Convert(Dictionary it) + { + return Models.DedicatedDatabaseOperationList.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 high availability status for a dedicated database. Returns replica + /// statuses, replication lag, and sync mode. + /// + /// + public Task GetReplicas(string databaseId) + { + var apiPath = "/documentsdb/{databaseId}/replicas" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseReplicas Convert(Dictionary it) + { + return Models.DedicatedDatabaseReplicas.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 real-time health and status information for a dedicated database. + /// Returns health status, readiness, uptime, connection info, replica status, + /// and volume information. + /// + /// + public Task GetStatus(string databaseId) + { + var apiPath = "/documentsdb/{databaseId}/status" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DatabaseStatus Convert(Dictionary it) + { + return Models.DatabaseStatus.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); + + } + + } +} diff --git a/Appwrite/Services/Mongo.cs b/Appwrite/Services/Mongo.cs new file mode 100644 index 00000000..ed073f24 --- /dev/null +++ b/Appwrite/Services/Mongo.cs @@ -0,0 +1,1204 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Appwrite.Models; +using Appwrite.Enums; + +namespace Appwrite.Services +{ + public class Mongo : Service + { + public Mongo(Client client) : base(client) + { + } + + /// + /// List all dedicated databases. Results support pagination. + /// + /// + public Task List(List? queries = null) + { + var apiPath = "/mongo"; + + var apiParameters = new Dictionary() + { + { "queries", queries } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseList Convert(Dictionary it) + { + return Models.DedicatedDatabaseList.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 dedicated database with the chosen engine and configuration. + /// Status will be 'provisioning' until the database is ready. + /// + /// + public Task Create(string databaseId, string name, string? version = 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) + { + var apiPath = "/mongo"; + + var apiParameters = new Dictionary() + { + { "databaseId", databaseId }, + { "name", name }, + { "version", version }, + { "specification", specification }, + { "replicas", replicas }, + { "syncMode", syncMode }, + { "networkIdleTimeoutSeconds", networkIdleTimeoutSeconds }, + { "networkIPAllowlist", networkIPAllowlist }, + { "idleTimeoutMinutes", idleTimeoutMinutes }, + { "pitr", pitr }, + { "pitrRetentionDays", pitrRetentionDays }, + { "storageAutoscaling", storageAutoscaling }, + { "storageAutoscalingThresholdPercent", storageAutoscalingThresholdPercent }, + { "storageAutoscalingMaxGb", storageAutoscalingMaxGb } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabase Convert(Dictionary it) + { + return Models.DedicatedDatabase.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 dedicated database specifications available on the current plan. + /// Each specification reports its resource limits, pricing, and whether it is + /// enabled for the organization. + /// + /// + public Task ListSpecifications() + { + var apiPath = "/mongo/specifications"; + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseSpecificationList Convert(Dictionary it) + { + return Models.DedicatedDatabaseSpecificationList.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 dedicated database by its unique ID. Returns the database + /// configuration and current status. + /// + /// + public Task Get(string databaseId) + { + var apiPath = "/mongo/{databaseId}" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabase Convert(Dictionary it) + { + return Models.DedicatedDatabase.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); + + } + + /// + /// Update a dedicated database configuration. All changes are applied with + /// zero downtime. Specification changes (cpu, memory, storage) are handled via + /// rolling cutover. Storage expansion is done online. All other settings are + /// applied in-place. + /// + /// + 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) + { + var apiPath = "/mongo/{databaseId}" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "name", name }, + { "status", status }, + { "specification", specification }, + { "replicas", replicas }, + { "syncMode", syncMode }, + { "networkIdleTimeoutSeconds", networkIdleTimeoutSeconds }, + { "networkIPAllowlist", networkIPAllowlist }, + { "idleTimeoutMinutes", idleTimeoutMinutes }, + { "pitr", pitr }, + { "pitrRetentionDays", pitrRetentionDays }, + { "storageAutoscaling", storageAutoscaling }, + { "storageAutoscalingThresholdPercent", storageAutoscalingThresholdPercent }, + { "storageAutoscalingMaxGb", storageAutoscalingMaxGb }, + { "metricsTraceSampleRate", metricsTraceSampleRate }, + { "metricsSlowQueryLogThresholdMs", metricsSlowQueryLogThresholdMs }, + { "sqlApiEnabled", sqlApiEnabled }, + { "sqlApiAllowedStatements", sqlApiAllowedStatements }, + { "sqlApiMaxRows", sqlApiMaxRows }, + { "sqlApiMaxBytes", sqlApiMaxBytes }, + { "sqlApiTimeoutSeconds", sqlApiTimeoutSeconds } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabase Convert(Dictionary it) + { + return Models.DedicatedDatabase.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 dedicated database. This action is irreversible. The database + /// status will be set to 'deleting' and all resources will be cleaned up. + /// Deletion is allowed from any state, and repeating the call re-dispatches + /// the cleanup. + /// + /// + public Task Delete(string databaseId) + { + var apiPath = "/mongo/{databaseId}" + .Replace("{databaseId}", databaseId); + + 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)!); + + } + + /// + /// List all backups for a dedicated database. Results can be filtered by + /// status and type. + /// + /// + public Task ListBackups(string databaseId, List? queries = null) + { + var apiPath = "/mongo/{databaseId}/backups" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "queries", queries } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseBackupList Convert(Dictionary it) + { + return Models.DedicatedDatabaseBackupList.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 manual backup of a dedicated database. The backup will be created + /// asynchronously and its status can be checked via the get backup endpoint. + /// + /// + public Task CreateBackup(string databaseId, string? type = null) + { + var apiPath = "/mongo/{databaseId}/backups" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "type", type } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseBackup Convert(Dictionary it) + { + return Models.DedicatedDatabaseBackup.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 scheduled backup policies for a dedicated database. + /// + /// + public Task ListBackupPolicies(string databaseId, List? queries = null) + { + var apiPath = "/mongo/{databaseId}/backups/policies" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "queries", queries } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.BackupPolicyList Convert(Dictionary it) + { + return Models.BackupPolicyList.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 scheduled backup policy for a dedicated database. + /// + /// + public Task CreateBackupPolicy(string databaseId, string policyId, string name, string schedule, long retention, string? type = null, bool? enabled = null) + { + var apiPath = "/mongo/{databaseId}/backups/policies" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "policyId", policyId }, + { "name", name }, + { "schedule", schedule }, + { "retention", retention }, + { "type", type }, + { "enabled", enabled } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.BackupPolicy Convert(Dictionary it) + { + return Models.BackupPolicy.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 scheduled backup policy for a dedicated database. + /// + /// + public Task GetBackupPolicy(string databaseId, string policyId) + { + var apiPath = "/mongo/{databaseId}/backups/policies/{policyId}" + .Replace("{databaseId}", databaseId) + .Replace("{policyId}", policyId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.BackupPolicy Convert(Dictionary it) + { + return Models.BackupPolicy.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); + + } + + /// + /// Update a scheduled backup policy for a dedicated database. + /// + /// + public Task UpdateBackupPolicy(string databaseId, string policyId, string? name = null, string? schedule = null, long? retention = null, bool? enabled = null) + { + var apiPath = "/mongo/{databaseId}/backups/policies/{policyId}" + .Replace("{databaseId}", databaseId) + .Replace("{policyId}", policyId); + + var apiParameters = new Dictionary() + { + { "name", name }, + { "schedule", schedule }, + { "retention", retention }, + { "enabled", enabled } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.BackupPolicy Convert(Dictionary it) + { + return Models.BackupPolicy.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 scheduled backup policy for a dedicated database. Backups already + /// taken by the policy are kept until their retention expires. + /// + /// + public Task DeleteBackupPolicy(string databaseId, string policyId) + { + var apiPath = "/mongo/{databaseId}/backups/policies/{policyId}" + .Replace("{databaseId}", databaseId) + .Replace("{policyId}", policyId); + + 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)!); + + } + + /// + /// Configure off-cluster backup storage for a dedicated database. Supports S3, + /// GCS, and Azure Blob Storage destinations. Backups will be stored to the + /// configured destination in addition to on-cluster storage. + /// + /// + public Task UpdateBackupStorage(string databaseId, string provider, string bucket, string accessKey, string secretKey, string? region = null, string? prefix = null, string? endpoint = null) + { + var apiPath = "/mongo/{databaseId}/backups/storage" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "provider", provider }, + { "bucket", bucket }, + { "region", region }, + { "prefix", prefix }, + { "endpoint", endpoint }, + { "accessKey", accessKey }, + { "secretKey", secretKey } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseBackupStorage Convert(Dictionary it) + { + return Models.DedicatedDatabaseBackupStorage.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 details of a specific database backup including its status, size, and + /// timestamps. + /// + /// + public Task GetBackup(string databaseId, string backupId) + { + var apiPath = "/mongo/{databaseId}/backups/{backupId}" + .Replace("{databaseId}", databaseId) + .Replace("{backupId}", backupId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseBackup Convert(Dictionary it) + { + return Models.DedicatedDatabaseBackup.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 database backup. This will permanently remove the backup from + /// storage and cannot be undone. + /// + /// + public Task DeleteBackup(string databaseId, string backupId) + { + var apiPath = "/mongo/{databaseId}/backups/{backupId}" + .Replace("{databaseId}", databaseId) + .Replace("{backupId}", backupId); + + 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)!); + + } + + /// + /// List all ephemeral branches for a dedicated database. Returns branch + /// metadata including ID, name, namespace, and expiration time. + /// + /// + public Task ListBranches(string databaseId) + { + var apiPath = "/mongo/{databaseId}/branches" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseBranchList Convert(Dictionary it) + { + return Models.DedicatedDatabaseBranchList.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 an ephemeral database branch from the primary via PVC snapshot. The + /// branch is a full copy of the database at the current point in time, useful + /// for testing schema migrations or running experiments without affecting + /// production data. Branches expire after the configured TTL (default 24 + /// hours). The branch is created asynchronously. + /// + /// + public Task CreateBranch(string databaseId, string? branchId = null, long? ttl = null) + { + var apiPath = "/mongo/{databaseId}/branches" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "branchId", branchId }, + { "ttl", ttl } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabase Convert(Dictionary it) + { + return Models.DedicatedDatabase.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); + + } + + /// + /// Delete an ephemeral database branch. This removes the branch namespace, its + /// PVC, and the associated VolumeSnapshot. The deletion runs asynchronously + /// and is irreversible. + /// + /// + public Task DeleteBranch(string databaseId, string branchId) + { + var apiPath = "/mongo/{databaseId}/branches/{branchId}" + .Replace("{databaseId}", databaseId) + .Replace("{branchId}", branchId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabase Convert(Dictionary it) + { + return Models.DedicatedDatabase.From(map: it); + } + + 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); + + } + + /// + /// Rotate the primary connection credentials for a dedicated database. + /// Generates a new password and updates the database atomically. Previous + /// credentials stop working immediately. Returns the database with a refreshed + /// connection string carrying the new password. + /// + /// + public Task UpdateCredentials(string databaseId) + { + var apiPath = "/mongo/{databaseId}/credentials" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabase Convert(Dictionary it) + { + return Models.DedicatedDatabase.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); + + } + + /// + /// Trigger a manual failover for a dedicated database with high availability + /// enabled. Promotes a replica to primary. The failover runs asynchronously; + /// poll the database document for status updates. A database left + /// mid-operation also accepts this call as a repair once nothing is driving + /// the operation it is stuck in. Repairing a failover that did not finish, a + /// `failed` database, a stranded upgrade or migrate, or a stranded compute + /// resize additionally requires `targetReplicaId` to name the member to + /// promote, because the default target may be the member that operation + /// already promoted. + /// + /// + public Task CreateFailover(string databaseId, string? targetReplicaId = null) + { + var apiPath = "/mongo/{databaseId}/failovers" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "targetReplicaId", targetReplicaId } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabase Convert(Dictionary it) + { + return Models.DedicatedDatabase.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 the maintenance window for a dedicated database. Maintenance + /// operations like minor version upgrades will be performed during this + /// window. + /// + /// + public Task UpdateMaintenance(string databaseId, string day, long hourUtc) + { + var apiPath = "/mongo/{databaseId}/maintenance" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "day", day }, + { "hourUtc", hourUtc } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabase Convert(Dictionary it) + { + return Models.DedicatedDatabase.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); + + } + + /// + /// Migrate a database between shared and dedicated types. Shared to dedicated + /// provisions an always-on dedicated instance; dedicated to shared converts to + /// a serverless instance that scales to zero when idle. Data is copied to the + /// target with a brief read-only window during cutover. + /// + /// + public Task CreateMigration(string databaseId, string targetType, string? specification = null) + { + var apiPath = "/mongo/{databaseId}/migrations" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "targetType", targetType }, + { "specification", specification } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabase Convert(Dictionary it) + { + return Models.DedicatedDatabase.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 lifecycle operations recorded for a dedicated database, newest + /// first. Every provision, update, restore, backup and replication action is + /// recorded here with its outcome, including an attempt that was abandoned + /// because another worker took over the database. + /// + /// + public Task ListOperations(string databaseId, string? status = null, long? limit = null, long? offset = null) + { + var apiPath = "/mongo/{databaseId}/operations" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "status", status }, + { "limit", limit }, + { "offset", offset } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseOperationList Convert(Dictionary it) + { + return Models.DedicatedDatabaseOperationList.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 available point-in-time recovery windows for a dedicated database. + /// Returns the earliest and latest recovery points. + /// + /// + public Task GetPitr(string databaseId) + { + var apiPath = "/mongo/{databaseId}/pitr" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabasePITRWindows Convert(Dictionary it) + { + return Models.DedicatedDatabasePITRWindows.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 high availability status for a dedicated database. Returns replica + /// statuses, replication lag, and sync mode. + /// + /// + public Task GetReplicas(string databaseId) + { + var apiPath = "/mongo/{databaseId}/replicas" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseReplicas Convert(Dictionary it) + { + return Models.DedicatedDatabaseReplicas.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); + + } + + /// + /// List all restorations for a dedicated database. Results can be filtered by + /// status and type. + /// + /// + public Task ListRestorations(string databaseId, string? status = null, string? type = null, long? limit = null, long? offset = null) + { + var apiPath = "/mongo/{databaseId}/restorations" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "status", status }, + { "type", type }, + { "limit", limit }, + { "offset", offset } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseRestorationList Convert(Dictionary it) + { + return Models.DedicatedDatabaseRestorationList.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); + + } + + /// + /// Restore a database from a backup or to a specific point in time (PITR). For + /// backup restoration, provide a backupId. For PITR, provide a targetTime as + /// an ISO 8601 datetime. PITR requires the database to have PITR enabled and + /// is only available for enterprise databases. + /// + /// + public Task CreateRestoration(string databaseId, string? type = null, string? backupId = null, string? targetDatabaseId = null, string? targetTime = null) + { + var apiPath = "/mongo/{databaseId}/restorations" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "type", type }, + { "backupId", backupId }, + { "targetDatabaseId", targetDatabaseId }, + { "targetTime", targetTime } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseRestoration Convert(Dictionary it) + { + return Models.DedicatedDatabaseRestoration.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 details of a specific database restoration including its status, type, + /// and timestamps. + /// + /// + public Task GetRestoration(string databaseId, string restorationId) + { + var apiPath = "/mongo/{databaseId}/restorations/{restorationId}" + .Replace("{databaseId}", databaseId) + .Replace("{restorationId}", restorationId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseRestoration Convert(Dictionary it) + { + return Models.DedicatedDatabaseRestoration.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 real-time health and status information for a dedicated database. + /// Returns health status, readiness, uptime, connection info, replica status, + /// and volume information. + /// + /// + public Task GetStatus(string databaseId) + { + var apiPath = "/mongo/{databaseId}/status" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DatabaseStatus Convert(Dictionary it) + { + return Models.DatabaseStatus.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); + + } + + /// + /// Upgrade a dedicated database to a new engine version. Uses blue-green + /// deployment for zero-downtime cutover. + /// + /// + public Task CreateUpgrade(string databaseId, string targetVersion) + { + var apiPath = "/mongo/{databaseId}/upgrades" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "targetVersion", targetVersion } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabase Convert(Dictionary it) + { + return Models.DedicatedDatabase.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); + + } + + } +} diff --git a/Appwrite/Services/Mysql.cs b/Appwrite/Services/Mysql.cs new file mode 100644 index 00000000..2fc6e1d4 --- /dev/null +++ b/Appwrite/Services/Mysql.cs @@ -0,0 +1,1329 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Appwrite.Models; +using Appwrite.Enums; + +namespace Appwrite.Services +{ + public class Mysql : Service + { + public Mysql(Client client) : base(client) + { + } + + /// + /// List all dedicated databases. Results support pagination. + /// + /// + public Task List(List? queries = null) + { + var apiPath = "/mysql"; + + var apiParameters = new Dictionary() + { + { "queries", queries } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseList Convert(Dictionary it) + { + return Models.DedicatedDatabaseList.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 dedicated database with the chosen engine and configuration. + /// Status will be 'provisioning' until the database is ready. + /// + /// + public Task Create(string databaseId, string name, string? version = 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) + { + var apiPath = "/mysql"; + + var apiParameters = new Dictionary() + { + { "databaseId", databaseId }, + { "name", name }, + { "version", version }, + { "specification", specification }, + { "replicas", replicas }, + { "syncMode", syncMode }, + { "networkIdleTimeoutSeconds", networkIdleTimeoutSeconds }, + { "networkIPAllowlist", networkIPAllowlist }, + { "idleTimeoutMinutes", idleTimeoutMinutes }, + { "pitr", pitr }, + { "pitrRetentionDays", pitrRetentionDays }, + { "storageAutoscaling", storageAutoscaling }, + { "storageAutoscalingThresholdPercent", storageAutoscalingThresholdPercent }, + { "storageAutoscalingMaxGb", storageAutoscalingMaxGb } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabase Convert(Dictionary it) + { + return Models.DedicatedDatabase.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 dedicated database specifications available on the current plan. + /// Each specification reports its resource limits, pricing, and whether it is + /// enabled for the organization. + /// + /// + public Task ListSpecifications() + { + var apiPath = "/mysql/specifications"; + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseSpecificationList Convert(Dictionary it) + { + return Models.DedicatedDatabaseSpecificationList.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 dedicated database by its unique ID. Returns the database + /// configuration and current status. + /// + /// + public Task Get(string databaseId) + { + var apiPath = "/mysql/{databaseId}" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabase Convert(Dictionary it) + { + return Models.DedicatedDatabase.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); + + } + + /// + /// Update a dedicated database configuration. All changes are applied with + /// zero downtime. Specification changes (cpu, memory, storage) are handled via + /// rolling cutover. Storage expansion is done online. All other settings are + /// applied in-place. + /// + /// + 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) + { + var apiPath = "/mysql/{databaseId}" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "name", name }, + { "status", status }, + { "specification", specification }, + { "replicas", replicas }, + { "syncMode", syncMode }, + { "networkIdleTimeoutSeconds", networkIdleTimeoutSeconds }, + { "networkIPAllowlist", networkIPAllowlist }, + { "idleTimeoutMinutes", idleTimeoutMinutes }, + { "pitr", pitr }, + { "pitrRetentionDays", pitrRetentionDays }, + { "storageAutoscaling", storageAutoscaling }, + { "storageAutoscalingThresholdPercent", storageAutoscalingThresholdPercent }, + { "storageAutoscalingMaxGb", storageAutoscalingMaxGb }, + { "metricsTraceSampleRate", metricsTraceSampleRate }, + { "metricsSlowQueryLogThresholdMs", metricsSlowQueryLogThresholdMs }, + { "sqlApiEnabled", sqlApiEnabled }, + { "sqlApiAllowedStatements", sqlApiAllowedStatements }, + { "sqlApiMaxRows", sqlApiMaxRows }, + { "sqlApiMaxBytes", sqlApiMaxBytes }, + { "sqlApiTimeoutSeconds", sqlApiTimeoutSeconds } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabase Convert(Dictionary it) + { + return Models.DedicatedDatabase.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 dedicated database. This action is irreversible. The database + /// status will be set to 'deleting' and all resources will be cleaned up. + /// Deletion is allowed from any state, and repeating the call re-dispatches + /// the cleanup. + /// + /// + public Task Delete(string databaseId) + { + var apiPath = "/mysql/{databaseId}" + .Replace("{databaseId}", databaseId); + + 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)!); + + } + + /// + /// List all backups for a dedicated database. Results can be filtered by + /// status and type. + /// + /// + public Task ListBackups(string databaseId, List? queries = null) + { + var apiPath = "/mysql/{databaseId}/backups" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "queries", queries } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseBackupList Convert(Dictionary it) + { + return Models.DedicatedDatabaseBackupList.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 manual backup of a dedicated database. The backup will be created + /// asynchronously and its status can be checked via the get backup endpoint. + /// + /// + public Task CreateBackup(string databaseId, string? type = null) + { + var apiPath = "/mysql/{databaseId}/backups" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "type", type } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseBackup Convert(Dictionary it) + { + return Models.DedicatedDatabaseBackup.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 scheduled backup policies for a dedicated database. + /// + /// + public Task ListBackupPolicies(string databaseId, List? queries = null) + { + var apiPath = "/mysql/{databaseId}/backups/policies" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "queries", queries } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.BackupPolicyList Convert(Dictionary it) + { + return Models.BackupPolicyList.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 scheduled backup policy for a dedicated database. + /// + /// + public Task CreateBackupPolicy(string databaseId, string policyId, string name, string schedule, long retention, string? type = null, bool? enabled = null) + { + var apiPath = "/mysql/{databaseId}/backups/policies" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "policyId", policyId }, + { "name", name }, + { "schedule", schedule }, + { "retention", retention }, + { "type", type }, + { "enabled", enabled } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.BackupPolicy Convert(Dictionary it) + { + return Models.BackupPolicy.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 scheduled backup policy for a dedicated database. + /// + /// + public Task GetBackupPolicy(string databaseId, string policyId) + { + var apiPath = "/mysql/{databaseId}/backups/policies/{policyId}" + .Replace("{databaseId}", databaseId) + .Replace("{policyId}", policyId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.BackupPolicy Convert(Dictionary it) + { + return Models.BackupPolicy.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); + + } + + /// + /// Update a scheduled backup policy for a dedicated database. + /// + /// + public Task UpdateBackupPolicy(string databaseId, string policyId, string? name = null, string? schedule = null, long? retention = null, bool? enabled = null) + { + var apiPath = "/mysql/{databaseId}/backups/policies/{policyId}" + .Replace("{databaseId}", databaseId) + .Replace("{policyId}", policyId); + + var apiParameters = new Dictionary() + { + { "name", name }, + { "schedule", schedule }, + { "retention", retention }, + { "enabled", enabled } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.BackupPolicy Convert(Dictionary it) + { + return Models.BackupPolicy.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 scheduled backup policy for a dedicated database. Backups already + /// taken by the policy are kept until their retention expires. + /// + /// + public Task DeleteBackupPolicy(string databaseId, string policyId) + { + var apiPath = "/mysql/{databaseId}/backups/policies/{policyId}" + .Replace("{databaseId}", databaseId) + .Replace("{policyId}", policyId); + + 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)!); + + } + + /// + /// Configure off-cluster backup storage for a dedicated database. Supports S3, + /// GCS, and Azure Blob Storage destinations. Backups will be stored to the + /// configured destination in addition to on-cluster storage. + /// + /// + public Task UpdateBackupStorage(string databaseId, string provider, string bucket, string accessKey, string secretKey, string? region = null, string? prefix = null, string? endpoint = null) + { + var apiPath = "/mysql/{databaseId}/backups/storage" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "provider", provider }, + { "bucket", bucket }, + { "region", region }, + { "prefix", prefix }, + { "endpoint", endpoint }, + { "accessKey", accessKey }, + { "secretKey", secretKey } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseBackupStorage Convert(Dictionary it) + { + return Models.DedicatedDatabaseBackupStorage.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 details of a specific database backup including its status, size, and + /// timestamps. + /// + /// + public Task GetBackup(string databaseId, string backupId) + { + var apiPath = "/mysql/{databaseId}/backups/{backupId}" + .Replace("{databaseId}", databaseId) + .Replace("{backupId}", backupId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseBackup Convert(Dictionary it) + { + return Models.DedicatedDatabaseBackup.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 database backup. This will permanently remove the backup from + /// storage and cannot be undone. + /// + /// + public Task DeleteBackup(string databaseId, string backupId) + { + var apiPath = "/mysql/{databaseId}/backups/{backupId}" + .Replace("{databaseId}", databaseId) + .Replace("{backupId}", backupId); + + 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)!); + + } + + /// + /// List all ephemeral branches for a dedicated database. Returns branch + /// metadata including ID, name, namespace, and expiration time. + /// + /// + public Task ListBranches(string databaseId) + { + var apiPath = "/mysql/{databaseId}/branches" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseBranchList Convert(Dictionary it) + { + return Models.DedicatedDatabaseBranchList.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 an ephemeral database branch from the primary via PVC snapshot. The + /// branch is a full copy of the database at the current point in time, useful + /// for testing schema migrations or running experiments without affecting + /// production data. Branches expire after the configured TTL (default 24 + /// hours). The branch is created asynchronously. + /// + /// + public Task CreateBranch(string databaseId, string? branchId = null, long? ttl = null) + { + var apiPath = "/mysql/{databaseId}/branches" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "branchId", branchId }, + { "ttl", ttl } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabase Convert(Dictionary it) + { + return Models.DedicatedDatabase.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); + + } + + /// + /// Delete an ephemeral database branch. This removes the branch namespace, its + /// PVC, and the associated VolumeSnapshot. The deletion runs asynchronously + /// and is irreversible. + /// + /// + public Task DeleteBranch(string databaseId, string branchId) + { + var apiPath = "/mysql/{databaseId}/branches/{branchId}" + .Replace("{databaseId}", databaseId) + .Replace("{branchId}", branchId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabase Convert(Dictionary it) + { + return Models.DedicatedDatabase.From(map: it); + } + + 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); + + } + + /// + /// Rotate the primary connection credentials for a dedicated database. + /// Generates a new password and updates the database atomically. Previous + /// credentials stop working immediately. Returns the database with a refreshed + /// connection string carrying the new password. + /// + /// + public Task UpdateCredentials(string databaseId) + { + var apiPath = "/mysql/{databaseId}/credentials" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabase Convert(Dictionary it) + { + return Models.DedicatedDatabase.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); + + } + + /// + /// Execute SQL through the console-facing Cloud endpoint. Cloud proxies + /// through the edge platform to the per-database SQL API sidecar. Application + /// traffic should bypass cloud entirely and POST directly to the per-database + /// hostname: + /// `https://db-{project}-{db}.{region}.appwrite.center/v1/sql/executions` with + /// an `X-Appwrite-Key` header — that path scales to the whole DB fleet + /// without a per-query cloud round-trip. The statement type must be on the + /// database's configured allow-list. Use bound parameters for any + /// user-supplied values — the API does not interpolate raw strings. + /// + /// + public Task CreateExecution(string databaseId, string sql, object? bindings = null, long? timeoutSeconds = null) + { + var apiPath = "/mysql/{databaseId}/executions" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "sql", sql }, + { "bindings", bindings }, + { "timeoutSeconds", timeoutSeconds } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseExecution Convert(Dictionary it) + { + return Models.DedicatedDatabaseExecution.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); + + } + + /// + /// Trigger a manual failover for a dedicated database with high availability + /// enabled. Promotes a replica to primary. The failover runs asynchronously; + /// poll the database document for status updates. A database left + /// mid-operation also accepts this call as a repair once nothing is driving + /// the operation it is stuck in. Repairing a failover that did not finish, a + /// `failed` database, a stranded upgrade or migrate, or a stranded compute + /// resize additionally requires `targetReplicaId` to name the member to + /// promote, because the default target may be the member that operation + /// already promoted. + /// + /// + public Task CreateFailover(string databaseId, string? targetReplicaId = null) + { + var apiPath = "/mysql/{databaseId}/failovers" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "targetReplicaId", targetReplicaId } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabase Convert(Dictionary it) + { + return Models.DedicatedDatabase.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 the maintenance window for a dedicated database. Maintenance + /// operations like minor version upgrades will be performed during this + /// window. + /// + /// + public Task UpdateMaintenance(string databaseId, string day, long hourUtc) + { + var apiPath = "/mysql/{databaseId}/maintenance" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "day", day }, + { "hourUtc", hourUtc } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabase Convert(Dictionary it) + { + return Models.DedicatedDatabase.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); + + } + + /// + /// Migrate a database between shared and dedicated types. Shared to dedicated + /// provisions an always-on dedicated instance; dedicated to shared converts to + /// a serverless instance that scales to zero when idle. Data is copied to the + /// target with a brief read-only window during cutover. + /// + /// + public Task CreateMigration(string databaseId, string targetType, string? specification = null) + { + var apiPath = "/mysql/{databaseId}/migrations" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "targetType", targetType }, + { "specification", specification } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabase Convert(Dictionary it) + { + return Models.DedicatedDatabase.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 lifecycle operations recorded for a dedicated database, newest + /// first. Every provision, update, restore, backup and replication action is + /// recorded here with its outcome, including an attempt that was abandoned + /// because another worker took over the database. + /// + /// + public Task ListOperations(string databaseId, string? status = null, long? limit = null, long? offset = null) + { + var apiPath = "/mysql/{databaseId}/operations" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "status", status }, + { "limit", limit }, + { "offset", offset } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseOperationList Convert(Dictionary it) + { + return Models.DedicatedDatabaseOperationList.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 available point-in-time recovery windows for a dedicated database. + /// Returns the earliest and latest recovery points. + /// + /// + public Task GetPitr(string databaseId) + { + var apiPath = "/mysql/{databaseId}/pitr" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabasePITRWindows Convert(Dictionary it) + { + return Models.DedicatedDatabasePITRWindows.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 the connection pooler configuration for a dedicated database. Returns + /// pooler mode, max connections, and pool size settings. + /// + /// + public Task GetPooler(string databaseId) + { + var apiPath = "/mysql/{databaseId}/pooler" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabasePooler Convert(Dictionary it) + { + return Models.DedicatedDatabasePooler.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); + + } + + /// + /// Update the connection pooler configuration for a dedicated database. + /// Configure pool mode, max connections, and pool sizes. + /// + /// + 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) + { + var apiPath = "/mysql/{databaseId}/pooler" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "mode", mode }, + { "maxConnections", maxConnections }, + { "defaultPoolSize", defaultPoolSize }, + { "readWriteSplitting", readWriteSplitting }, + { "poolerCpuRequest", poolerCpuRequest }, + { "poolerCpuLimit", poolerCpuLimit }, + { "poolerMemoryRequest", poolerMemoryRequest }, + { "poolerMemoryLimit", poolerMemoryLimit } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabasePooler Convert(Dictionary it) + { + return Models.DedicatedDatabasePooler.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 high availability status for a dedicated database. Returns replica + /// statuses, replication lag, and sync mode. + /// + /// + public Task GetReplicas(string databaseId) + { + var apiPath = "/mysql/{databaseId}/replicas" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseReplicas Convert(Dictionary it) + { + return Models.DedicatedDatabaseReplicas.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); + + } + + /// + /// List all restorations for a dedicated database. Results can be filtered by + /// status and type. + /// + /// + public Task ListRestorations(string databaseId, string? status = null, string? type = null, long? limit = null, long? offset = null) + { + var apiPath = "/mysql/{databaseId}/restorations" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "status", status }, + { "type", type }, + { "limit", limit }, + { "offset", offset } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseRestorationList Convert(Dictionary it) + { + return Models.DedicatedDatabaseRestorationList.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); + + } + + /// + /// Restore a database from a backup or to a specific point in time (PITR). For + /// backup restoration, provide a backupId. For PITR, provide a targetTime as + /// an ISO 8601 datetime. PITR requires the database to have PITR enabled and + /// is only available for enterprise databases. + /// + /// + public Task CreateRestoration(string databaseId, string? type = null, string? backupId = null, string? targetDatabaseId = null, string? targetTime = null) + { + var apiPath = "/mysql/{databaseId}/restorations" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "type", type }, + { "backupId", backupId }, + { "targetDatabaseId", targetDatabaseId }, + { "targetTime", targetTime } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseRestoration Convert(Dictionary it) + { + return Models.DedicatedDatabaseRestoration.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 details of a specific database restoration including its status, type, + /// and timestamps. + /// + /// + public Task GetRestoration(string databaseId, string restorationId) + { + var apiPath = "/mysql/{databaseId}/restorations/{restorationId}" + .Replace("{databaseId}", databaseId) + .Replace("{restorationId}", restorationId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseRestoration Convert(Dictionary it) + { + return Models.DedicatedDatabaseRestoration.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 real-time health and status information for a dedicated database. + /// Returns health status, readiness, uptime, connection info, replica status, + /// and volume information. + /// + /// + public Task GetStatus(string databaseId) + { + var apiPath = "/mysql/{databaseId}/status" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DatabaseStatus Convert(Dictionary it) + { + return Models.DatabaseStatus.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); + + } + + /// + /// Upgrade a dedicated database to a new engine version. Uses blue-green + /// deployment for zero-downtime cutover. + /// + /// + public Task CreateUpgrade(string databaseId, string targetVersion) + { + var apiPath = "/mysql/{databaseId}/upgrades" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "targetVersion", targetVersion } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabase Convert(Dictionary it) + { + return Models.DedicatedDatabase.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); + + } + + } +} diff --git a/Appwrite/Services/Postgresql.cs b/Appwrite/Services/Postgresql.cs new file mode 100644 index 00000000..a45fc9b8 --- /dev/null +++ b/Appwrite/Services/Postgresql.cs @@ -0,0 +1,1437 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Appwrite.Models; +using Appwrite.Enums; + +namespace Appwrite.Services +{ + public class Postgresql : Service + { + public Postgresql(Client client) : base(client) + { + } + + /// + /// List all dedicated databases. Results support pagination. + /// + /// + public Task List(List? queries = null) + { + var apiPath = "/postgresql"; + + var apiParameters = new Dictionary() + { + { "queries", queries } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseList Convert(Dictionary it) + { + return Models.DedicatedDatabaseList.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 dedicated database with the chosen engine and configuration. + /// Status will be 'provisioning' until the database is ready. + /// + /// + public Task Create(string databaseId, string name, string? version = 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) + { + var apiPath = "/postgresql"; + + var apiParameters = new Dictionary() + { + { "databaseId", databaseId }, + { "name", name }, + { "version", version }, + { "specification", specification }, + { "replicas", replicas }, + { "syncMode", syncMode }, + { "networkIdleTimeoutSeconds", networkIdleTimeoutSeconds }, + { "networkIPAllowlist", networkIPAllowlist }, + { "idleTimeoutMinutes", idleTimeoutMinutes }, + { "pitr", pitr }, + { "pitrRetentionDays", pitrRetentionDays }, + { "storageAutoscaling", storageAutoscaling }, + { "storageAutoscalingThresholdPercent", storageAutoscalingThresholdPercent }, + { "storageAutoscalingMaxGb", storageAutoscalingMaxGb } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabase Convert(Dictionary it) + { + return Models.DedicatedDatabase.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 dedicated database specifications available on the current plan. + /// Each specification reports its resource limits, pricing, and whether it is + /// enabled for the organization. + /// + /// + public Task ListSpecifications() + { + var apiPath = "/postgresql/specifications"; + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseSpecificationList Convert(Dictionary it) + { + return Models.DedicatedDatabaseSpecificationList.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 dedicated database by its unique ID. Returns the database + /// configuration and current status. + /// + /// + public Task Get(string databaseId) + { + var apiPath = "/postgresql/{databaseId}" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabase Convert(Dictionary it) + { + return Models.DedicatedDatabase.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); + + } + + /// + /// Update a dedicated database configuration. All changes are applied with + /// zero downtime. Specification changes (cpu, memory, storage) are handled via + /// rolling cutover. Storage expansion is done online. All other settings are + /// applied in-place. + /// + /// + 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) + { + var apiPath = "/postgresql/{databaseId}" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "name", name }, + { "status", status }, + { "specification", specification }, + { "replicas", replicas }, + { "syncMode", syncMode }, + { "networkIdleTimeoutSeconds", networkIdleTimeoutSeconds }, + { "networkIPAllowlist", networkIPAllowlist }, + { "idleTimeoutMinutes", idleTimeoutMinutes }, + { "pitr", pitr }, + { "pitrRetentionDays", pitrRetentionDays }, + { "storageAutoscaling", storageAutoscaling }, + { "storageAutoscalingThresholdPercent", storageAutoscalingThresholdPercent }, + { "storageAutoscalingMaxGb", storageAutoscalingMaxGb }, + { "metricsTraceSampleRate", metricsTraceSampleRate }, + { "metricsSlowQueryLogThresholdMs", metricsSlowQueryLogThresholdMs }, + { "sqlApiEnabled", sqlApiEnabled }, + { "sqlApiAllowedStatements", sqlApiAllowedStatements }, + { "sqlApiMaxRows", sqlApiMaxRows }, + { "sqlApiMaxBytes", sqlApiMaxBytes }, + { "sqlApiTimeoutSeconds", sqlApiTimeoutSeconds } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabase Convert(Dictionary it) + { + return Models.DedicatedDatabase.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 dedicated database. This action is irreversible. The database + /// status will be set to 'deleting' and all resources will be cleaned up. + /// Deletion is allowed from any state, and repeating the call re-dispatches + /// the cleanup. + /// + /// + public Task Delete(string databaseId) + { + var apiPath = "/postgresql/{databaseId}" + .Replace("{databaseId}", databaseId); + + 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)!); + + } + + /// + /// List all backups for a dedicated database. Results can be filtered by + /// status and type. + /// + /// + public Task ListBackups(string databaseId, List? queries = null) + { + var apiPath = "/postgresql/{databaseId}/backups" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "queries", queries } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseBackupList Convert(Dictionary it) + { + return Models.DedicatedDatabaseBackupList.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 manual backup of a dedicated database. The backup will be created + /// asynchronously and its status can be checked via the get backup endpoint. + /// + /// + public Task CreateBackup(string databaseId, string? type = null) + { + var apiPath = "/postgresql/{databaseId}/backups" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "type", type } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseBackup Convert(Dictionary it) + { + return Models.DedicatedDatabaseBackup.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 scheduled backup policies for a dedicated database. + /// + /// + public Task ListBackupPolicies(string databaseId, List? queries = null) + { + var apiPath = "/postgresql/{databaseId}/backups/policies" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "queries", queries } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.BackupPolicyList Convert(Dictionary it) + { + return Models.BackupPolicyList.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 scheduled backup policy for a dedicated database. + /// + /// + public Task CreateBackupPolicy(string databaseId, string policyId, string name, string schedule, long retention, string? type = null, bool? enabled = null) + { + var apiPath = "/postgresql/{databaseId}/backups/policies" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "policyId", policyId }, + { "name", name }, + { "schedule", schedule }, + { "retention", retention }, + { "type", type }, + { "enabled", enabled } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.BackupPolicy Convert(Dictionary it) + { + return Models.BackupPolicy.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 scheduled backup policy for a dedicated database. + /// + /// + public Task GetBackupPolicy(string databaseId, string policyId) + { + var apiPath = "/postgresql/{databaseId}/backups/policies/{policyId}" + .Replace("{databaseId}", databaseId) + .Replace("{policyId}", policyId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.BackupPolicy Convert(Dictionary it) + { + return Models.BackupPolicy.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); + + } + + /// + /// Update a scheduled backup policy for a dedicated database. + /// + /// + public Task UpdateBackupPolicy(string databaseId, string policyId, string? name = null, string? schedule = null, long? retention = null, bool? enabled = null) + { + var apiPath = "/postgresql/{databaseId}/backups/policies/{policyId}" + .Replace("{databaseId}", databaseId) + .Replace("{policyId}", policyId); + + var apiParameters = new Dictionary() + { + { "name", name }, + { "schedule", schedule }, + { "retention", retention }, + { "enabled", enabled } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.BackupPolicy Convert(Dictionary it) + { + return Models.BackupPolicy.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 scheduled backup policy for a dedicated database. Backups already + /// taken by the policy are kept until their retention expires. + /// + /// + public Task DeleteBackupPolicy(string databaseId, string policyId) + { + var apiPath = "/postgresql/{databaseId}/backups/policies/{policyId}" + .Replace("{databaseId}", databaseId) + .Replace("{policyId}", policyId); + + 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)!); + + } + + /// + /// Configure off-cluster backup storage for a dedicated database. Supports S3, + /// GCS, and Azure Blob Storage destinations. Backups will be stored to the + /// configured destination in addition to on-cluster storage. + /// + /// + public Task UpdateBackupStorage(string databaseId, string provider, string bucket, string accessKey, string secretKey, string? region = null, string? prefix = null, string? endpoint = null) + { + var apiPath = "/postgresql/{databaseId}/backups/storage" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "provider", provider }, + { "bucket", bucket }, + { "region", region }, + { "prefix", prefix }, + { "endpoint", endpoint }, + { "accessKey", accessKey }, + { "secretKey", secretKey } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseBackupStorage Convert(Dictionary it) + { + return Models.DedicatedDatabaseBackupStorage.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 details of a specific database backup including its status, size, and + /// timestamps. + /// + /// + public Task GetBackup(string databaseId, string backupId) + { + var apiPath = "/postgresql/{databaseId}/backups/{backupId}" + .Replace("{databaseId}", databaseId) + .Replace("{backupId}", backupId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseBackup Convert(Dictionary it) + { + return Models.DedicatedDatabaseBackup.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 database backup. This will permanently remove the backup from + /// storage and cannot be undone. + /// + /// + public Task DeleteBackup(string databaseId, string backupId) + { + var apiPath = "/postgresql/{databaseId}/backups/{backupId}" + .Replace("{databaseId}", databaseId) + .Replace("{backupId}", backupId); + + 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)!); + + } + + /// + /// List all ephemeral branches for a dedicated database. Returns branch + /// metadata including ID, name, namespace, and expiration time. + /// + /// + public Task ListBranches(string databaseId) + { + var apiPath = "/postgresql/{databaseId}/branches" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseBranchList Convert(Dictionary it) + { + return Models.DedicatedDatabaseBranchList.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 an ephemeral database branch from the primary via PVC snapshot. The + /// branch is a full copy of the database at the current point in time, useful + /// for testing schema migrations or running experiments without affecting + /// production data. Branches expire after the configured TTL (default 24 + /// hours). The branch is created asynchronously. + /// + /// + public Task CreateBranch(string databaseId, string? branchId = null, long? ttl = null) + { + var apiPath = "/postgresql/{databaseId}/branches" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "branchId", branchId }, + { "ttl", ttl } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabase Convert(Dictionary it) + { + return Models.DedicatedDatabase.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); + + } + + /// + /// Delete an ephemeral database branch. This removes the branch namespace, its + /// PVC, and the associated VolumeSnapshot. The deletion runs asynchronously + /// and is irreversible. + /// + /// + public Task DeleteBranch(string databaseId, string branchId) + { + var apiPath = "/postgresql/{databaseId}/branches/{branchId}" + .Replace("{databaseId}", databaseId) + .Replace("{branchId}", branchId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabase Convert(Dictionary it) + { + return Models.DedicatedDatabase.From(map: it); + } + + 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); + + } + + /// + /// Rotate the primary connection credentials for a dedicated database. + /// Generates a new password and updates the database atomically. Previous + /// credentials stop working immediately. Returns the database with a refreshed + /// connection string carrying the new password. + /// + /// + public Task UpdateCredentials(string databaseId) + { + var apiPath = "/postgresql/{databaseId}/credentials" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabase Convert(Dictionary it) + { + return Models.DedicatedDatabase.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); + + } + + /// + /// Execute SQL through the console-facing Cloud endpoint. Cloud proxies + /// through the edge platform to the per-database SQL API sidecar. Application + /// traffic should bypass cloud entirely and POST directly to the per-database + /// hostname: + /// `https://db-{project}-{db}.{region}.appwrite.center/v1/sql/executions` with + /// an `X-Appwrite-Key` header — that path scales to the whole DB fleet + /// without a per-query cloud round-trip. The statement type must be on the + /// database's configured allow-list. Use bound parameters for any + /// user-supplied values — the API does not interpolate raw strings. + /// + /// + public Task CreateExecution(string databaseId, string sql, object? bindings = null, long? timeoutSeconds = null) + { + var apiPath = "/postgresql/{databaseId}/executions" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "sql", sql }, + { "bindings", bindings }, + { "timeoutSeconds", timeoutSeconds } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseExecution Convert(Dictionary it) + { + return Models.DedicatedDatabaseExecution.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 installed and available extensions for a PostgreSQL database. + /// + /// + public Task ListExtensions(string databaseId) + { + var apiPath = "/postgresql/{databaseId}/extensions" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseExtensions Convert(Dictionary it) + { + return Models.DedicatedDatabaseExtensions.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); + + } + + /// + /// Install a database extension. Only available for PostgreSQL databases. The + /// install runs asynchronously; poll the extensions list endpoint for status. + /// + /// + public Task CreateExtension(string databaseId, string name) + { + var apiPath = "/postgresql/{databaseId}/extensions" + .Replace("{databaseId}", databaseId); + + 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.DedicatedDatabase Convert(Dictionary it) + { + return Models.DedicatedDatabase.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); + + } + + /// + /// Uninstall a database extension from a PostgreSQL database. The uninstall + /// runs asynchronously; poll the extensions list endpoint for status. + /// + /// + public Task DeleteExtension(string databaseId, string extensionName) + { + var apiPath = "/postgresql/{databaseId}/extensions/{extensionName}" + .Replace("{databaseId}", databaseId) + .Replace("{extensionName}", extensionName); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabase Convert(Dictionary it) + { + return Models.DedicatedDatabase.From(map: it); + } + + 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); + + } + + /// + /// Trigger a manual failover for a dedicated database with high availability + /// enabled. Promotes a replica to primary. The failover runs asynchronously; + /// poll the database document for status updates. A database left + /// mid-operation also accepts this call as a repair once nothing is driving + /// the operation it is stuck in. Repairing a failover that did not finish, a + /// `failed` database, a stranded upgrade or migrate, or a stranded compute + /// resize additionally requires `targetReplicaId` to name the member to + /// promote, because the default target may be the member that operation + /// already promoted. + /// + /// + public Task CreateFailover(string databaseId, string? targetReplicaId = null) + { + var apiPath = "/postgresql/{databaseId}/failovers" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "targetReplicaId", targetReplicaId } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabase Convert(Dictionary it) + { + return Models.DedicatedDatabase.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 the maintenance window for a dedicated database. Maintenance + /// operations like minor version upgrades will be performed during this + /// window. + /// + /// + public Task UpdateMaintenance(string databaseId, string day, long hourUtc) + { + var apiPath = "/postgresql/{databaseId}/maintenance" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "day", day }, + { "hourUtc", hourUtc } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabase Convert(Dictionary it) + { + return Models.DedicatedDatabase.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); + + } + + /// + /// Migrate a database between shared and dedicated types. Shared to dedicated + /// provisions an always-on dedicated instance; dedicated to shared converts to + /// a serverless instance that scales to zero when idle. Data is copied to the + /// target with a brief read-only window during cutover. + /// + /// + public Task CreateMigration(string databaseId, string targetType, string? specification = null) + { + var apiPath = "/postgresql/{databaseId}/migrations" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "targetType", targetType }, + { "specification", specification } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabase Convert(Dictionary it) + { + return Models.DedicatedDatabase.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 lifecycle operations recorded for a dedicated database, newest + /// first. Every provision, update, restore, backup and replication action is + /// recorded here with its outcome, including an attempt that was abandoned + /// because another worker took over the database. + /// + /// + public Task ListOperations(string databaseId, string? status = null, long? limit = null, long? offset = null) + { + var apiPath = "/postgresql/{databaseId}/operations" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "status", status }, + { "limit", limit }, + { "offset", offset } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseOperationList Convert(Dictionary it) + { + return Models.DedicatedDatabaseOperationList.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 available point-in-time recovery windows for a dedicated database. + /// Returns the earliest and latest recovery points. + /// + /// + public Task GetPitr(string databaseId) + { + var apiPath = "/postgresql/{databaseId}/pitr" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabasePITRWindows Convert(Dictionary it) + { + return Models.DedicatedDatabasePITRWindows.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 the connection pooler configuration for a dedicated database. Returns + /// pooler mode, max connections, and pool size settings. + /// + /// + public Task GetPooler(string databaseId) + { + var apiPath = "/postgresql/{databaseId}/pooler" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabasePooler Convert(Dictionary it) + { + return Models.DedicatedDatabasePooler.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); + + } + + /// + /// Update the connection pooler configuration for a dedicated database. + /// Configure pool mode, max connections, and pool sizes. + /// + /// + 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) + { + var apiPath = "/postgresql/{databaseId}/pooler" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "mode", mode }, + { "maxConnections", maxConnections }, + { "defaultPoolSize", defaultPoolSize }, + { "readWriteSplitting", readWriteSplitting }, + { "poolerCpuRequest", poolerCpuRequest }, + { "poolerCpuLimit", poolerCpuLimit }, + { "poolerMemoryRequest", poolerMemoryRequest }, + { "poolerMemoryLimit", poolerMemoryLimit } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabasePooler Convert(Dictionary it) + { + return Models.DedicatedDatabasePooler.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 high availability status for a dedicated database. Returns replica + /// statuses, replication lag, and sync mode. + /// + /// + public Task GetReplicas(string databaseId) + { + var apiPath = "/postgresql/{databaseId}/replicas" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseReplicas Convert(Dictionary it) + { + return Models.DedicatedDatabaseReplicas.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); + + } + + /// + /// List all restorations for a dedicated database. Results can be filtered by + /// status and type. + /// + /// + public Task ListRestorations(string databaseId, string? status = null, string? type = null, long? limit = null, long? offset = null) + { + var apiPath = "/postgresql/{databaseId}/restorations" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "status", status }, + { "type", type }, + { "limit", limit }, + { "offset", offset } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseRestorationList Convert(Dictionary it) + { + return Models.DedicatedDatabaseRestorationList.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); + + } + + /// + /// Restore a database from a backup or to a specific point in time (PITR). For + /// backup restoration, provide a backupId. For PITR, provide a targetTime as + /// an ISO 8601 datetime. PITR requires the database to have PITR enabled and + /// is only available for enterprise databases. + /// + /// + public Task CreateRestoration(string databaseId, string? type = null, string? backupId = null, string? targetDatabaseId = null, string? targetTime = null) + { + var apiPath = "/postgresql/{databaseId}/restorations" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "type", type }, + { "backupId", backupId }, + { "targetDatabaseId", targetDatabaseId }, + { "targetTime", targetTime } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseRestoration Convert(Dictionary it) + { + return Models.DedicatedDatabaseRestoration.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 details of a specific database restoration including its status, type, + /// and timestamps. + /// + /// + public Task GetRestoration(string databaseId, string restorationId) + { + var apiPath = "/postgresql/{databaseId}/restorations/{restorationId}" + .Replace("{databaseId}", databaseId) + .Replace("{restorationId}", restorationId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseRestoration Convert(Dictionary it) + { + return Models.DedicatedDatabaseRestoration.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 real-time health and status information for a dedicated database. + /// Returns health status, readiness, uptime, connection info, replica status, + /// and volume information. + /// + /// + public Task GetStatus(string databaseId) + { + var apiPath = "/postgresql/{databaseId}/status" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DatabaseStatus Convert(Dictionary it) + { + return Models.DatabaseStatus.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); + + } + + /// + /// Upgrade a dedicated database to a new engine version. Uses blue-green + /// deployment for zero-downtime cutover. + /// + /// + public Task CreateUpgrade(string databaseId, string targetVersion) + { + var apiPath = "/postgresql/{databaseId}/upgrades" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "targetVersion", targetVersion } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabase Convert(Dictionary it) + { + return Models.DedicatedDatabase.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); + + } + + } +} diff --git a/Appwrite/Services/Project.cs b/Appwrite/Services/Project.cs index 7b77c5d4..6eff7b13 100644 --- a/Appwrite/Services/Project.cs +++ b/Appwrite/Services/Project.cs @@ -1333,6 +1333,43 @@ static Models.OAuth2Google Convert(Dictionary it) } + /// + /// Update the project OAuth2 Hugging Face configuration. + /// + /// + public Task UpdateOAuth2HuggingFace(string? clientId = null, string? clientSecret = null, bool? enabled = null) + { + var apiPath = "/project/oauth2/huggingface"; + + 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.OAuth2HuggingFace Convert(Dictionary it) + { + return Models.OAuth2HuggingFace.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. /// @@ -2310,71 +2347,75 @@ static object Convert(Dictionary it) { return Appwrite.Models.OAuth2Yahoo.From(map: it); } - if (it.TryGetValue("$id", out var idValue24) && idValue24?.ToString() == "linkedin") + if (it.TryGetValue("$id", out var idValue24) && idValue24?.ToString() == "huggingface") + { + return Appwrite.Models.OAuth2HuggingFace.From(map: it); + } + if (it.TryGetValue("$id", out var idValue25) && idValue25?.ToString() == "linkedin") { return Appwrite.Models.OAuth2Linkedin.From(map: it); } - if (it.TryGetValue("$id", out var idValue25) && idValue25?.ToString() == "disqus") + if (it.TryGetValue("$id", out var idValue26) && idValue26?.ToString() == "disqus") { return Appwrite.Models.OAuth2Disqus.From(map: it); } - if (it.TryGetValue("$id", out var idValue26) && idValue26?.ToString() == "amazon") + if (it.TryGetValue("$id", out var idValue27) && idValue27?.ToString() == "amazon") { return Appwrite.Models.OAuth2Amazon.From(map: it); } - if (it.TryGetValue("$id", out var idValue27) && idValue27?.ToString() == "etsy") + if (it.TryGetValue("$id", out var idValue28) && idValue28?.ToString() == "etsy") { return Appwrite.Models.OAuth2Etsy.From(map: it); } - if (it.TryGetValue("$id", out var idValue28) && idValue28?.ToString() == "facebook") + if (it.TryGetValue("$id", out var idValue29) && idValue29?.ToString() == "facebook") { return Appwrite.Models.OAuth2Facebook.From(map: it); } - if (it.TryGetValue("$id", out var idValue29) && idValue29?.ToString() == "tradeshiftBox") + if (it.TryGetValue("$id", out var idValue30) && idValue30?.ToString() == "tradeshiftBox") { return Appwrite.Models.OAuth2Tradeshift.From(map: it); } - if (it.TryGetValue("$id", out var idValue30) && idValue30?.ToString() == "paypalSandbox") + if (it.TryGetValue("$id", out var idValue31) && idValue31?.ToString() == "paypalSandbox") { return Appwrite.Models.OAuth2Paypal.From(map: it); } - if (it.TryGetValue("$id", out var idValue31) && idValue31?.ToString() == "gitlab") + if (it.TryGetValue("$id", out var idValue32) && idValue32?.ToString() == "gitlab") { return Appwrite.Models.OAuth2Gitlab.From(map: it); } - if (it.TryGetValue("$id", out var idValue32) && idValue32?.ToString() == "authentik") + if (it.TryGetValue("$id", out var idValue33) && idValue33?.ToString() == "authentik") { return Appwrite.Models.OAuth2Authentik.From(map: it); } - if (it.TryGetValue("$id", out var idValue33) && idValue33?.ToString() == "auth0") + if (it.TryGetValue("$id", out var idValue34) && idValue34?.ToString() == "auth0") { return Appwrite.Models.OAuth2Auth0.From(map: it); } - if (it.TryGetValue("$id", out var idValue34) && idValue34?.ToString() == "fusionauth") + if (it.TryGetValue("$id", out var idValue35) && idValue35?.ToString() == "fusionauth") { return Appwrite.Models.OAuth2FusionAuth.From(map: it); } - if (it.TryGetValue("$id", out var idValue35) && idValue35?.ToString() == "keycloak") + if (it.TryGetValue("$id", out var idValue36) && idValue36?.ToString() == "keycloak") { return Appwrite.Models.OAuth2Keycloak.From(map: it); } - if (it.TryGetValue("$id", out var idValue36) && idValue36?.ToString() == "oidc") + if (it.TryGetValue("$id", out var idValue37) && idValue37?.ToString() == "oidc") { return Appwrite.Models.OAuth2Oidc.From(map: it); } - if (it.TryGetValue("$id", out var idValue37) && idValue37?.ToString() == "apple") + if (it.TryGetValue("$id", out var idValue38) && idValue38?.ToString() == "apple") { return Appwrite.Models.OAuth2Apple.From(map: it); } - if (it.TryGetValue("$id", out var idValue38) && idValue38?.ToString() == "okta") + if (it.TryGetValue("$id", out var idValue39) && idValue39?.ToString() == "okta") { return Appwrite.Models.OAuth2Okta.From(map: it); } - if (it.TryGetValue("$id", out var idValue39) && idValue39?.ToString() == "kick") + if (it.TryGetValue("$id", out var idValue40) && idValue40?.ToString() == "kick") { return Appwrite.Models.OAuth2Kick.From(map: it); } - if (it.TryGetValue("$id", out var idValue40) && idValue40?.ToString() == "microsoft") + if (it.TryGetValue("$id", out var idValue41) && idValue41?.ToString() == "microsoft") { return Appwrite.Models.OAuth2Microsoft.From(map: it); } diff --git a/Appwrite/Services/Sites.cs b/Appwrite/Services/Sites.cs index b088f975..b6a939cf 100644 --- a/Appwrite/Services/Sites.cs +++ b/Appwrite/Services/Sites.cs @@ -54,7 +54,7 @@ static Models.SiteList Convert(Dictionary it) /// Create a new site. /// /// - public Task Create(string siteId, string name, Appwrite.Enums.Framework framework, Appwrite.Enums.BuildRuntime buildRuntime, bool? enabled = null, bool? logging = null, long? timeout = null, string? installCommand = null, string? buildCommand = null, string? startCommand = null, string? outputDirectory = null, Appwrite.Enums.Adapter? adapter = null, string? installationId = null, string? fallbackFile = 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) + public Task Create(string siteId, string name, Appwrite.Enums.Framework framework, Appwrite.Enums.BuildRuntime buildRuntime, bool? enabled = null, bool? logging = null, long? timeout = null, string? installCommand = null, string? buildCommand = null, string? startCommand = null, string? outputDirectory = null, Appwrite.Enums.Adapter? adapter = null, string? installationId = null, string? fallbackFile = 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) { var apiPath = "/sites"; @@ -82,7 +82,8 @@ static Models.SiteList Convert(Dictionary it) { "providerPaths", providerPaths }, { "buildSpecification", buildSpecification }, { "runtimeSpecification", runtimeSpecification }, - { "deploymentRetention", deploymentRetention } + { "deploymentRetention", deploymentRetention }, + { "scopes", scopes?.Select(e => e.Value).ToList() } }; var apiHeaders = new Dictionary() @@ -213,7 +214,7 @@ static Models.Site Convert(Dictionary it) /// Update site by its unique ID. /// /// - 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) + 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) { var apiPath = "/sites/{siteId}" .Replace("{siteId}", siteId); @@ -241,7 +242,8 @@ static Models.Site Convert(Dictionary it) { "providerPaths", providerPaths }, { "buildSpecification", buildSpecification }, { "runtimeSpecification", runtimeSpecification }, - { "deploymentRetention", deploymentRetention } + { "deploymentRetention", deploymentRetention }, + { "scopes", scopes?.Select(e => e.Value).ToList() } }; var apiHeaders = new Dictionary() diff --git a/Appwrite/Services/TablesDB.cs b/Appwrite/Services/TablesDB.cs index d3ca30db..3b9d1894 100644 --- a/Appwrite/Services/TablesDB.cs +++ b/Appwrite/Services/TablesDB.cs @@ -440,8 +440,12 @@ public Task Delete(string databaseId) /// Trigger a manual failover for a dedicated database with high availability /// enabled. Promotes a replica to primary. The failover runs asynchronously; /// poll the database document for status updates. A database left - /// mid-operation by a failover that did not finish also accepts this call as a - /// repair, provided `targetReplicaId` names the member to promote. + /// mid-operation also accepts this call as a repair once nothing is driving + /// the operation it is stuck in. Repairing a failover that did not finish, a + /// `failed` database, a stranded upgrade or migrate, or a stranded compute + /// resize additionally requires `targetReplicaId` to name the member to + /// promote, because the default target may be the member that operation + /// already promoted. /// /// public Task CreateFailover(string databaseId, string? targetReplicaId = null) diff --git a/Appwrite/Services/VectorsDB.cs b/Appwrite/Services/VectorsDB.cs new file mode 100644 index 00000000..845df101 --- /dev/null +++ b/Appwrite/Services/VectorsDB.cs @@ -0,0 +1,1374 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Appwrite.Models; +using Appwrite.Enums; + +namespace Appwrite.Services +{ + public class VectorsDB : Service + { + public VectorsDB(Client client) : base(client) + { + } + + /// + /// Get a list of all databases from the current Appwrite project. You can use + /// the search parameter to filter your results. + /// + /// + public Task List(List? queries = null, bool? total = null) + { + var apiPath = "/vectorsdb"; + + var apiParameters = new Dictionary() + { + { "queries", queries }, + { "total", total } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DatabaseList Convert(Dictionary it) + { + return Models.DatabaseList.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 Database. + /// + /// + /// + public Task Create(string databaseId, string name, bool? enabled = null, string? specification = null, long? replicas = null, string? syncMode = null) + { + var apiPath = "/vectorsdb"; + + var apiParameters = new Dictionary() + { + { "databaseId", databaseId }, + { "name", name }, + { "enabled", enabled }, + { "specification", specification }, + { "replicas", replicas }, + { "syncMode", syncMode } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.Database Convert(Dictionary it) + { + return Models.Database.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 dedicated database specifications available on the current plan. + /// Each specification reports its resource limits, pricing, and whether it is + /// enabled for the organization. + /// + /// + public Task ListSpecifications() + { + var apiPath = "/vectorsdb/specifications"; + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseSpecificationList Convert(Dictionary it) + { + return Models.DedicatedDatabaseSpecificationList.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); + + } + + /// + /// List transactions across all databases. + /// + /// + public Task ListTransactions(List? queries = null) + { + var apiPath = "/vectorsdb/transactions"; + + var apiParameters = new Dictionary() + { + { "queries", queries } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.TransactionList Convert(Dictionary it) + { + return Models.TransactionList.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 transaction. + /// + /// + public Task CreateTransaction(long? ttl = null) + { + var apiPath = "/vectorsdb/transactions"; + + var apiParameters = new Dictionary() + { + { "ttl", ttl } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.Transaction Convert(Dictionary it) + { + return Models.Transaction.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 transaction by its unique ID. + /// + /// + public Task GetTransaction(string transactionId) + { + var apiPath = "/vectorsdb/transactions/{transactionId}" + .Replace("{transactionId}", transactionId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.Transaction Convert(Dictionary it) + { + return Models.Transaction.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); + + } + + /// + /// Update a transaction, to either commit or roll back its operations. + /// + /// + public Task UpdateTransaction(string transactionId, bool? commit = null, bool? rollback = null) + { + var apiPath = "/vectorsdb/transactions/{transactionId}" + .Replace("{transactionId}", transactionId); + + var apiParameters = new Dictionary() + { + { "commit", commit }, + { "rollback", rollback } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.Transaction Convert(Dictionary it) + { + return Models.Transaction.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 transaction by its unique ID. + /// + /// + public Task DeleteTransaction(string transactionId) + { + var apiPath = "/vectorsdb/transactions/{transactionId}" + .Replace("{transactionId}", transactionId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "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)!); + + } + + /// + /// Create multiple operations in a single transaction. + /// + /// + public Task CreateOperations(string transactionId, List? operations = null) + { + var apiPath = "/vectorsdb/transactions/{transactionId}/operations" + .Replace("{transactionId}", transactionId); + + var apiParameters = new Dictionary() + { + { "operations", operations } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.Transaction Convert(Dictionary it) + { + return Models.Transaction.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 database by its unique ID. This endpoint response returns a JSON + /// object with the database metadata. + /// + /// + public Task Get(string databaseId) + { + var apiPath = "/vectorsdb/{databaseId}" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.Database Convert(Dictionary it) + { + return Models.Database.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); + + } + + /// + /// Update a database by its unique ID. + /// + /// + public Task Update(string databaseId, string name, bool? enabled = null, string? specification = null, long? replicas = null, string? syncMode = null) + { + var apiPath = "/vectorsdb/{databaseId}" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "name", name }, + { "enabled", enabled }, + { "specification", specification }, + { "replicas", replicas }, + { "syncMode", syncMode } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.Database Convert(Dictionary it) + { + return Models.Database.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); + + } + + /// + /// Delete a database by its unique ID. Only API keys with with databases.write + /// scope can delete a database. + /// + /// + public Task Delete(string databaseId) + { + var apiPath = "/vectorsdb/{databaseId}" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "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)!); + + } + + /// + /// Get a list of all collections that belong to the provided databaseId. You + /// can use the search parameter to filter your results. + /// + /// + public Task ListCollections(string databaseId, List? queries = null, string? search = null, bool? total = null) + { + var apiPath = "/vectorsdb/{databaseId}/collections" + .Replace("{databaseId}", databaseId); + + 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.VectorsdbCollectionList Convert(Dictionary it) + { + return Models.VectorsdbCollectionList.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 Collection. Before using this route, you should create a new + /// database resource using either a [server + /// integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) + /// API or directly from your database console. + /// + /// + public Task CreateCollection(string databaseId, string collectionId, string name, long dimension, List? permissions = null, bool? documentSecurity = null, bool? enabled = null) + { + var apiPath = "/vectorsdb/{databaseId}/collections" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "collectionId", collectionId }, + { "name", name }, + { "dimension", dimension }, + { "permissions", permissions }, + { "documentSecurity", documentSecurity }, + { "enabled", enabled } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.VectorsdbCollection Convert(Dictionary it) + { + return Models.VectorsdbCollection.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 collection by its unique ID. This endpoint response returns a JSON + /// object with the collection metadata. + /// + /// + public Task GetCollection(string databaseId, string collectionId) + { + var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.VectorsdbCollection Convert(Dictionary it) + { + return Models.VectorsdbCollection.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); + + } + + /// + /// Update a collection by its unique ID. + /// + /// + public Task UpdateCollection(string databaseId, string collectionId, string name, long? dimension = null, List? permissions = null, bool? documentSecurity = null, bool? enabled = null) + { + var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId); + + var apiParameters = new Dictionary() + { + { "name", name }, + { "dimension", dimension }, + { "permissions", permissions }, + { "documentSecurity", documentSecurity }, + { "enabled", enabled } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.VectorsdbCollection Convert(Dictionary it) + { + return Models.VectorsdbCollection.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); + + } + + /// + /// Delete a collection by its unique ID. Only users with write permissions + /// have access to delete this resource. + /// + /// + public Task DeleteCollection(string databaseId, string collectionId) + { + var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "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)!); + + } + + /// + /// Get a list of all the user's documents in a given collection. You can use + /// the query params to filter your results. + /// + /// + public Task ListDocuments(string databaseId, string collectionId, List? queries = null, string? transactionId = null, bool? total = null, long? ttl = null) + { + var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/documents" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId); + + var apiParameters = new Dictionary() + { + { "queries", queries }, + { "transactionId", transactionId }, + { "total", total }, + { "ttl", ttl } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DocumentList Convert(Dictionary it) + { + return Models.DocumentList.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 Document. Before using this route, you should create a new + /// collection resource using either a [server + /// integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) + /// API or directly from your database console. + /// + /// + public Task CreateDocument(string databaseId, string collectionId, string documentId, object data, List? permissions = null) + { + var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/documents" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId); + + var apiParameters = new Dictionary() + { + { "documentId", documentId }, + { "data", data }, + { "permissions", permissions } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.Document Convert(Dictionary it) + { + return Models.Document.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); + + } + + /// + /// Create new Documents. Before using this route, you should create a new + /// collection resource using either a [server + /// integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) + /// API or directly from your database console. + /// + /// + public Task CreateDocuments(string databaseId, string collectionId, List documents) + { + var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/documents" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId); + + var apiParameters = new Dictionary() + { + { "documents", documents } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DocumentList Convert(Dictionary it) + { + return Models.DocumentList.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); + + } + + /// + /// Create or update Documents. Before using this route, you should create a + /// new collection resource using either a [server + /// integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) + /// API or directly from your database console. + /// + /// + /// + public Task UpsertDocuments(string databaseId, string collectionId, List documents, string? transactionId = null) + { + var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/documents" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId); + + var apiParameters = new Dictionary() + { + { "documents", documents }, + { "transactionId", transactionId } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DocumentList Convert(Dictionary it) + { + return Models.DocumentList.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 all documents that match your queries, if no queries are submitted + /// then all documents are updated. You can pass only specific fields to be + /// updated. + /// + /// + public Task UpdateDocuments(string databaseId, string collectionId, object? data = null, List? queries = null, string? transactionId = null) + { + var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/documents" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId); + + var apiParameters = new Dictionary() + { + { "data", data }, + { "queries", queries }, + { "transactionId", transactionId } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DocumentList Convert(Dictionary it) + { + return Models.DocumentList.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); + + } + + /// + /// Bulk delete documents using queries, if no queries are passed then all + /// documents are deleted. + /// + /// + public Task DeleteDocuments(string databaseId, string collectionId, List? queries = null, string? transactionId = null) + { + var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/documents" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId); + + var apiParameters = new Dictionary() + { + { "queries", queries }, + { "transactionId", transactionId } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DocumentList Convert(Dictionary it) + { + return Models.DocumentList.From(map: it); + } + + 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); + + } + + /// + /// Get a list of all the user's documents in a given collection using a POST + /// request. This behaves identically to the list documents endpoint but + /// accepts the queries in the request body, allowing much larger `queries` + /// arrays than can fit in a URL query string. + /// + /// + /// + public Task CreateQuery(string databaseId, string collectionId, List? queries = null, string? transactionId = null, bool? total = null, long? ttl = null) + { + var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/documents/query" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId); + + var apiParameters = new Dictionary() + { + { "queries", queries }, + { "transactionId", transactionId }, + { "total", total }, + { "ttl", ttl } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DocumentList Convert(Dictionary it) + { + return Models.DocumentList.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 document by its unique ID. This endpoint response returns a JSON + /// object with the document data. + /// + /// + public Task GetDocument(string databaseId, string collectionId, string documentId, List? queries = null, string? transactionId = null) + { + var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/documents/{documentId}" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId) + .Replace("{documentId}", documentId); + + var apiParameters = new Dictionary() + { + { "queries", queries }, + { "transactionId", transactionId } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.Document Convert(Dictionary it) + { + return Models.Document.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 or update a Document. Before using this route, you should create a + /// new collection resource using either a [server + /// integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) + /// API or directly from your database console. + /// + /// + public Task UpsertDocument(string databaseId, string collectionId, string documentId, object? data = null, List? permissions = null, string? transactionId = null) + { + var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/documents/{documentId}" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId) + .Replace("{documentId}", documentId); + + var apiParameters = new Dictionary() + { + { "data", data }, + { "permissions", permissions }, + { "transactionId", transactionId } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.Document Convert(Dictionary it) + { + return Models.Document.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 a document by its unique ID. Using the patch method you can pass + /// only specific fields that will get updated. + /// + /// + public Task UpdateDocument(string databaseId, string collectionId, string documentId, object? data = null, List? permissions = null, string? transactionId = null) + { + var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/documents/{documentId}" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId) + .Replace("{documentId}", documentId); + + var apiParameters = new Dictionary() + { + { "data", data }, + { "permissions", permissions }, + { "transactionId", transactionId } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.Document Convert(Dictionary it) + { + return Models.Document.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 document by its unique ID. + /// + /// + public Task DeleteDocument(string databaseId, string collectionId, string documentId, string? transactionId = null) + { + var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/documents/{documentId}" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId) + .Replace("{documentId}", documentId); + + var apiParameters = new Dictionary() + { + { "transactionId", transactionId } + }; + + var apiHeaders = new Dictionary() + { + { "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)!); + + } + + /// + /// List indexes in the collection. + /// + /// + public Task ListIndexes(string databaseId, string collectionId, List? queries = null, bool? total = null) + { + var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/indexes" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId); + + var apiParameters = new Dictionary() + { + { "queries", queries }, + { "total", total } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.IndexList Convert(Dictionary it) + { + return Models.IndexList.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); + + } + + /// + /// Creates an index on the attributes listed. Your index should include all + /// the attributes you will query in a single request. + /// Attributes can be `key`, `fulltext`, and `unique`. + /// + /// + public Task CreateIndex(string databaseId, string collectionId, string key, Appwrite.Enums.VectorsDBIndexType type, List attributes, List? orders = null, List? lengths = null) + { + var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/indexes" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId); + + var apiParameters = new Dictionary() + { + { "key", key }, + { "type", type?.Value }, + { "attributes", attributes }, + { "orders", orders?.Select(e => e.Value).ToList() }, + { "lengths", lengths } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.Index Convert(Dictionary it) + { + return Models.Index.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 index by ID. + /// + /// + public Task GetIndex(string databaseId, string collectionId, string key) + { + var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/indexes/{key}" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId) + .Replace("{key}", key); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.Index Convert(Dictionary it) + { + return Models.Index.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 an index. + /// + /// + public Task DeleteIndex(string databaseId, string collectionId, string key) + { + var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/indexes/{key}" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId) + .Replace("{key}", key); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "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)!); + + } + + /// + /// Trigger a manual failover for a dedicated database with high availability + /// enabled. Promotes a replica to primary. The failover runs asynchronously; + /// poll the database document for status updates. A database left + /// mid-operation also accepts this call as a repair once nothing is driving + /// the operation it is stuck in. Repairing a failover that did not finish, a + /// `failed` database, a stranded upgrade or migrate, or a stranded compute + /// resize additionally requires `targetReplicaId` to name the member to + /// promote, because the default target may be the member that operation + /// already promoted. + /// + /// + public Task CreateFailover(string databaseId, string? targetReplicaId = null) + { + var apiPath = "/vectorsdb/{databaseId}/failovers" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "targetReplicaId", targetReplicaId } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabase Convert(Dictionary it) + { + return Models.DedicatedDatabase.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 lifecycle operations recorded for a dedicated database, newest + /// first. Every provision, update, restore, backup and replication action is + /// recorded here with its outcome, including an attempt that was abandoned + /// because another worker took over the database. + /// + /// + public Task ListOperations(string databaseId, string? status = null, long? limit = null, long? offset = null) + { + var apiPath = "/vectorsdb/{databaseId}/operations" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "status", status }, + { "limit", limit }, + { "offset", offset } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseOperationList Convert(Dictionary it) + { + return Models.DedicatedDatabaseOperationList.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 high availability status for a dedicated database. Returns replica + /// statuses, replication lag, and sync mode. + /// + /// + public Task GetReplicas(string databaseId) + { + var apiPath = "/vectorsdb/{databaseId}/replicas" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseReplicas Convert(Dictionary it) + { + return Models.DedicatedDatabaseReplicas.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 real-time health and status information for a dedicated database. + /// Returns health status, readiness, uptime, connection info, replica status, + /// and volume information. + /// + /// + public Task GetStatus(string databaseId) + { + var apiPath = "/vectorsdb/{databaseId}/status" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DatabaseStatus Convert(Dictionary it) + { + return Models.DatabaseStatus.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); + + } + + } +} diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d4bd50c..3d754fda 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,23 @@ # Change Log +## 8.0.0-rc.1 + +* Breaking: `Execution.functionId` is replaced by `resourceId` and `resourceType`, now that executions cover both functions and sites +* Breaking: `AppInstallation.authorizationDetails` is now an array instead of an object +* Breaking: removed `dedicatedDatabases.execute` from `ProjectKeyScopes` +* Breaking: `EmbeddingModel` no longer offers `embedding-gemma` or `bge-small` +* Added: `documentsDB`, `vectorsDB`, `mysql`, `postgresql`, and `mongo` services, no longer hidden from server SDKs +* Added: `DocumentsDBIndexType` and `VectorsDBIndexType` enums +* Added: dedicated database models for branches, backups, restorations, poolers, PITR windows, extensions, and executions +* Added: `PostgresExtension`, `VectorsdbCollection`, `AttributeObject`, and `AttributeVector` models +* Added: `ExecutionResourceType` enum and `resourceType` on the `Execution` model +* Added: `OAuth2HuggingFace` model and the `huggingface` OAuth provider +* Added: `userId`, `emailHash`, and `name` parameters to `avatars.getPhoto` +* Added: `error`, `containerStatus`, and `lifecycleState` on the `Database` model +* Added: `changelogWatermark` on the `DatabaseMigration` model +* Added: `total` on the `DedicatedDatabaseBranchList` model +* Updated: `DedicatedDatabaseOperation.status` documents the new `queued` state + ## 7.0.0 * Breaking: removed `account.createJWT`; use `users.createJWT` instead. A leaked JWT could mint further JWTs, letting a credential outlive its own expiry — a session cannot duplicate itself to live forever either diff --git a/README.md b/README.md index 46bd11ae..bdb512b9 100644 --- a/README.md +++ b/README.md @@ -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 7.0.0 +Install-Package Appwrite -Version 8.0.0-rc.1 # or .NET CLI -dotnet add package Appwrite --version 7.0.0 +dotnet add package Appwrite --version 8.0.0-rc.1 ``` diff --git a/docs/examples/account/create-anonymous-session.md b/docs/examples/account/create-anonymous-session.md index 47a2fc6d..35b3aab4 100644 --- a/docs/examples/account/create-anonymous-session.md +++ b/docs/examples/account/create-anonymous-session.md @@ -11,4 +11,6 @@ Client client = new Client() Account account = new Account(client); 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 a2408cdc..f24e35ca 100644 --- a/docs/examples/account/create-email-password-session.md +++ b/docs/examples/account/create-email-password-session.md @@ -13,4 +13,6 @@ Account account = new Account(client); Session result = await account.CreateEmailPasswordSession( email: "email@example.com", password: "password" -);``` +); + +``` diff --git a/docs/examples/account/create-email-token.md b/docs/examples/account/create-email-token.md index dd012ac0..be003ffe 100644 --- a/docs/examples/account/create-email-token.md +++ b/docs/examples/account/create-email-token.md @@ -14,4 +14,6 @@ Token result = await account.CreateEmailToken( userId: "", email: "email@example.com", phrase: false // optional -);``` +); + +``` diff --git a/docs/examples/account/create-email-verification.md b/docs/examples/account/create-email-verification.md index ca242970..b5c4aad4 100644 --- a/docs/examples/account/create-email-verification.md +++ b/docs/examples/account/create-email-verification.md @@ -12,4 +12,6 @@ Account account = new Account(client); Token result = await account.CreateEmailVerification( url: "https://example.com" -);``` +); + +``` diff --git a/docs/examples/account/create-magic-url-token.md b/docs/examples/account/create-magic-url-token.md index f1d22ded..85e77164 100644 --- a/docs/examples/account/create-magic-url-token.md +++ b/docs/examples/account/create-magic-url-token.md @@ -15,4 +15,6 @@ Token result = await account.CreateMagicURLToken( email: "email@example.com", url: "https://example.com", // optional phrase: false // optional -);``` +); + +``` diff --git a/docs/examples/account/create-mfa-authenticator.md b/docs/examples/account/create-mfa-authenticator.md index 4bea1f21..74e3d105 100644 --- a/docs/examples/account/create-mfa-authenticator.md +++ b/docs/examples/account/create-mfa-authenticator.md @@ -13,4 +13,6 @@ Account account = new Account(client); 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 afd90663..8f7a9208 100644 --- a/docs/examples/account/create-mfa-challenge.md +++ b/docs/examples/account/create-mfa-challenge.md @@ -13,4 +13,6 @@ Account account = new Account(client); 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 89985468..6869828d 100644 --- a/docs/examples/account/create-mfa-recovery-codes.md +++ b/docs/examples/account/create-mfa-recovery-codes.md @@ -11,4 +11,6 @@ Client client = new Client() Account account = new Account(client); MfaRecoveryCodes result = await account.CreateMFARecoveryCodes(); + + ``` diff --git a/docs/examples/account/create-o-auth-2-token.md b/docs/examples/account/create-o-auth-2-token.md index 891bf4ff..f47f7e5e 100644 --- a/docs/examples/account/create-o-auth-2-token.md +++ b/docs/examples/account/create-o-auth-2-token.md @@ -16,4 +16,6 @@ await account.CreateOAuth2Token( success: "https://example.com", // optional failure: "https://example.com", // optional scopes: new List() // optional -);``` +); + +``` diff --git a/docs/examples/account/create-phone-token.md b/docs/examples/account/create-phone-token.md index af5747b3..e296f8ed 100644 --- a/docs/examples/account/create-phone-token.md +++ b/docs/examples/account/create-phone-token.md @@ -13,4 +13,6 @@ Account account = new Account(client); 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 177ea7f7..e5f1144d 100644 --- a/docs/examples/account/create-phone-verification.md +++ b/docs/examples/account/create-phone-verification.md @@ -11,4 +11,6 @@ Client client = new Client() Account account = new Account(client); Token result = await account.CreatePhoneVerification(); + + ``` diff --git a/docs/examples/account/create-recovery.md b/docs/examples/account/create-recovery.md index e236ddf5..7951fcb6 100644 --- a/docs/examples/account/create-recovery.md +++ b/docs/examples/account/create-recovery.md @@ -13,4 +13,6 @@ Account account = new Account(client); 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 5d2c1d2e..9cd8558a 100644 --- a/docs/examples/account/create-session.md +++ b/docs/examples/account/create-session.md @@ -13,4 +13,6 @@ Account account = new Account(client); Session result = await account.CreateSession( userId: "", secret: "" -);``` +); + +``` diff --git a/docs/examples/account/create-verification.md b/docs/examples/account/create-verification.md index 49be6750..a25aa0de 100644 --- a/docs/examples/account/create-verification.md +++ b/docs/examples/account/create-verification.md @@ -12,4 +12,6 @@ Account account = new Account(client); Token result = await account.CreateVerification( url: "https://example.com" -);``` +); + +``` diff --git a/docs/examples/account/create.md b/docs/examples/account/create.md index 3488b4a4..b068e0c3 100644 --- a/docs/examples/account/create.md +++ b/docs/examples/account/create.md @@ -15,4 +15,6 @@ User result = await account.Create( email: "email@example.com", password: "password", name: "" // optional -);``` +); + +``` diff --git a/docs/examples/account/delete-consent-token.md b/docs/examples/account/delete-consent-token.md index a99b4f30..0080afa9 100644 --- a/docs/examples/account/delete-consent-token.md +++ b/docs/examples/account/delete-consent-token.md @@ -13,4 +13,6 @@ Account account = new Account(client); await account.DeleteConsentToken( consentId: "", tokenId: "" -);``` +); + +``` diff --git a/docs/examples/account/delete-consent.md b/docs/examples/account/delete-consent.md index 9b053f70..34adec2b 100644 --- a/docs/examples/account/delete-consent.md +++ b/docs/examples/account/delete-consent.md @@ -12,4 +12,6 @@ Account account = new Account(client); await account.DeleteConsent( consentId: "" -);``` +); + +``` diff --git a/docs/examples/account/delete-identity.md b/docs/examples/account/delete-identity.md index d68919c4..bc4938d6 100644 --- a/docs/examples/account/delete-identity.md +++ b/docs/examples/account/delete-identity.md @@ -12,4 +12,6 @@ Account account = new Account(client); await account.DeleteIdentity( identityId: "" -);``` +); + +``` diff --git a/docs/examples/account/delete-mfa-authenticator.md b/docs/examples/account/delete-mfa-authenticator.md index 1a552019..58aa3af1 100644 --- a/docs/examples/account/delete-mfa-authenticator.md +++ b/docs/examples/account/delete-mfa-authenticator.md @@ -13,4 +13,6 @@ Account account = new Account(client); await account.DeleteMFAAuthenticator( type: AuthenticatorType.Totp -);``` +); + +``` diff --git a/docs/examples/account/delete-session.md b/docs/examples/account/delete-session.md index fa546c00..9c8e9c1f 100644 --- a/docs/examples/account/delete-session.md +++ b/docs/examples/account/delete-session.md @@ -12,4 +12,6 @@ Account account = new Account(client); await account.DeleteSession( sessionId: "" -);``` +); + +``` diff --git a/docs/examples/account/delete-sessions.md b/docs/examples/account/delete-sessions.md index d6051e83..31bd03a1 100644 --- a/docs/examples/account/delete-sessions.md +++ b/docs/examples/account/delete-sessions.md @@ -11,4 +11,6 @@ Client client = new Client() Account account = new Account(client); await account.DeleteSessions(); + + ``` diff --git a/docs/examples/account/get-consent-token.md b/docs/examples/account/get-consent-token.md index 2cb00b16..d348e155 100644 --- a/docs/examples/account/get-consent-token.md +++ b/docs/examples/account/get-consent-token.md @@ -13,4 +13,6 @@ Account account = new Account(client); Oauth2ConsentToken result = await account.GetConsentToken( consentId: "", tokenId: "" -);``` +); + +``` diff --git a/docs/examples/account/get-consent.md b/docs/examples/account/get-consent.md index cb364047..816f6d5e 100644 --- a/docs/examples/account/get-consent.md +++ b/docs/examples/account/get-consent.md @@ -12,4 +12,6 @@ Account account = new Account(client); 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 f2ba2fa7..54ffda45 100644 --- a/docs/examples/account/get-mfa-recovery-codes.md +++ b/docs/examples/account/get-mfa-recovery-codes.md @@ -11,4 +11,6 @@ Client client = new Client() Account account = new Account(client); MfaRecoveryCodes result = await account.GetMFARecoveryCodes(); + + ``` diff --git a/docs/examples/account/get-prefs.md b/docs/examples/account/get-prefs.md index 75d0984b..fb891b6e 100644 --- a/docs/examples/account/get-prefs.md +++ b/docs/examples/account/get-prefs.md @@ -11,4 +11,6 @@ Client client = new Client() Account account = new Account(client); Preferences result = await account.GetPrefs(); + + ``` diff --git a/docs/examples/account/get-session.md b/docs/examples/account/get-session.md index 903360ae..dee7ad1b 100644 --- a/docs/examples/account/get-session.md +++ b/docs/examples/account/get-session.md @@ -12,4 +12,6 @@ Account account = new Account(client); Session result = await account.GetSession( sessionId: "" -);``` +); + +``` diff --git a/docs/examples/account/get.md b/docs/examples/account/get.md index 0184bb9e..ba7c848b 100644 --- a/docs/examples/account/get.md +++ b/docs/examples/account/get.md @@ -11,4 +11,6 @@ Client client = new Client() Account account = new Account(client); User result = await account.Get(); + + ``` diff --git a/docs/examples/account/list-consent-tokens.md b/docs/examples/account/list-consent-tokens.md index 451b8f21..5f1f36d4 100644 --- a/docs/examples/account/list-consent-tokens.md +++ b/docs/examples/account/list-consent-tokens.md @@ -14,4 +14,6 @@ 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 b9ebfcef..ca7eb65a 100644 --- a/docs/examples/account/list-consents.md +++ b/docs/examples/account/list-consents.md @@ -13,4 +13,6 @@ Account account = new Account(client); 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 3d0b024b..f64b03b0 100644 --- a/docs/examples/account/list-identities.md +++ b/docs/examples/account/list-identities.md @@ -13,4 +13,6 @@ Account account = new Account(client); IdentityList result = await account.ListIdentities( queries: new List(), // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/account/list-logs.md b/docs/examples/account/list-logs.md index d73311bc..99f6bea0 100644 --- a/docs/examples/account/list-logs.md +++ b/docs/examples/account/list-logs.md @@ -13,4 +13,6 @@ Account account = new Account(client); LogList result = await account.ListLogs( 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 37bd907e..5fa29c29 100644 --- a/docs/examples/account/list-mfa-factors.md +++ b/docs/examples/account/list-mfa-factors.md @@ -11,4 +11,6 @@ Client client = new Client() Account account = new Account(client); MfaFactors result = await account.ListMFAFactors(); + + ``` diff --git a/docs/examples/account/list-sessions.md b/docs/examples/account/list-sessions.md index 791af973..81402bcc 100644 --- a/docs/examples/account/list-sessions.md +++ b/docs/examples/account/list-sessions.md @@ -11,4 +11,6 @@ Client client = new Client() Account account = new Account(client); SessionList result = await account.ListSessions(); + + ``` diff --git a/docs/examples/account/update-email-verification.md b/docs/examples/account/update-email-verification.md index ef431989..3b4214e6 100644 --- a/docs/examples/account/update-email-verification.md +++ b/docs/examples/account/update-email-verification.md @@ -13,4 +13,6 @@ Account account = new Account(client); Token result = await account.UpdateEmailVerification( userId: "", secret: "" -);``` +); + +``` diff --git a/docs/examples/account/update-email.md b/docs/examples/account/update-email.md index 5dbb8ee6..9135dc1c 100644 --- a/docs/examples/account/update-email.md +++ b/docs/examples/account/update-email.md @@ -13,4 +13,6 @@ Account account = new Account(client); 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 f123e72b..06f707ee 100644 --- a/docs/examples/account/update-magic-url-session.md +++ b/docs/examples/account/update-magic-url-session.md @@ -13,4 +13,6 @@ Account account = new Account(client); 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 6950ba6f..a9cdba19 100644 --- a/docs/examples/account/update-mfa-authenticator.md +++ b/docs/examples/account/update-mfa-authenticator.md @@ -14,4 +14,6 @@ Account account = new Account(client); 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 c7108fef..d74d8d58 100644 --- a/docs/examples/account/update-mfa-challenge.md +++ b/docs/examples/account/update-mfa-challenge.md @@ -13,4 +13,6 @@ Account account = new Account(client); 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 3f2943d9..eefede0f 100644 --- a/docs/examples/account/update-mfa-recovery-codes.md +++ b/docs/examples/account/update-mfa-recovery-codes.md @@ -11,4 +11,6 @@ Client client = new Client() Account account = new Account(client); MfaRecoveryCodes result = await account.UpdateMFARecoveryCodes(); + + ``` diff --git a/docs/examples/account/update-mfa.md b/docs/examples/account/update-mfa.md index 3480ee42..449edcb3 100644 --- a/docs/examples/account/update-mfa.md +++ b/docs/examples/account/update-mfa.md @@ -12,4 +12,6 @@ Account account = new Account(client); User result = await account.UpdateMFA( mfa: false -);``` +); + +``` diff --git a/docs/examples/account/update-name.md b/docs/examples/account/update-name.md index cdbf82c2..bf88c662 100644 --- a/docs/examples/account/update-name.md +++ b/docs/examples/account/update-name.md @@ -12,4 +12,6 @@ Account account = new Account(client); User result = await account.UpdateName( name: "" -);``` +); + +``` diff --git a/docs/examples/account/update-password.md b/docs/examples/account/update-password.md index 17e459e1..323934ab 100644 --- a/docs/examples/account/update-password.md +++ b/docs/examples/account/update-password.md @@ -13,4 +13,6 @@ Account account = new Account(client); 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 d1aada97..dd7ab048 100644 --- a/docs/examples/account/update-phone-session.md +++ b/docs/examples/account/update-phone-session.md @@ -13,4 +13,6 @@ Account account = new Account(client); 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 fd99865b..c2b7eebb 100644 --- a/docs/examples/account/update-phone-verification.md +++ b/docs/examples/account/update-phone-verification.md @@ -13,4 +13,6 @@ Account account = new Account(client); Token result = await account.UpdatePhoneVerification( userId: "", secret: "" -);``` +); + +``` diff --git a/docs/examples/account/update-phone.md b/docs/examples/account/update-phone.md index 558fd1c8..d2b7276b 100644 --- a/docs/examples/account/update-phone.md +++ b/docs/examples/account/update-phone.md @@ -13,4 +13,6 @@ Account account = new Account(client); 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 4c43263b..105e6988 100644 --- a/docs/examples/account/update-prefs.md +++ b/docs/examples/account/update-prefs.md @@ -16,4 +16,6 @@ User result = await account.UpdatePrefs( timezone = "UTC", darkTheme = true } -);``` +); + +``` diff --git a/docs/examples/account/update-recovery.md b/docs/examples/account/update-recovery.md index ea571253..5875c5b0 100644 --- a/docs/examples/account/update-recovery.md +++ b/docs/examples/account/update-recovery.md @@ -14,4 +14,6 @@ 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 48adb6c0..d49e556f 100644 --- a/docs/examples/account/update-session.md +++ b/docs/examples/account/update-session.md @@ -12,4 +12,6 @@ Account account = new Account(client); Session result = await account.UpdateSession( sessionId: "" -);``` +); + +``` diff --git a/docs/examples/account/update-status.md b/docs/examples/account/update-status.md index 1ea1fc4b..95ac938d 100644 --- a/docs/examples/account/update-status.md +++ b/docs/examples/account/update-status.md @@ -11,4 +11,6 @@ Client client = new Client() Account account = new Account(client); User result = await account.UpdateStatus(); + + ``` diff --git a/docs/examples/account/update-verification.md b/docs/examples/account/update-verification.md index 60c397bc..16fbc2ce 100644 --- a/docs/examples/account/update-verification.md +++ b/docs/examples/account/update-verification.md @@ -13,4 +13,6 @@ Account account = new Account(client); Token result = await account.UpdateVerification( userId: "", secret: "" -);``` +); + +``` diff --git a/docs/examples/activities/get-event.md b/docs/examples/activities/get-event.md index 0855c8b4..82e50a0b 100644 --- a/docs/examples/activities/get-event.md +++ b/docs/examples/activities/get-event.md @@ -12,4 +12,6 @@ Activities activities = new Activities(client); ActivityEvent result = await activities.GetEvent( eventId: "" -);``` +); + +``` diff --git a/docs/examples/activities/list-events.md b/docs/examples/activities/list-events.md index dc0ad42d..c3d2ba2f 100644 --- a/docs/examples/activities/list-events.md +++ b/docs/examples/activities/list-events.md @@ -12,4 +12,6 @@ Activities activities = new Activities(client); ActivityEventList result = await activities.ListEvents( queries: new List() // optional -);``` +); + +``` diff --git a/docs/examples/advisor/delete-report.md b/docs/examples/advisor/delete-report.md index 188f2334..4e8f4123 100644 --- a/docs/examples/advisor/delete-report.md +++ b/docs/examples/advisor/delete-report.md @@ -12,4 +12,6 @@ Advisor advisor = new Advisor(client); await advisor.DeleteReport( reportId: "" -);``` +); + +``` diff --git a/docs/examples/advisor/get-insight.md b/docs/examples/advisor/get-insight.md index cd5c72a5..29543bdc 100644 --- a/docs/examples/advisor/get-insight.md +++ b/docs/examples/advisor/get-insight.md @@ -13,4 +13,6 @@ Advisor advisor = new Advisor(client); Insight result = await advisor.GetInsight( reportId: "", insightId: "" -);``` +); + +``` diff --git a/docs/examples/advisor/get-report.md b/docs/examples/advisor/get-report.md index 9e8834f5..2143cbc0 100644 --- a/docs/examples/advisor/get-report.md +++ b/docs/examples/advisor/get-report.md @@ -12,4 +12,6 @@ Advisor advisor = new Advisor(client); Report result = await advisor.GetReport( reportId: "" -);``` +); + +``` diff --git a/docs/examples/advisor/list-insights.md b/docs/examples/advisor/list-insights.md index 7e2c6479..00322495 100644 --- a/docs/examples/advisor/list-insights.md +++ b/docs/examples/advisor/list-insights.md @@ -14,4 +14,6 @@ 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 ba3266da..e610e521 100644 --- a/docs/examples/advisor/list-reports.md +++ b/docs/examples/advisor/list-reports.md @@ -13,4 +13,6 @@ Advisor advisor = new Advisor(client); 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 c28cc638..0aabf4b1 100644 --- a/docs/examples/apps/create-installation-token.md +++ b/docs/examples/apps/create-installation-token.md @@ -13,4 +13,6 @@ Apps apps = new Apps(client); Oauth2Token result = await apps.CreateInstallationToken( appId: "", installationId: "" -);``` +); + +``` diff --git a/docs/examples/apps/create-key.md b/docs/examples/apps/create-key.md index e8089591..a4e53d1e 100644 --- a/docs/examples/apps/create-key.md +++ b/docs/examples/apps/create-key.md @@ -12,4 +12,6 @@ Apps apps = new Apps(client); AppKey result = await apps.CreateKey( appId: "" -);``` +); + +``` diff --git a/docs/examples/apps/create-secret.md b/docs/examples/apps/create-secret.md index d5204290..12553ab6 100644 --- a/docs/examples/apps/create-secret.md +++ b/docs/examples/apps/create-secret.md @@ -12,4 +12,6 @@ Apps apps = new Apps(client); AppSecretPlaintext result = await apps.CreateSecret( appId: "" -);``` +); + +``` diff --git a/docs/examples/apps/create.md b/docs/examples/apps/create.md index 596b31cc..18adab45 100644 --- a/docs/examples/apps/create.md +++ b/docs/examples/apps/create.md @@ -30,4 +30,6 @@ App result = await apps.Create( type: "public", // optional deviceFlow: false, // optional teamId: "" // optional -);``` +); + +``` diff --git a/docs/examples/apps/delete-installation.md b/docs/examples/apps/delete-installation.md index 81545045..b55d8b31 100644 --- a/docs/examples/apps/delete-installation.md +++ b/docs/examples/apps/delete-installation.md @@ -13,4 +13,6 @@ Apps apps = new Apps(client); await apps.DeleteInstallation( appId: "", installationId: "" -);``` +); + +``` diff --git a/docs/examples/apps/delete-key.md b/docs/examples/apps/delete-key.md index 352e036f..d816e061 100644 --- a/docs/examples/apps/delete-key.md +++ b/docs/examples/apps/delete-key.md @@ -13,4 +13,6 @@ Apps apps = new Apps(client); await apps.DeleteKey( appId: "", keyId: "" -);``` +); + +``` diff --git a/docs/examples/apps/delete-secret.md b/docs/examples/apps/delete-secret.md index c97148a7..762390a2 100644 --- a/docs/examples/apps/delete-secret.md +++ b/docs/examples/apps/delete-secret.md @@ -13,4 +13,6 @@ Apps apps = new Apps(client); await apps.DeleteSecret( appId: "", secretId: "" -);``` +); + +``` diff --git a/docs/examples/apps/delete-tokens.md b/docs/examples/apps/delete-tokens.md index ebe444be..4be6c113 100644 --- a/docs/examples/apps/delete-tokens.md +++ b/docs/examples/apps/delete-tokens.md @@ -12,4 +12,6 @@ Apps apps = new Apps(client); await apps.DeleteTokens( appId: "" -);``` +); + +``` diff --git a/docs/examples/apps/delete.md b/docs/examples/apps/delete.md index 0942bb2f..973b9f43 100644 --- a/docs/examples/apps/delete.md +++ b/docs/examples/apps/delete.md @@ -12,4 +12,6 @@ Apps apps = new Apps(client); await apps.Delete( appId: "" -);``` +); + +``` diff --git a/docs/examples/apps/get-installation.md b/docs/examples/apps/get-installation.md index 4102d094..16221bdc 100644 --- a/docs/examples/apps/get-installation.md +++ b/docs/examples/apps/get-installation.md @@ -13,4 +13,6 @@ Apps apps = new Apps(client); AppInstallation result = await apps.GetInstallation( appId: "", installationId: "" -);``` +); + +``` diff --git a/docs/examples/apps/get-key.md b/docs/examples/apps/get-key.md index 17adf20f..4bfe168c 100644 --- a/docs/examples/apps/get-key.md +++ b/docs/examples/apps/get-key.md @@ -13,4 +13,6 @@ Apps apps = new Apps(client); AppKey result = await apps.GetKey( appId: "", keyId: "" -);``` +); + +``` diff --git a/docs/examples/apps/get-secret.md b/docs/examples/apps/get-secret.md index 3e8b9925..e1f6e4fc 100644 --- a/docs/examples/apps/get-secret.md +++ b/docs/examples/apps/get-secret.md @@ -13,4 +13,6 @@ Apps apps = new Apps(client); AppSecret result = await apps.GetSecret( appId: "", secretId: "" -);``` +); + +``` diff --git a/docs/examples/apps/get.md b/docs/examples/apps/get.md index a9ee6a0f..df6aefd0 100644 --- a/docs/examples/apps/get.md +++ b/docs/examples/apps/get.md @@ -12,4 +12,6 @@ Apps apps = new Apps(client); 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 72aaa4fa..2ba341f0 100644 --- a/docs/examples/apps/list-installation-scopes.md +++ b/docs/examples/apps/list-installation-scopes.md @@ -11,4 +11,6 @@ Client client = new Client() Apps apps = new Apps(client); AppScopeList result = await apps.ListInstallationScopes(); + + ``` diff --git a/docs/examples/apps/list-installations.md b/docs/examples/apps/list-installations.md index 6b800561..1a1bdf8d 100644 --- a/docs/examples/apps/list-installations.md +++ b/docs/examples/apps/list-installations.md @@ -14,4 +14,6 @@ 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 6d164d32..e6e8522f 100644 --- a/docs/examples/apps/list-keys.md +++ b/docs/examples/apps/list-keys.md @@ -14,4 +14,6 @@ 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 f9382134..6efd8503 100644 --- a/docs/examples/apps/list-o-auth-2-scopes.md +++ b/docs/examples/apps/list-o-auth-2-scopes.md @@ -11,4 +11,6 @@ Client client = new Client() Apps apps = new Apps(client); AppScopeList result = await apps.ListOAuth2Scopes(); + + ``` diff --git a/docs/examples/apps/list-secrets.md b/docs/examples/apps/list-secrets.md index fe394026..ab831c0a 100644 --- a/docs/examples/apps/list-secrets.md +++ b/docs/examples/apps/list-secrets.md @@ -14,4 +14,6 @@ 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 1dffb6a0..724cfd91 100644 --- a/docs/examples/apps/list.md +++ b/docs/examples/apps/list.md @@ -13,4 +13,6 @@ Apps apps = new Apps(client); 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 ac99b7b8..3a311d25 100644 --- a/docs/examples/apps/update-labels.md +++ b/docs/examples/apps/update-labels.md @@ -13,4 +13,6 @@ Apps apps = new Apps(client); 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 18084338..ac6fc92d 100644 --- a/docs/examples/apps/update-team.md +++ b/docs/examples/apps/update-team.md @@ -13,4 +13,6 @@ Apps apps = new Apps(client); App result = await apps.UpdateTeam( appId: "", teamId: "" -);``` +); + +``` diff --git a/docs/examples/apps/update.md b/docs/examples/apps/update.md index d6af16a9..20de7ef0 100644 --- a/docs/examples/apps/update.md +++ b/docs/examples/apps/update.md @@ -31,4 +31,6 @@ App result = await apps.Update( deviceFlow: false, // optional installationScopes: new List(), // optional installationRedirectUrl: "https://example.com" // optional -);``` +); + +``` diff --git a/docs/examples/avatars/get-browser.md b/docs/examples/avatars/get-browser.md index f17be7dd..4b53a3e4 100644 --- a/docs/examples/avatars/get-browser.md +++ b/docs/examples/avatars/get-browser.md @@ -16,4 +16,6 @@ byte[] result = await avatars.GetBrowser( width: 0, // optional height: 0, // optional quality: -1 // optional -);``` +); + +``` diff --git a/docs/examples/avatars/get-credit-card.md b/docs/examples/avatars/get-credit-card.md index 6d1647ee..924d4b6c 100644 --- a/docs/examples/avatars/get-credit-card.md +++ b/docs/examples/avatars/get-credit-card.md @@ -16,4 +16,6 @@ byte[] result = await avatars.GetCreditCard( width: 0, // optional height: 0, // optional quality: -1 // optional -);``` +); + +``` diff --git a/docs/examples/avatars/get-favicon.md b/docs/examples/avatars/get-favicon.md index 4443daf4..d7179748 100644 --- a/docs/examples/avatars/get-favicon.md +++ b/docs/examples/avatars/get-favicon.md @@ -12,4 +12,6 @@ Avatars avatars = new Avatars(client); byte[] result = await avatars.GetFavicon( url: "https://example.com" -);``` +); + +``` diff --git a/docs/examples/avatars/get-flag.md b/docs/examples/avatars/get-flag.md index 2242497a..8480c6fb 100644 --- a/docs/examples/avatars/get-flag.md +++ b/docs/examples/avatars/get-flag.md @@ -16,4 +16,6 @@ byte[] result = await avatars.GetFlag( width: 0, // optional height: 0, // optional quality: -1 // optional -);``` +); + +``` diff --git a/docs/examples/avatars/get-image.md b/docs/examples/avatars/get-image.md index 99518bed..86ef67f7 100644 --- a/docs/examples/avatars/get-image.md +++ b/docs/examples/avatars/get-image.md @@ -14,4 +14,6 @@ byte[] result = await avatars.GetImage( url: "https://example.com", width: 0, // optional height: 0 // optional -);``` +); + +``` diff --git a/docs/examples/avatars/get-initials.md b/docs/examples/avatars/get-initials.md index 8f6f1cd4..3c6d7dd1 100644 --- a/docs/examples/avatars/get-initials.md +++ b/docs/examples/avatars/get-initials.md @@ -14,5 +14,7 @@ byte[] result = await avatars.GetInitials( name: "", // optional width: 0, // optional height: 0, // optional - background: "" // optional -);``` + background: "FFFFFF" // optional +); + +``` diff --git a/docs/examples/avatars/get-photo.md b/docs/examples/avatars/get-photo.md new file mode 100644 index 00000000..0f65e539 --- /dev/null +++ b/docs/examples/avatars/get-photo.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 + .SetSession(""); // The user session to authenticate with + +Avatars avatars = new Avatars(client); + +byte[] result = await avatars.GetPhoto( + width: 0, // optional + height: 0, // optional + quality: 0, // optional + output: "png", // optional + rating: "g", // optional + userId: "current()", // optional + emailHash: "", // optional + name: "" // optional +); + +``` diff --git a/docs/examples/avatars/get-qr.md b/docs/examples/avatars/get-qr.md index 2414e3d5..0be679e6 100644 --- a/docs/examples/avatars/get-qr.md +++ b/docs/examples/avatars/get-qr.md @@ -15,4 +15,6 @@ byte[] result = await avatars.GetQR( size: 1, // optional margin: 0, // optional download: false // optional -);``` +); + +``` diff --git a/docs/examples/avatars/get-screenshot.md b/docs/examples/avatars/get-screenshot.md index eaa39c8d..92828bf7 100644 --- a/docs/examples/avatars/get-screenshot.md +++ b/docs/examples/avatars/get-screenshot.md @@ -35,4 +35,6 @@ byte[] result = await avatars.GetScreenshot( height: 600, // optional quality: 85, // optional output: ImageFormat.Jpeg // optional -);``` +); + +``` diff --git a/docs/examples/backups/create-archive.md b/docs/examples/backups/create-archive.md index 4eee7308..6cb21045 100644 --- a/docs/examples/backups/create-archive.md +++ b/docs/examples/backups/create-archive.md @@ -14,4 +14,6 @@ Backups backups = new Backups(client); 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 a357c855..cee682ed 100644 --- a/docs/examples/backups/create-policy.md +++ b/docs/examples/backups/create-policy.md @@ -19,4 +19,6 @@ BackupPolicy result = await backups.CreatePolicy( name: "", // optional resourceId: "", // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/backups/create-restoration.md b/docs/examples/backups/create-restoration.md index 80ec86a1..f3649c17 100644 --- a/docs/examples/backups/create-restoration.md +++ b/docs/examples/backups/create-restoration.md @@ -16,4 +16,6 @@ BackupRestoration result = await backups.CreateRestoration( services: new List<BackupServices> { BackupServices.Databases }, newResourceId: "", // optional newResourceName: "" // optional -);``` +); + +``` diff --git a/docs/examples/backups/delete-archive.md b/docs/examples/backups/delete-archive.md index 2fe98e06..650e2a01 100644 --- a/docs/examples/backups/delete-archive.md +++ b/docs/examples/backups/delete-archive.md @@ -12,4 +12,6 @@ Backups backups = new Backups(client); await backups.DeleteArchive( archiveId: "" -);``` +); + +``` diff --git a/docs/examples/backups/delete-policy.md b/docs/examples/backups/delete-policy.md index cc154823..cacac41f 100644 --- a/docs/examples/backups/delete-policy.md +++ b/docs/examples/backups/delete-policy.md @@ -12,4 +12,6 @@ Backups backups = new Backups(client); await backups.DeletePolicy( policyId: "" -);``` +); + +``` diff --git a/docs/examples/backups/get-archive.md b/docs/examples/backups/get-archive.md index d06e0bc5..15c9b83d 100644 --- a/docs/examples/backups/get-archive.md +++ b/docs/examples/backups/get-archive.md @@ -12,4 +12,6 @@ Backups backups = new Backups(client); BackupArchive result = await backups.GetArchive( archiveId: "" -);``` +); + +``` diff --git a/docs/examples/backups/get-policy.md b/docs/examples/backups/get-policy.md index 427fcfa0..0fe94d97 100644 --- a/docs/examples/backups/get-policy.md +++ b/docs/examples/backups/get-policy.md @@ -12,4 +12,6 @@ Backups backups = new Backups(client); BackupPolicy result = await backups.GetPolicy( policyId: "" -);``` +); + +``` diff --git a/docs/examples/backups/get-restoration.md b/docs/examples/backups/get-restoration.md index bed028bb..e48d04ee 100644 --- a/docs/examples/backups/get-restoration.md +++ b/docs/examples/backups/get-restoration.md @@ -12,4 +12,6 @@ Backups backups = new Backups(client); BackupRestoration result = await backups.GetRestoration( restorationId: "" -);``` +); + +``` diff --git a/docs/examples/backups/list-archives.md b/docs/examples/backups/list-archives.md index ddc46339..15f69c28 100644 --- a/docs/examples/backups/list-archives.md +++ b/docs/examples/backups/list-archives.md @@ -12,4 +12,6 @@ Backups backups = new Backups(client); 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 8ebdffdf..f1695519 100644 --- a/docs/examples/backups/list-policies.md +++ b/docs/examples/backups/list-policies.md @@ -12,4 +12,6 @@ Backups backups = new Backups(client); 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 7d9712d6..ee286a75 100644 --- a/docs/examples/backups/list-restorations.md +++ b/docs/examples/backups/list-restorations.md @@ -12,4 +12,6 @@ Backups backups = new Backups(client); 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 acba52a3..93d1233b 100644 --- a/docs/examples/backups/update-policy.md +++ b/docs/examples/backups/update-policy.md @@ -16,4 +16,6 @@ BackupPolicy result = await backups.UpdatePolicy( retention: 1, // optional schedule: "", // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/databases/create-big-int-attribute.md b/docs/examples/databases/create-big-int-attribute.md index 405bdfdd..db06ba5d 100644 --- a/docs/examples/databases/create-big-int-attribute.md +++ b/docs/examples/databases/create-big-int-attribute.md @@ -13,10 +13,12 @@ Databases databases = new Databases(client); AttributeBigint result = await databases.CreateBigIntAttribute( databaseId: "", collectionId: "", - key: "", + key: "", required: false, min: 0, // optional - max: 0, // optional + max: 1000000, // optional default: 0, // optional array: false // optional -);``` +); + +``` diff --git a/docs/examples/databases/create-boolean-attribute.md b/docs/examples/databases/create-boolean-attribute.md index 7a2a8038..ba2df46c 100644 --- a/docs/examples/databases/create-boolean-attribute.md +++ b/docs/examples/databases/create-boolean-attribute.md @@ -13,8 +13,10 @@ Databases databases = new Databases(client); AttributeBoolean result = await databases.CreateBooleanAttribute( databaseId: "", collectionId: "", - key: "", + key: "", required: false, default: false, // optional array: false // optional -);``` +); + +``` diff --git a/docs/examples/databases/create-collection.md b/docs/examples/databases/create-collection.md index 51398280..8fbf9538 100644 --- a/docs/examples/databases/create-collection.md +++ b/docs/examples/databases/create-collection.md @@ -19,4 +19,6 @@ Collection result = await databases.CreateCollection( enabled: false, // optional attributes: new List(), // optional indexes: new List() // optional -);``` +); + +``` diff --git a/docs/examples/databases/create-datetime-attribute.md b/docs/examples/databases/create-datetime-attribute.md index 85d2e095..f9248808 100644 --- a/docs/examples/databases/create-datetime-attribute.md +++ b/docs/examples/databases/create-datetime-attribute.md @@ -13,8 +13,10 @@ Databases databases = new Databases(client); AttributeDatetime result = await databases.CreateDatetimeAttribute( databaseId: "", collectionId: "", - key: "", + key: "", required: false, default: "2020-10-15T06:38:00.000+00:00", // optional array: false // optional -);``` +); + +``` diff --git a/docs/examples/databases/create-document.md b/docs/examples/databases/create-document.md index f2eb911c..54730c8d 100644 --- a/docs/examples/databases/create-document.md +++ b/docs/examples/databases/create-document.md @@ -23,4 +23,6 @@ Document result = await databases.CreateDocument( }, permissions: new List { Permission.Read(Role.Any()) }, // optional transactionId: "" // optional -);``` +); + +``` diff --git a/docs/examples/databases/create-documents.md b/docs/examples/databases/create-documents.md index f026a31a..e490a0b8 100644 --- a/docs/examples/databases/create-documents.md +++ b/docs/examples/databases/create-documents.md @@ -15,4 +15,6 @@ DocumentList result = await databases.CreateDocuments( collectionId: "", documents: new List(), transactionId: "" // optional -);``` +); + +``` diff --git a/docs/examples/databases/create-email-attribute.md b/docs/examples/databases/create-email-attribute.md index a08ca0b3..94757f04 100644 --- a/docs/examples/databases/create-email-attribute.md +++ b/docs/examples/databases/create-email-attribute.md @@ -13,8 +13,10 @@ Databases databases = new Databases(client); AttributeEmail result = await databases.CreateEmailAttribute( databaseId: "", collectionId: "", - key: "", + key: "", required: false, default: "email@example.com", // optional array: false // optional -);``` +); + +``` diff --git a/docs/examples/databases/create-enum-attribute.md b/docs/examples/databases/create-enum-attribute.md index 5a27fbca..d66cb3ac 100644 --- a/docs/examples/databases/create-enum-attribute.md +++ b/docs/examples/databases/create-enum-attribute.md @@ -13,9 +13,11 @@ Databases databases = new Databases(client); AttributeEnum result = await databases.CreateEnumAttribute( databaseId: "", collectionId: "", - key: "", - elements: new List(), + key: "", + elements: ["active", "inactive"], required: false, - default: "", // optional + default: "active", // optional array: false // optional -);``` +); + +``` diff --git a/docs/examples/databases/create-float-attribute.md b/docs/examples/databases/create-float-attribute.md index 2c8f71ed..26fb95a7 100644 --- a/docs/examples/databases/create-float-attribute.md +++ b/docs/examples/databases/create-float-attribute.md @@ -13,10 +13,12 @@ Databases databases = new Databases(client); AttributeFloat result = await databases.CreateFloatAttribute( databaseId: "", collectionId: "", - key: "", + key: "", required: false, min: 0, // optional - max: 0, // optional - default: 0, // optional + max: 100, // optional + default: 10.5, // optional array: false // optional -);``` +); + +``` diff --git a/docs/examples/databases/create-index.md b/docs/examples/databases/create-index.md index 3d653021..748394d9 100644 --- a/docs/examples/databases/create-index.md +++ b/docs/examples/databases/create-index.md @@ -14,9 +14,11 @@ Databases databases = new Databases(client); Index result = await databases.CreateIndex( databaseId: "", collectionId: "", - key: "", + key: "", type: DatabasesIndexType.Key, attributes: new List(), 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 71a02566..04678b94 100644 --- a/docs/examples/databases/create-integer-attribute.md +++ b/docs/examples/databases/create-integer-attribute.md @@ -13,10 +13,12 @@ Databases databases = new Databases(client); AttributeInteger result = await databases.CreateIntegerAttribute( databaseId: "", collectionId: "", - key: "", + key: "", required: false, min: 0, // optional - max: 0, // optional - default: 0, // optional + max: 100, // optional + default: 10, // optional array: false // optional -);``` +); + +``` diff --git a/docs/examples/databases/create-ip-attribute.md b/docs/examples/databases/create-ip-attribute.md index 666ae483..b5de19be 100644 --- a/docs/examples/databases/create-ip-attribute.md +++ b/docs/examples/databases/create-ip-attribute.md @@ -13,8 +13,10 @@ Databases databases = new Databases(client); AttributeIp result = await databases.CreateIpAttribute( databaseId: "", collectionId: "", - key: "", + key: "", required: false, - default: "", // optional + default: "192.0.2.0", // optional array: false // optional -);``` +); + +``` diff --git a/docs/examples/databases/create-line-attribute.md b/docs/examples/databases/create-line-attribute.md index ac36d800..53f1ada4 100644 --- a/docs/examples/databases/create-line-attribute.md +++ b/docs/examples/databases/create-line-attribute.md @@ -13,7 +13,9 @@ Databases databases = new Databases(client); AttributeLine result = await databases.CreateLineAttribute( databaseId: "", collectionId: "", - key: "", + key: "", required: false, default: [[1, 2], [3, 4], [5, 6]] // optional -);``` +); + +``` diff --git a/docs/examples/databases/create-longtext-attribute.md b/docs/examples/databases/create-longtext-attribute.md index 95bc8112..3bf127aa 100644 --- a/docs/examples/databases/create-longtext-attribute.md +++ b/docs/examples/databases/create-longtext-attribute.md @@ -13,9 +13,11 @@ Databases databases = new Databases(client); AttributeLongtext result = await databases.CreateLongtextAttribute( databaseId: "", collectionId: "", - key: "", + key: "", required: false, - default: "", // optional + default: "Hello World", // optional array: false, // optional encrypt: false // optional -);``` +); + +``` diff --git a/docs/examples/databases/create-mediumtext-attribute.md b/docs/examples/databases/create-mediumtext-attribute.md index c2e321f0..2e758f7b 100644 --- a/docs/examples/databases/create-mediumtext-attribute.md +++ b/docs/examples/databases/create-mediumtext-attribute.md @@ -13,9 +13,11 @@ Databases databases = new Databases(client); AttributeMediumtext result = await databases.CreateMediumtextAttribute( databaseId: "", collectionId: "", - key: "", + key: "", required: false, - default: "", // optional + default: "Hello World", // optional array: false, // optional encrypt: false // optional -);``` +); + +``` diff --git a/docs/examples/databases/create-operations.md b/docs/examples/databases/create-operations.md index 689678a0..7b150194 100644 --- a/docs/examples/databases/create-operations.md +++ b/docs/examples/databases/create-operations.md @@ -23,4 +23,6 @@ Transaction result = await databases.CreateOperations( } } ] // optional -);``` +); + +``` diff --git a/docs/examples/databases/create-point-attribute.md b/docs/examples/databases/create-point-attribute.md index 66e87640..a08e2b9a 100644 --- a/docs/examples/databases/create-point-attribute.md +++ b/docs/examples/databases/create-point-attribute.md @@ -13,7 +13,9 @@ Databases databases = new Databases(client); AttributePoint result = await databases.CreatePointAttribute( databaseId: "", collectionId: "", - key: "", + key: "", required: false, default: [1, 2] // optional -);``` +); + +``` diff --git a/docs/examples/databases/create-polygon-attribute.md b/docs/examples/databases/create-polygon-attribute.md index 66c44b12..917a45c9 100644 --- a/docs/examples/databases/create-polygon-attribute.md +++ b/docs/examples/databases/create-polygon-attribute.md @@ -13,7 +13,9 @@ Databases databases = new Databases(client); AttributePolygon result = await databases.CreatePolygonAttribute( databaseId: "", collectionId: "", - key: "", + key: "", required: false, default: [[[1, 2], [3, 4], [5, 6], [1, 2]]] // optional -);``` +); + +``` diff --git a/docs/examples/databases/create-relationship-attribute.md b/docs/examples/databases/create-relationship-attribute.md index a5262ffe..6f8ac621 100644 --- a/docs/examples/databases/create-relationship-attribute.md +++ b/docs/examples/databases/create-relationship-attribute.md @@ -17,7 +17,9 @@ AttributeRelationship result = await databases.CreateRelationshipAttribute( relatedCollectionId: "", type: RelationshipType.OneToOne, twoWay: false, // optional - key: "", // optional - twoWayKey: "", // optional + key: "", // optional + twoWayKey: "", // optional onDelete: RelationMutate.Cascade // optional -);``` +); + +``` diff --git a/docs/examples/databases/create-string-attribute.md b/docs/examples/databases/create-string-attribute.md index 9e7be5f6..ea547aaa 100644 --- a/docs/examples/databases/create-string-attribute.md +++ b/docs/examples/databases/create-string-attribute.md @@ -13,10 +13,12 @@ Databases databases = new Databases(client); AttributeString result = await databases.CreateStringAttribute( databaseId: "", collectionId: "", - key: "", + key: "", size: 1, required: false, - default: "", // optional + default: "Hello World", // optional array: false, // optional encrypt: false // optional -);``` +); + +``` diff --git a/docs/examples/databases/create-text-attribute.md b/docs/examples/databases/create-text-attribute.md index c31955d7..dd6fe3cb 100644 --- a/docs/examples/databases/create-text-attribute.md +++ b/docs/examples/databases/create-text-attribute.md @@ -13,9 +13,11 @@ Databases databases = new Databases(client); AttributeText result = await databases.CreateTextAttribute( databaseId: "", collectionId: "", - key: "", + key: "", required: false, - default: "", // optional + default: "Hello World", // optional array: false, // optional encrypt: false // optional -);``` +); + +``` diff --git a/docs/examples/databases/create-transaction.md b/docs/examples/databases/create-transaction.md index affe6894..29b18cd4 100644 --- a/docs/examples/databases/create-transaction.md +++ b/docs/examples/databases/create-transaction.md @@ -12,4 +12,6 @@ Databases databases = new Databases(client); 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 2f278ed1..dd0e356b 100644 --- a/docs/examples/databases/create-url-attribute.md +++ b/docs/examples/databases/create-url-attribute.md @@ -13,8 +13,10 @@ Databases databases = new Databases(client); AttributeUrl result = await databases.CreateUrlAttribute( databaseId: "", collectionId: "", - key: "", + key: "", required: false, default: "https://example.com", // optional array: false // optional -);``` +); + +``` diff --git a/docs/examples/databases/create-varchar-attribute.md b/docs/examples/databases/create-varchar-attribute.md index 215c6a71..4c3f3a1e 100644 --- a/docs/examples/databases/create-varchar-attribute.md +++ b/docs/examples/databases/create-varchar-attribute.md @@ -13,10 +13,12 @@ Databases databases = new Databases(client); AttributeVarchar result = await databases.CreateVarcharAttribute( databaseId: "", collectionId: "", - key: "", + key: "", size: 1, required: false, - default: "", // optional + default: "Hello World", // optional array: false, // optional encrypt: false // optional -);``` +); + +``` diff --git a/docs/examples/databases/create.md b/docs/examples/databases/create.md index 534cd64f..6d0a504c 100644 --- a/docs/examples/databases/create.md +++ b/docs/examples/databases/create.md @@ -14,4 +14,6 @@ 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 4dc89d8e..46dd163d 100644 --- a/docs/examples/databases/decrement-document-attribute.md +++ b/docs/examples/databases/decrement-document-attribute.md @@ -14,8 +14,10 @@ Document result = await databases.DecrementDocumentAttribute( databaseId: "", collectionId: "", documentId: "", - attribute: "", - value: 0, // optional + attribute: "", + value: 1, // optional min: 0, // optional transactionId: "" // optional -);``` +); + +``` diff --git a/docs/examples/databases/delete-attribute.md b/docs/examples/databases/delete-attribute.md index fdf5b395..05fb3e78 100644 --- a/docs/examples/databases/delete-attribute.md +++ b/docs/examples/databases/delete-attribute.md @@ -13,5 +13,7 @@ Databases databases = new Databases(client); await databases.DeleteAttribute( databaseId: "", collectionId: "", - key: "" -);``` + key: "" +); + +``` diff --git a/docs/examples/databases/delete-collection.md b/docs/examples/databases/delete-collection.md index 50d6e4e7..ecebab3a 100644 --- a/docs/examples/databases/delete-collection.md +++ b/docs/examples/databases/delete-collection.md @@ -13,4 +13,6 @@ Databases databases = new Databases(client); await databases.DeleteCollection( databaseId: "", collectionId: "" -);``` +); + +``` diff --git a/docs/examples/databases/delete-document.md b/docs/examples/databases/delete-document.md index fda3b456..02adf999 100644 --- a/docs/examples/databases/delete-document.md +++ b/docs/examples/databases/delete-document.md @@ -15,4 +15,6 @@ await databases.DeleteDocument( collectionId: "", documentId: "", transactionId: "" // optional -);``` +); + +``` diff --git a/docs/examples/databases/delete-documents.md b/docs/examples/databases/delete-documents.md index d6c85c9a..4b14b138 100644 --- a/docs/examples/databases/delete-documents.md +++ b/docs/examples/databases/delete-documents.md @@ -15,4 +15,6 @@ await databases.DeleteDocuments( collectionId: "", queries: new List(), // optional transactionId: "" // optional -);``` +); + +``` diff --git a/docs/examples/databases/delete-index.md b/docs/examples/databases/delete-index.md index 5dce6650..60303458 100644 --- a/docs/examples/databases/delete-index.md +++ b/docs/examples/databases/delete-index.md @@ -13,5 +13,7 @@ Databases databases = new Databases(client); await databases.DeleteIndex( databaseId: "", collectionId: "", - key: "" -);``` + key: "" +); + +``` diff --git a/docs/examples/databases/delete-transaction.md b/docs/examples/databases/delete-transaction.md index 692245f6..2c3b947f 100644 --- a/docs/examples/databases/delete-transaction.md +++ b/docs/examples/databases/delete-transaction.md @@ -12,4 +12,6 @@ Databases databases = new Databases(client); await databases.DeleteTransaction( transactionId: "" -);``` +); + +``` diff --git a/docs/examples/databases/delete.md b/docs/examples/databases/delete.md index 2c4d440b..519bcab3 100644 --- a/docs/examples/databases/delete.md +++ b/docs/examples/databases/delete.md @@ -12,4 +12,6 @@ Databases databases = new Databases(client); await databases.Delete( databaseId: "" -);``` +); + +``` diff --git a/docs/examples/databases/get-attribute.md b/docs/examples/databases/get-attribute.md index 3e0832c3..d131b814 100644 --- a/docs/examples/databases/get-attribute.md +++ b/docs/examples/databases/get-attribute.md @@ -13,5 +13,7 @@ Databases databases = new Databases(client); object result = await databases.GetAttribute( databaseId: "", collectionId: "", - key: "" -);``` + key: "" +); + +``` diff --git a/docs/examples/databases/get-collection.md b/docs/examples/databases/get-collection.md index 90bcbd5b..0798f68e 100644 --- a/docs/examples/databases/get-collection.md +++ b/docs/examples/databases/get-collection.md @@ -13,4 +13,6 @@ Databases databases = new Databases(client); Collection result = await databases.GetCollection( databaseId: "", collectionId: "" -);``` +); + +``` diff --git a/docs/examples/databases/get-document.md b/docs/examples/databases/get-document.md index 404aeaa2..102cbb5b 100644 --- a/docs/examples/databases/get-document.md +++ b/docs/examples/databases/get-document.md @@ -16,4 +16,6 @@ Document result = await databases.GetDocument( documentId: "", queries: new List(), // optional transactionId: "" // optional -);``` +); + +``` diff --git a/docs/examples/databases/get-index.md b/docs/examples/databases/get-index.md index fb11f427..ad06f1fb 100644 --- a/docs/examples/databases/get-index.md +++ b/docs/examples/databases/get-index.md @@ -13,5 +13,7 @@ Databases databases = new Databases(client); Index result = await databases.GetIndex( databaseId: "", collectionId: "", - key: "" -);``` + key: "" +); + +``` diff --git a/docs/examples/databases/get-transaction.md b/docs/examples/databases/get-transaction.md index 38441e99..fe449961 100644 --- a/docs/examples/databases/get-transaction.md +++ b/docs/examples/databases/get-transaction.md @@ -12,4 +12,6 @@ Databases databases = new Databases(client); Transaction result = await databases.GetTransaction( transactionId: "" -);``` +); + +``` diff --git a/docs/examples/databases/get.md b/docs/examples/databases/get.md index ff8ff6ba..91d9a0ec 100644 --- a/docs/examples/databases/get.md +++ b/docs/examples/databases/get.md @@ -12,4 +12,6 @@ Databases databases = new Databases(client); 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 3a6eaa2b..230784d7 100644 --- a/docs/examples/databases/increment-document-attribute.md +++ b/docs/examples/databases/increment-document-attribute.md @@ -14,8 +14,10 @@ Document result = await databases.IncrementDocumentAttribute( databaseId: "", collectionId: "", documentId: "", - attribute: "", - value: 0, // optional - max: 0, // optional + attribute: "", + value: 1, // optional + max: 100, // optional transactionId: "" // optional -);``` +); + +``` diff --git a/docs/examples/databases/list-attributes.md b/docs/examples/databases/list-attributes.md index b0ac39a0..ff57878c 100644 --- a/docs/examples/databases/list-attributes.md +++ b/docs/examples/databases/list-attributes.md @@ -15,4 +15,6 @@ AttributeList result = await databases.ListAttributes( collectionId: "", queries: new List(), // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/databases/list-collections.md b/docs/examples/databases/list-collections.md index 9cc4aeff..ed856f6e 100644 --- a/docs/examples/databases/list-collections.md +++ b/docs/examples/databases/list-collections.md @@ -15,4 +15,6 @@ CollectionList result = await databases.ListCollections( queries: new List(), // optional search: "", // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/databases/list-documents.md b/docs/examples/databases/list-documents.md index cb2d2dbe..d8cdff0a 100644 --- a/docs/examples/databases/list-documents.md +++ b/docs/examples/databases/list-documents.md @@ -17,4 +17,6 @@ DocumentList result = await databases.ListDocuments( transactionId: "", // optional total: false, // optional ttl: 0 // optional -);``` +); + +``` diff --git a/docs/examples/databases/list-indexes.md b/docs/examples/databases/list-indexes.md index 207d060b..80f4bcf2 100644 --- a/docs/examples/databases/list-indexes.md +++ b/docs/examples/databases/list-indexes.md @@ -15,4 +15,6 @@ IndexList result = await databases.ListIndexes( collectionId: "", queries: new List(), // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/databases/list-transactions.md b/docs/examples/databases/list-transactions.md index 1213629c..fc141674 100644 --- a/docs/examples/databases/list-transactions.md +++ b/docs/examples/databases/list-transactions.md @@ -12,4 +12,6 @@ Databases databases = new Databases(client); TransactionList result = await databases.ListTransactions( queries: new List() // optional -);``` +); + +``` diff --git a/docs/examples/databases/list.md b/docs/examples/databases/list.md index 52aa1970..57095184 100644 --- a/docs/examples/databases/list.md +++ b/docs/examples/databases/list.md @@ -14,4 +14,6 @@ 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 14dba131..7fea78b5 100644 --- a/docs/examples/databases/update-big-int-attribute.md +++ b/docs/examples/databases/update-big-int-attribute.md @@ -13,10 +13,12 @@ Databases databases = new Databases(client); AttributeBigint result = await databases.UpdateBigIntAttribute( databaseId: "", collectionId: "", - key: "", + key: "", required: false, default: 0, min: 0, // optional - max: 0, // optional - newKey: "" // optional -);``` + max: 1000000, // optional + newKey: "" // optional +); + +``` diff --git a/docs/examples/databases/update-boolean-attribute.md b/docs/examples/databases/update-boolean-attribute.md index 0b5caaa2..52b0a767 100644 --- a/docs/examples/databases/update-boolean-attribute.md +++ b/docs/examples/databases/update-boolean-attribute.md @@ -13,8 +13,10 @@ Databases databases = new Databases(client); AttributeBoolean result = await databases.UpdateBooleanAttribute( databaseId: "", collectionId: "", - key: "", + key: "", required: false, default: false, - newKey: "" // optional -);``` + newKey: "" // optional +); + +``` diff --git a/docs/examples/databases/update-collection.md b/docs/examples/databases/update-collection.md index ab058806..7e3378fa 100644 --- a/docs/examples/databases/update-collection.md +++ b/docs/examples/databases/update-collection.md @@ -18,4 +18,6 @@ Collection result = await databases.UpdateCollection( documentSecurity: false, // optional enabled: false, // optional purge: false // optional -);``` +); + +``` diff --git a/docs/examples/databases/update-datetime-attribute.md b/docs/examples/databases/update-datetime-attribute.md index a2da8980..2a1df23f 100644 --- a/docs/examples/databases/update-datetime-attribute.md +++ b/docs/examples/databases/update-datetime-attribute.md @@ -13,8 +13,10 @@ Databases databases = new Databases(client); AttributeDatetime result = await databases.UpdateDatetimeAttribute( databaseId: "", collectionId: "", - key: "", + key: "", required: false, default: "2020-10-15T06:38:00.000+00:00", - newKey: "" // optional -);``` + newKey: "" // optional +); + +``` diff --git a/docs/examples/databases/update-document.md b/docs/examples/databases/update-document.md index 58d268ba..e18a6ef9 100644 --- a/docs/examples/databases/update-document.md +++ b/docs/examples/databases/update-document.md @@ -23,4 +23,6 @@ Document result = await databases.UpdateDocument( }, // optional permissions: new List { Permission.Read(Role.Any()) }, // optional transactionId: "" // optional -);``` +); + +``` diff --git a/docs/examples/databases/update-documents.md b/docs/examples/databases/update-documents.md index add1deb6..db3133df 100644 --- a/docs/examples/databases/update-documents.md +++ b/docs/examples/databases/update-documents.md @@ -22,4 +22,6 @@ DocumentList result = await databases.UpdateDocuments( }, // optional queries: new List(), // optional transactionId: "" // optional -);``` +); + +``` diff --git a/docs/examples/databases/update-email-attribute.md b/docs/examples/databases/update-email-attribute.md index 543e95be..b1f0e37f 100644 --- a/docs/examples/databases/update-email-attribute.md +++ b/docs/examples/databases/update-email-attribute.md @@ -13,8 +13,10 @@ Databases databases = new Databases(client); AttributeEmail result = await databases.UpdateEmailAttribute( databaseId: "", collectionId: "", - key: "", + key: "", required: false, default: "email@example.com", - newKey: "" // optional -);``` + newKey: "" // optional +); + +``` diff --git a/docs/examples/databases/update-enum-attribute.md b/docs/examples/databases/update-enum-attribute.md index e71c4bdb..d009b5c7 100644 --- a/docs/examples/databases/update-enum-attribute.md +++ b/docs/examples/databases/update-enum-attribute.md @@ -13,9 +13,11 @@ Databases databases = new Databases(client); AttributeEnum result = await databases.UpdateEnumAttribute( databaseId: "", collectionId: "", - key: "", - elements: new List(), + key: "", + elements: ["active", "inactive"], required: false, - default: "", - newKey: "" // optional -);``` + default: "active", + newKey: "" // optional +); + +``` diff --git a/docs/examples/databases/update-float-attribute.md b/docs/examples/databases/update-float-attribute.md index 14723431..fd8dc427 100644 --- a/docs/examples/databases/update-float-attribute.md +++ b/docs/examples/databases/update-float-attribute.md @@ -13,10 +13,12 @@ Databases databases = new Databases(client); AttributeFloat result = await databases.UpdateFloatAttribute( databaseId: "", collectionId: "", - key: "", + key: "", required: false, - default: 0, + default: 10.5, min: 0, // optional - max: 0, // optional - newKey: "" // optional -);``` + max: 100, // optional + newKey: "" // optional +); + +``` diff --git a/docs/examples/databases/update-integer-attribute.md b/docs/examples/databases/update-integer-attribute.md index 75764af7..17a0cc8b 100644 --- a/docs/examples/databases/update-integer-attribute.md +++ b/docs/examples/databases/update-integer-attribute.md @@ -13,10 +13,12 @@ Databases databases = new Databases(client); AttributeInteger result = await databases.UpdateIntegerAttribute( databaseId: "", collectionId: "", - key: "", + key: "", required: false, - default: 0, + default: 10, min: 0, // optional - max: 0, // optional - newKey: "" // optional -);``` + max: 100, // optional + newKey: "" // optional +); + +``` diff --git a/docs/examples/databases/update-ip-attribute.md b/docs/examples/databases/update-ip-attribute.md index d0b25c7c..432bb4d4 100644 --- a/docs/examples/databases/update-ip-attribute.md +++ b/docs/examples/databases/update-ip-attribute.md @@ -13,8 +13,10 @@ Databases databases = new Databases(client); AttributeIp result = await databases.UpdateIpAttribute( databaseId: "", collectionId: "", - key: "", + key: "", required: false, - default: "", - newKey: "" // optional -);``` + default: "192.0.2.0", + newKey: "" // optional +); + +``` diff --git a/docs/examples/databases/update-line-attribute.md b/docs/examples/databases/update-line-attribute.md index eb3a8e76..11dc3840 100644 --- a/docs/examples/databases/update-line-attribute.md +++ b/docs/examples/databases/update-line-attribute.md @@ -13,8 +13,10 @@ Databases databases = new Databases(client); AttributeLine result = await databases.UpdateLineAttribute( databaseId: "", collectionId: "", - key: "", + key: "", required: false, default: [[1, 2], [3, 4], [5, 6]], // optional - newKey: "" // optional -);``` + newKey: "" // optional +); + +``` diff --git a/docs/examples/databases/update-longtext-attribute.md b/docs/examples/databases/update-longtext-attribute.md index ad74738f..2dba9171 100644 --- a/docs/examples/databases/update-longtext-attribute.md +++ b/docs/examples/databases/update-longtext-attribute.md @@ -13,8 +13,10 @@ Databases databases = new Databases(client); AttributeLongtext result = await databases.UpdateLongtextAttribute( databaseId: "", collectionId: "", - key: "", + key: "", required: false, - default: "", - newKey: "" // optional -);``` + default: "Hello World", + newKey: "" // optional +); + +``` diff --git a/docs/examples/databases/update-mediumtext-attribute.md b/docs/examples/databases/update-mediumtext-attribute.md index b85055ef..ba356254 100644 --- a/docs/examples/databases/update-mediumtext-attribute.md +++ b/docs/examples/databases/update-mediumtext-attribute.md @@ -13,8 +13,10 @@ Databases databases = new Databases(client); AttributeMediumtext result = await databases.UpdateMediumtextAttribute( databaseId: "", collectionId: "", - key: "", + key: "", required: false, - default: "", - newKey: "" // optional -);``` + default: "Hello World", + newKey: "" // optional +); + +``` diff --git a/docs/examples/databases/update-point-attribute.md b/docs/examples/databases/update-point-attribute.md index cb8d54b6..7bbf9fb6 100644 --- a/docs/examples/databases/update-point-attribute.md +++ b/docs/examples/databases/update-point-attribute.md @@ -13,8 +13,10 @@ Databases databases = new Databases(client); AttributePoint result = await databases.UpdatePointAttribute( databaseId: "", collectionId: "", - key: "", + key: "", required: false, default: [1, 2], // optional - newKey: "" // optional -);``` + newKey: "" // optional +); + +``` diff --git a/docs/examples/databases/update-polygon-attribute.md b/docs/examples/databases/update-polygon-attribute.md index 5c893799..f35fdcff 100644 --- a/docs/examples/databases/update-polygon-attribute.md +++ b/docs/examples/databases/update-polygon-attribute.md @@ -13,8 +13,10 @@ Databases databases = new Databases(client); AttributePolygon result = await databases.UpdatePolygonAttribute( databaseId: "", collectionId: "", - key: "", + key: "", required: false, default: [[[1, 2], [3, 4], [5, 6], [1, 2]]], // optional - newKey: "" // optional -);``` + newKey: "" // optional +); + +``` diff --git a/docs/examples/databases/update-relationship-attribute.md b/docs/examples/databases/update-relationship-attribute.md index 5d260d97..aa7fd030 100644 --- a/docs/examples/databases/update-relationship-attribute.md +++ b/docs/examples/databases/update-relationship-attribute.md @@ -14,7 +14,9 @@ Databases databases = new Databases(client); AttributeRelationship result = await databases.UpdateRelationshipAttribute( databaseId: "", collectionId: "", - key: "", + key: "", onDelete: RelationMutate.Cascade, // optional - newKey: "" // optional -);``` + newKey: "" // optional +); + +``` diff --git a/docs/examples/databases/update-string-attribute.md b/docs/examples/databases/update-string-attribute.md index 08337fc2..00bf4aed 100644 --- a/docs/examples/databases/update-string-attribute.md +++ b/docs/examples/databases/update-string-attribute.md @@ -13,9 +13,11 @@ Databases databases = new Databases(client); AttributeString result = await databases.UpdateStringAttribute( databaseId: "", collectionId: "", - key: "", + key: "", required: false, - default: "", + default: "Hello World", size: 1, // optional - newKey: "" // optional -);``` + newKey: "" // optional +); + +``` diff --git a/docs/examples/databases/update-text-attribute.md b/docs/examples/databases/update-text-attribute.md index 2ead38d2..e041f96e 100644 --- a/docs/examples/databases/update-text-attribute.md +++ b/docs/examples/databases/update-text-attribute.md @@ -13,8 +13,10 @@ Databases databases = new Databases(client); AttributeText result = await databases.UpdateTextAttribute( databaseId: "", collectionId: "", - key: "", + key: "", required: false, - default: "", - newKey: "" // optional -);``` + default: "Hello World", + newKey: "" // optional +); + +``` diff --git a/docs/examples/databases/update-transaction.md b/docs/examples/databases/update-transaction.md index afa8362a..b3058935 100644 --- a/docs/examples/databases/update-transaction.md +++ b/docs/examples/databases/update-transaction.md @@ -14,4 +14,6 @@ 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 2c78b794..4beafd13 100644 --- a/docs/examples/databases/update-url-attribute.md +++ b/docs/examples/databases/update-url-attribute.md @@ -13,8 +13,10 @@ Databases databases = new Databases(client); AttributeUrl result = await databases.UpdateUrlAttribute( databaseId: "", collectionId: "", - key: "", + key: "", required: false, default: "https://example.com", - newKey: "" // optional -);``` + newKey: "" // optional +); + +``` diff --git a/docs/examples/databases/update-varchar-attribute.md b/docs/examples/databases/update-varchar-attribute.md index 201c17de..2d721512 100644 --- a/docs/examples/databases/update-varchar-attribute.md +++ b/docs/examples/databases/update-varchar-attribute.md @@ -13,9 +13,11 @@ Databases databases = new Databases(client); AttributeVarchar result = await databases.UpdateVarcharAttribute( databaseId: "", collectionId: "", - key: "", + key: "", required: false, - default: "", + default: "Hello World", size: 1, // optional - newKey: "" // optional -);``` + newKey: "" // optional +); + +``` diff --git a/docs/examples/databases/update.md b/docs/examples/databases/update.md index 7a6c2e4c..1439c1ce 100644 --- a/docs/examples/databases/update.md +++ b/docs/examples/databases/update.md @@ -14,4 +14,6 @@ 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 a4714099..3eff270e 100644 --- a/docs/examples/databases/upsert-document.md +++ b/docs/examples/databases/upsert-document.md @@ -23,4 +23,6 @@ Document result = await databases.UpsertDocument( }, // optional permissions: new List { Permission.Read(Role.Any()) }, // optional transactionId: "" // optional -);``` +); + +``` diff --git a/docs/examples/databases/upsert-documents.md b/docs/examples/databases/upsert-documents.md index 8223f8ab..d22184b8 100644 --- a/docs/examples/databases/upsert-documents.md +++ b/docs/examples/databases/upsert-documents.md @@ -15,4 +15,6 @@ DocumentList result = await databases.UpsertDocuments( collectionId: "", documents: new List(), transactionId: "" // optional -);``` +); + +``` diff --git a/docs/examples/documentsdb/create-collection.md b/docs/examples/documentsdb/create-collection.md new file mode 100644 index 00000000..5c42dc56 --- /dev/null +++ b/docs/examples/documentsdb/create-collection.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 + +DocumentsDB documentsDB = new DocumentsDB(client); + +Collection result = await documentsDB.CreateCollection( + databaseId: "", + collectionId: "", + name: "", + permissions: new List { Permission.Read(Role.Any()) }, // optional + documentSecurity: false, // optional + enabled: false, // optional + attributes: new List(), // optional + indexes: new List() // optional +); + +``` diff --git a/docs/examples/documentsdb/create-document.md b/docs/examples/documentsdb/create-document.md new file mode 100644 index 00000000..4c71e2f7 --- /dev/null +++ b/docs/examples/documentsdb/create-document.md @@ -0,0 +1,27 @@ +```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 + +DocumentsDB documentsDB = new DocumentsDB(client); + +Document result = await documentsDB.CreateDocument( + databaseId: "", + collectionId: "", + documentId: "", + data: new { + username = "walter.obrien", + email = "walter.obrien@example.com", + fullName = "Walter O'Brien", + age = 30, + isAdmin = false + }, + permissions: new List { Permission.Read(Role.Any()) } // optional +); + +``` diff --git a/docs/examples/documentsdb/create-documents.md b/docs/examples/documentsdb/create-documents.md new file mode 100644 index 00000000..8e5c33a9 --- /dev/null +++ b/docs/examples/documentsdb/create-documents.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 + +DocumentsDB documentsDB = new DocumentsDB(client); + +DocumentList result = await documentsDB.CreateDocuments( + databaseId: "", + collectionId: "", + documents: new List() +); + +``` diff --git a/docs/examples/documentsdb/create-failover.md b/docs/examples/documentsdb/create-failover.md new file mode 100644 index 00000000..5a22d1c7 --- /dev/null +++ b/docs/examples/documentsdb/create-failover.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 + +DocumentsDB documentsDB = new DocumentsDB(client); + +DedicatedDatabase result = await documentsDB.CreateFailover( + databaseId: "", + targetReplicaId: "" // optional +); + +``` diff --git a/docs/examples/documentsdb/create-index.md b/docs/examples/documentsdb/create-index.md new file mode 100644 index 00000000..31a06292 --- /dev/null +++ b/docs/examples/documentsdb/create-index.md @@ -0,0 +1,24 @@ +```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 + +DocumentsDB documentsDB = new DocumentsDB(client); + +Index result = await documentsDB.CreateIndex( + databaseId: "", + collectionId: "", + key: "", + type: DocumentsDBIndexType.Key, + attributes: new List(), + 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 new file mode 100644 index 00000000..abe507f3 --- /dev/null +++ b/docs/examples/documentsdb/create-operations.md @@ -0,0 +1,28 @@ +```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 + +DocumentsDB documentsDB = new DocumentsDB(client); + +Transaction result = await documentsDB.CreateOperations( + transactionId: "", + operations: [ + { + "action": "create", + "databaseId": "", + "collectionId": "", + "documentId": "", + "data": { + "name": "Walter O'Brien" + } + } + ] // optional +); + +``` diff --git a/docs/examples/documentsdb/create-transaction.md b/docs/examples/documentsdb/create-transaction.md new file mode 100644 index 00000000..a948934b --- /dev/null +++ b/docs/examples/documentsdb/create-transaction.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 + +DocumentsDB documentsDB = new DocumentsDB(client); + +Transaction result = await documentsDB.CreateTransaction( + ttl: 60 // optional +); + +``` diff --git a/docs/examples/documentsdb/create.md b/docs/examples/documentsdb/create.md new file mode 100644 index 00000000..8c1fa6b5 --- /dev/null +++ b/docs/examples/documentsdb/create.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 + +DocumentsDB documentsDB = new DocumentsDB(client); + +Database result = await documentsDB.Create( + databaseId: "", + name: "", + enabled: false, // optional + specification: "serverless", // optional + replicas: 0, // optional + syncMode: "async" // optional +); + +``` diff --git a/docs/examples/documentsdb/decrement-document-attribute.md b/docs/examples/documentsdb/decrement-document-attribute.md new file mode 100644 index 00000000..5ab49cdd --- /dev/null +++ b/docs/examples/documentsdb/decrement-document-attribute.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 + .SetSession(""); // The user session to authenticate with + +DocumentsDB documentsDB = new DocumentsDB(client); + +Document result = await documentsDB.DecrementDocumentAttribute( + databaseId: "", + collectionId: "", + documentId: "", + attribute: "", + value: 1, // optional + min: 0, // optional + transactionId: "" // optional +); + +``` diff --git a/docs/examples/documentsdb/delete-collection.md b/docs/examples/documentsdb/delete-collection.md new file mode 100644 index 00000000..ce55d795 --- /dev/null +++ b/docs/examples/documentsdb/delete-collection.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 + +DocumentsDB documentsDB = new DocumentsDB(client); + +await documentsDB.DeleteCollection( + databaseId: "", + collectionId: "" +); + +``` diff --git a/docs/examples/documentsdb/delete-document.md b/docs/examples/documentsdb/delete-document.md new file mode 100644 index 00000000..eeca145b --- /dev/null +++ b/docs/examples/documentsdb/delete-document.md @@ -0,0 +1,20 @@ +```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 + +DocumentsDB documentsDB = new DocumentsDB(client); + +await documentsDB.DeleteDocument( + databaseId: "", + collectionId: "", + documentId: "", + transactionId: "" // optional +); + +``` diff --git a/docs/examples/documentsdb/delete-documents.md b/docs/examples/documentsdb/delete-documents.md new file mode 100644 index 00000000..c1c885aa --- /dev/null +++ b/docs/examples/documentsdb/delete-documents.md @@ -0,0 +1,20 @@ +```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 + +DocumentsDB documentsDB = new DocumentsDB(client); + +await documentsDB.DeleteDocuments( + databaseId: "", + collectionId: "", + queries: new List(), // optional + transactionId: "" // optional +); + +``` diff --git a/docs/examples/documentsdb/delete-index.md b/docs/examples/documentsdb/delete-index.md new file mode 100644 index 00000000..fed0c3cc --- /dev/null +++ b/docs/examples/documentsdb/delete-index.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 + .SetKey(""); // Your secret API key + +DocumentsDB documentsDB = new DocumentsDB(client); + +await documentsDB.DeleteIndex( + databaseId: "", + collectionId: "", + key: "" +); + +``` diff --git a/docs/examples/documentsdb/delete-transaction.md b/docs/examples/documentsdb/delete-transaction.md new file mode 100644 index 00000000..5ad20ffd --- /dev/null +++ b/docs/examples/documentsdb/delete-transaction.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 + +DocumentsDB documentsDB = new DocumentsDB(client); + +await documentsDB.DeleteTransaction( + transactionId: "" +); + +``` diff --git a/docs/examples/documentsdb/delete.md b/docs/examples/documentsdb/delete.md new file mode 100644 index 00000000..12696db2 --- /dev/null +++ b/docs/examples/documentsdb/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 + +DocumentsDB documentsDB = new DocumentsDB(client); + +await documentsDB.Delete( + databaseId: "" +); + +``` diff --git a/docs/examples/documentsdb/get-collection.md b/docs/examples/documentsdb/get-collection.md new file mode 100644 index 00000000..f50e03a1 --- /dev/null +++ b/docs/examples/documentsdb/get-collection.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 + +DocumentsDB documentsDB = new DocumentsDB(client); + +Collection result = await documentsDB.GetCollection( + databaseId: "", + collectionId: "" +); + +``` diff --git a/docs/examples/documentsdb/get-document.md b/docs/examples/documentsdb/get-document.md new file mode 100644 index 00000000..1e3bfa5c --- /dev/null +++ b/docs/examples/documentsdb/get-document.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 + .SetSession(""); // The user session to authenticate with + +DocumentsDB documentsDB = new DocumentsDB(client); + +Document result = await documentsDB.GetDocument( + databaseId: "", + collectionId: "", + documentId: "", + queries: new List(), // optional + transactionId: "" // optional +); + +``` diff --git a/docs/examples/documentsdb/get-index.md b/docs/examples/documentsdb/get-index.md new file mode 100644 index 00000000..e8c99e38 --- /dev/null +++ b/docs/examples/documentsdb/get-index.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 + .SetKey(""); // Your secret API key + +DocumentsDB documentsDB = new DocumentsDB(client); + +Index result = await documentsDB.GetIndex( + databaseId: "", + collectionId: "", + key: "" +); + +``` diff --git a/docs/examples/documentsdb/get-replicas.md b/docs/examples/documentsdb/get-replicas.md new file mode 100644 index 00000000..abe66999 --- /dev/null +++ b/docs/examples/documentsdb/get-replicas.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 + +DocumentsDB documentsDB = new DocumentsDB(client); + +DedicatedDatabaseReplicas result = await documentsDB.GetReplicas( + databaseId: "" +); + +``` diff --git a/docs/examples/documentsdb/get-status.md b/docs/examples/documentsdb/get-status.md new file mode 100644 index 00000000..418a7613 --- /dev/null +++ b/docs/examples/documentsdb/get-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 + +DocumentsDB documentsDB = new DocumentsDB(client); + +DatabaseStatus result = await documentsDB.GetStatus( + databaseId: "" +); + +``` diff --git a/docs/examples/documentsdb/get-transaction.md b/docs/examples/documentsdb/get-transaction.md new file mode 100644 index 00000000..800897c2 --- /dev/null +++ b/docs/examples/documentsdb/get-transaction.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 + +DocumentsDB documentsDB = new DocumentsDB(client); + +Transaction result = await documentsDB.GetTransaction( + transactionId: "" +); + +``` diff --git a/docs/examples/documentsdb/get.md b/docs/examples/documentsdb/get.md new file mode 100644 index 00000000..f8d06919 --- /dev/null +++ b/docs/examples/documentsdb/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 + +DocumentsDB documentsDB = new DocumentsDB(client); + +Database result = await documentsDB.Get( + databaseId: "" +); + +``` diff --git a/docs/examples/documentsdb/increment-document-attribute.md b/docs/examples/documentsdb/increment-document-attribute.md new file mode 100644 index 00000000..fc9d0795 --- /dev/null +++ b/docs/examples/documentsdb/increment-document-attribute.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 + .SetSession(""); // The user session to authenticate with + +DocumentsDB documentsDB = new DocumentsDB(client); + +Document result = await documentsDB.IncrementDocumentAttribute( + databaseId: "", + collectionId: "", + documentId: "", + attribute: "", + value: 1, // optional + max: 100, // optional + transactionId: "" // optional +); + +``` diff --git a/docs/examples/documentsdb/list-collections.md b/docs/examples/documentsdb/list-collections.md new file mode 100644 index 00000000..1227361b --- /dev/null +++ b/docs/examples/documentsdb/list-collections.md @@ -0,0 +1,20 @@ +```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 + +DocumentsDB documentsDB = new DocumentsDB(client); + +CollectionList result = await documentsDB.ListCollections( + databaseId: "", + queries: new List(), // optional + search: "", // optional + total: false // optional +); + +``` diff --git a/docs/examples/documentsdb/list-documents.md b/docs/examples/documentsdb/list-documents.md new file mode 100644 index 00000000..0838c9c1 --- /dev/null +++ b/docs/examples/documentsdb/list-documents.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 + .SetSession(""); // The user session to authenticate with + +DocumentsDB documentsDB = new DocumentsDB(client); + +DocumentList result = await documentsDB.ListDocuments( + databaseId: "", + collectionId: "", + queries: new List(), // optional + transactionId: "", // optional + total: false, // optional + ttl: 0 // optional +); + +``` diff --git a/docs/examples/documentsdb/list-indexes.md b/docs/examples/documentsdb/list-indexes.md new file mode 100644 index 00000000..aa8435ca --- /dev/null +++ b/docs/examples/documentsdb/list-indexes.md @@ -0,0 +1,20 @@ +```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 + +DocumentsDB documentsDB = new DocumentsDB(client); + +IndexList result = await documentsDB.ListIndexes( + databaseId: "", + collectionId: "", + queries: new List(), // optional + total: false // optional +); + +``` diff --git a/docs/examples/documentsdb/list-operations.md b/docs/examples/documentsdb/list-operations.md new file mode 100644 index 00000000..5e274792 --- /dev/null +++ b/docs/examples/documentsdb/list-operations.md @@ -0,0 +1,20 @@ +```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 + +DocumentsDB documentsDB = new DocumentsDB(client); + +DedicatedDatabaseOperationList result = await documentsDB.ListOperations( + databaseId: "", + status: "queued", // optional + limit: 1, // optional + offset: 0 // optional +); + +``` diff --git a/docs/examples/documentsdb/list-specifications.md b/docs/examples/documentsdb/list-specifications.md new file mode 100644 index 00000000..33e4c32a --- /dev/null +++ b/docs/examples/documentsdb/list-specifications.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 + .SetKey(""); // Your secret API key + +DocumentsDB documentsDB = new DocumentsDB(client); + +DedicatedDatabaseSpecificationList result = await documentsDB.ListSpecifications(); + + +``` diff --git a/docs/examples/documentsdb/list-transactions.md b/docs/examples/documentsdb/list-transactions.md new file mode 100644 index 00000000..84539069 --- /dev/null +++ b/docs/examples/documentsdb/list-transactions.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 + +DocumentsDB documentsDB = new DocumentsDB(client); + +TransactionList result = await documentsDB.ListTransactions( + queries: new List() // optional +); + +``` diff --git a/docs/examples/documentsdb/list.md b/docs/examples/documentsdb/list.md new file mode 100644 index 00000000..79bfce24 --- /dev/null +++ b/docs/examples/documentsdb/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 + +DocumentsDB documentsDB = new DocumentsDB(client); + +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 new file mode 100644 index 00000000..093d9db9 --- /dev/null +++ b/docs/examples/documentsdb/update-collection.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 + +DocumentsDB documentsDB = new DocumentsDB(client); + +Collection result = await documentsDB.UpdateCollection( + databaseId: "", + collectionId: "", + name: "", + permissions: new List { Permission.Read(Role.Any()) }, // optional + documentSecurity: false, // optional + enabled: false, // optional + purge: false // optional +); + +``` diff --git a/docs/examples/documentsdb/update-document.md b/docs/examples/documentsdb/update-document.md new file mode 100644 index 00000000..87172a6e --- /dev/null +++ b/docs/examples/documentsdb/update-document.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 + .SetSession(""); // The user session to authenticate with + +DocumentsDB documentsDB = new DocumentsDB(client); + +Document result = await documentsDB.UpdateDocument( + databaseId: "", + collectionId: "", + documentId: "", + data: [object], // optional + permissions: new List { Permission.Read(Role.Any()) }, // optional + transactionId: "" // optional +); + +``` diff --git a/docs/examples/documentsdb/update-documents.md b/docs/examples/documentsdb/update-documents.md new file mode 100644 index 00000000..f325b2ea --- /dev/null +++ b/docs/examples/documentsdb/update-documents.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 + +DocumentsDB documentsDB = new DocumentsDB(client); + +DocumentList result = await documentsDB.UpdateDocuments( + databaseId: "", + collectionId: "", + data: [object], // optional + queries: new List(), // optional + transactionId: "" // optional +); + +``` diff --git a/docs/examples/documentsdb/update-transaction.md b/docs/examples/documentsdb/update-transaction.md new file mode 100644 index 00000000..b4a30687 --- /dev/null +++ b/docs/examples/documentsdb/update-transaction.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 + .SetKey(""); // Your secret API key + +DocumentsDB documentsDB = new DocumentsDB(client); + +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 new file mode 100644 index 00000000..e9fd54c5 --- /dev/null +++ b/docs/examples/documentsdb/update.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 + +DocumentsDB documentsDB = new DocumentsDB(client); + +Database result = await documentsDB.Update( + databaseId: "", + name: "", + enabled: false, // optional + specification: "serverless", // optional + replicas: 0, // optional + syncMode: "async" // optional +); + +``` diff --git a/docs/examples/documentsdb/upsert-document.md b/docs/examples/documentsdb/upsert-document.md new file mode 100644 index 00000000..a5de788f --- /dev/null +++ b/docs/examples/documentsdb/upsert-document.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 + .SetSession(""); // The user session to authenticate with + +DocumentsDB documentsDB = new DocumentsDB(client); + +Document result = await documentsDB.UpsertDocument( + databaseId: "", + collectionId: "", + documentId: "", + data: [object], // optional + permissions: new List { Permission.Read(Role.Any()) }, // optional + transactionId: "" // optional +); + +``` diff --git a/docs/examples/documentsdb/upsert-documents.md b/docs/examples/documentsdb/upsert-documents.md new file mode 100644 index 00000000..66f738cf --- /dev/null +++ b/docs/examples/documentsdb/upsert-documents.md @@ -0,0 +1,20 @@ +```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 + +DocumentsDB documentsDB = new DocumentsDB(client); + +DocumentList result = await documentsDB.UpsertDocuments( + databaseId: "", + collectionId: "", + documents: new List(), + transactionId: "" // optional +); + +``` diff --git a/docs/examples/embeddings/create-text-embeddings.md b/docs/examples/embeddings/create-text-embeddings.md index 64848cd2..95b97cc0 100644 --- a/docs/examples/embeddings/create-text-embeddings.md +++ b/docs/examples/embeddings/create-text-embeddings.md @@ -14,4 +14,6 @@ Embeddings embeddings = new Embeddings(client); EmbeddingList result = await embeddings.CreateTextEmbeddings( texts: new List(), model: EmbeddingModel.NomicEmbedText // optional -);``` +); + +``` diff --git a/docs/examples/functions/create-deployment.md b/docs/examples/functions/create-deployment.md index ec99b73c..a445e35f 100644 --- a/docs/examples/functions/create-deployment.md +++ b/docs/examples/functions/create-deployment.md @@ -16,4 +16,6 @@ Deployment result = await functions.CreateDeployment( activate: false, entrypoint: "", // optional commands: "" // optional -);``` +); + +``` diff --git a/docs/examples/functions/create-duplicate-deployment.md b/docs/examples/functions/create-duplicate-deployment.md index e906e373..20ba6fab 100644 --- a/docs/examples/functions/create-duplicate-deployment.md +++ b/docs/examples/functions/create-duplicate-deployment.md @@ -14,4 +14,6 @@ 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 11a6b73a..38e0b69b 100644 --- a/docs/examples/functions/create-execution.md +++ b/docs/examples/functions/create-execution.md @@ -19,4 +19,6 @@ Execution result = await functions.CreateExecution( method: ExecutionMethod.GET, // optional headers: [object], // optional scheduledAt: "" // optional -);``` +); + +``` diff --git a/docs/examples/functions/create-template-deployment.md b/docs/examples/functions/create-template-deployment.md index 18cb1c7b..47edfa96 100644 --- a/docs/examples/functions/create-template-deployment.md +++ b/docs/examples/functions/create-template-deployment.md @@ -19,4 +19,6 @@ Deployment result = await functions.CreateTemplateDeployment( type: TemplateReferenceType.Commit, reference: "", activate: false // optional -);``` +); + +``` diff --git a/docs/examples/functions/create-variable.md b/docs/examples/functions/create-variable.md index dfb84f44..7e3d32f6 100644 --- a/docs/examples/functions/create-variable.md +++ b/docs/examples/functions/create-variable.md @@ -16,4 +16,6 @@ Variable result = await functions.CreateVariable( key: "", value: "", secret: false // optional -);``` +); + +``` diff --git a/docs/examples/functions/create-vcs-deployment.md b/docs/examples/functions/create-vcs-deployment.md index 02761724..bfc06888 100644 --- a/docs/examples/functions/create-vcs-deployment.md +++ b/docs/examples/functions/create-vcs-deployment.md @@ -16,4 +16,6 @@ Deployment result = await functions.CreateVcsDeployment( type: VCSReferenceType.Branch, reference: "", activate: false // optional -);``` +); + +``` diff --git a/docs/examples/functions/create.md b/docs/examples/functions/create.md index 5df83e1d..741a659a 100644 --- a/docs/examples/functions/create.md +++ b/docs/examples/functions/create.md @@ -17,7 +17,7 @@ Function result = await functions.Create( runtime: Runtime.Node145, execute: ["any"], // optional events: new List(), // optional - schedule: "", // optional + schedule: "0 0 * * *", // optional timeout: 1, // optional enabled: false, // optional logging: false, // optional @@ -31,7 +31,9 @@ Function result = await functions.Create( providerRootDirectory: "", // optional providerBranches: new List(), // optional providerPaths: new List(), // optional - buildSpecification: "", // optional - runtimeSpecification: "", // optional + buildSpecification: "s-1vcpu-512mb", // optional + runtimeSpecification: "s-1vcpu-512mb", // optional deploymentRetention: 0 // optional -);``` +); + +``` diff --git a/docs/examples/functions/delete-deployment.md b/docs/examples/functions/delete-deployment.md index 89ed174d..673fc1c8 100644 --- a/docs/examples/functions/delete-deployment.md +++ b/docs/examples/functions/delete-deployment.md @@ -13,4 +13,6 @@ Functions functions = new Functions(client); await functions.DeleteDeployment( functionId: "", deploymentId: "" -);``` +); + +``` diff --git a/docs/examples/functions/delete-execution.md b/docs/examples/functions/delete-execution.md index 0d5958be..28882815 100644 --- a/docs/examples/functions/delete-execution.md +++ b/docs/examples/functions/delete-execution.md @@ -13,4 +13,6 @@ Functions functions = new Functions(client); await functions.DeleteExecution( functionId: "", executionId: "" -);``` +); + +``` diff --git a/docs/examples/functions/delete-variable.md b/docs/examples/functions/delete-variable.md index 2c69a588..7dcb9a9a 100644 --- a/docs/examples/functions/delete-variable.md +++ b/docs/examples/functions/delete-variable.md @@ -13,4 +13,6 @@ Functions functions = new Functions(client); await functions.DeleteVariable( functionId: "", variableId: "" -);``` +); + +``` diff --git a/docs/examples/functions/delete.md b/docs/examples/functions/delete.md index 104a7485..c814f321 100644 --- a/docs/examples/functions/delete.md +++ b/docs/examples/functions/delete.md @@ -12,4 +12,6 @@ Functions functions = new Functions(client); await functions.Delete( functionId: "" -);``` +); + +``` diff --git a/docs/examples/functions/get-deployment-download.md b/docs/examples/functions/get-deployment-download.md index 64cff1ac..0756473a 100644 --- a/docs/examples/functions/get-deployment-download.md +++ b/docs/examples/functions/get-deployment-download.md @@ -16,4 +16,6 @@ byte[] result = await functions.GetDeploymentDownload( deploymentId: "", type: DeploymentDownloadType.Source, // optional token: "" // optional -);``` +); + +``` diff --git a/docs/examples/functions/get-deployment.md b/docs/examples/functions/get-deployment.md index 4bca044d..fb0905f5 100644 --- a/docs/examples/functions/get-deployment.md +++ b/docs/examples/functions/get-deployment.md @@ -13,4 +13,6 @@ Functions functions = new Functions(client); Deployment result = await functions.GetDeployment( functionId: "", deploymentId: "" -);``` +); + +``` diff --git a/docs/examples/functions/get-execution.md b/docs/examples/functions/get-execution.md index a4705dc9..6f2871b4 100644 --- a/docs/examples/functions/get-execution.md +++ b/docs/examples/functions/get-execution.md @@ -13,4 +13,6 @@ Functions functions = new Functions(client); Execution result = await functions.GetExecution( functionId: "", executionId: "" -);``` +); + +``` diff --git a/docs/examples/functions/get-variable.md b/docs/examples/functions/get-variable.md index fb4bd217..7b383b0b 100644 --- a/docs/examples/functions/get-variable.md +++ b/docs/examples/functions/get-variable.md @@ -13,4 +13,6 @@ Functions functions = new Functions(client); Variable result = await functions.GetVariable( functionId: "", variableId: "" -);``` +); + +``` diff --git a/docs/examples/functions/get.md b/docs/examples/functions/get.md index 1c8ab331..86ffaa29 100644 --- a/docs/examples/functions/get.md +++ b/docs/examples/functions/get.md @@ -12,4 +12,6 @@ Functions functions = new Functions(client); Function result = await functions.Get( functionId: "" -);``` +); + +``` diff --git a/docs/examples/functions/list-deployments.md b/docs/examples/functions/list-deployments.md index ae2a3f7b..8e368f9f 100644 --- a/docs/examples/functions/list-deployments.md +++ b/docs/examples/functions/list-deployments.md @@ -15,4 +15,6 @@ DeploymentList result = await functions.ListDeployments( queries: new List(), // optional search: "", // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/functions/list-executions.md b/docs/examples/functions/list-executions.md index e3e838e1..85cc2ab4 100644 --- a/docs/examples/functions/list-executions.md +++ b/docs/examples/functions/list-executions.md @@ -14,4 +14,6 @@ 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 c0a58ab6..b0b68625 100644 --- a/docs/examples/functions/list-runtimes.md +++ b/docs/examples/functions/list-runtimes.md @@ -11,4 +11,6 @@ Client client = new Client() Functions functions = new Functions(client); RuntimeList result = await functions.ListRuntimes(); + + ``` diff --git a/docs/examples/functions/list-specifications.md b/docs/examples/functions/list-specifications.md index cacd502b..b97f4cf4 100644 --- a/docs/examples/functions/list-specifications.md +++ b/docs/examples/functions/list-specifications.md @@ -12,4 +12,6 @@ Functions functions = new Functions(client); SpecificationList result = await functions.ListSpecifications( type: "runtimes" // optional -);``` +); + +``` diff --git a/docs/examples/functions/list-variables.md b/docs/examples/functions/list-variables.md index 4e540e7b..df8029e3 100644 --- a/docs/examples/functions/list-variables.md +++ b/docs/examples/functions/list-variables.md @@ -14,4 +14,6 @@ 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 f8da87f8..b09d8ee6 100644 --- a/docs/examples/functions/list.md +++ b/docs/examples/functions/list.md @@ -14,4 +14,6 @@ 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 819221cb..ee782aed 100644 --- a/docs/examples/functions/update-deployment-status.md +++ b/docs/examples/functions/update-deployment-status.md @@ -13,4 +13,6 @@ Functions functions = new Functions(client); 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 1045b455..563d5a21 100644 --- a/docs/examples/functions/update-function-deployment.md +++ b/docs/examples/functions/update-function-deployment.md @@ -13,4 +13,6 @@ Functions functions = new Functions(client); Function result = await functions.UpdateFunctionDeployment( functionId: "", deploymentId: "" -);``` +); + +``` diff --git a/docs/examples/functions/update-variable.md b/docs/examples/functions/update-variable.md index af7eb84a..a1fd20ee 100644 --- a/docs/examples/functions/update-variable.md +++ b/docs/examples/functions/update-variable.md @@ -16,4 +16,6 @@ Variable result = await functions.UpdateVariable( key: "", // optional value: "", // optional secret: false // optional -);``` +); + +``` diff --git a/docs/examples/functions/update.md b/docs/examples/functions/update.md index 3d5aaeae..10d4a96b 100644 --- a/docs/examples/functions/update.md +++ b/docs/examples/functions/update.md @@ -17,7 +17,7 @@ Function result = await functions.Update( runtime: Runtime.Node145, // optional execute: ["any"], // optional events: new List(), // optional - schedule: "", // optional + schedule: "0 0 * * *", // optional timeout: 1, // optional enabled: false, // optional logging: false, // optional @@ -31,7 +31,9 @@ Function result = await functions.Update( providerRootDirectory: "", // optional providerBranches: new List(), // optional providerPaths: new List(), // optional - buildSpecification: "", // optional - runtimeSpecification: "", // optional + buildSpecification: "s-1vcpu-512mb", // optional + runtimeSpecification: "s-1vcpu-512mb", // optional deploymentRetention: 0 // optional -);``` +); + +``` diff --git a/docs/examples/graphql/mutation.md b/docs/examples/graphql/mutation.md index 4280455f..0145c03c 100644 --- a/docs/examples/graphql/mutation.md +++ b/docs/examples/graphql/mutation.md @@ -12,4 +12,6 @@ Graphql graphql = new Graphql(client); Any result = await graphql.Mutation( query: [object] -);``` +); + +``` diff --git a/docs/examples/graphql/query.md b/docs/examples/graphql/query.md index 6d1c447e..88c82162 100644 --- a/docs/examples/graphql/query.md +++ b/docs/examples/graphql/query.md @@ -12,4 +12,6 @@ Graphql graphql = new Graphql(client); Any result = await graphql.Query( query: [object] -);``` +); + +``` diff --git a/docs/examples/locale/get.md b/docs/examples/locale/get.md index c8bd51ea..a1dcbcc9 100644 --- a/docs/examples/locale/get.md +++ b/docs/examples/locale/get.md @@ -11,4 +11,6 @@ Client client = new Client() Locale locale = new Locale(client); Locale result = await locale.Get(); + + ``` diff --git a/docs/examples/locale/list-codes.md b/docs/examples/locale/list-codes.md index ec8da7d6..a3bfeff5 100644 --- a/docs/examples/locale/list-codes.md +++ b/docs/examples/locale/list-codes.md @@ -11,4 +11,6 @@ Client client = new Client() Locale locale = new Locale(client); LocaleCodeList result = await locale.ListCodes(); + + ``` diff --git a/docs/examples/locale/list-continents.md b/docs/examples/locale/list-continents.md index b53a4a1f..02b86116 100644 --- a/docs/examples/locale/list-continents.md +++ b/docs/examples/locale/list-continents.md @@ -11,4 +11,6 @@ Client client = new Client() Locale locale = new Locale(client); ContinentList result = await locale.ListContinents(); + + ``` diff --git a/docs/examples/locale/list-countries-eu.md b/docs/examples/locale/list-countries-eu.md index aa85c781..9452cd0e 100644 --- a/docs/examples/locale/list-countries-eu.md +++ b/docs/examples/locale/list-countries-eu.md @@ -11,4 +11,6 @@ Client client = new Client() Locale locale = new Locale(client); CountryList result = await locale.ListCountriesEU(); + + ``` diff --git a/docs/examples/locale/list-countries-phones.md b/docs/examples/locale/list-countries-phones.md index 6a600fc5..e3b5346e 100644 --- a/docs/examples/locale/list-countries-phones.md +++ b/docs/examples/locale/list-countries-phones.md @@ -11,4 +11,6 @@ Client client = new Client() Locale locale = new Locale(client); PhoneList result = await locale.ListCountriesPhones(); + + ``` diff --git a/docs/examples/locale/list-countries.md b/docs/examples/locale/list-countries.md index ce3e0f53..c9c1fb94 100644 --- a/docs/examples/locale/list-countries.md +++ b/docs/examples/locale/list-countries.md @@ -11,4 +11,6 @@ Client client = new Client() Locale locale = new Locale(client); CountryList result = await locale.ListCountries(); + + ``` diff --git a/docs/examples/locale/list-currencies.md b/docs/examples/locale/list-currencies.md index 526d6180..18d04a69 100644 --- a/docs/examples/locale/list-currencies.md +++ b/docs/examples/locale/list-currencies.md @@ -11,4 +11,6 @@ Client client = new Client() Locale locale = new Locale(client); CurrencyList result = await locale.ListCurrencies(); + + ``` diff --git a/docs/examples/locale/list-languages.md b/docs/examples/locale/list-languages.md index bd9cd058..83ed0241 100644 --- a/docs/examples/locale/list-languages.md +++ b/docs/examples/locale/list-languages.md @@ -11,4 +11,6 @@ Client client = new Client() Locale locale = new Locale(client); LanguageList result = await locale.ListLanguages(); + + ``` diff --git a/docs/examples/messaging/create-apns-provider.md b/docs/examples/messaging/create-apns-provider.md index 8f1e99d0..55be57aa 100644 --- a/docs/examples/messaging/create-apns-provider.md +++ b/docs/examples/messaging/create-apns-provider.md @@ -19,4 +19,6 @@ Provider result = await messaging.CreateAPNSProvider( bundleId: "", // optional sandbox: false, // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/messaging/create-email.md b/docs/examples/messaging/create-email.md index a748744c..03c71b14 100644 --- a/docs/examples/messaging/create-email.md +++ b/docs/examples/messaging/create-email.md @@ -23,4 +23,6 @@ Message result = await messaging.CreateEmail( 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 e07bfe9a..4ef0b591 100644 --- a/docs/examples/messaging/create-fcm-provider.md +++ b/docs/examples/messaging/create-fcm-provider.md @@ -15,4 +15,6 @@ Provider result = await messaging.CreateFCMProvider( name: "", serviceAccountJSON: [object], // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/messaging/create-mailgun-provider.md b/docs/examples/messaging/create-mailgun-provider.md index 352bd504..ba278efe 100644 --- a/docs/examples/messaging/create-mailgun-provider.md +++ b/docs/examples/messaging/create-mailgun-provider.md @@ -14,11 +14,13 @@ Provider result = await messaging.CreateMailgunProvider( providerId: "", name: "", apiKey: "", // optional - domain: "", // optional + domain: "example.com", // optional isEuRegion: false, // optional fromName: "", // optional fromEmail: "email@example.com", // optional replyToName: "", // optional replyToEmail: "email@example.com", // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/messaging/create-msg-91-provider.md b/docs/examples/messaging/create-msg-91-provider.md index 6abd30bc..e7638b6e 100644 --- a/docs/examples/messaging/create-msg-91-provider.md +++ b/docs/examples/messaging/create-msg-91-provider.md @@ -17,4 +17,6 @@ Provider result = await messaging.CreateMsg91Provider( senderId: "", // optional authKey: "", // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/messaging/create-push.md b/docs/examples/messaging/create-push.md index a7c31e20..3ee6e423 100644 --- a/docs/examples/messaging/create-push.md +++ b/docs/examples/messaging/create-push.md @@ -25,10 +25,12 @@ Message result = await messaging.CreatePush( sound: "", // optional color: "", // optional tag: "", // optional - badge: 0, // optional + badge: 1, // optional draft: false, // optional scheduledAt: "2020-10-15T06:38:00.000+00:00", // optional contentAvailable: false, // optional critical: false, // optional priority: MessagePriority.Normal // optional -);``` +); + +``` diff --git a/docs/examples/messaging/create-resend-provider.md b/docs/examples/messaging/create-resend-provider.md index ea6ff5ec..e2400c9f 100644 --- a/docs/examples/messaging/create-resend-provider.md +++ b/docs/examples/messaging/create-resend-provider.md @@ -19,4 +19,6 @@ Provider result = await messaging.CreateResendProvider( replyToName: "", // optional replyToEmail: "email@example.com", // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/messaging/create-sendgrid-provider.md b/docs/examples/messaging/create-sendgrid-provider.md index 9df34e0a..f18e9a05 100644 --- a/docs/examples/messaging/create-sendgrid-provider.md +++ b/docs/examples/messaging/create-sendgrid-provider.md @@ -19,4 +19,6 @@ Provider result = await messaging.CreateSendgridProvider( replyToName: "", // optional replyToEmail: "email@example.com", // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/messaging/create-ses-provider.md b/docs/examples/messaging/create-ses-provider.md index 5750c3a6..ef569769 100644 --- a/docs/examples/messaging/create-ses-provider.md +++ b/docs/examples/messaging/create-ses-provider.md @@ -21,4 +21,6 @@ Provider result = await messaging.CreateSesProvider( replyToName: "", // optional replyToEmail: "email@example.com", // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/messaging/create-sms.md b/docs/examples/messaging/create-sms.md index f6677ab8..2756f28c 100644 --- a/docs/examples/messaging/create-sms.md +++ b/docs/examples/messaging/create-sms.md @@ -18,4 +18,6 @@ Message result = await messaging.CreateSMS( targets: new List(), // optional draft: false, // optional scheduledAt: "2020-10-15T06:38:00.000+00:00" // optional -);``` +); + +``` diff --git a/docs/examples/messaging/create-smtp-provider.md b/docs/examples/messaging/create-smtp-provider.md index 4ec4314f..bbe34356 100644 --- a/docs/examples/messaging/create-smtp-provider.md +++ b/docs/examples/messaging/create-smtp-provider.md @@ -15,7 +15,7 @@ Provider result = await messaging.CreateSMTPProvider( providerId: "", name: "", host: "", - port: 1, // optional + port: 587, // optional username: "", // optional password: "password", // optional encryption: SmtpEncryption.None, // optional @@ -26,4 +26,6 @@ Provider result = await messaging.CreateSMTPProvider( replyToName: "", // optional replyToEmail: "email@example.com", // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/messaging/create-subscriber.md b/docs/examples/messaging/create-subscriber.md index cfb3d159..619abf20 100644 --- a/docs/examples/messaging/create-subscriber.md +++ b/docs/examples/messaging/create-subscriber.md @@ -14,4 +14,6 @@ Subscriber result = await messaging.CreateSubscriber( topicId: "", subscriberId: "", targetId: "" -);``` +); + +``` diff --git a/docs/examples/messaging/create-telesign-provider.md b/docs/examples/messaging/create-telesign-provider.md index 14770eb5..68c37c33 100644 --- a/docs/examples/messaging/create-telesign-provider.md +++ b/docs/examples/messaging/create-telesign-provider.md @@ -17,4 +17,6 @@ Provider result = await messaging.CreateTelesignProvider( customerId: "", // optional apiKey: "", // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/messaging/create-textmagic-provider.md b/docs/examples/messaging/create-textmagic-provider.md index 2fbea11a..d549516c 100644 --- a/docs/examples/messaging/create-textmagic-provider.md +++ b/docs/examples/messaging/create-textmagic-provider.md @@ -17,4 +17,6 @@ Provider result = await messaging.CreateTextmagicProvider( username: "", // optional apiKey: "", // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/messaging/create-topic.md b/docs/examples/messaging/create-topic.md index d9b8370b..9b4338dc 100644 --- a/docs/examples/messaging/create-topic.md +++ b/docs/examples/messaging/create-topic.md @@ -14,4 +14,6 @@ Topic result = await messaging.CreateTopic( topicId: "", name: "", subscribe: ["any"] // optional -);``` +); + +``` diff --git a/docs/examples/messaging/create-twilio-provider.md b/docs/examples/messaging/create-twilio-provider.md index 4eba8078..a8a5d8c9 100644 --- a/docs/examples/messaging/create-twilio-provider.md +++ b/docs/examples/messaging/create-twilio-provider.md @@ -17,4 +17,6 @@ Provider result = await messaging.CreateTwilioProvider( accountSid: "", // optional authToken: "", // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/messaging/create-vonage-provider.md b/docs/examples/messaging/create-vonage-provider.md index 1407190e..8fc8335b 100644 --- a/docs/examples/messaging/create-vonage-provider.md +++ b/docs/examples/messaging/create-vonage-provider.md @@ -17,4 +17,6 @@ Provider result = await messaging.CreateVonageProvider( apiKey: "", // optional apiSecret: "", // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/messaging/delete-provider.md b/docs/examples/messaging/delete-provider.md index 06dbf22f..fb8bca39 100644 --- a/docs/examples/messaging/delete-provider.md +++ b/docs/examples/messaging/delete-provider.md @@ -12,4 +12,6 @@ Messaging messaging = new Messaging(client); await messaging.DeleteProvider( providerId: "" -);``` +); + +``` diff --git a/docs/examples/messaging/delete-subscriber.md b/docs/examples/messaging/delete-subscriber.md index ee4b8dc4..81f1d1ce 100644 --- a/docs/examples/messaging/delete-subscriber.md +++ b/docs/examples/messaging/delete-subscriber.md @@ -13,4 +13,6 @@ Messaging messaging = new Messaging(client); await messaging.DeleteSubscriber( topicId: "", subscriberId: "" -);``` +); + +``` diff --git a/docs/examples/messaging/delete-topic.md b/docs/examples/messaging/delete-topic.md index a27b4036..579cce5b 100644 --- a/docs/examples/messaging/delete-topic.md +++ b/docs/examples/messaging/delete-topic.md @@ -12,4 +12,6 @@ Messaging messaging = new Messaging(client); await messaging.DeleteTopic( topicId: "" -);``` +); + +``` diff --git a/docs/examples/messaging/delete.md b/docs/examples/messaging/delete.md index 8e2777a1..a04d0334 100644 --- a/docs/examples/messaging/delete.md +++ b/docs/examples/messaging/delete.md @@ -12,4 +12,6 @@ Messaging messaging = new Messaging(client); await messaging.Delete( messageId: "" -);``` +); + +``` diff --git a/docs/examples/messaging/get-message.md b/docs/examples/messaging/get-message.md index 6e7d6a82..53597127 100644 --- a/docs/examples/messaging/get-message.md +++ b/docs/examples/messaging/get-message.md @@ -12,4 +12,6 @@ Messaging messaging = new Messaging(client); Message result = await messaging.GetMessage( messageId: "" -);``` +); + +``` diff --git a/docs/examples/messaging/get-provider.md b/docs/examples/messaging/get-provider.md index e30778d7..fb9c334e 100644 --- a/docs/examples/messaging/get-provider.md +++ b/docs/examples/messaging/get-provider.md @@ -12,4 +12,6 @@ Messaging messaging = new Messaging(client); Provider result = await messaging.GetProvider( providerId: "" -);``` +); + +``` diff --git a/docs/examples/messaging/get-subscriber.md b/docs/examples/messaging/get-subscriber.md index 91f76b88..79e6bb07 100644 --- a/docs/examples/messaging/get-subscriber.md +++ b/docs/examples/messaging/get-subscriber.md @@ -13,4 +13,6 @@ Messaging messaging = new Messaging(client); Subscriber result = await messaging.GetSubscriber( topicId: "", subscriberId: "" -);``` +); + +``` diff --git a/docs/examples/messaging/get-topic.md b/docs/examples/messaging/get-topic.md index 8236a966..6fc890d0 100644 --- a/docs/examples/messaging/get-topic.md +++ b/docs/examples/messaging/get-topic.md @@ -12,4 +12,6 @@ Messaging messaging = new Messaging(client); Topic result = await messaging.GetTopic( topicId: "" -);``` +); + +``` diff --git a/docs/examples/messaging/list-messages.md b/docs/examples/messaging/list-messages.md index dfdf9056..6bc43ea9 100644 --- a/docs/examples/messaging/list-messages.md +++ b/docs/examples/messaging/list-messages.md @@ -14,4 +14,6 @@ MessageList result = await messaging.ListMessages( queries: new List(), // optional search: "", // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/messaging/list-providers.md b/docs/examples/messaging/list-providers.md index 3823f052..5d286744 100644 --- a/docs/examples/messaging/list-providers.md +++ b/docs/examples/messaging/list-providers.md @@ -14,4 +14,6 @@ ProviderList result = await messaging.ListProviders( queries: new List(), // optional search: "", // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/messaging/list-subscribers.md b/docs/examples/messaging/list-subscribers.md index 22a267e7..15773d00 100644 --- a/docs/examples/messaging/list-subscribers.md +++ b/docs/examples/messaging/list-subscribers.md @@ -15,4 +15,6 @@ SubscriberList result = await messaging.ListSubscribers( queries: new List(), // optional search: "", // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/messaging/list-targets.md b/docs/examples/messaging/list-targets.md index d6e99c9a..e5b2cd94 100644 --- a/docs/examples/messaging/list-targets.md +++ b/docs/examples/messaging/list-targets.md @@ -14,4 +14,6 @@ TargetList result = await messaging.ListTargets( messageId: "", queries: new List(), // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/messaging/list-topics.md b/docs/examples/messaging/list-topics.md index 1002a4d9..4fa6f4df 100644 --- a/docs/examples/messaging/list-topics.md +++ b/docs/examples/messaging/list-topics.md @@ -14,4 +14,6 @@ TopicList result = await messaging.ListTopics( queries: new List(), // optional search: "", // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/messaging/update-apns-provider.md b/docs/examples/messaging/update-apns-provider.md index 51550098..d8a04a49 100644 --- a/docs/examples/messaging/update-apns-provider.md +++ b/docs/examples/messaging/update-apns-provider.md @@ -19,4 +19,6 @@ Provider result = await messaging.UpdateAPNSProvider( teamId: "", // optional bundleId: "", // optional sandbox: false // optional -);``` +); + +``` diff --git a/docs/examples/messaging/update-email.md b/docs/examples/messaging/update-email.md index b795cda1..5e87deeb 100644 --- a/docs/examples/messaging/update-email.md +++ b/docs/examples/messaging/update-email.md @@ -23,4 +23,6 @@ Message result = await messaging.UpdateEmail( bcc: new List(), // optional scheduledAt: "2020-10-15T06:38:00.000+00:00", // optional attachments: new List() // optional -);``` +); + +``` diff --git a/docs/examples/messaging/update-fcm-provider.md b/docs/examples/messaging/update-fcm-provider.md index 43478a5a..c7381ed2 100644 --- a/docs/examples/messaging/update-fcm-provider.md +++ b/docs/examples/messaging/update-fcm-provider.md @@ -15,4 +15,6 @@ Provider result = await messaging.UpdateFCMProvider( name: "", // optional enabled: false, // optional serviceAccountJSON: [object] // optional -);``` +); + +``` diff --git a/docs/examples/messaging/update-mailgun-provider.md b/docs/examples/messaging/update-mailgun-provider.md index 2cf3a83e..95b8466d 100644 --- a/docs/examples/messaging/update-mailgun-provider.md +++ b/docs/examples/messaging/update-mailgun-provider.md @@ -14,11 +14,13 @@ Provider result = await messaging.UpdateMailgunProvider( providerId: "", name: "", // optional apiKey: "", // optional - domain: "", // optional + domain: "example.com", // optional isEuRegion: false, // optional enabled: false, // optional fromName: "", // optional fromEmail: "email@example.com", // optional replyToName: "", // optional replyToEmail: "" // optional -);``` +); + +``` diff --git a/docs/examples/messaging/update-msg-91-provider.md b/docs/examples/messaging/update-msg-91-provider.md index 7a651250..3652c6a0 100644 --- a/docs/examples/messaging/update-msg-91-provider.md +++ b/docs/examples/messaging/update-msg-91-provider.md @@ -17,4 +17,6 @@ Provider result = await messaging.UpdateMsg91Provider( templateId: "", // optional senderId: "", // optional authKey: "" // optional -);``` +); + +``` diff --git a/docs/examples/messaging/update-push.md b/docs/examples/messaging/update-push.md index 95de201c..6a151cca 100644 --- a/docs/examples/messaging/update-push.md +++ b/docs/examples/messaging/update-push.md @@ -25,10 +25,12 @@ Message result = await messaging.UpdatePush( sound: "", // optional color: "", // optional tag: "", // optional - badge: 0, // optional + badge: 1, // optional draft: false, // optional scheduledAt: "2020-10-15T06:38:00.000+00:00", // optional contentAvailable: false, // optional critical: false, // optional priority: MessagePriority.Normal // optional -);``` +); + +``` diff --git a/docs/examples/messaging/update-resend-provider.md b/docs/examples/messaging/update-resend-provider.md index d6d42c85..9bef411a 100644 --- a/docs/examples/messaging/update-resend-provider.md +++ b/docs/examples/messaging/update-resend-provider.md @@ -19,4 +19,6 @@ Provider result = await messaging.UpdateResendProvider( fromEmail: "email@example.com", // optional replyToName: "", // optional replyToEmail: "" // optional -);``` +); + +``` diff --git a/docs/examples/messaging/update-sendgrid-provider.md b/docs/examples/messaging/update-sendgrid-provider.md index 03d1972d..b98feaa1 100644 --- a/docs/examples/messaging/update-sendgrid-provider.md +++ b/docs/examples/messaging/update-sendgrid-provider.md @@ -19,4 +19,6 @@ Provider result = await messaging.UpdateSendgridProvider( fromEmail: "email@example.com", // optional replyToName: "", // optional replyToEmail: "" // optional -);``` +); + +``` diff --git a/docs/examples/messaging/update-ses-provider.md b/docs/examples/messaging/update-ses-provider.md index 32a67f01..982cd549 100644 --- a/docs/examples/messaging/update-ses-provider.md +++ b/docs/examples/messaging/update-ses-provider.md @@ -21,4 +21,6 @@ Provider result = await messaging.UpdateSesProvider( fromEmail: "email@example.com", // optional replyToName: "", // optional replyToEmail: "" // optional -);``` +); + +``` diff --git a/docs/examples/messaging/update-sms.md b/docs/examples/messaging/update-sms.md index db9795dd..3d38d9fb 100644 --- a/docs/examples/messaging/update-sms.md +++ b/docs/examples/messaging/update-sms.md @@ -18,4 +18,6 @@ Message result = await messaging.UpdateSMS( 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 9789829c..2d9da6ca 100644 --- a/docs/examples/messaging/update-smtp-provider.md +++ b/docs/examples/messaging/update-smtp-provider.md @@ -26,4 +26,6 @@ Provider result = await messaging.UpdateSMTPProvider( replyToName: "", // optional replyToEmail: "", // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/messaging/update-telesign-provider.md b/docs/examples/messaging/update-telesign-provider.md index e9ebd80e..5a7048b1 100644 --- a/docs/examples/messaging/update-telesign-provider.md +++ b/docs/examples/messaging/update-telesign-provider.md @@ -17,4 +17,6 @@ Provider result = await messaging.UpdateTelesignProvider( customerId: "", // optional apiKey: "", // optional from: "" // optional -);``` +); + +``` diff --git a/docs/examples/messaging/update-textmagic-provider.md b/docs/examples/messaging/update-textmagic-provider.md index b5b7b8af..4f0a7a0d 100644 --- a/docs/examples/messaging/update-textmagic-provider.md +++ b/docs/examples/messaging/update-textmagic-provider.md @@ -17,4 +17,6 @@ Provider result = await messaging.UpdateTextmagicProvider( username: "", // optional apiKey: "", // optional from: "" // optional -);``` +); + +``` diff --git a/docs/examples/messaging/update-topic.md b/docs/examples/messaging/update-topic.md index 361a2396..aa45f99b 100644 --- a/docs/examples/messaging/update-topic.md +++ b/docs/examples/messaging/update-topic.md @@ -14,4 +14,6 @@ Topic result = await messaging.UpdateTopic( topicId: "", name: "", // optional subscribe: ["any"] // optional -);``` +); + +``` diff --git a/docs/examples/messaging/update-twilio-provider.md b/docs/examples/messaging/update-twilio-provider.md index 594bdee8..a1d51e9e 100644 --- a/docs/examples/messaging/update-twilio-provider.md +++ b/docs/examples/messaging/update-twilio-provider.md @@ -17,4 +17,6 @@ Provider result = await messaging.UpdateTwilioProvider( accountSid: "", // optional authToken: "", // optional from: "" // optional -);``` +); + +``` diff --git a/docs/examples/messaging/update-vonage-provider.md b/docs/examples/messaging/update-vonage-provider.md index 61e8c848..d26a17dd 100644 --- a/docs/examples/messaging/update-vonage-provider.md +++ b/docs/examples/messaging/update-vonage-provider.md @@ -17,4 +17,6 @@ Provider result = await messaging.UpdateVonageProvider( apiKey: "", // optional apiSecret: "", // optional from: "" // optional -);``` +); + +``` diff --git a/docs/examples/mongo/create-backup-policy.md b/docs/examples/mongo/create-backup-policy.md new file mode 100644 index 00000000..41e2ed4b --- /dev/null +++ b/docs/examples/mongo/create-backup-policy.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 + +Mongo mongo = new Mongo(client); + +BackupPolicy result = await mongo.CreateBackupPolicy( + databaseId: "", + policyId: "", + name: "", + schedule: "", + retention: 1, + type: "full", // optional + enabled: false // optional +); + +``` diff --git a/docs/examples/mongo/create-backup.md b/docs/examples/mongo/create-backup.md new file mode 100644 index 00000000..e25efa99 --- /dev/null +++ b/docs/examples/mongo/create-backup.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 + +Mongo mongo = new Mongo(client); + +DedicatedDatabaseBackup result = await mongo.CreateBackup( + databaseId: "", + type: "full" // optional +); + +``` diff --git a/docs/examples/mongo/create-branch.md b/docs/examples/mongo/create-branch.md new file mode 100644 index 00000000..8c01df43 --- /dev/null +++ b/docs/examples/mongo/create-branch.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 + .SetKey(""); // Your secret API key + +Mongo mongo = new Mongo(client); + +DedicatedDatabase result = await mongo.CreateBranch( + databaseId: "", + branchId: "", // optional + ttl: 300 // optional +); + +``` diff --git a/docs/examples/mongo/create-failover.md b/docs/examples/mongo/create-failover.md new file mode 100644 index 00000000..d4a6686e --- /dev/null +++ b/docs/examples/mongo/create-failover.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 + +Mongo mongo = new Mongo(client); + +DedicatedDatabase result = await mongo.CreateFailover( + databaseId: "", + targetReplicaId: "" // optional +); + +``` diff --git a/docs/examples/mongo/create-migration.md b/docs/examples/mongo/create-migration.md new file mode 100644 index 00000000..b7fbcc7a --- /dev/null +++ b/docs/examples/mongo/create-migration.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 + .SetKey(""); // Your secret API key + +Mongo mongo = new Mongo(client); + +DedicatedDatabase result = await mongo.CreateMigration( + databaseId: "", + targetType: "shared", + specification: "" // optional +); + +``` diff --git a/docs/examples/mongo/create-restoration.md b/docs/examples/mongo/create-restoration.md new file mode 100644 index 00000000..8e9358eb --- /dev/null +++ b/docs/examples/mongo/create-restoration.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 + +Mongo mongo = new Mongo(client); + +DedicatedDatabaseRestoration result = await mongo.CreateRestoration( + databaseId: "", + type: "backup", // optional + backupId: "", // optional + targetDatabaseId: "", // optional + targetTime: "2020-10-15T06:38:00.000+00:00" // optional +); + +``` diff --git a/docs/examples/mongo/create-upgrade.md b/docs/examples/mongo/create-upgrade.md new file mode 100644 index 00000000..c18e2d62 --- /dev/null +++ b/docs/examples/mongo/create-upgrade.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 + +Mongo mongo = new Mongo(client); + +DedicatedDatabase result = await mongo.CreateUpgrade( + databaseId: "", + targetVersion: "" +); + +``` diff --git a/docs/examples/mongo/create.md b/docs/examples/mongo/create.md new file mode 100644 index 00000000..c6ef970c --- /dev/null +++ b/docs/examples/mongo/create.md @@ -0,0 +1,30 @@ +```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 + +Mongo mongo = new Mongo(client); + +DedicatedDatabase result = await mongo.Create( + databaseId: "", + name: "", + version: "17", // optional + specification: "", // optional + replicas: 0, // optional + syncMode: "async", // optional + networkIdleTimeoutSeconds: 60, // optional + networkIPAllowlist: new List(), // optional + idleTimeoutMinutes: 5, // optional + pitr: false, // optional + pitrRetentionDays: 1, // optional + storageAutoscaling: false, // optional + storageAutoscalingThresholdPercent: 50, // optional + storageAutoscalingMaxGb: 0 // optional +); + +``` diff --git a/docs/examples/mongo/delete-backup-policy.md b/docs/examples/mongo/delete-backup-policy.md new file mode 100644 index 00000000..923bea41 --- /dev/null +++ b/docs/examples/mongo/delete-backup-policy.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 + +Mongo mongo = new Mongo(client); + +await mongo.DeleteBackupPolicy( + databaseId: "", + policyId: "" +); + +``` diff --git a/docs/examples/mongo/delete-backup.md b/docs/examples/mongo/delete-backup.md new file mode 100644 index 00000000..48529d97 --- /dev/null +++ b/docs/examples/mongo/delete-backup.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 + +Mongo mongo = new Mongo(client); + +await mongo.DeleteBackup( + databaseId: "", + backupId: "" +); + +``` diff --git a/docs/examples/mongo/delete-branch.md b/docs/examples/mongo/delete-branch.md new file mode 100644 index 00000000..a17780fd --- /dev/null +++ b/docs/examples/mongo/delete-branch.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 + +Mongo mongo = new Mongo(client); + +await mongo.DeleteBranch( + databaseId: "", + branchId: "" +); + +``` diff --git a/docs/examples/mongo/delete.md b/docs/examples/mongo/delete.md new file mode 100644 index 00000000..e014f378 --- /dev/null +++ b/docs/examples/mongo/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 + +Mongo mongo = new Mongo(client); + +await mongo.Delete( + databaseId: "" +); + +``` diff --git a/docs/examples/mongo/get-backup-policy.md b/docs/examples/mongo/get-backup-policy.md new file mode 100644 index 00000000..d05d979d --- /dev/null +++ b/docs/examples/mongo/get-backup-policy.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 + +Mongo mongo = new Mongo(client); + +BackupPolicy result = await mongo.GetBackupPolicy( + databaseId: "", + policyId: "" +); + +``` diff --git a/docs/examples/mongo/get-backup.md b/docs/examples/mongo/get-backup.md new file mode 100644 index 00000000..ced57a21 --- /dev/null +++ b/docs/examples/mongo/get-backup.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 + +Mongo mongo = new Mongo(client); + +DedicatedDatabaseBackup result = await mongo.GetBackup( + databaseId: "", + backupId: "" +); + +``` diff --git a/docs/examples/mongo/get-pitr.md b/docs/examples/mongo/get-pitr.md new file mode 100644 index 00000000..55a1e64e --- /dev/null +++ b/docs/examples/mongo/get-pitr.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 + +Mongo mongo = new Mongo(client); + +DedicatedDatabasePITRWindows result = await mongo.GetPitr( + databaseId: "" +); + +``` diff --git a/docs/examples/mongo/get-replicas.md b/docs/examples/mongo/get-replicas.md new file mode 100644 index 00000000..7c52ecee --- /dev/null +++ b/docs/examples/mongo/get-replicas.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 + +Mongo mongo = new Mongo(client); + +DedicatedDatabaseReplicas result = await mongo.GetReplicas( + databaseId: "" +); + +``` diff --git a/docs/examples/mongo/get-restoration.md b/docs/examples/mongo/get-restoration.md new file mode 100644 index 00000000..32e83008 --- /dev/null +++ b/docs/examples/mongo/get-restoration.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 + +Mongo mongo = new Mongo(client); + +DedicatedDatabaseRestoration result = await mongo.GetRestoration( + databaseId: "", + restorationId: "" +); + +``` diff --git a/docs/examples/mongo/get-status.md b/docs/examples/mongo/get-status.md new file mode 100644 index 00000000..883f3b97 --- /dev/null +++ b/docs/examples/mongo/get-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 + +Mongo mongo = new Mongo(client); + +DatabaseStatus result = await mongo.GetStatus( + databaseId: "" +); + +``` diff --git a/docs/examples/mongo/get.md b/docs/examples/mongo/get.md new file mode 100644 index 00000000..86e0b80c --- /dev/null +++ b/docs/examples/mongo/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 + +Mongo mongo = new Mongo(client); + +DedicatedDatabase result = await mongo.Get( + databaseId: "" +); + +``` diff --git a/docs/examples/mongo/list-backup-policies.md b/docs/examples/mongo/list-backup-policies.md new file mode 100644 index 00000000..9b56913a --- /dev/null +++ b/docs/examples/mongo/list-backup-policies.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 + +Mongo mongo = new Mongo(client); + +BackupPolicyList result = await mongo.ListBackupPolicies( + databaseId: "", + queries: new List() // optional +); + +``` diff --git a/docs/examples/mongo/list-backups.md b/docs/examples/mongo/list-backups.md new file mode 100644 index 00000000..6da449f8 --- /dev/null +++ b/docs/examples/mongo/list-backups.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 + +Mongo mongo = new Mongo(client); + +DedicatedDatabaseBackupList result = await mongo.ListBackups( + databaseId: "", + queries: new List() // optional +); + +``` diff --git a/docs/examples/mongo/list-branches.md b/docs/examples/mongo/list-branches.md new file mode 100644 index 00000000..f68102dc --- /dev/null +++ b/docs/examples/mongo/list-branches.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 + +Mongo mongo = new Mongo(client); + +DedicatedDatabaseBranchList result = await mongo.ListBranches( + databaseId: "" +); + +``` diff --git a/docs/examples/mongo/list-operations.md b/docs/examples/mongo/list-operations.md new file mode 100644 index 00000000..c2dc679f --- /dev/null +++ b/docs/examples/mongo/list-operations.md @@ -0,0 +1,20 @@ +```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 + +Mongo mongo = new Mongo(client); + +DedicatedDatabaseOperationList result = await mongo.ListOperations( + databaseId: "", + status: "queued", // optional + limit: 1, // optional + offset: 0 // optional +); + +``` diff --git a/docs/examples/mongo/list-restorations.md b/docs/examples/mongo/list-restorations.md new file mode 100644 index 00000000..b5655c37 --- /dev/null +++ b/docs/examples/mongo/list-restorations.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 + +Mongo mongo = new Mongo(client); + +DedicatedDatabaseRestorationList result = await mongo.ListRestorations( + databaseId: "", + status: "pending", // optional + type: "backup", // optional + limit: 1, // optional + offset: 0 // optional +); + +``` diff --git a/docs/examples/mongo/list-specifications.md b/docs/examples/mongo/list-specifications.md new file mode 100644 index 00000000..474e6123 --- /dev/null +++ b/docs/examples/mongo/list-specifications.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 + .SetKey(""); // Your secret API key + +Mongo mongo = new Mongo(client); + +DedicatedDatabaseSpecificationList result = await mongo.ListSpecifications(); + + +``` diff --git a/docs/examples/mongo/list.md b/docs/examples/mongo/list.md new file mode 100644 index 00000000..bd222419 --- /dev/null +++ b/docs/examples/mongo/list.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 + +Mongo mongo = new Mongo(client); + +DedicatedDatabaseList result = await mongo.List( + queries: new List() // optional +); + +``` diff --git a/docs/examples/mongo/update-backup-policy.md b/docs/examples/mongo/update-backup-policy.md new file mode 100644 index 00000000..7bec7bf3 --- /dev/null +++ b/docs/examples/mongo/update-backup-policy.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 + +Mongo mongo = new Mongo(client); + +BackupPolicy result = await mongo.UpdateBackupPolicy( + databaseId: "", + policyId: "", + name: "", // optional + schedule: "", // optional + retention: 1, // optional + enabled: false // optional +); + +``` diff --git a/docs/examples/mongo/update-backup-storage.md b/docs/examples/mongo/update-backup-storage.md new file mode 100644 index 00000000..27f365d4 --- /dev/null +++ b/docs/examples/mongo/update-backup-storage.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 + +Mongo mongo = new Mongo(client); + +DedicatedDatabaseBackupStorage result = await mongo.UpdateBackupStorage( + databaseId: "", + provider: "s3", + bucket: "", + accessKey: "", + secretKey: "", + region: "", // optional + prefix: "", // optional + endpoint: "" // optional +); + +``` diff --git a/docs/examples/mongo/update-credentials.md b/docs/examples/mongo/update-credentials.md new file mode 100644 index 00000000..268c4348 --- /dev/null +++ b/docs/examples/mongo/update-credentials.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 + +Mongo mongo = new Mongo(client); + +DedicatedDatabase result = await mongo.UpdateCredentials( + databaseId: "" +); + +``` diff --git a/docs/examples/mongo/update-maintenance.md b/docs/examples/mongo/update-maintenance.md new file mode 100644 index 00000000..e64faec6 --- /dev/null +++ b/docs/examples/mongo/update-maintenance.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 + .SetKey(""); // Your secret API key + +Mongo mongo = new Mongo(client); + +DedicatedDatabase result = await mongo.UpdateMaintenance( + databaseId: "", + day: "sun", + hourUtc: 0 +); + +``` diff --git a/docs/examples/mongo/update.md b/docs/examples/mongo/update.md new file mode 100644 index 00000000..6c9b8d0a --- /dev/null +++ b/docs/examples/mongo/update.md @@ -0,0 +1,37 @@ +```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 + +Mongo mongo = new Mongo(client); + +DedicatedDatabase result = await mongo.Update( + databaseId: "", + name: "", // optional + status: "ready", // optional + specification: "", // optional + replicas: 0, // optional + syncMode: "async", // optional + networkIdleTimeoutSeconds: 60, // optional + networkIPAllowlist: new List(), // optional + idleTimeoutMinutes: 5, // optional + pitr: false, // optional + pitrRetentionDays: 1, // optional + storageAutoscaling: false, // optional + storageAutoscalingThresholdPercent: 50, // optional + storageAutoscalingMaxGb: 0, // optional + metricsTraceSampleRate: 0, // optional + metricsSlowQueryLogThresholdMs: 0, // optional + sqlApiEnabled: false, // optional + sqlApiAllowedStatements: new List(), // optional + sqlApiMaxRows: 1, // optional + sqlApiMaxBytes: 1024, // optional + sqlApiTimeoutSeconds: 1 // optional +); + +``` diff --git a/docs/examples/mysql/create-backup-policy.md b/docs/examples/mysql/create-backup-policy.md new file mode 100644 index 00000000..ca410dc0 --- /dev/null +++ b/docs/examples/mysql/create-backup-policy.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 + +Mysql mysql = new Mysql(client); + +BackupPolicy result = await mysql.CreateBackupPolicy( + databaseId: "", + policyId: "", + name: "", + schedule: "", + retention: 1, + type: "full", // optional + enabled: false // optional +); + +``` diff --git a/docs/examples/mysql/create-backup.md b/docs/examples/mysql/create-backup.md new file mode 100644 index 00000000..f5e271df --- /dev/null +++ b/docs/examples/mysql/create-backup.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 + +Mysql mysql = new Mysql(client); + +DedicatedDatabaseBackup result = await mysql.CreateBackup( + databaseId: "", + type: "full" // optional +); + +``` diff --git a/docs/examples/mysql/create-branch.md b/docs/examples/mysql/create-branch.md new file mode 100644 index 00000000..a4d9283f --- /dev/null +++ b/docs/examples/mysql/create-branch.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 + .SetKey(""); // Your secret API key + +Mysql mysql = new Mysql(client); + +DedicatedDatabase result = await mysql.CreateBranch( + databaseId: "", + branchId: "", // optional + ttl: 300 // optional +); + +``` diff --git a/docs/examples/mysql/create-execution.md b/docs/examples/mysql/create-execution.md new file mode 100644 index 00000000..364fd302 --- /dev/null +++ b/docs/examples/mysql/create-execution.md @@ -0,0 +1,20 @@ +```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 + +Mysql mysql = new Mysql(client); + +DedicatedDatabaseExecution result = await mysql.CreateExecution( + databaseId: "", + sql: "", + bindings: [object], // optional + timeoutSeconds: 1 // optional +); + +``` diff --git a/docs/examples/mysql/create-failover.md b/docs/examples/mysql/create-failover.md new file mode 100644 index 00000000..e30720ba --- /dev/null +++ b/docs/examples/mysql/create-failover.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 + +Mysql mysql = new Mysql(client); + +DedicatedDatabase result = await mysql.CreateFailover( + databaseId: "", + targetReplicaId: "" // optional +); + +``` diff --git a/docs/examples/mysql/create-migration.md b/docs/examples/mysql/create-migration.md new file mode 100644 index 00000000..c0b943c8 --- /dev/null +++ b/docs/examples/mysql/create-migration.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 + .SetKey(""); // Your secret API key + +Mysql mysql = new Mysql(client); + +DedicatedDatabase result = await mysql.CreateMigration( + databaseId: "", + targetType: "shared", + specification: "" // optional +); + +``` diff --git a/docs/examples/mysql/create-restoration.md b/docs/examples/mysql/create-restoration.md new file mode 100644 index 00000000..d6f1fa35 --- /dev/null +++ b/docs/examples/mysql/create-restoration.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 + +Mysql mysql = new Mysql(client); + +DedicatedDatabaseRestoration result = await mysql.CreateRestoration( + databaseId: "", + type: "backup", // optional + backupId: "", // optional + targetDatabaseId: "", // optional + targetTime: "2020-10-15T06:38:00.000+00:00" // optional +); + +``` diff --git a/docs/examples/mysql/create-upgrade.md b/docs/examples/mysql/create-upgrade.md new file mode 100644 index 00000000..4b408cee --- /dev/null +++ b/docs/examples/mysql/create-upgrade.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 + +Mysql mysql = new Mysql(client); + +DedicatedDatabase result = await mysql.CreateUpgrade( + databaseId: "", + targetVersion: "" +); + +``` diff --git a/docs/examples/mysql/create.md b/docs/examples/mysql/create.md new file mode 100644 index 00000000..23bcc79e --- /dev/null +++ b/docs/examples/mysql/create.md @@ -0,0 +1,30 @@ +```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 + +Mysql mysql = new Mysql(client); + +DedicatedDatabase result = await mysql.Create( + databaseId: "", + name: "", + version: "17", // optional + specification: "", // optional + replicas: 0, // optional + syncMode: "async", // optional + networkIdleTimeoutSeconds: 60, // optional + networkIPAllowlist: new List(), // optional + idleTimeoutMinutes: 5, // optional + pitr: false, // optional + pitrRetentionDays: 1, // optional + storageAutoscaling: false, // optional + storageAutoscalingThresholdPercent: 50, // optional + storageAutoscalingMaxGb: 0 // optional +); + +``` diff --git a/docs/examples/mysql/delete-backup-policy.md b/docs/examples/mysql/delete-backup-policy.md new file mode 100644 index 00000000..b9edb4ce --- /dev/null +++ b/docs/examples/mysql/delete-backup-policy.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 + +Mysql mysql = new Mysql(client); + +await mysql.DeleteBackupPolicy( + databaseId: "", + policyId: "" +); + +``` diff --git a/docs/examples/mysql/delete-backup.md b/docs/examples/mysql/delete-backup.md new file mode 100644 index 00000000..dca510ca --- /dev/null +++ b/docs/examples/mysql/delete-backup.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 + +Mysql mysql = new Mysql(client); + +await mysql.DeleteBackup( + databaseId: "", + backupId: "" +); + +``` diff --git a/docs/examples/mysql/delete-branch.md b/docs/examples/mysql/delete-branch.md new file mode 100644 index 00000000..1fc078f7 --- /dev/null +++ b/docs/examples/mysql/delete-branch.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 + +Mysql mysql = new Mysql(client); + +await mysql.DeleteBranch( + databaseId: "", + branchId: "" +); + +``` diff --git a/docs/examples/mysql/delete.md b/docs/examples/mysql/delete.md new file mode 100644 index 00000000..4da3ff7f --- /dev/null +++ b/docs/examples/mysql/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 + +Mysql mysql = new Mysql(client); + +await mysql.Delete( + databaseId: "" +); + +``` diff --git a/docs/examples/mysql/get-backup-policy.md b/docs/examples/mysql/get-backup-policy.md new file mode 100644 index 00000000..524bd066 --- /dev/null +++ b/docs/examples/mysql/get-backup-policy.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 + +Mysql mysql = new Mysql(client); + +BackupPolicy result = await mysql.GetBackupPolicy( + databaseId: "", + policyId: "" +); + +``` diff --git a/docs/examples/mysql/get-backup.md b/docs/examples/mysql/get-backup.md new file mode 100644 index 00000000..1c81ffc4 --- /dev/null +++ b/docs/examples/mysql/get-backup.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 + +Mysql mysql = new Mysql(client); + +DedicatedDatabaseBackup result = await mysql.GetBackup( + databaseId: "", + backupId: "" +); + +``` diff --git a/docs/examples/mysql/get-pitr.md b/docs/examples/mysql/get-pitr.md new file mode 100644 index 00000000..3f1d3fcc --- /dev/null +++ b/docs/examples/mysql/get-pitr.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 + +Mysql mysql = new Mysql(client); + +DedicatedDatabasePITRWindows result = await mysql.GetPitr( + databaseId: "" +); + +``` diff --git a/docs/examples/mysql/get-pooler.md b/docs/examples/mysql/get-pooler.md new file mode 100644 index 00000000..c88ec9c8 --- /dev/null +++ b/docs/examples/mysql/get-pooler.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 + +Mysql mysql = new Mysql(client); + +DedicatedDatabasePooler result = await mysql.GetPooler( + databaseId: "" +); + +``` diff --git a/docs/examples/mysql/get-replicas.md b/docs/examples/mysql/get-replicas.md new file mode 100644 index 00000000..4033dc58 --- /dev/null +++ b/docs/examples/mysql/get-replicas.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 + +Mysql mysql = new Mysql(client); + +DedicatedDatabaseReplicas result = await mysql.GetReplicas( + databaseId: "" +); + +``` diff --git a/docs/examples/mysql/get-restoration.md b/docs/examples/mysql/get-restoration.md new file mode 100644 index 00000000..11f18fc1 --- /dev/null +++ b/docs/examples/mysql/get-restoration.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 + +Mysql mysql = new Mysql(client); + +DedicatedDatabaseRestoration result = await mysql.GetRestoration( + databaseId: "", + restorationId: "" +); + +``` diff --git a/docs/examples/mysql/get-status.md b/docs/examples/mysql/get-status.md new file mode 100644 index 00000000..a6adb9a2 --- /dev/null +++ b/docs/examples/mysql/get-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 + +Mysql mysql = new Mysql(client); + +DatabaseStatus result = await mysql.GetStatus( + databaseId: "" +); + +``` diff --git a/docs/examples/mysql/get.md b/docs/examples/mysql/get.md new file mode 100644 index 00000000..0ae1db33 --- /dev/null +++ b/docs/examples/mysql/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 + +Mysql mysql = new Mysql(client); + +DedicatedDatabase result = await mysql.Get( + databaseId: "" +); + +``` diff --git a/docs/examples/mysql/list-backup-policies.md b/docs/examples/mysql/list-backup-policies.md new file mode 100644 index 00000000..546c276a --- /dev/null +++ b/docs/examples/mysql/list-backup-policies.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 + +Mysql mysql = new Mysql(client); + +BackupPolicyList result = await mysql.ListBackupPolicies( + databaseId: "", + queries: new List() // optional +); + +``` diff --git a/docs/examples/mysql/list-backups.md b/docs/examples/mysql/list-backups.md new file mode 100644 index 00000000..11fda3e8 --- /dev/null +++ b/docs/examples/mysql/list-backups.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 + +Mysql mysql = new Mysql(client); + +DedicatedDatabaseBackupList result = await mysql.ListBackups( + databaseId: "", + queries: new List() // optional +); + +``` diff --git a/docs/examples/mysql/list-branches.md b/docs/examples/mysql/list-branches.md new file mode 100644 index 00000000..471fecec --- /dev/null +++ b/docs/examples/mysql/list-branches.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 + +Mysql mysql = new Mysql(client); + +DedicatedDatabaseBranchList result = await mysql.ListBranches( + databaseId: "" +); + +``` diff --git a/docs/examples/mysql/list-operations.md b/docs/examples/mysql/list-operations.md new file mode 100644 index 00000000..5b3f342a --- /dev/null +++ b/docs/examples/mysql/list-operations.md @@ -0,0 +1,20 @@ +```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 + +Mysql mysql = new Mysql(client); + +DedicatedDatabaseOperationList result = await mysql.ListOperations( + databaseId: "", + status: "queued", // optional + limit: 1, // optional + offset: 0 // optional +); + +``` diff --git a/docs/examples/mysql/list-restorations.md b/docs/examples/mysql/list-restorations.md new file mode 100644 index 00000000..0238c2ce --- /dev/null +++ b/docs/examples/mysql/list-restorations.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 + +Mysql mysql = new Mysql(client); + +DedicatedDatabaseRestorationList result = await mysql.ListRestorations( + databaseId: "", + status: "pending", // optional + type: "backup", // optional + limit: 1, // optional + offset: 0 // optional +); + +``` diff --git a/docs/examples/mysql/list-specifications.md b/docs/examples/mysql/list-specifications.md new file mode 100644 index 00000000..a469ff04 --- /dev/null +++ b/docs/examples/mysql/list-specifications.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 + .SetKey(""); // Your secret API key + +Mysql mysql = new Mysql(client); + +DedicatedDatabaseSpecificationList result = await mysql.ListSpecifications(); + + +``` diff --git a/docs/examples/mysql/list.md b/docs/examples/mysql/list.md new file mode 100644 index 00000000..f49707d1 --- /dev/null +++ b/docs/examples/mysql/list.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 + +Mysql mysql = new Mysql(client); + +DedicatedDatabaseList result = await mysql.List( + queries: new List() // optional +); + +``` diff --git a/docs/examples/mysql/update-backup-policy.md b/docs/examples/mysql/update-backup-policy.md new file mode 100644 index 00000000..c812e9ea --- /dev/null +++ b/docs/examples/mysql/update-backup-policy.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 + +Mysql mysql = new Mysql(client); + +BackupPolicy result = await mysql.UpdateBackupPolicy( + databaseId: "", + policyId: "", + name: "", // optional + schedule: "", // optional + retention: 1, // optional + enabled: false // optional +); + +``` diff --git a/docs/examples/mysql/update-backup-storage.md b/docs/examples/mysql/update-backup-storage.md new file mode 100644 index 00000000..6efbdc49 --- /dev/null +++ b/docs/examples/mysql/update-backup-storage.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 + +Mysql mysql = new Mysql(client); + +DedicatedDatabaseBackupStorage result = await mysql.UpdateBackupStorage( + databaseId: "", + provider: "s3", + bucket: "", + accessKey: "", + secretKey: "", + region: "", // optional + prefix: "", // optional + endpoint: "" // optional +); + +``` diff --git a/docs/examples/mysql/update-credentials.md b/docs/examples/mysql/update-credentials.md new file mode 100644 index 00000000..581a13e9 --- /dev/null +++ b/docs/examples/mysql/update-credentials.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 + +Mysql mysql = new Mysql(client); + +DedicatedDatabase result = await mysql.UpdateCredentials( + databaseId: "" +); + +``` diff --git a/docs/examples/mysql/update-maintenance.md b/docs/examples/mysql/update-maintenance.md new file mode 100644 index 00000000..4a28819a --- /dev/null +++ b/docs/examples/mysql/update-maintenance.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 + .SetKey(""); // Your secret API key + +Mysql mysql = new Mysql(client); + +DedicatedDatabase result = await mysql.UpdateMaintenance( + databaseId: "", + day: "sun", + hourUtc: 0 +); + +``` diff --git a/docs/examples/mysql/update-pooler.md b/docs/examples/mysql/update-pooler.md new file mode 100644 index 00000000..455b6d2b --- /dev/null +++ b/docs/examples/mysql/update-pooler.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 + +Mysql mysql = new Mysql(client); + +DedicatedDatabasePooler result = await mysql.UpdatePooler( + databaseId: "", + mode: "transaction", // optional + maxConnections: 10, // optional + defaultPoolSize: 1, // optional + readWriteSplitting: false, // optional + poolerCpuRequest: "", // optional + poolerCpuLimit: "", // optional + poolerMemoryRequest: "", // optional + poolerMemoryLimit: "" // optional +); + +``` diff --git a/docs/examples/mysql/update.md b/docs/examples/mysql/update.md new file mode 100644 index 00000000..4e9e8adb --- /dev/null +++ b/docs/examples/mysql/update.md @@ -0,0 +1,37 @@ +```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 + +Mysql mysql = new Mysql(client); + +DedicatedDatabase result = await mysql.Update( + databaseId: "", + name: "", // optional + status: "ready", // optional + specification: "", // optional + replicas: 0, // optional + syncMode: "async", // optional + networkIdleTimeoutSeconds: 60, // optional + networkIPAllowlist: new List(), // optional + idleTimeoutMinutes: 5, // optional + pitr: false, // optional + pitrRetentionDays: 1, // optional + storageAutoscaling: false, // optional + storageAutoscalingThresholdPercent: 50, // optional + storageAutoscalingMaxGb: 0, // optional + metricsTraceSampleRate: 0, // optional + metricsSlowQueryLogThresholdMs: 0, // optional + sqlApiEnabled: false, // optional + sqlApiAllowedStatements: new List(), // optional + sqlApiMaxRows: 1, // optional + sqlApiMaxBytes: 1024, // optional + sqlApiTimeoutSeconds: 1 // optional +); + +``` diff --git a/docs/examples/oauth2/approve.md b/docs/examples/oauth2/approve.md index 887fab55..b59de4dd 100644 --- a/docs/examples/oauth2/approve.md +++ b/docs/examples/oauth2/approve.md @@ -14,4 +14,6 @@ Oauth2Approve result = await oauth2.Approve( grant_id: "", authorization_details: "", // optional scope: "" // optional -);``` +); + +``` diff --git a/docs/examples/oauth2/authorize-post.md b/docs/examples/oauth2/authorize-post.md index 72f43d1a..b2269a0e 100644 --- a/docs/examples/oauth2/authorize-post.md +++ b/docs/examples/oauth2/authorize-post.md @@ -25,4 +25,6 @@ Oauth2Authorize result = await oauth2.AuthorizePost( resource: "", // optional audience: "", // optional request_uri: "" // optional -);``` +); + +``` diff --git a/docs/examples/oauth2/authorize.md b/docs/examples/oauth2/authorize.md index 10d68bd1..056859ea 100644 --- a/docs/examples/oauth2/authorize.md +++ b/docs/examples/oauth2/authorize.md @@ -25,4 +25,6 @@ Oauth2Authorize result = await oauth2.Authorize( resource: "", // optional audience: "", // optional request_uri: "" // optional -);``` +); + +``` diff --git a/docs/examples/oauth2/create-device-authorization.md b/docs/examples/oauth2/create-device-authorization.md index 248fbf89..a6697fe0 100644 --- a/docs/examples/oauth2/create-device-authorization.md +++ b/docs/examples/oauth2/create-device-authorization.md @@ -16,4 +16,6 @@ Oauth2DeviceAuthorization result = await oauth2.CreateDeviceAuthorization( authorization_details: "", // optional resource: "", // optional audience: "" // optional -);``` +); + +``` diff --git a/docs/examples/oauth2/create-grant.md b/docs/examples/oauth2/create-grant.md index 627e290d..856a8815 100644 --- a/docs/examples/oauth2/create-grant.md +++ b/docs/examples/oauth2/create-grant.md @@ -12,4 +12,6 @@ Oauth2 oauth2 = new Oauth2(client); Oauth2Grant result = await oauth2.CreateGrant( user_code: "" -);``` +); + +``` diff --git a/docs/examples/oauth2/create-par.md b/docs/examples/oauth2/create-par.md index 306c995c..2d8827f3 100644 --- a/docs/examples/oauth2/create-par.md +++ b/docs/examples/oauth2/create-par.md @@ -24,4 +24,6 @@ Oauth2PAR result = await oauth2.CreatePAR( authorization_details: "", // optional resource: "", // optional audience: "" // optional -);``` +); + +``` diff --git a/docs/examples/oauth2/create-token.md b/docs/examples/oauth2/create-token.md index 6afac7ed..a4b2d762 100644 --- a/docs/examples/oauth2/create-token.md +++ b/docs/examples/oauth2/create-token.md @@ -21,4 +21,6 @@ Oauth2Token result = await oauth2.CreateToken( redirect_uri: "https://example.com", // optional resource: "", // optional audience: "" // optional -);``` +); + +``` diff --git a/docs/examples/oauth2/get-grant.md b/docs/examples/oauth2/get-grant.md index a7cf5f9a..389e5005 100644 --- a/docs/examples/oauth2/get-grant.md +++ b/docs/examples/oauth2/get-grant.md @@ -12,4 +12,6 @@ Oauth2 oauth2 = new Oauth2(client); Oauth2Grant result = await oauth2.GetGrant( grant_id: "" -);``` +); + +``` diff --git a/docs/examples/oauth2/list-organizations.md b/docs/examples/oauth2/list-organizations.md index 59a30b97..d2787675 100644 --- a/docs/examples/oauth2/list-organizations.md +++ b/docs/examples/oauth2/list-organizations.md @@ -14,4 +14,6 @@ Oauth2OrganizationList result = await oauth2.ListOrganizations( limit: 1, // optional offset: 0, // optional search: "" // optional -);``` +); + +``` diff --git a/docs/examples/oauth2/list-projects.md b/docs/examples/oauth2/list-projects.md index cfe7b8ca..cff6d2a9 100644 --- a/docs/examples/oauth2/list-projects.md +++ b/docs/examples/oauth2/list-projects.md @@ -14,4 +14,6 @@ Oauth2ProjectList result = await oauth2.ListProjects( limit: 1, // optional offset: 0, // optional search: "" // optional -);``` +); + +``` diff --git a/docs/examples/oauth2/reject.md b/docs/examples/oauth2/reject.md index bf32913e..9a92b2c7 100644 --- a/docs/examples/oauth2/reject.md +++ b/docs/examples/oauth2/reject.md @@ -12,4 +12,6 @@ Oauth2 oauth2 = new Oauth2(client); Oauth2Reject result = await oauth2.Reject( grant_id: "" -);``` +); + +``` diff --git a/docs/examples/oauth2/revoke.md b/docs/examples/oauth2/revoke.md index 322ba30a..eb902a05 100644 --- a/docs/examples/oauth2/revoke.md +++ b/docs/examples/oauth2/revoke.md @@ -15,4 +15,6 @@ Oauth2 oauth2 = new Oauth2(client); token_type_hint: "access_token", // optional client_id: "", // optional client_secret: "" // optional -);``` +); + +``` diff --git a/docs/examples/organization/create-installation.md b/docs/examples/organization/create-installation.md index 1545dc73..78aa2c38 100644 --- a/docs/examples/organization/create-installation.md +++ b/docs/examples/organization/create-installation.md @@ -13,4 +13,6 @@ Organization organization = new Organization(client); AppInstallation result = await organization.CreateInstallation( appId: "", authorizationDetails: "" // optional -);``` +); + +``` diff --git a/docs/examples/organization/create-key.md b/docs/examples/organization/create-key.md index e7354082..85288ad8 100644 --- a/docs/examples/organization/create-key.md +++ b/docs/examples/organization/create-key.md @@ -16,4 +16,6 @@ Key result = await organization.CreateKey( name: "", scopes: new List<OrganizationKeyScopes> { OrganizationKeyScopes.ProjectsRead }, expire: "2020-10-15T06:38:00.000+00:00" // optional -);``` +); + +``` diff --git a/docs/examples/organization/create-membership.md b/docs/examples/organization/create-membership.md index 07f723aa..bbeb4a1f 100644 --- a/docs/examples/organization/create-membership.md +++ b/docs/examples/organization/create-membership.md @@ -17,4 +17,6 @@ Membership result = await organization.CreateMembership( phone: "+12065550100", // optional url: "https://example.com", // optional name: "" // optional -);``` +); + +``` diff --git a/docs/examples/organization/create-project.md b/docs/examples/organization/create-project.md index ba736acd..c4f2e627 100644 --- a/docs/examples/organization/create-project.md +++ b/docs/examples/organization/create-project.md @@ -12,7 +12,9 @@ Client client = new Client() Organization organization = new Organization(client); Project result = await organization.CreateProject( - projectId: "", + projectId: "", name: "", region: Region.Fra // optional -);``` +); + +``` diff --git a/docs/examples/organization/delete-installation.md b/docs/examples/organization/delete-installation.md index d295bbd5..2bfb9f04 100644 --- a/docs/examples/organization/delete-installation.md +++ b/docs/examples/organization/delete-installation.md @@ -12,4 +12,6 @@ Organization organization = new Organization(client); await organization.DeleteInstallation( installationId: "" -);``` +); + +``` diff --git a/docs/examples/organization/delete-key.md b/docs/examples/organization/delete-key.md index e6d088bb..78ff5b81 100644 --- a/docs/examples/organization/delete-key.md +++ b/docs/examples/organization/delete-key.md @@ -12,4 +12,6 @@ Organization organization = new Organization(client); await organization.DeleteKey( keyId: "" -);``` +); + +``` diff --git a/docs/examples/organization/delete-membership.md b/docs/examples/organization/delete-membership.md index 0c3b257f..efcf35cc 100644 --- a/docs/examples/organization/delete-membership.md +++ b/docs/examples/organization/delete-membership.md @@ -12,4 +12,6 @@ Organization organization = new Organization(client); await organization.DeleteMembership( membershipId: "" -);``` +); + +``` diff --git a/docs/examples/organization/delete-project.md b/docs/examples/organization/delete-project.md index 89581192..df9eb153 100644 --- a/docs/examples/organization/delete-project.md +++ b/docs/examples/organization/delete-project.md @@ -12,4 +12,6 @@ Organization organization = new Organization(client); await organization.DeleteProject( projectId: "" -);``` +); + +``` diff --git a/docs/examples/organization/delete.md b/docs/examples/organization/delete.md index 702750fe..5b034aa8 100644 --- a/docs/examples/organization/delete.md +++ b/docs/examples/organization/delete.md @@ -11,4 +11,6 @@ Client client = new Client() Organization organization = new Organization(client); await organization.Delete(); + + ``` diff --git a/docs/examples/organization/get-installation.md b/docs/examples/organization/get-installation.md index 13de6238..c324528b 100644 --- a/docs/examples/organization/get-installation.md +++ b/docs/examples/organization/get-installation.md @@ -12,4 +12,6 @@ Organization organization = new Organization(client); AppInstallation result = await organization.GetInstallation( installationId: "" -);``` +); + +``` diff --git a/docs/examples/organization/get-key.md b/docs/examples/organization/get-key.md index a254c99e..c240dbc0 100644 --- a/docs/examples/organization/get-key.md +++ b/docs/examples/organization/get-key.md @@ -12,4 +12,6 @@ Organization organization = new Organization(client); Key result = await organization.GetKey( keyId: "" -);``` +); + +``` diff --git a/docs/examples/organization/get-membership.md b/docs/examples/organization/get-membership.md index 60426303..44d6363e 100644 --- a/docs/examples/organization/get-membership.md +++ b/docs/examples/organization/get-membership.md @@ -12,4 +12,6 @@ Organization organization = new Organization(client); Membership result = await organization.GetMembership( membershipId: "" -);``` +); + +``` diff --git a/docs/examples/organization/get-project.md b/docs/examples/organization/get-project.md index b69b0d14..3d64fe0c 100644 --- a/docs/examples/organization/get-project.md +++ b/docs/examples/organization/get-project.md @@ -12,4 +12,6 @@ Organization organization = new Organization(client); Project result = await organization.GetProject( projectId: "" -);``` +); + +``` diff --git a/docs/examples/organization/get.md b/docs/examples/organization/get.md index ab20af7d..4c3c2b76 100644 --- a/docs/examples/organization/get.md +++ b/docs/examples/organization/get.md @@ -11,4 +11,6 @@ Client client = new Client() Organization organization = new Organization(client); Organization result = await organization.Get(); + + ``` diff --git a/docs/examples/organization/list-installations.md b/docs/examples/organization/list-installations.md index 843302a7..2890e336 100644 --- a/docs/examples/organization/list-installations.md +++ b/docs/examples/organization/list-installations.md @@ -13,4 +13,6 @@ Organization organization = new Organization(client); AppInstallationList result = await organization.ListInstallations( queries: new List(), // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/organization/list-keys.md b/docs/examples/organization/list-keys.md index 9f7a3f1d..4671782d 100644 --- a/docs/examples/organization/list-keys.md +++ b/docs/examples/organization/list-keys.md @@ -13,4 +13,6 @@ Organization organization = new Organization(client); KeyList result = await organization.ListKeys( queries: new List(), // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/organization/list-memberships.md b/docs/examples/organization/list-memberships.md index 00a7c736..69c357b7 100644 --- a/docs/examples/organization/list-memberships.md +++ b/docs/examples/organization/list-memberships.md @@ -14,4 +14,6 @@ MembershipList result = await organization.ListMemberships( queries: new List(), // optional search: "", // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/organization/list-projects.md b/docs/examples/organization/list-projects.md index 2c09826d..c61a3341 100644 --- a/docs/examples/organization/list-projects.md +++ b/docs/examples/organization/list-projects.md @@ -14,4 +14,6 @@ ProjectList result = await organization.ListProjects( queries: new List(), // optional search: "", // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/organization/update-installation.md b/docs/examples/organization/update-installation.md index 9799ebfa..c79ee8b5 100644 --- a/docs/examples/organization/update-installation.md +++ b/docs/examples/organization/update-installation.md @@ -13,4 +13,6 @@ Organization organization = new Organization(client); AppInstallation result = await organization.UpdateInstallation( installationId: "", authorizationDetails: "" // optional -);``` +); + +``` diff --git a/docs/examples/organization/update-key.md b/docs/examples/organization/update-key.md index b07ddeaa..d22ee7f6 100644 --- a/docs/examples/organization/update-key.md +++ b/docs/examples/organization/update-key.md @@ -16,4 +16,6 @@ Key result = await organization.UpdateKey( name: "", scopes: new List<OrganizationKeyScopes> { OrganizationKeyScopes.ProjectsRead }, expire: "2020-10-15T06:38:00.000+00:00" // optional -);``` +); + +``` diff --git a/docs/examples/organization/update-membership.md b/docs/examples/organization/update-membership.md index de696dc5..d1faf7f0 100644 --- a/docs/examples/organization/update-membership.md +++ b/docs/examples/organization/update-membership.md @@ -13,4 +13,6 @@ Organization organization = new Organization(client); Membership result = await organization.UpdateMembership( membershipId: "", roles: new List() -);``` +); + +``` diff --git a/docs/examples/organization/update-project.md b/docs/examples/organization/update-project.md index de55bb5d..ae8e2664 100644 --- a/docs/examples/organization/update-project.md +++ b/docs/examples/organization/update-project.md @@ -13,4 +13,6 @@ Organization organization = new Organization(client); Project result = await organization.UpdateProject( projectId: "", name: "" -);``` +); + +``` diff --git a/docs/examples/organization/update.md b/docs/examples/organization/update.md index 2db709e5..8b559ce1 100644 --- a/docs/examples/organization/update.md +++ b/docs/examples/organization/update.md @@ -12,4 +12,6 @@ Organization organization = new Organization(client); Organization result = await organization.Update( name: "" -);``` +); + +``` diff --git a/docs/examples/postgresql/create-backup-policy.md b/docs/examples/postgresql/create-backup-policy.md new file mode 100644 index 00000000..ba827ae7 --- /dev/null +++ b/docs/examples/postgresql/create-backup-policy.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 + +Postgresql postgresql = new Postgresql(client); + +BackupPolicy result = await postgresql.CreateBackupPolicy( + databaseId: "", + policyId: "", + name: "", + schedule: "", + retention: 1, + type: "full", // optional + enabled: false // optional +); + +``` diff --git a/docs/examples/postgresql/create-backup.md b/docs/examples/postgresql/create-backup.md new file mode 100644 index 00000000..de70d5c5 --- /dev/null +++ b/docs/examples/postgresql/create-backup.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 + +Postgresql postgresql = new Postgresql(client); + +DedicatedDatabaseBackup result = await postgresql.CreateBackup( + databaseId: "", + type: "full" // optional +); + +``` diff --git a/docs/examples/postgresql/create-branch.md b/docs/examples/postgresql/create-branch.md new file mode 100644 index 00000000..f4e8d566 --- /dev/null +++ b/docs/examples/postgresql/create-branch.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 + .SetKey(""); // Your secret API key + +Postgresql postgresql = new Postgresql(client); + +DedicatedDatabase result = await postgresql.CreateBranch( + databaseId: "", + branchId: "", // optional + ttl: 300 // optional +); + +``` diff --git a/docs/examples/postgresql/create-execution.md b/docs/examples/postgresql/create-execution.md new file mode 100644 index 00000000..14804cc0 --- /dev/null +++ b/docs/examples/postgresql/create-execution.md @@ -0,0 +1,20 @@ +```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 + +Postgresql postgresql = new Postgresql(client); + +DedicatedDatabaseExecution result = await postgresql.CreateExecution( + databaseId: "", + sql: "", + bindings: [object], // optional + timeoutSeconds: 1 // optional +); + +``` diff --git a/docs/examples/postgresql/create-extension.md b/docs/examples/postgresql/create-extension.md new file mode 100644 index 00000000..d7a6e6fd --- /dev/null +++ b/docs/examples/postgresql/create-extension.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 + +Postgresql postgresql = new Postgresql(client); + +DedicatedDatabase result = await postgresql.CreateExtension( + databaseId: "", + name: "" +); + +``` diff --git a/docs/examples/postgresql/create-failover.md b/docs/examples/postgresql/create-failover.md new file mode 100644 index 00000000..b798844f --- /dev/null +++ b/docs/examples/postgresql/create-failover.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 + +Postgresql postgresql = new Postgresql(client); + +DedicatedDatabase result = await postgresql.CreateFailover( + databaseId: "", + targetReplicaId: "" // optional +); + +``` diff --git a/docs/examples/postgresql/create-migration.md b/docs/examples/postgresql/create-migration.md new file mode 100644 index 00000000..1868ba84 --- /dev/null +++ b/docs/examples/postgresql/create-migration.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 + .SetKey(""); // Your secret API key + +Postgresql postgresql = new Postgresql(client); + +DedicatedDatabase result = await postgresql.CreateMigration( + databaseId: "", + targetType: "shared", + specification: "" // optional +); + +``` diff --git a/docs/examples/postgresql/create-restoration.md b/docs/examples/postgresql/create-restoration.md new file mode 100644 index 00000000..fdd09484 --- /dev/null +++ b/docs/examples/postgresql/create-restoration.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 + +Postgresql postgresql = new Postgresql(client); + +DedicatedDatabaseRestoration result = await postgresql.CreateRestoration( + databaseId: "", + type: "backup", // optional + backupId: "", // optional + targetDatabaseId: "", // optional + targetTime: "2020-10-15T06:38:00.000+00:00" // optional +); + +``` diff --git a/docs/examples/postgresql/create-upgrade.md b/docs/examples/postgresql/create-upgrade.md new file mode 100644 index 00000000..c81ca922 --- /dev/null +++ b/docs/examples/postgresql/create-upgrade.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 + +Postgresql postgresql = new Postgresql(client); + +DedicatedDatabase result = await postgresql.CreateUpgrade( + databaseId: "", + targetVersion: "" +); + +``` diff --git a/docs/examples/postgresql/create.md b/docs/examples/postgresql/create.md new file mode 100644 index 00000000..b4c3a49b --- /dev/null +++ b/docs/examples/postgresql/create.md @@ -0,0 +1,30 @@ +```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 + +Postgresql postgresql = new Postgresql(client); + +DedicatedDatabase result = await postgresql.Create( + databaseId: "", + name: "", + version: "17", // optional + specification: "", // optional + replicas: 0, // optional + syncMode: "async", // optional + networkIdleTimeoutSeconds: 60, // optional + networkIPAllowlist: new List(), // optional + idleTimeoutMinutes: 5, // optional + pitr: false, // optional + pitrRetentionDays: 1, // optional + storageAutoscaling: false, // optional + storageAutoscalingThresholdPercent: 50, // optional + storageAutoscalingMaxGb: 0 // optional +); + +``` diff --git a/docs/examples/postgresql/delete-backup-policy.md b/docs/examples/postgresql/delete-backup-policy.md new file mode 100644 index 00000000..0610c1a1 --- /dev/null +++ b/docs/examples/postgresql/delete-backup-policy.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 + +Postgresql postgresql = new Postgresql(client); + +await postgresql.DeleteBackupPolicy( + databaseId: "", + policyId: "" +); + +``` diff --git a/docs/examples/postgresql/delete-backup.md b/docs/examples/postgresql/delete-backup.md new file mode 100644 index 00000000..45d01366 --- /dev/null +++ b/docs/examples/postgresql/delete-backup.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 + +Postgresql postgresql = new Postgresql(client); + +await postgresql.DeleteBackup( + databaseId: "", + backupId: "" +); + +``` diff --git a/docs/examples/postgresql/delete-branch.md b/docs/examples/postgresql/delete-branch.md new file mode 100644 index 00000000..31419ede --- /dev/null +++ b/docs/examples/postgresql/delete-branch.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 + +Postgresql postgresql = new Postgresql(client); + +await postgresql.DeleteBranch( + databaseId: "", + branchId: "" +); + +``` diff --git a/docs/examples/postgresql/delete-extension.md b/docs/examples/postgresql/delete-extension.md new file mode 100644 index 00000000..b625a039 --- /dev/null +++ b/docs/examples/postgresql/delete-extension.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 + +Postgresql postgresql = new Postgresql(client); + +await postgresql.DeleteExtension( + databaseId: "", + extensionName: "" +); + +``` diff --git a/docs/examples/postgresql/delete.md b/docs/examples/postgresql/delete.md new file mode 100644 index 00000000..e6e7201e --- /dev/null +++ b/docs/examples/postgresql/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 + +Postgresql postgresql = new Postgresql(client); + +await postgresql.Delete( + databaseId: "" +); + +``` diff --git a/docs/examples/postgresql/get-backup-policy.md b/docs/examples/postgresql/get-backup-policy.md new file mode 100644 index 00000000..e58d4e21 --- /dev/null +++ b/docs/examples/postgresql/get-backup-policy.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 + +Postgresql postgresql = new Postgresql(client); + +BackupPolicy result = await postgresql.GetBackupPolicy( + databaseId: "", + policyId: "" +); + +``` diff --git a/docs/examples/postgresql/get-backup.md b/docs/examples/postgresql/get-backup.md new file mode 100644 index 00000000..4091ac39 --- /dev/null +++ b/docs/examples/postgresql/get-backup.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 + +Postgresql postgresql = new Postgresql(client); + +DedicatedDatabaseBackup result = await postgresql.GetBackup( + databaseId: "", + backupId: "" +); + +``` diff --git a/docs/examples/postgresql/get-pitr.md b/docs/examples/postgresql/get-pitr.md new file mode 100644 index 00000000..aaabade0 --- /dev/null +++ b/docs/examples/postgresql/get-pitr.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 + +Postgresql postgresql = new Postgresql(client); + +DedicatedDatabasePITRWindows result = await postgresql.GetPitr( + databaseId: "" +); + +``` diff --git a/docs/examples/postgresql/get-pooler.md b/docs/examples/postgresql/get-pooler.md new file mode 100644 index 00000000..b42fd780 --- /dev/null +++ b/docs/examples/postgresql/get-pooler.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 + +Postgresql postgresql = new Postgresql(client); + +DedicatedDatabasePooler result = await postgresql.GetPooler( + databaseId: "" +); + +``` diff --git a/docs/examples/postgresql/get-replicas.md b/docs/examples/postgresql/get-replicas.md new file mode 100644 index 00000000..62475f36 --- /dev/null +++ b/docs/examples/postgresql/get-replicas.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 + +Postgresql postgresql = new Postgresql(client); + +DedicatedDatabaseReplicas result = await postgresql.GetReplicas( + databaseId: "" +); + +``` diff --git a/docs/examples/postgresql/get-restoration.md b/docs/examples/postgresql/get-restoration.md new file mode 100644 index 00000000..40a23f03 --- /dev/null +++ b/docs/examples/postgresql/get-restoration.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 + +Postgresql postgresql = new Postgresql(client); + +DedicatedDatabaseRestoration result = await postgresql.GetRestoration( + databaseId: "", + restorationId: "" +); + +``` diff --git a/docs/examples/postgresql/get-status.md b/docs/examples/postgresql/get-status.md new file mode 100644 index 00000000..0101abcb --- /dev/null +++ b/docs/examples/postgresql/get-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 + +Postgresql postgresql = new Postgresql(client); + +DatabaseStatus result = await postgresql.GetStatus( + databaseId: "" +); + +``` diff --git a/docs/examples/postgresql/get.md b/docs/examples/postgresql/get.md new file mode 100644 index 00000000..67bd780f --- /dev/null +++ b/docs/examples/postgresql/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 + +Postgresql postgresql = new Postgresql(client); + +DedicatedDatabase result = await postgresql.Get( + databaseId: "" +); + +``` diff --git a/docs/examples/postgresql/list-backup-policies.md b/docs/examples/postgresql/list-backup-policies.md new file mode 100644 index 00000000..7fe5d3f7 --- /dev/null +++ b/docs/examples/postgresql/list-backup-policies.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 + +Postgresql postgresql = new Postgresql(client); + +BackupPolicyList result = await postgresql.ListBackupPolicies( + databaseId: "", + queries: new List() // optional +); + +``` diff --git a/docs/examples/postgresql/list-backups.md b/docs/examples/postgresql/list-backups.md new file mode 100644 index 00000000..f3b66895 --- /dev/null +++ b/docs/examples/postgresql/list-backups.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 + +Postgresql postgresql = new Postgresql(client); + +DedicatedDatabaseBackupList result = await postgresql.ListBackups( + databaseId: "", + queries: new List() // optional +); + +``` diff --git a/docs/examples/postgresql/list-branches.md b/docs/examples/postgresql/list-branches.md new file mode 100644 index 00000000..1c092d45 --- /dev/null +++ b/docs/examples/postgresql/list-branches.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 + +Postgresql postgresql = new Postgresql(client); + +DedicatedDatabaseBranchList result = await postgresql.ListBranches( + databaseId: "" +); + +``` diff --git a/docs/examples/postgresql/list-extensions.md b/docs/examples/postgresql/list-extensions.md new file mode 100644 index 00000000..a7ca3908 --- /dev/null +++ b/docs/examples/postgresql/list-extensions.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 + +Postgresql postgresql = new Postgresql(client); + +DedicatedDatabaseExtensions result = await postgresql.ListExtensions( + databaseId: "" +); + +``` diff --git a/docs/examples/postgresql/list-operations.md b/docs/examples/postgresql/list-operations.md new file mode 100644 index 00000000..cb745eaa --- /dev/null +++ b/docs/examples/postgresql/list-operations.md @@ -0,0 +1,20 @@ +```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 + +Postgresql postgresql = new Postgresql(client); + +DedicatedDatabaseOperationList result = await postgresql.ListOperations( + databaseId: "", + status: "queued", // optional + limit: 1, // optional + offset: 0 // optional +); + +``` diff --git a/docs/examples/postgresql/list-restorations.md b/docs/examples/postgresql/list-restorations.md new file mode 100644 index 00000000..2663a1f8 --- /dev/null +++ b/docs/examples/postgresql/list-restorations.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 + +Postgresql postgresql = new Postgresql(client); + +DedicatedDatabaseRestorationList result = await postgresql.ListRestorations( + databaseId: "", + status: "pending", // optional + type: "backup", // optional + limit: 1, // optional + offset: 0 // optional +); + +``` diff --git a/docs/examples/postgresql/list-specifications.md b/docs/examples/postgresql/list-specifications.md new file mode 100644 index 00000000..da1539be --- /dev/null +++ b/docs/examples/postgresql/list-specifications.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 + .SetKey(""); // Your secret API key + +Postgresql postgresql = new Postgresql(client); + +DedicatedDatabaseSpecificationList result = await postgresql.ListSpecifications(); + + +``` diff --git a/docs/examples/postgresql/list.md b/docs/examples/postgresql/list.md new file mode 100644 index 00000000..eb2e0e06 --- /dev/null +++ b/docs/examples/postgresql/list.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 + +Postgresql postgresql = new Postgresql(client); + +DedicatedDatabaseList result = await postgresql.List( + queries: new List() // optional +); + +``` diff --git a/docs/examples/postgresql/update-backup-policy.md b/docs/examples/postgresql/update-backup-policy.md new file mode 100644 index 00000000..c1faaa09 --- /dev/null +++ b/docs/examples/postgresql/update-backup-policy.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 + +Postgresql postgresql = new Postgresql(client); + +BackupPolicy result = await postgresql.UpdateBackupPolicy( + databaseId: "", + policyId: "", + name: "", // optional + schedule: "", // optional + retention: 1, // optional + enabled: false // optional +); + +``` diff --git a/docs/examples/postgresql/update-backup-storage.md b/docs/examples/postgresql/update-backup-storage.md new file mode 100644 index 00000000..88d946e1 --- /dev/null +++ b/docs/examples/postgresql/update-backup-storage.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 + +Postgresql postgresql = new Postgresql(client); + +DedicatedDatabaseBackupStorage result = await postgresql.UpdateBackupStorage( + databaseId: "", + provider: "s3", + bucket: "", + accessKey: "", + secretKey: "", + region: "", // optional + prefix: "", // optional + endpoint: "" // optional +); + +``` diff --git a/docs/examples/postgresql/update-credentials.md b/docs/examples/postgresql/update-credentials.md new file mode 100644 index 00000000..c02fcd67 --- /dev/null +++ b/docs/examples/postgresql/update-credentials.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 + +Postgresql postgresql = new Postgresql(client); + +DedicatedDatabase result = await postgresql.UpdateCredentials( + databaseId: "" +); + +``` diff --git a/docs/examples/postgresql/update-maintenance.md b/docs/examples/postgresql/update-maintenance.md new file mode 100644 index 00000000..ed6fa91a --- /dev/null +++ b/docs/examples/postgresql/update-maintenance.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 + .SetKey(""); // Your secret API key + +Postgresql postgresql = new Postgresql(client); + +DedicatedDatabase result = await postgresql.UpdateMaintenance( + databaseId: "", + day: "sun", + hourUtc: 0 +); + +``` diff --git a/docs/examples/postgresql/update-pooler.md b/docs/examples/postgresql/update-pooler.md new file mode 100644 index 00000000..bc77771f --- /dev/null +++ b/docs/examples/postgresql/update-pooler.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 + +Postgresql postgresql = new Postgresql(client); + +DedicatedDatabasePooler result = await postgresql.UpdatePooler( + databaseId: "", + mode: "transaction", // optional + maxConnections: 10, // optional + defaultPoolSize: 1, // optional + readWriteSplitting: false, // optional + poolerCpuRequest: "", // optional + poolerCpuLimit: "", // optional + poolerMemoryRequest: "", // optional + poolerMemoryLimit: "" // optional +); + +``` diff --git a/docs/examples/postgresql/update.md b/docs/examples/postgresql/update.md new file mode 100644 index 00000000..c6e5d48a --- /dev/null +++ b/docs/examples/postgresql/update.md @@ -0,0 +1,37 @@ +```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 + +Postgresql postgresql = new Postgresql(client); + +DedicatedDatabase result = await postgresql.Update( + databaseId: "", + name: "", // optional + status: "ready", // optional + specification: "", // optional + replicas: 0, // optional + syncMode: "async", // optional + networkIdleTimeoutSeconds: 60, // optional + networkIPAllowlist: new List(), // optional + idleTimeoutMinutes: 5, // optional + pitr: false, // optional + pitrRetentionDays: 1, // optional + storageAutoscaling: false, // optional + storageAutoscalingThresholdPercent: 50, // optional + storageAutoscalingMaxGb: 0, // optional + metricsTraceSampleRate: 0, // optional + metricsSlowQueryLogThresholdMs: 0, // optional + sqlApiEnabled: false, // optional + sqlApiAllowedStatements: new List(), // optional + sqlApiMaxRows: 1, // optional + sqlApiMaxBytes: 1024, // optional + sqlApiTimeoutSeconds: 1 // optional +); + +``` diff --git a/docs/examples/presences/delete.md b/docs/examples/presences/delete.md index 0431d249..e3540674 100644 --- a/docs/examples/presences/delete.md +++ b/docs/examples/presences/delete.md @@ -12,4 +12,6 @@ Presences presences = new Presences(client); await presences.Delete( presenceId: "" -);``` +); + +``` diff --git a/docs/examples/presences/get.md b/docs/examples/presences/get.md index acf317de..85e7287e 100644 --- a/docs/examples/presences/get.md +++ b/docs/examples/presences/get.md @@ -12,4 +12,6 @@ Presences presences = new Presences(client); Presence result = await presences.Get( presenceId: "" -);``` +); + +``` diff --git a/docs/examples/presences/list.md b/docs/examples/presences/list.md index e1bd9653..8285644e 100644 --- a/docs/examples/presences/list.md +++ b/docs/examples/presences/list.md @@ -14,4 +14,6 @@ PresenceList result = await presences.List( queries: new List(), // optional total: false, // optional ttl: 0 // optional -);``` +); + +``` diff --git a/docs/examples/presences/update.md b/docs/examples/presences/update.md index 723d681c..ed55483b 100644 --- a/docs/examples/presences/update.md +++ b/docs/examples/presences/update.md @@ -18,4 +18,6 @@ Presence result = await presences.Update( metadata: [object], // optional permissions: new List { Permission.Read(Role.Any()) }, // optional purge: false // optional -);``` +); + +``` diff --git a/docs/examples/presences/upsert.md b/docs/examples/presences/upsert.md index 4c73ddc4..b7868248 100644 --- a/docs/examples/presences/upsert.md +++ b/docs/examples/presences/upsert.md @@ -17,4 +17,6 @@ Presence result = await presences.Upsert( permissions: new List { Permission.Read(Role.Any()) }, // optional expiresAt: "2020-10-15T06:38:00.000+00:00", // optional metadata: [object] // optional -);``` +); + +``` diff --git a/docs/examples/project/create-android-platform.md b/docs/examples/project/create-android-platform.md index 34280b50..df8dd6e0 100644 --- a/docs/examples/project/create-android-platform.md +++ b/docs/examples/project/create-android-platform.md @@ -14,4 +14,6 @@ PlatformAndroid result = await project.CreateAndroidPlatform( platformId: "", name: "", applicationId: "" -);``` +); + +``` diff --git a/docs/examples/project/create-apple-platform.md b/docs/examples/project/create-apple-platform.md index 0326c775..10dc58da 100644 --- a/docs/examples/project/create-apple-platform.md +++ b/docs/examples/project/create-apple-platform.md @@ -14,4 +14,6 @@ PlatformApple result = await project.CreateApplePlatform( platformId: "", name: "", bundleIdentifier: "" -);``` +); + +``` diff --git a/docs/examples/project/create-ephemeral-key.md b/docs/examples/project/create-ephemeral-key.md index afc4fc28..5b6226bb 100644 --- a/docs/examples/project/create-ephemeral-key.md +++ b/docs/examples/project/create-ephemeral-key.md @@ -14,4 +14,6 @@ Project project = new Project(client); EphemeralKey result = await project.CreateEphemeralKey( scopes: new List<ProjectKeyScopes> { ProjectKeyScopes.ProjectRead }, duration: 600 -);``` +); + +``` diff --git a/docs/examples/project/create-linux-platform.md b/docs/examples/project/create-linux-platform.md index 5fa6c77d..7037a09c 100644 --- a/docs/examples/project/create-linux-platform.md +++ b/docs/examples/project/create-linux-platform.md @@ -14,4 +14,6 @@ PlatformLinux result = await project.CreateLinuxPlatform( platformId: "", name: "", packageName: "" -);``` +); + +``` diff --git a/docs/examples/project/create-mock-phone.md b/docs/examples/project/create-mock-phone.md index f3d846ab..f8bb1bf5 100644 --- a/docs/examples/project/create-mock-phone.md +++ b/docs/examples/project/create-mock-phone.md @@ -13,4 +13,6 @@ Project project = new Project(client); MockNumber result = await project.CreateMockPhone( number: "+12065550100", otp: "" -);``` +); + +``` diff --git a/docs/examples/project/create-smtp-test.md b/docs/examples/project/create-smtp-test.md index 3ee832cb..d461c0cd 100644 --- a/docs/examples/project/create-smtp-test.md +++ b/docs/examples/project/create-smtp-test.md @@ -12,4 +12,6 @@ Project project = new Project(client); result = await project.CreateSMTPTest( emails: new List() -);``` +); + +``` diff --git a/docs/examples/project/create-variable.md b/docs/examples/project/create-variable.md index a49aa454..1e361c54 100644 --- a/docs/examples/project/create-variable.md +++ b/docs/examples/project/create-variable.md @@ -15,4 +15,6 @@ Variable result = await project.CreateVariable( key: "", value: "", secret: false // optional -);``` +); + +``` diff --git a/docs/examples/project/create-web-platform.md b/docs/examples/project/create-web-platform.md index 1a2bd50a..83f148a0 100644 --- a/docs/examples/project/create-web-platform.md +++ b/docs/examples/project/create-web-platform.md @@ -14,4 +14,6 @@ PlatformWeb result = await project.CreateWebPlatform( platformId: "", name: "", hostname: "app.example.com" -);``` +); + +``` diff --git a/docs/examples/project/create-windows-platform.md b/docs/examples/project/create-windows-platform.md index ab48dc3d..01eb5b90 100644 --- a/docs/examples/project/create-windows-platform.md +++ b/docs/examples/project/create-windows-platform.md @@ -14,4 +14,6 @@ PlatformWindows result = await project.CreateWindowsPlatform( platformId: "", name: "", packageIdentifierName: "" -);``` +); + +``` diff --git a/docs/examples/project/delete-key.md b/docs/examples/project/delete-key.md index 96654a14..258def64 100644 --- a/docs/examples/project/delete-key.md +++ b/docs/examples/project/delete-key.md @@ -12,4 +12,6 @@ Project project = new Project(client); await project.DeleteKey( keyId: "" -);``` +); + +``` diff --git a/docs/examples/project/delete-mock-phone.md b/docs/examples/project/delete-mock-phone.md index 3ba22dcc..c716be59 100644 --- a/docs/examples/project/delete-mock-phone.md +++ b/docs/examples/project/delete-mock-phone.md @@ -12,4 +12,6 @@ Project project = new Project(client); await project.DeleteMockPhone( number: "+12065550100" -);``` +); + +``` diff --git a/docs/examples/project/delete-platform.md b/docs/examples/project/delete-platform.md index 6eb9777a..77ddecda 100644 --- a/docs/examples/project/delete-platform.md +++ b/docs/examples/project/delete-platform.md @@ -12,4 +12,6 @@ Project project = new Project(client); await project.DeletePlatform( platformId: "" -);``` +); + +``` diff --git a/docs/examples/project/delete-variable.md b/docs/examples/project/delete-variable.md index 83762d9b..5ef1405e 100644 --- a/docs/examples/project/delete-variable.md +++ b/docs/examples/project/delete-variable.md @@ -12,4 +12,6 @@ Project project = new Project(client); await project.DeleteVariable( variableId: "" -);``` +); + +``` diff --git a/docs/examples/project/delete.md b/docs/examples/project/delete.md index 42f63b32..17f70c47 100644 --- a/docs/examples/project/delete.md +++ b/docs/examples/project/delete.md @@ -11,4 +11,6 @@ Client client = new Client() Project project = new Project(client); await project.Delete(); + + ``` diff --git a/docs/examples/project/get-email-template.md b/docs/examples/project/get-email-template.md index 64c4435a..11a331a2 100644 --- a/docs/examples/project/get-email-template.md +++ b/docs/examples/project/get-email-template.md @@ -14,4 +14,6 @@ Project project = new Project(client); 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 6b0e8192..a84c4602 100644 --- a/docs/examples/project/get-key.md +++ b/docs/examples/project/get-key.md @@ -12,4 +12,6 @@ Project project = new Project(client); Key result = await project.GetKey( keyId: "" -);``` +); + +``` diff --git a/docs/examples/project/get-mock-phone.md b/docs/examples/project/get-mock-phone.md index 70a48e59..43fea545 100644 --- a/docs/examples/project/get-mock-phone.md +++ b/docs/examples/project/get-mock-phone.md @@ -12,4 +12,6 @@ Project project = new Project(client); MockNumber result = await project.GetMockPhone( number: "+12065550100" -);``` +); + +``` diff --git a/docs/examples/project/get-o-auth-2-provider.md b/docs/examples/project/get-o-auth-2-provider.md index c7128c37..ea55cb1e 100644 --- a/docs/examples/project/get-o-auth-2-provider.md +++ b/docs/examples/project/get-o-auth-2-provider.md @@ -13,4 +13,6 @@ Project project = new Project(client); object result = await project.GetOAuth2Provider( providerId: ProjectOAuthProviderId.Amazon -);``` +); + +``` diff --git a/docs/examples/project/get-platform.md b/docs/examples/project/get-platform.md index 6dc39ce0..236eeb77 100644 --- a/docs/examples/project/get-platform.md +++ b/docs/examples/project/get-platform.md @@ -12,4 +12,6 @@ Project project = new Project(client); object result = await project.GetPlatform( platformId: "" -);``` +); + +``` diff --git a/docs/examples/project/get-policy.md b/docs/examples/project/get-policy.md index 21a1bc23..ed4e8a5f 100644 --- a/docs/examples/project/get-policy.md +++ b/docs/examples/project/get-policy.md @@ -13,4 +13,6 @@ Project project = new Project(client); object result = await project.GetPolicy( policyId: ProjectPolicyId.PasswordDictionary -);``` +); + +``` diff --git a/docs/examples/project/get-variable.md b/docs/examples/project/get-variable.md index d1283ed3..bda49739 100644 --- a/docs/examples/project/get-variable.md +++ b/docs/examples/project/get-variable.md @@ -12,4 +12,6 @@ Project project = new Project(client); Variable result = await project.GetVariable( variableId: "" -);``` +); + +``` diff --git a/docs/examples/project/get.md b/docs/examples/project/get.md index bba3b088..8dbf5a58 100644 --- a/docs/examples/project/get.md +++ b/docs/examples/project/get.md @@ -11,4 +11,6 @@ Client client = new Client() Project project = new Project(client); Project result = await project.Get(); + + ``` diff --git a/docs/examples/project/list-email-templates.md b/docs/examples/project/list-email-templates.md index 828692bf..0cd3cad1 100644 --- a/docs/examples/project/list-email-templates.md +++ b/docs/examples/project/list-email-templates.md @@ -13,4 +13,6 @@ Project project = new Project(client); EmailTemplateList result = await project.ListEmailTemplates( queries: new List(), // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/project/list-keys.md b/docs/examples/project/list-keys.md index ac4c2cf4..f006dd19 100644 --- a/docs/examples/project/list-keys.md +++ b/docs/examples/project/list-keys.md @@ -13,4 +13,6 @@ Project project = new Project(client); KeyList result = await project.ListKeys( queries: new List(), // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/project/list-mock-phones.md b/docs/examples/project/list-mock-phones.md index 9e276369..3fa07bdc 100644 --- a/docs/examples/project/list-mock-phones.md +++ b/docs/examples/project/list-mock-phones.md @@ -13,4 +13,6 @@ Project project = new Project(client); MockNumberList result = await project.ListMockPhones( queries: new List(), // 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 58413a81..9d0e7eae 100644 --- a/docs/examples/project/list-o-auth-2-providers.md +++ b/docs/examples/project/list-o-auth-2-providers.md @@ -13,4 +13,6 @@ Project project = new Project(client); OAuth2ProviderList result = await project.ListOAuth2Providers( queries: new List(), // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/project/list-platforms.md b/docs/examples/project/list-platforms.md index 066d6e0d..2a507c27 100644 --- a/docs/examples/project/list-platforms.md +++ b/docs/examples/project/list-platforms.md @@ -13,4 +13,6 @@ Project project = new Project(client); PlatformList result = await project.ListPlatforms( queries: new List(), // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/project/list-policies.md b/docs/examples/project/list-policies.md index e1045511..bbd49b4c 100644 --- a/docs/examples/project/list-policies.md +++ b/docs/examples/project/list-policies.md @@ -13,4 +13,6 @@ Project project = new Project(client); PolicyList result = await project.ListPolicies( queries: new List(), // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/project/list-variables.md b/docs/examples/project/list-variables.md index 5f6f00cc..e8107ab6 100644 --- a/docs/examples/project/list-variables.md +++ b/docs/examples/project/list-variables.md @@ -13,4 +13,6 @@ Project project = new Project(client); VariableList result = await project.ListVariables( queries: new List(), // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-android-platform.md b/docs/examples/project/update-android-platform.md index 6106dcfb..77b78b57 100644 --- a/docs/examples/project/update-android-platform.md +++ b/docs/examples/project/update-android-platform.md @@ -14,4 +14,6 @@ PlatformAndroid result = await project.UpdateAndroidPlatform( platformId: "", name: "", applicationId: "" -);``` +); + +``` diff --git a/docs/examples/project/update-apple-platform.md b/docs/examples/project/update-apple-platform.md index ebe02343..fa9ec462 100644 --- a/docs/examples/project/update-apple-platform.md +++ b/docs/examples/project/update-apple-platform.md @@ -14,4 +14,6 @@ PlatformApple result = await project.UpdateApplePlatform( platformId: "", name: "", bundleIdentifier: "" -);``` +); + +``` diff --git a/docs/examples/project/update-auth-method.md b/docs/examples/project/update-auth-method.md index 8e5b4199..0b180be2 100644 --- a/docs/examples/project/update-auth-method.md +++ b/docs/examples/project/update-auth-method.md @@ -14,4 +14,6 @@ Project project = new Project(client); 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 b902b574..50d622ea 100644 --- a/docs/examples/project/update-deny-aliased-email-policy.md +++ b/docs/examples/project/update-deny-aliased-email-policy.md @@ -12,4 +12,6 @@ Project project = new Project(client); 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 99a41b18..13e204eb 100644 --- a/docs/examples/project/update-deny-corporate-email-policy.md +++ b/docs/examples/project/update-deny-corporate-email-policy.md @@ -12,4 +12,6 @@ Project project = new Project(client); 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 3bee9a1a..7e22b31a 100644 --- a/docs/examples/project/update-deny-disposable-email-policy.md +++ b/docs/examples/project/update-deny-disposable-email-policy.md @@ -12,4 +12,6 @@ Project project = new Project(client); 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 88da981f..49ba6767 100644 --- a/docs/examples/project/update-deny-free-email-policy.md +++ b/docs/examples/project/update-deny-free-email-policy.md @@ -12,4 +12,6 @@ Project project = new Project(client); 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 97277a96..2c4c747d 100644 --- a/docs/examples/project/update-email-template.md +++ b/docs/examples/project/update-email-template.md @@ -20,4 +20,6 @@ EmailTemplate result = await project.UpdateEmailTemplate( senderEmail: "email@example.com", // optional replyToEmail: "email@example.com", // optional replyToName: "" // optional -);``` +); + +``` diff --git a/docs/examples/project/update-key.md b/docs/examples/project/update-key.md index 23da35d9..619fca4b 100644 --- a/docs/examples/project/update-key.md +++ b/docs/examples/project/update-key.md @@ -16,4 +16,6 @@ Key result = await project.UpdateKey( name: "", scopes: new List<ProjectKeyScopes> { ProjectKeyScopes.ProjectRead }, 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 22079e52..2dfe3ea8 100644 --- a/docs/examples/project/update-labels.md +++ b/docs/examples/project/update-labels.md @@ -12,4 +12,6 @@ Project project = new Project(client); Project result = await project.UpdateLabels( labels: new List() -);``` +); + +``` diff --git a/docs/examples/project/update-linux-platform.md b/docs/examples/project/update-linux-platform.md index fe94ccba..0e0be47d 100644 --- a/docs/examples/project/update-linux-platform.md +++ b/docs/examples/project/update-linux-platform.md @@ -14,4 +14,6 @@ PlatformLinux result = await project.UpdateLinuxPlatform( platformId: "", name: "", packageName: "" -);``` +); + +``` diff --git a/docs/examples/project/update-membership-privacy-policy.md b/docs/examples/project/update-membership-privacy-policy.md index bd452cf8..3e6102f6 100644 --- a/docs/examples/project/update-membership-privacy-policy.md +++ b/docs/examples/project/update-membership-privacy-policy.md @@ -17,4 +17,6 @@ Project result = await project.UpdateMembershipPrivacyPolicy( userName: false, // optional userMFA: false, // optional userAccessedAt: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-mfa-factors-policy.md b/docs/examples/project/update-mfa-factors-policy.md index b1d4ccf9..aa9ed2a5 100644 --- a/docs/examples/project/update-mfa-factors-policy.md +++ b/docs/examples/project/update-mfa-factors-policy.md @@ -15,4 +15,6 @@ Project result = await project.UpdateMFAFactorsPolicy( email: false, // optional phone: false, // optional custom: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-mock-phone.md b/docs/examples/project/update-mock-phone.md index c5a18e2b..e2c699e2 100644 --- a/docs/examples/project/update-mock-phone.md +++ b/docs/examples/project/update-mock-phone.md @@ -13,4 +13,6 @@ Project project = new Project(client); MockNumber result = await project.UpdateMockPhone( number: "+12065550100", otp: "" -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-amazon.md b/docs/examples/project/update-o-auth-2-amazon.md index 8680703d..b104edf0 100644 --- a/docs/examples/project/update-o-auth-2-amazon.md +++ b/docs/examples/project/update-o-auth-2-amazon.md @@ -14,4 +14,6 @@ OAuth2Amazon result = await project.UpdateOAuth2Amazon( clientId: "", // optional clientSecret: "", // 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 942cebc6..d36a2b98 100644 --- a/docs/examples/project/update-o-auth-2-apple.md +++ b/docs/examples/project/update-o-auth-2-apple.md @@ -16,4 +16,6 @@ OAuth2Apple result = await project.UpdateOAuth2Apple( teamId: "", // optional p8File: "", // optional enabled: 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 45aec1c8..cb38c52d 100644 --- a/docs/examples/project/update-o-auth-2-appwrite.md +++ b/docs/examples/project/update-o-auth-2-appwrite.md @@ -14,4 +14,6 @@ OAuth2Appwrite result = await project.UpdateOAuth2Appwrite( clientId: "", // optional clientSecret: "", // 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 2c212601..081f8323 100644 --- a/docs/examples/project/update-o-auth-2-auth-0.md +++ b/docs/examples/project/update-o-auth-2-auth-0.md @@ -15,4 +15,6 @@ OAuth2Auth0 result = await project.UpdateOAuth2Auth0( clientSecret: "", // optional endpoint: "", // 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 293b98e9..75107594 100644 --- a/docs/examples/project/update-o-auth-2-authentik.md +++ b/docs/examples/project/update-o-auth-2-authentik.md @@ -15,4 +15,6 @@ OAuth2Authentik result = await project.UpdateOAuth2Authentik( clientSecret: "", // optional endpoint: "", // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-autodesk.md b/docs/examples/project/update-o-auth-2-autodesk.md index 40edd2b1..836fcc55 100644 --- a/docs/examples/project/update-o-auth-2-autodesk.md +++ b/docs/examples/project/update-o-auth-2-autodesk.md @@ -14,4 +14,6 @@ OAuth2Autodesk result = await project.UpdateOAuth2Autodesk( clientId: "", // optional clientSecret: "", // 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 53f7411e..6a72900d 100644 --- a/docs/examples/project/update-o-auth-2-bitbucket.md +++ b/docs/examples/project/update-o-auth-2-bitbucket.md @@ -14,4 +14,6 @@ OAuth2Bitbucket result = await project.UpdateOAuth2Bitbucket( key: "", // optional 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 eec326fd..f46dd35a 100644 --- a/docs/examples/project/update-o-auth-2-bitly.md +++ b/docs/examples/project/update-o-auth-2-bitly.md @@ -14,4 +14,6 @@ OAuth2Bitly result = await project.UpdateOAuth2Bitly( clientId: "", // optional clientSecret: "", // 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 c1f1915b..1f331e2c 100644 --- a/docs/examples/project/update-o-auth-2-box.md +++ b/docs/examples/project/update-o-auth-2-box.md @@ -14,4 +14,6 @@ OAuth2Box result = await project.UpdateOAuth2Box( clientId: "", // optional clientSecret: "", // 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 b99bc357..87c2c478 100644 --- a/docs/examples/project/update-o-auth-2-dailymotion.md +++ b/docs/examples/project/update-o-auth-2-dailymotion.md @@ -14,4 +14,6 @@ OAuth2Dailymotion result = await project.UpdateOAuth2Dailymotion( apiKey: "", // optional apiSecret: "", // 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 7d6dc9d5..b6a92dbe 100644 --- a/docs/examples/project/update-o-auth-2-discord.md +++ b/docs/examples/project/update-o-auth-2-discord.md @@ -14,4 +14,6 @@ OAuth2Discord result = await project.UpdateOAuth2Discord( clientId: "", // optional clientSecret: "", // 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 6c7d9c7e..a7235621 100644 --- a/docs/examples/project/update-o-auth-2-disqus.md +++ b/docs/examples/project/update-o-auth-2-disqus.md @@ -14,4 +14,6 @@ OAuth2Disqus result = await project.UpdateOAuth2Disqus( publicKey: "", // optional secretKey: "", // 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 0106e913..16dd0f99 100644 --- a/docs/examples/project/update-o-auth-2-dropbox.md +++ b/docs/examples/project/update-o-auth-2-dropbox.md @@ -14,4 +14,6 @@ OAuth2Dropbox result = await project.UpdateOAuth2Dropbox( appKey: "", // optional appSecret: "", // 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 4143db45..7ffcb53f 100644 --- a/docs/examples/project/update-o-auth-2-etsy.md +++ b/docs/examples/project/update-o-auth-2-etsy.md @@ -14,4 +14,6 @@ OAuth2Etsy result = await project.UpdateOAuth2Etsy( keyString: "", // optional sharedSecret: "", // 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 ac5ebcb8..a1549973 100644 --- a/docs/examples/project/update-o-auth-2-facebook.md +++ b/docs/examples/project/update-o-auth-2-facebook.md @@ -14,4 +14,6 @@ OAuth2Facebook result = await project.UpdateOAuth2Facebook( appId: "", // optional appSecret: "", // 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 b99a6b25..4c2e8bcd 100644 --- a/docs/examples/project/update-o-auth-2-figma.md +++ b/docs/examples/project/update-o-auth-2-figma.md @@ -14,4 +14,6 @@ OAuth2Figma result = await project.UpdateOAuth2Figma( clientId: "", // optional clientSecret: "", // 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 8fa9fe55..d8515eea 100644 --- a/docs/examples/project/update-o-auth-2-fusion-auth.md +++ b/docs/examples/project/update-o-auth-2-fusion-auth.md @@ -15,4 +15,6 @@ OAuth2FusionAuth result = await project.UpdateOAuth2FusionAuth( clientSecret: "", // optional endpoint: "", // optional enabled: false // 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 5c2cf3b5..f57712e3 100644 --- a/docs/examples/project/update-o-auth-2-git-hub.md +++ b/docs/examples/project/update-o-auth-2-git-hub.md @@ -14,4 +14,6 @@ OAuth2Github result = await project.UpdateOAuth2GitHub( clientId: "", // optional clientSecret: "", // 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 b3530fb2..169b2ec8 100644 --- a/docs/examples/project/update-o-auth-2-gitlab.md +++ b/docs/examples/project/update-o-auth-2-gitlab.md @@ -15,4 +15,6 @@ OAuth2Gitlab result = await project.UpdateOAuth2Gitlab( secret: "", // optional endpoint: "https://example.com", // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-google.md b/docs/examples/project/update-o-auth-2-google.md index d9e7308a..ca498940 100644 --- a/docs/examples/project/update-o-auth-2-google.md +++ b/docs/examples/project/update-o-auth-2-google.md @@ -16,4 +16,6 @@ OAuth2Google result = await project.UpdateOAuth2Google( clientSecret: "", // optional prompt: new List<ProjectOAuth2GooglePrompt> { ProjectOAuth2GooglePrompt.None }, // optional enabled: 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 new file mode 100644 index 00000000..350640d4 --- /dev/null +++ b/docs/examples/project/update-o-auth-2-hugging-face.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 + .SetKey(""); // Your secret API key + +Project project = new Project(client); + +OAuth2HuggingFace result = await project.UpdateOAuth2HuggingFace( + clientId: "", // optional + clientSecret: "", // 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 3027251e..67b03697 100644 --- a/docs/examples/project/update-o-auth-2-keycloak.md +++ b/docs/examples/project/update-o-auth-2-keycloak.md @@ -16,4 +16,6 @@ OAuth2Keycloak result = await project.UpdateOAuth2Keycloak( endpoint: "", // optional realmName: "", // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-kick.md b/docs/examples/project/update-o-auth-2-kick.md index 8b9661bf..56cbef85 100644 --- a/docs/examples/project/update-o-auth-2-kick.md +++ b/docs/examples/project/update-o-auth-2-kick.md @@ -14,4 +14,6 @@ OAuth2Kick result = await project.UpdateOAuth2Kick( clientId: "", // optional clientSecret: "", // 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 e360cc7a..72c13842 100644 --- a/docs/examples/project/update-o-auth-2-linkedin.md +++ b/docs/examples/project/update-o-auth-2-linkedin.md @@ -14,4 +14,6 @@ OAuth2Linkedin result = await project.UpdateOAuth2Linkedin( clientId: "", // optional primaryClientSecret: "", // 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 eb8780b1..8e5afa31 100644 --- a/docs/examples/project/update-o-auth-2-microsoft.md +++ b/docs/examples/project/update-o-auth-2-microsoft.md @@ -15,4 +15,6 @@ OAuth2Microsoft result = await project.UpdateOAuth2Microsoft( applicationSecret: "", // optional tenant: "", // 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 06199ccf..a3cb7763 100644 --- a/docs/examples/project/update-o-auth-2-notion.md +++ b/docs/examples/project/update-o-auth-2-notion.md @@ -14,4 +14,6 @@ OAuth2Notion result = await project.UpdateOAuth2Notion( oauthClientId: "", // optional oauthClientSecret: "", // 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 fee55e75..5abb4932 100644 --- a/docs/examples/project/update-o-auth-2-oidc.md +++ b/docs/examples/project/update-o-auth-2-oidc.md @@ -21,4 +21,6 @@ OAuth2Oidc result = await project.UpdateOAuth2Oidc( prompt: new List<ProjectOAuth2OidcPrompt> { ProjectOAuth2OidcPrompt.None }, // optional maxAge: 0, // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-okta.md b/docs/examples/project/update-o-auth-2-okta.md index 87e3c4b4..fa2a1151 100644 --- a/docs/examples/project/update-o-auth-2-okta.md +++ b/docs/examples/project/update-o-auth-2-okta.md @@ -13,7 +13,9 @@ Project project = new Project(client); OAuth2Okta result = await project.UpdateOAuth2Okta( clientId: "", // optional clientSecret: "", // optional - domain: "", // optional + domain: "example.com", // optional authorizationServerId: "", // 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 f98cf68e..1cbc8c57 100644 --- a/docs/examples/project/update-o-auth-2-paypal-sandbox.md +++ b/docs/examples/project/update-o-auth-2-paypal-sandbox.md @@ -14,4 +14,6 @@ OAuth2Paypal result = await project.UpdateOAuth2PaypalSandbox( clientId: "", // optional secretKey: "", // 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 cb2a010f..03fc6659 100644 --- a/docs/examples/project/update-o-auth-2-paypal.md +++ b/docs/examples/project/update-o-auth-2-paypal.md @@ -14,4 +14,6 @@ OAuth2Paypal result = await project.UpdateOAuth2Paypal( clientId: "", // optional secretKey: "", // 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 1233e25b..9e8b31f6 100644 --- a/docs/examples/project/update-o-auth-2-podio.md +++ b/docs/examples/project/update-o-auth-2-podio.md @@ -14,4 +14,6 @@ OAuth2Podio result = await project.UpdateOAuth2Podio( clientId: "", // optional clientSecret: "", // 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 f87bb018..e4b6629c 100644 --- a/docs/examples/project/update-o-auth-2-salesforce.md +++ b/docs/examples/project/update-o-auth-2-salesforce.md @@ -14,4 +14,6 @@ OAuth2Salesforce result = await project.UpdateOAuth2Salesforce( customerKey: "", // optional customerSecret: "", // 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 615e1621..c43efa26 100644 --- a/docs/examples/project/update-o-auth-2-server.md +++ b/docs/examples/project/update-o-auth-2-server.md @@ -27,4 +27,6 @@ Project result = await project.UpdateOAuth2Server( deviceCodeDuration: 60, // optional defaultScopes: new List(), // optional installationScopes: new List() // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-slack.md b/docs/examples/project/update-o-auth-2-slack.md index b3ac0084..1d7cc149 100644 --- a/docs/examples/project/update-o-auth-2-slack.md +++ b/docs/examples/project/update-o-auth-2-slack.md @@ -14,4 +14,6 @@ OAuth2Slack result = await project.UpdateOAuth2Slack( clientId: "", // optional clientSecret: "", // 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 22d7b4c1..481634e4 100644 --- a/docs/examples/project/update-o-auth-2-spotify.md +++ b/docs/examples/project/update-o-auth-2-spotify.md @@ -14,4 +14,6 @@ OAuth2Spotify result = await project.UpdateOAuth2Spotify( clientId: "", // optional clientSecret: "", // 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 fbe842ff..97ce54a1 100644 --- a/docs/examples/project/update-o-auth-2-stripe.md +++ b/docs/examples/project/update-o-auth-2-stripe.md @@ -14,4 +14,6 @@ OAuth2Stripe result = await project.UpdateOAuth2Stripe( clientId: "", // optional apiSecretKey: "", // 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 18d5644c..72ab7c5a 100644 --- a/docs/examples/project/update-o-auth-2-tradeshift-sandbox.md +++ b/docs/examples/project/update-o-auth-2-tradeshift-sandbox.md @@ -14,4 +14,6 @@ OAuth2Tradeshift result = await project.UpdateOAuth2TradeshiftSandbox( oauth2ClientId: "", // optional oauth2ClientSecret: "", // 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 649f5590..01edc689 100644 --- a/docs/examples/project/update-o-auth-2-tradeshift.md +++ b/docs/examples/project/update-o-auth-2-tradeshift.md @@ -14,4 +14,6 @@ OAuth2Tradeshift result = await project.UpdateOAuth2Tradeshift( oauth2ClientId: "", // optional oauth2ClientSecret: "", // 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 30acec4a..405b7dc7 100644 --- a/docs/examples/project/update-o-auth-2-twitch.md +++ b/docs/examples/project/update-o-auth-2-twitch.md @@ -14,4 +14,6 @@ OAuth2Twitch result = await project.UpdateOAuth2Twitch( clientId: "", // optional clientSecret: "", // 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 40e387e8..60bbdfcf 100644 --- a/docs/examples/project/update-o-auth-2-word-press.md +++ b/docs/examples/project/update-o-auth-2-word-press.md @@ -14,4 +14,6 @@ OAuth2WordPress result = await project.UpdateOAuth2WordPress( clientId: "", // optional clientSecret: "", // 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 3fbc0b55..127f9786 100644 --- a/docs/examples/project/update-o-auth-2-yahoo.md +++ b/docs/examples/project/update-o-auth-2-yahoo.md @@ -14,4 +14,6 @@ OAuth2Yahoo result = await project.UpdateOAuth2Yahoo( clientId: "", // optional clientSecret: "", // 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 186d3a0c..0fcc0dc7 100644 --- a/docs/examples/project/update-o-auth-2-yandex.md +++ b/docs/examples/project/update-o-auth-2-yandex.md @@ -14,4 +14,6 @@ OAuth2Yandex result = await project.UpdateOAuth2Yandex( clientId: "", // optional clientSecret: "", // 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 3ae358d7..6347cb2b 100644 --- a/docs/examples/project/update-o-auth-2-zoho.md +++ b/docs/examples/project/update-o-auth-2-zoho.md @@ -14,4 +14,6 @@ OAuth2Zoho result = await project.UpdateOAuth2Zoho( clientId: "", // optional clientSecret: "", // 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 3398abe7..2b9d60dd 100644 --- a/docs/examples/project/update-o-auth-2-zoom.md +++ b/docs/examples/project/update-o-auth-2-zoom.md @@ -14,4 +14,6 @@ OAuth2Zoom result = await project.UpdateOAuth2Zoom( clientId: "", // optional clientSecret: "", // 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 e346ab5c..01bab140 100644 --- a/docs/examples/project/update-o-auth-2x.md +++ b/docs/examples/project/update-o-auth-2x.md @@ -14,4 +14,6 @@ OAuth2X result = await project.UpdateOAuth2X( customerKey: "", // optional secretKey: "", // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-password-dictionary-policy.md b/docs/examples/project/update-password-dictionary-policy.md index d332a214..bfcf1c3d 100644 --- a/docs/examples/project/update-password-dictionary-policy.md +++ b/docs/examples/project/update-password-dictionary-policy.md @@ -12,4 +12,6 @@ Project project = new Project(client); 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 9f74fa8b..83876154 100644 --- a/docs/examples/project/update-password-history-policy.md +++ b/docs/examples/project/update-password-history-policy.md @@ -12,4 +12,6 @@ Project project = new Project(client); 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 f6543483..e79919f2 100644 --- a/docs/examples/project/update-password-personal-data-policy.md +++ b/docs/examples/project/update-password-personal-data-policy.md @@ -12,4 +12,6 @@ Project project = new Project(client); Project result = await project.UpdatePasswordPersonalDataPolicy( enabled: false -);``` +); + +``` diff --git a/docs/examples/project/update-password-strength-policy.md b/docs/examples/project/update-password-strength-policy.md index 6394609b..7edf3050 100644 --- a/docs/examples/project/update-password-strength-policy.md +++ b/docs/examples/project/update-password-strength-policy.md @@ -16,4 +16,6 @@ PolicyPasswordStrength result = await project.UpdatePasswordStrengthPolicy( lowercase: false, // optional number: false, // optional symbols: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-protocol.md b/docs/examples/project/update-protocol.md index 0440e0b9..9a53240a 100644 --- a/docs/examples/project/update-protocol.md +++ b/docs/examples/project/update-protocol.md @@ -14,4 +14,6 @@ Project project = new Project(client); 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 fd9c1eff..8463028b 100644 --- a/docs/examples/project/update-service.md +++ b/docs/examples/project/update-service.md @@ -14,4 +14,6 @@ Project project = new Project(client); 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 14bc61a2..247fe3ce 100644 --- a/docs/examples/project/update-session-alert-policy.md +++ b/docs/examples/project/update-session-alert-policy.md @@ -12,4 +12,6 @@ Project project = new Project(client); 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 bfe9a07e..1c66cc20 100644 --- a/docs/examples/project/update-session-duration-policy.md +++ b/docs/examples/project/update-session-duration-policy.md @@ -12,4 +12,6 @@ Project project = new Project(client); 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 ba3ccc21..e354b471 100644 --- a/docs/examples/project/update-session-invalidation-policy.md +++ b/docs/examples/project/update-session-invalidation-policy.md @@ -12,4 +12,6 @@ Project project = new Project(client); 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 6b4b8017..11434253 100644 --- a/docs/examples/project/update-session-limit-policy.md +++ b/docs/examples/project/update-session-limit-policy.md @@ -12,4 +12,6 @@ Project project = new Project(client); Project result = await project.UpdateSessionLimitPolicy( total: 1 -);``` +); + +``` diff --git a/docs/examples/project/update-smtp.md b/docs/examples/project/update-smtp.md index 91c2fda2..4af1ceee 100644 --- a/docs/examples/project/update-smtp.md +++ b/docs/examples/project/update-smtp.md @@ -12,8 +12,8 @@ Client client = new Client() Project project = new Project(client); Project result = await project.UpdateSMTP( - host: "", // optional - port: 0, // optional + host: "example.com", // optional + port: 587, // optional username: "", // optional password: "password", // optional senderEmail: "email@example.com", // optional @@ -22,4 +22,6 @@ Project result = await project.UpdateSMTP( replyToName: "", // optional secure: ProjectSMTPSecure.Tls, // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-user-limit-policy.md b/docs/examples/project/update-user-limit-policy.md index aea79aaf..d24957e0 100644 --- a/docs/examples/project/update-user-limit-policy.md +++ b/docs/examples/project/update-user-limit-policy.md @@ -12,4 +12,6 @@ Project project = new Project(client); Project result = await project.UpdateUserLimitPolicy( total: 0 -);``` +); + +``` diff --git a/docs/examples/project/update-variable.md b/docs/examples/project/update-variable.md index cfdf56bd..b612ed86 100644 --- a/docs/examples/project/update-variable.md +++ b/docs/examples/project/update-variable.md @@ -15,4 +15,6 @@ Variable result = await project.UpdateVariable( key: "", // optional value: "", // optional secret: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-web-platform.md b/docs/examples/project/update-web-platform.md index 11454ea4..3d03f26d 100644 --- a/docs/examples/project/update-web-platform.md +++ b/docs/examples/project/update-web-platform.md @@ -14,4 +14,6 @@ PlatformWeb result = await project.UpdateWebPlatform( platformId: "", name: "", hostname: "app.example.com" -);``` +); + +``` diff --git a/docs/examples/project/update-windows-platform.md b/docs/examples/project/update-windows-platform.md index 42a3073d..64e21998 100644 --- a/docs/examples/project/update-windows-platform.md +++ b/docs/examples/project/update-windows-platform.md @@ -14,4 +14,6 @@ PlatformWindows result = await project.UpdateWindowsPlatform( platformId: "", name: "", packageIdentifierName: "" -);``` +); + +``` diff --git a/docs/examples/proxy/create-api-rule.md b/docs/examples/proxy/create-api-rule.md index 548dcd82..a5511bd3 100644 --- a/docs/examples/proxy/create-api-rule.md +++ b/docs/examples/proxy/create-api-rule.md @@ -11,5 +11,7 @@ Client client = new Client() Proxy proxy = new Proxy(client); ProxyRule result = await proxy.CreateAPIRule( - domain: "" -);``` + domain: "example.com" +); + +``` diff --git a/docs/examples/proxy/create-function-rule.md b/docs/examples/proxy/create-function-rule.md index c2052d56..fe1fd906 100644 --- a/docs/examples/proxy/create-function-rule.md +++ b/docs/examples/proxy/create-function-rule.md @@ -11,7 +11,9 @@ Client client = new Client() Proxy proxy = new Proxy(client); ProxyRule result = await proxy.CreateFunctionRule( - domain: "", + domain: "example.com", functionId: "", branch: "" // optional -);``` +); + +``` diff --git a/docs/examples/proxy/create-invalidation.md b/docs/examples/proxy/create-invalidation.md index 8fe43e67..0b51ed48 100644 --- a/docs/examples/proxy/create-invalidation.md +++ b/docs/examples/proxy/create-invalidation.md @@ -12,7 +12,9 @@ Client client = new Client() Proxy proxy = new Proxy(client); ProxyInvalidation result = await proxy.CreateInvalidation( - domain: "", + domain: "example.com", type: InvalidationType.Tag, reference: "" // optional -);``` +); + +``` diff --git a/docs/examples/proxy/create-redirect-rule.md b/docs/examples/proxy/create-redirect-rule.md index 494a41c2..71ffbefe 100644 --- a/docs/examples/proxy/create-redirect-rule.md +++ b/docs/examples/proxy/create-redirect-rule.md @@ -12,9 +12,11 @@ Client client = new Client() Proxy proxy = new Proxy(client); ProxyRule result = await proxy.CreateRedirectRule( - domain: "", + domain: "example.com", url: "https://example.com", statusCode: StatusCode.MovedPermanently, resourceId: "", resourceType: ProxyResourceType.Site -);``` +); + +``` diff --git a/docs/examples/proxy/create-site-rule.md b/docs/examples/proxy/create-site-rule.md index 6e29ede9..52b6b60e 100644 --- a/docs/examples/proxy/create-site-rule.md +++ b/docs/examples/proxy/create-site-rule.md @@ -11,7 +11,9 @@ Client client = new Client() Proxy proxy = new Proxy(client); ProxyRule result = await proxy.CreateSiteRule( - domain: "", + domain: "example.com", siteId: "", branch: "" // optional -);``` +); + +``` diff --git a/docs/examples/proxy/delete-rule.md b/docs/examples/proxy/delete-rule.md index c198c832..d9e9b160 100644 --- a/docs/examples/proxy/delete-rule.md +++ b/docs/examples/proxy/delete-rule.md @@ -12,4 +12,6 @@ Proxy proxy = new Proxy(client); await proxy.DeleteRule( ruleId: "" -);``` +); + +``` diff --git a/docs/examples/proxy/get-rule.md b/docs/examples/proxy/get-rule.md index edaca90d..6834db74 100644 --- a/docs/examples/proxy/get-rule.md +++ b/docs/examples/proxy/get-rule.md @@ -12,4 +12,6 @@ Proxy proxy = new Proxy(client); ProxyRule result = await proxy.GetRule( ruleId: "" -);``` +); + +``` diff --git a/docs/examples/proxy/list-rules.md b/docs/examples/proxy/list-rules.md index e38680a4..4a962d30 100644 --- a/docs/examples/proxy/list-rules.md +++ b/docs/examples/proxy/list-rules.md @@ -13,4 +13,6 @@ Proxy proxy = new Proxy(client); ProxyRuleList result = await proxy.ListRules( queries: new List(), // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/proxy/update-rule-status.md b/docs/examples/proxy/update-rule-status.md index 30f7f9e7..da3efe37 100644 --- a/docs/examples/proxy/update-rule-status.md +++ b/docs/examples/proxy/update-rule-status.md @@ -12,4 +12,6 @@ Proxy proxy = new Proxy(client); ProxyRule result = await proxy.UpdateRuleStatus( ruleId: "" -);``` +); + +``` diff --git a/docs/examples/sites/create-deployment.md b/docs/examples/sites/create-deployment.md index 692d7743..61b56268 100644 --- a/docs/examples/sites/create-deployment.md +++ b/docs/examples/sites/create-deployment.md @@ -17,4 +17,6 @@ Deployment result = await sites.CreateDeployment( buildCommand: "", // optional outputDirectory: "", // optional activate: false // optional -);``` +); + +``` diff --git a/docs/examples/sites/create-duplicate-deployment.md b/docs/examples/sites/create-duplicate-deployment.md index acca4c7c..22c70c1d 100644 --- a/docs/examples/sites/create-duplicate-deployment.md +++ b/docs/examples/sites/create-duplicate-deployment.md @@ -13,4 +13,6 @@ Sites sites = new Sites(client); Deployment result = await sites.CreateDuplicateDeployment( siteId: "", deploymentId: "" -);``` +); + +``` diff --git a/docs/examples/sites/create-template-deployment.md b/docs/examples/sites/create-template-deployment.md index 306a9653..769fcc1c 100644 --- a/docs/examples/sites/create-template-deployment.md +++ b/docs/examples/sites/create-template-deployment.md @@ -19,4 +19,6 @@ Deployment result = await sites.CreateTemplateDeployment( type: TemplateReferenceType.Branch, reference: "", activate: false // optional -);``` +); + +``` diff --git a/docs/examples/sites/create-variable.md b/docs/examples/sites/create-variable.md index 551e381a..9e9d1ef7 100644 --- a/docs/examples/sites/create-variable.md +++ b/docs/examples/sites/create-variable.md @@ -16,4 +16,6 @@ Variable result = await sites.CreateVariable( key: "", value: "", secret: false // optional -);``` +); + +``` diff --git a/docs/examples/sites/create-vcs-deployment.md b/docs/examples/sites/create-vcs-deployment.md index 8a4a618d..42ec3756 100644 --- a/docs/examples/sites/create-vcs-deployment.md +++ b/docs/examples/sites/create-vcs-deployment.md @@ -16,4 +16,6 @@ Deployment result = await sites.CreateVcsDeployment( type: VCSReferenceType.Branch, reference: "", activate: false // optional -);``` +); + +``` diff --git a/docs/examples/sites/create.md b/docs/examples/sites/create.md index 65fd4f07..9b2d5b52 100644 --- a/docs/examples/sites/create.md +++ b/docs/examples/sites/create.md @@ -32,7 +32,10 @@ Site result = await sites.Create( providerRootDirectory: "", // optional providerBranches: new List(), // optional providerPaths: new List(), // optional - buildSpecification: "", // optional - runtimeSpecification: "", // optional - deploymentRetention: 0 // optional -);``` + buildSpecification: "s-1vcpu-512mb", // optional + runtimeSpecification: "s-1vcpu-512mb", // optional + deploymentRetention: 0, // optional + scopes: new List<ProjectKeyScopes> { ProjectKeyScopes.ProjectRead } // optional +); + +``` diff --git a/docs/examples/sites/delete-deployment.md b/docs/examples/sites/delete-deployment.md index fb457b05..be144088 100644 --- a/docs/examples/sites/delete-deployment.md +++ b/docs/examples/sites/delete-deployment.md @@ -13,4 +13,6 @@ Sites sites = new Sites(client); await sites.DeleteDeployment( siteId: "", deploymentId: "" -);``` +); + +``` diff --git a/docs/examples/sites/delete-log.md b/docs/examples/sites/delete-log.md index a5aebb19..576be3fb 100644 --- a/docs/examples/sites/delete-log.md +++ b/docs/examples/sites/delete-log.md @@ -13,4 +13,6 @@ Sites sites = new Sites(client); await sites.DeleteLog( siteId: "", logId: "" -);``` +); + +``` diff --git a/docs/examples/sites/delete-variable.md b/docs/examples/sites/delete-variable.md index 2b79ffeb..0d7d68be 100644 --- a/docs/examples/sites/delete-variable.md +++ b/docs/examples/sites/delete-variable.md @@ -13,4 +13,6 @@ Sites sites = new Sites(client); await sites.DeleteVariable( siteId: "", variableId: "" -);``` +); + +``` diff --git a/docs/examples/sites/delete.md b/docs/examples/sites/delete.md index 2e1470f6..80510f15 100644 --- a/docs/examples/sites/delete.md +++ b/docs/examples/sites/delete.md @@ -12,4 +12,6 @@ Sites sites = new Sites(client); await sites.Delete( siteId: "" -);``` +); + +``` diff --git a/docs/examples/sites/get-deployment-download.md b/docs/examples/sites/get-deployment-download.md index 457f1532..e4f0985b 100644 --- a/docs/examples/sites/get-deployment-download.md +++ b/docs/examples/sites/get-deployment-download.md @@ -16,4 +16,6 @@ byte[] result = await sites.GetDeploymentDownload( deploymentId: "", type: DeploymentDownloadType.Source, // optional token: "" // optional -);``` +); + +``` diff --git a/docs/examples/sites/get-deployment.md b/docs/examples/sites/get-deployment.md index f92ffb42..dfd86dfc 100644 --- a/docs/examples/sites/get-deployment.md +++ b/docs/examples/sites/get-deployment.md @@ -13,4 +13,6 @@ Sites sites = new Sites(client); Deployment result = await sites.GetDeployment( siteId: "", deploymentId: "" -);``` +); + +``` diff --git a/docs/examples/sites/get-log.md b/docs/examples/sites/get-log.md index 822bcdbd..caa38be7 100644 --- a/docs/examples/sites/get-log.md +++ b/docs/examples/sites/get-log.md @@ -13,4 +13,6 @@ Sites sites = new Sites(client); Execution result = await sites.GetLog( siteId: "", logId: "" -);``` +); + +``` diff --git a/docs/examples/sites/get-variable.md b/docs/examples/sites/get-variable.md index 75c28abd..9a68b661 100644 --- a/docs/examples/sites/get-variable.md +++ b/docs/examples/sites/get-variable.md @@ -13,4 +13,6 @@ Sites sites = new Sites(client); Variable result = await sites.GetVariable( siteId: "", variableId: "" -);``` +); + +``` diff --git a/docs/examples/sites/get.md b/docs/examples/sites/get.md index 6863555c..7c1885cb 100644 --- a/docs/examples/sites/get.md +++ b/docs/examples/sites/get.md @@ -12,4 +12,6 @@ Sites sites = new Sites(client); Site result = await sites.Get( siteId: "" -);``` +); + +``` diff --git a/docs/examples/sites/list-deployments.md b/docs/examples/sites/list-deployments.md index 39acb57c..b25172e2 100644 --- a/docs/examples/sites/list-deployments.md +++ b/docs/examples/sites/list-deployments.md @@ -15,4 +15,6 @@ DeploymentList result = await sites.ListDeployments( queries: new List(), // optional search: "", // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/sites/list-frameworks.md b/docs/examples/sites/list-frameworks.md index 8d802f7f..7a3165f9 100644 --- a/docs/examples/sites/list-frameworks.md +++ b/docs/examples/sites/list-frameworks.md @@ -11,4 +11,6 @@ Client client = new Client() Sites sites = new Sites(client); FrameworkList result = await sites.ListFrameworks(); + + ``` diff --git a/docs/examples/sites/list-logs.md b/docs/examples/sites/list-logs.md index 36463eeb..baee6c91 100644 --- a/docs/examples/sites/list-logs.md +++ b/docs/examples/sites/list-logs.md @@ -14,4 +14,6 @@ ExecutionList result = await sites.ListLogs( siteId: "", queries: new List(), // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/sites/list-specifications.md b/docs/examples/sites/list-specifications.md index af963654..12d18408 100644 --- a/docs/examples/sites/list-specifications.md +++ b/docs/examples/sites/list-specifications.md @@ -12,4 +12,6 @@ Sites sites = new Sites(client); SpecificationList result = await sites.ListSpecifications( type: "runtimes" // optional -);``` +); + +``` diff --git a/docs/examples/sites/list-variables.md b/docs/examples/sites/list-variables.md index 0f3d254f..8f546817 100644 --- a/docs/examples/sites/list-variables.md +++ b/docs/examples/sites/list-variables.md @@ -14,4 +14,6 @@ VariableList result = await sites.ListVariables( siteId: "", queries: new List(), // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/sites/list.md b/docs/examples/sites/list.md index fe543e7c..27c4f659 100644 --- a/docs/examples/sites/list.md +++ b/docs/examples/sites/list.md @@ -14,4 +14,6 @@ SiteList result = await sites.List( queries: new List(), // optional search: "", // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/sites/update-deployment-status.md b/docs/examples/sites/update-deployment-status.md index 322c8cc1..0a6bf240 100644 --- a/docs/examples/sites/update-deployment-status.md +++ b/docs/examples/sites/update-deployment-status.md @@ -13,4 +13,6 @@ Sites sites = new Sites(client); Deployment result = await sites.UpdateDeploymentStatus( siteId: "", deploymentId: "" -);``` +); + +``` diff --git a/docs/examples/sites/update-site-deployment.md b/docs/examples/sites/update-site-deployment.md index 4f75e1f3..8633ab7e 100644 --- a/docs/examples/sites/update-site-deployment.md +++ b/docs/examples/sites/update-site-deployment.md @@ -13,4 +13,6 @@ Sites sites = new Sites(client); Site result = await sites.UpdateSiteDeployment( siteId: "", deploymentId: "" -);``` +); + +``` diff --git a/docs/examples/sites/update-variable.md b/docs/examples/sites/update-variable.md index 2b1e1662..e7236cef 100644 --- a/docs/examples/sites/update-variable.md +++ b/docs/examples/sites/update-variable.md @@ -16,4 +16,6 @@ Variable result = await sites.UpdateVariable( key: "", // optional value: "", // optional secret: false // optional -);``` +); + +``` diff --git a/docs/examples/sites/update.md b/docs/examples/sites/update.md index 5a7fd0ca..8c812841 100644 --- a/docs/examples/sites/update.md +++ b/docs/examples/sites/update.md @@ -32,7 +32,10 @@ Site result = await sites.Update( providerRootDirectory: "", // optional providerBranches: new List(), // optional providerPaths: new List(), // optional - buildSpecification: "", // optional - runtimeSpecification: "", // optional - deploymentRetention: 0 // optional -);``` + buildSpecification: "s-1vcpu-512mb", // optional + runtimeSpecification: "s-1vcpu-512mb", // optional + deploymentRetention: 0, // optional + scopes: new List<ProjectKeyScopes> { ProjectKeyScopes.ProjectRead } // optional +); + +``` diff --git a/docs/examples/storage/create-bucket.md b/docs/examples/storage/create-bucket.md index 6ccdb33e..bdbd46a9 100644 --- a/docs/examples/storage/create-bucket.md +++ b/docs/examples/storage/create-bucket.md @@ -23,4 +23,6 @@ Bucket result = await storage.CreateBucket( encryption: false, // optional antivirus: false, // optional transformations: false // optional -);``` +); + +``` diff --git a/docs/examples/storage/create-file.md b/docs/examples/storage/create-file.md index c471f283..32cbd1d3 100644 --- a/docs/examples/storage/create-file.md +++ b/docs/examples/storage/create-file.md @@ -15,5 +15,7 @@ File result = await storage.CreateFile( fileId: "", file: InputFile.FromPath("./path-to-files/image.jpg"), permissions: new List { Permission.Read(Role.Any()) }, // optional - folder: "" // optional -);``` + folder: "photos/2026" // optional +); + +``` diff --git a/docs/examples/storage/delete-bucket.md b/docs/examples/storage/delete-bucket.md index dfee759b..7203b3fb 100644 --- a/docs/examples/storage/delete-bucket.md +++ b/docs/examples/storage/delete-bucket.md @@ -12,4 +12,6 @@ Storage storage = new Storage(client); await storage.DeleteBucket( bucketId: "" -);``` +); + +``` diff --git a/docs/examples/storage/delete-file.md b/docs/examples/storage/delete-file.md index a637341b..cc540d6d 100644 --- a/docs/examples/storage/delete-file.md +++ b/docs/examples/storage/delete-file.md @@ -13,4 +13,6 @@ Storage storage = new Storage(client); await storage.DeleteFile( bucketId: "", fileId: "" -);``` +); + +``` diff --git a/docs/examples/storage/get-bucket.md b/docs/examples/storage/get-bucket.md index 27d9e405..8c1edda2 100644 --- a/docs/examples/storage/get-bucket.md +++ b/docs/examples/storage/get-bucket.md @@ -12,4 +12,6 @@ Storage storage = new Storage(client); Bucket result = await storage.GetBucket( bucketId: "" -);``` +); + +``` diff --git a/docs/examples/storage/get-file-download.md b/docs/examples/storage/get-file-download.md index 02ad30d5..0cb45475 100644 --- a/docs/examples/storage/get-file-download.md +++ b/docs/examples/storage/get-file-download.md @@ -14,4 +14,6 @@ byte[] result = await storage.GetFileDownload( bucketId: "", fileId: "", token: "" // optional -);``` +); + +``` diff --git a/docs/examples/storage/get-file-preview.md b/docs/examples/storage/get-file-preview.md index cc3d88a8..0f8ae58d 100644 --- a/docs/examples/storage/get-file-preview.md +++ b/docs/examples/storage/get-file-preview.md @@ -19,11 +19,13 @@ byte[] result = await storage.GetFilePreview( gravity: ImageGravity.Center, // optional quality: -1, // optional borderWidth: 0, // optional - borderColor: "", // optional + borderColor: "FFFFFF", // optional borderRadius: 0, // optional opacity: 0, // optional rotation: -360, // optional - background: "", // optional + background: "FFFFFF", // optional output: ImageFormat.Jpg, // optional token: "" // optional -);``` +); + +``` diff --git a/docs/examples/storage/get-file-view.md b/docs/examples/storage/get-file-view.md index b9088d00..5639caef 100644 --- a/docs/examples/storage/get-file-view.md +++ b/docs/examples/storage/get-file-view.md @@ -14,4 +14,6 @@ byte[] result = await storage.GetFileView( bucketId: "", fileId: "", token: "" // optional -);``` +); + +``` diff --git a/docs/examples/storage/get-file.md b/docs/examples/storage/get-file.md index 769386ed..925a7b5d 100644 --- a/docs/examples/storage/get-file.md +++ b/docs/examples/storage/get-file.md @@ -13,4 +13,6 @@ Storage storage = new Storage(client); File result = await storage.GetFile( bucketId: "", fileId: "" -);``` +); + +``` diff --git a/docs/examples/storage/list-buckets.md b/docs/examples/storage/list-buckets.md index 5580b727..df214567 100644 --- a/docs/examples/storage/list-buckets.md +++ b/docs/examples/storage/list-buckets.md @@ -14,4 +14,6 @@ BucketList result = await storage.ListBuckets( queries: new List(), // optional search: "", // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/storage/list-files.md b/docs/examples/storage/list-files.md index 93943019..756aeb9f 100644 --- a/docs/examples/storage/list-files.md +++ b/docs/examples/storage/list-files.md @@ -15,4 +15,6 @@ FileList result = await storage.ListFiles( queries: new List(), // optional search: "", // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/storage/update-bucket.md b/docs/examples/storage/update-bucket.md index c68d001c..6e31cb35 100644 --- a/docs/examples/storage/update-bucket.md +++ b/docs/examples/storage/update-bucket.md @@ -23,4 +23,6 @@ Bucket result = await storage.UpdateBucket( encryption: false, // optional antivirus: false, // optional transformations: false // optional -);``` +); + +``` diff --git a/docs/examples/storage/update-file.md b/docs/examples/storage/update-file.md index df3e7373..a2b7013c 100644 --- a/docs/examples/storage/update-file.md +++ b/docs/examples/storage/update-file.md @@ -15,4 +15,6 @@ File result = await storage.UpdateFile( fileId: "", name: "", // optional permissions: new List { Permission.Read(Role.Any()) } // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/create-big-int-column.md b/docs/examples/tablesdb/create-big-int-column.md index 58137859..9849dc44 100644 --- a/docs/examples/tablesdb/create-big-int-column.md +++ b/docs/examples/tablesdb/create-big-int-column.md @@ -13,10 +13,12 @@ TablesDB tablesDB = new TablesDB(client); ColumnBigint result = await tablesDB.CreateBigIntColumn( databaseId: "", tableId: "", - key: "", + key: "", required: false, min: 0, // optional - max: 0, // optional + max: 1000000, // optional default: 0, // optional array: false // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/create-boolean-column.md b/docs/examples/tablesdb/create-boolean-column.md index 67cefc22..d4d17767 100644 --- a/docs/examples/tablesdb/create-boolean-column.md +++ b/docs/examples/tablesdb/create-boolean-column.md @@ -13,8 +13,10 @@ TablesDB tablesDB = new TablesDB(client); ColumnBoolean result = await tablesDB.CreateBooleanColumn( databaseId: "", tableId: "", - key: "", + key: "", required: false, default: false, // optional array: false // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/create-datetime-column.md b/docs/examples/tablesdb/create-datetime-column.md index 23f02dff..0739c6cf 100644 --- a/docs/examples/tablesdb/create-datetime-column.md +++ b/docs/examples/tablesdb/create-datetime-column.md @@ -13,8 +13,10 @@ TablesDB tablesDB = new TablesDB(client); ColumnDatetime result = await tablesDB.CreateDatetimeColumn( databaseId: "", tableId: "", - key: "", + key: "", required: false, default: "2020-10-15T06:38:00.000+00:00", // optional array: false // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/create-email-column.md b/docs/examples/tablesdb/create-email-column.md index 4c07c436..b5879ca4 100644 --- a/docs/examples/tablesdb/create-email-column.md +++ b/docs/examples/tablesdb/create-email-column.md @@ -13,8 +13,10 @@ TablesDB tablesDB = new TablesDB(client); ColumnEmail result = await tablesDB.CreateEmailColumn( databaseId: "", tableId: "", - key: "", + key: "", required: false, default: "email@example.com", // optional array: false // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/create-enum-column.md b/docs/examples/tablesdb/create-enum-column.md index ebe5d6b7..7a855e5d 100644 --- a/docs/examples/tablesdb/create-enum-column.md +++ b/docs/examples/tablesdb/create-enum-column.md @@ -13,9 +13,11 @@ TablesDB tablesDB = new TablesDB(client); ColumnEnum result = await tablesDB.CreateEnumColumn( databaseId: "", tableId: "", - key: "", - elements: new List(), + key: "", + elements: ["active", "inactive"], required: false, - default: "", // optional + default: "active", // optional array: false // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/create-failover.md b/docs/examples/tablesdb/create-failover.md index 897e9df9..8eee23f4 100644 --- a/docs/examples/tablesdb/create-failover.md +++ b/docs/examples/tablesdb/create-failover.md @@ -13,4 +13,6 @@ TablesDB tablesDB = new TablesDB(client); DedicatedDatabase result = await tablesDB.CreateFailover( databaseId: "", targetReplicaId: "" // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/create-float-column.md b/docs/examples/tablesdb/create-float-column.md index 2a0c5023..8d7293a5 100644 --- a/docs/examples/tablesdb/create-float-column.md +++ b/docs/examples/tablesdb/create-float-column.md @@ -13,10 +13,12 @@ TablesDB tablesDB = new TablesDB(client); ColumnFloat result = await tablesDB.CreateFloatColumn( databaseId: "", tableId: "", - key: "", + key: "", required: false, min: 0, // optional - max: 0, // optional - default: 0, // optional + max: 100, // optional + default: 10.5, // optional array: false // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/create-index.md b/docs/examples/tablesdb/create-index.md index 46bfcd27..df5d61e3 100644 --- a/docs/examples/tablesdb/create-index.md +++ b/docs/examples/tablesdb/create-index.md @@ -14,9 +14,11 @@ TablesDB tablesDB = new TablesDB(client); ColumnIndex result = await tablesDB.CreateIndex( databaseId: "", tableId: "", - key: "", + key: "", type: TablesDBIndexType.Key, columns: new List(), orders: new List<OrderBy> { OrderBy.Asc }, // optional lengths: new List() // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/create-integer-column.md b/docs/examples/tablesdb/create-integer-column.md index 4f822041..60ecc4c1 100644 --- a/docs/examples/tablesdb/create-integer-column.md +++ b/docs/examples/tablesdb/create-integer-column.md @@ -13,10 +13,12 @@ TablesDB tablesDB = new TablesDB(client); ColumnInteger result = await tablesDB.CreateIntegerColumn( databaseId: "", tableId: "", - key: "", + key: "", required: false, min: 0, // optional - max: 0, // optional - default: 0, // optional + max: 100, // optional + default: 10, // optional array: false // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/create-ip-column.md b/docs/examples/tablesdb/create-ip-column.md index bf996e72..dea6f8a0 100644 --- a/docs/examples/tablesdb/create-ip-column.md +++ b/docs/examples/tablesdb/create-ip-column.md @@ -13,8 +13,10 @@ TablesDB tablesDB = new TablesDB(client); ColumnIp result = await tablesDB.CreateIpColumn( databaseId: "", tableId: "", - key: "", + key: "", required: false, - default: "", // optional + default: "192.0.2.0", // optional array: false // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/create-line-column.md b/docs/examples/tablesdb/create-line-column.md index e3d438a2..3f7ae338 100644 --- a/docs/examples/tablesdb/create-line-column.md +++ b/docs/examples/tablesdb/create-line-column.md @@ -13,7 +13,9 @@ TablesDB tablesDB = new TablesDB(client); ColumnLine result = await tablesDB.CreateLineColumn( databaseId: "", tableId: "", - key: "", + key: "", required: false, default: [[1, 2], [3, 4], [5, 6]] // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/create-longtext-column.md b/docs/examples/tablesdb/create-longtext-column.md index 9846702d..7f63f462 100644 --- a/docs/examples/tablesdb/create-longtext-column.md +++ b/docs/examples/tablesdb/create-longtext-column.md @@ -13,9 +13,11 @@ TablesDB tablesDB = new TablesDB(client); ColumnLongtext result = await tablesDB.CreateLongtextColumn( databaseId: "", tableId: "", - key: "", + key: "", required: false, - default: "", // optional + default: "Hello World", // optional array: false, // optional encrypt: false // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/create-mediumtext-column.md b/docs/examples/tablesdb/create-mediumtext-column.md index 8d69db7d..f834cf24 100644 --- a/docs/examples/tablesdb/create-mediumtext-column.md +++ b/docs/examples/tablesdb/create-mediumtext-column.md @@ -13,9 +13,11 @@ TablesDB tablesDB = new TablesDB(client); ColumnMediumtext result = await tablesDB.CreateMediumtextColumn( databaseId: "", tableId: "", - key: "", + key: "", required: false, - default: "", // optional + default: "Hello World", // optional array: false, // optional encrypt: false // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/create-migration.md b/docs/examples/tablesdb/create-migration.md index 8318f4f6..863f223c 100644 --- a/docs/examples/tablesdb/create-migration.md +++ b/docs/examples/tablesdb/create-migration.md @@ -14,4 +14,6 @@ DatabaseMigration result = await tablesDB.CreateMigration( databaseId: "", specification: "s-1vcpu-1gb", autoCutover: false // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/create-operations.md b/docs/examples/tablesdb/create-operations.md index 1d5b385a..e7e92df1 100644 --- a/docs/examples/tablesdb/create-operations.md +++ b/docs/examples/tablesdb/create-operations.md @@ -23,4 +23,6 @@ Transaction result = await tablesDB.CreateOperations( } } ] // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/create-point-column.md b/docs/examples/tablesdb/create-point-column.md index 318e8eb7..aa787a48 100644 --- a/docs/examples/tablesdb/create-point-column.md +++ b/docs/examples/tablesdb/create-point-column.md @@ -13,7 +13,9 @@ TablesDB tablesDB = new TablesDB(client); ColumnPoint result = await tablesDB.CreatePointColumn( databaseId: "", tableId: "", - key: "", + key: "", required: false, default: [1, 2] // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/create-polygon-column.md b/docs/examples/tablesdb/create-polygon-column.md index f39ceeb5..c667492f 100644 --- a/docs/examples/tablesdb/create-polygon-column.md +++ b/docs/examples/tablesdb/create-polygon-column.md @@ -13,7 +13,9 @@ TablesDB tablesDB = new TablesDB(client); ColumnPolygon result = await tablesDB.CreatePolygonColumn( databaseId: "", tableId: "", - key: "", + key: "", required: false, default: [[[1, 2], [3, 4], [5, 6], [1, 2]]] // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/create-relationship-column.md b/docs/examples/tablesdb/create-relationship-column.md index 003d9b8c..2ad3e365 100644 --- a/docs/examples/tablesdb/create-relationship-column.md +++ b/docs/examples/tablesdb/create-relationship-column.md @@ -17,7 +17,9 @@ ColumnRelationship result = await tablesDB.CreateRelationshipColumn( relatedTableId: "", type: RelationshipType.OneToOne, twoWay: false, // optional - key: "", // optional - twoWayKey: "", // optional + key: "", // optional + twoWayKey: "", // optional onDelete: RelationMutate.Cascade // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/create-row.md b/docs/examples/tablesdb/create-row.md index 4f6112b8..05cbe3ce 100644 --- a/docs/examples/tablesdb/create-row.md +++ b/docs/examples/tablesdb/create-row.md @@ -23,4 +23,6 @@ Row result = await tablesDB.CreateRow( }, permissions: new List { Permission.Read(Role.Any()) }, // optional transactionId: "" // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/create-rows.md b/docs/examples/tablesdb/create-rows.md index 2a8a07b7..868c515a 100644 --- a/docs/examples/tablesdb/create-rows.md +++ b/docs/examples/tablesdb/create-rows.md @@ -15,4 +15,6 @@ RowList result = await tablesDB.CreateRows( tableId: "", rows: new List(), transactionId: "" // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/create-string-column.md b/docs/examples/tablesdb/create-string-column.md index 28f5e4c3..70d55283 100644 --- a/docs/examples/tablesdb/create-string-column.md +++ b/docs/examples/tablesdb/create-string-column.md @@ -13,10 +13,12 @@ TablesDB tablesDB = new TablesDB(client); ColumnString result = await tablesDB.CreateStringColumn( databaseId: "", tableId: "", - key: "", + key: "", size: 1, required: false, - default: "", // optional + default: "Hello World", // optional array: false, // optional encrypt: false // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/create-table.md b/docs/examples/tablesdb/create-table.md index 242456de..f7781fc7 100644 --- a/docs/examples/tablesdb/create-table.md +++ b/docs/examples/tablesdb/create-table.md @@ -19,4 +19,6 @@ Table result = await tablesDB.CreateTable( enabled: false, // optional columns: new List(), // optional indexes: new List() // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/create-text-column.md b/docs/examples/tablesdb/create-text-column.md index efde4ad8..ae046a6a 100644 --- a/docs/examples/tablesdb/create-text-column.md +++ b/docs/examples/tablesdb/create-text-column.md @@ -13,9 +13,11 @@ TablesDB tablesDB = new TablesDB(client); ColumnText result = await tablesDB.CreateTextColumn( databaseId: "", tableId: "", - key: "", + key: "", required: false, - default: "", // optional + default: "Hello World", // optional array: false, // optional encrypt: false // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/create-transaction.md b/docs/examples/tablesdb/create-transaction.md index 9fea42b8..cc3845f0 100644 --- a/docs/examples/tablesdb/create-transaction.md +++ b/docs/examples/tablesdb/create-transaction.md @@ -12,4 +12,6 @@ TablesDB tablesDB = new TablesDB(client); 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 1df7b2e9..de79303f 100644 --- a/docs/examples/tablesdb/create-url-column.md +++ b/docs/examples/tablesdb/create-url-column.md @@ -13,8 +13,10 @@ TablesDB tablesDB = new TablesDB(client); ColumnUrl result = await tablesDB.CreateUrlColumn( databaseId: "", tableId: "", - key: "", + key: "", required: false, default: "https://example.com", // optional array: false // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/create-varchar-column.md b/docs/examples/tablesdb/create-varchar-column.md index 5656c9c2..507c8dd4 100644 --- a/docs/examples/tablesdb/create-varchar-column.md +++ b/docs/examples/tablesdb/create-varchar-column.md @@ -13,10 +13,12 @@ TablesDB tablesDB = new TablesDB(client); ColumnVarchar result = await tablesDB.CreateVarcharColumn( databaseId: "", tableId: "", - key: "", + key: "", size: 1, required: false, - default: "", // optional + default: "Hello World", // optional array: false, // optional encrypt: false // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/create.md b/docs/examples/tablesdb/create.md index 717cca18..8175c0eb 100644 --- a/docs/examples/tablesdb/create.md +++ b/docs/examples/tablesdb/create.md @@ -17,4 +17,6 @@ Database result = await tablesDB.Create( specification: "serverless", // optional replicas: 0, // optional syncMode: "async" // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/cutover-migration.md b/docs/examples/tablesdb/cutover-migration.md index e82c3a25..1fd78e64 100644 --- a/docs/examples/tablesdb/cutover-migration.md +++ b/docs/examples/tablesdb/cutover-migration.md @@ -13,4 +13,6 @@ TablesDB tablesDB = new TablesDB(client); DatabaseMigration result = await tablesDB.CutoverMigration( databaseId: "", migrationId: "" -);``` +); + +``` diff --git a/docs/examples/tablesdb/decrement-row-column.md b/docs/examples/tablesdb/decrement-row-column.md index b91aed74..c7a97020 100644 --- a/docs/examples/tablesdb/decrement-row-column.md +++ b/docs/examples/tablesdb/decrement-row-column.md @@ -14,8 +14,10 @@ Row result = await tablesDB.DecrementRowColumn( databaseId: "", tableId: "", rowId: "", - column: "", - value: 0, // optional + column: "", + value: 1, // optional min: 0, // optional transactionId: "" // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/delete-column.md b/docs/examples/tablesdb/delete-column.md index edd94325..fbb62253 100644 --- a/docs/examples/tablesdb/delete-column.md +++ b/docs/examples/tablesdb/delete-column.md @@ -13,5 +13,7 @@ TablesDB tablesDB = new TablesDB(client); await tablesDB.DeleteColumn( databaseId: "", tableId: "", - key: "" -);``` + key: "" +); + +``` diff --git a/docs/examples/tablesdb/delete-index.md b/docs/examples/tablesdb/delete-index.md index e52f9655..ccf44a5f 100644 --- a/docs/examples/tablesdb/delete-index.md +++ b/docs/examples/tablesdb/delete-index.md @@ -13,5 +13,7 @@ TablesDB tablesDB = new TablesDB(client); await tablesDB.DeleteIndex( databaseId: "", tableId: "", - key: "" -);``` + key: "" +); + +``` diff --git a/docs/examples/tablesdb/delete-migration.md b/docs/examples/tablesdb/delete-migration.md index 4be3a7cc..84541e14 100644 --- a/docs/examples/tablesdb/delete-migration.md +++ b/docs/examples/tablesdb/delete-migration.md @@ -13,4 +13,6 @@ TablesDB tablesDB = new TablesDB(client); await tablesDB.DeleteMigration( databaseId: "", migrationId: "" -);``` +); + +``` diff --git a/docs/examples/tablesdb/delete-row.md b/docs/examples/tablesdb/delete-row.md index 9186473c..51c0168e 100644 --- a/docs/examples/tablesdb/delete-row.md +++ b/docs/examples/tablesdb/delete-row.md @@ -15,4 +15,6 @@ await tablesDB.DeleteRow( tableId: "", rowId: "", transactionId: "" // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/delete-rows.md b/docs/examples/tablesdb/delete-rows.md index 57762ab4..1cfdfe72 100644 --- a/docs/examples/tablesdb/delete-rows.md +++ b/docs/examples/tablesdb/delete-rows.md @@ -15,4 +15,6 @@ await tablesDB.DeleteRows( tableId: "", queries: new List(), // optional transactionId: "" // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/delete-table.md b/docs/examples/tablesdb/delete-table.md index 89af4df8..486d1cfd 100644 --- a/docs/examples/tablesdb/delete-table.md +++ b/docs/examples/tablesdb/delete-table.md @@ -13,4 +13,6 @@ TablesDB tablesDB = new TablesDB(client); await tablesDB.DeleteTable( databaseId: "", tableId: "" -);``` +); + +``` diff --git a/docs/examples/tablesdb/delete-transaction.md b/docs/examples/tablesdb/delete-transaction.md index 42fdcc14..1fc1ced4 100644 --- a/docs/examples/tablesdb/delete-transaction.md +++ b/docs/examples/tablesdb/delete-transaction.md @@ -12,4 +12,6 @@ TablesDB tablesDB = new TablesDB(client); await tablesDB.DeleteTransaction( transactionId: "" -);``` +); + +``` diff --git a/docs/examples/tablesdb/delete.md b/docs/examples/tablesdb/delete.md index 051de970..8af9ed67 100644 --- a/docs/examples/tablesdb/delete.md +++ b/docs/examples/tablesdb/delete.md @@ -12,4 +12,6 @@ TablesDB tablesDB = new TablesDB(client); await tablesDB.Delete( databaseId: "" -);``` +); + +``` diff --git a/docs/examples/tablesdb/get-column.md b/docs/examples/tablesdb/get-column.md index 70242d92..c0d9c042 100644 --- a/docs/examples/tablesdb/get-column.md +++ b/docs/examples/tablesdb/get-column.md @@ -13,5 +13,7 @@ TablesDB tablesDB = new TablesDB(client); object result = await tablesDB.GetColumn( databaseId: "", tableId: "", - key: "" -);``` + key: "" +); + +``` diff --git a/docs/examples/tablesdb/get-index.md b/docs/examples/tablesdb/get-index.md index 66cdd1ca..45cb4826 100644 --- a/docs/examples/tablesdb/get-index.md +++ b/docs/examples/tablesdb/get-index.md @@ -13,5 +13,7 @@ TablesDB tablesDB = new TablesDB(client); ColumnIndex result = await tablesDB.GetIndex( databaseId: "", tableId: "", - key: "" -);``` + key: "" +); + +``` diff --git a/docs/examples/tablesdb/get-migration.md b/docs/examples/tablesdb/get-migration.md index 9e5e1525..de4d85e3 100644 --- a/docs/examples/tablesdb/get-migration.md +++ b/docs/examples/tablesdb/get-migration.md @@ -13,4 +13,6 @@ TablesDB tablesDB = new TablesDB(client); DatabaseMigration result = await tablesDB.GetMigration( databaseId: "", migrationId: "" -);``` +); + +``` diff --git a/docs/examples/tablesdb/get-replicas.md b/docs/examples/tablesdb/get-replicas.md index 1001b30e..1053522f 100644 --- a/docs/examples/tablesdb/get-replicas.md +++ b/docs/examples/tablesdb/get-replicas.md @@ -12,4 +12,6 @@ TablesDB tablesDB = new TablesDB(client); DedicatedDatabaseReplicas result = await tablesDB.GetReplicas( databaseId: "" -);``` +); + +``` diff --git a/docs/examples/tablesdb/get-row.md b/docs/examples/tablesdb/get-row.md index 21af7c4d..83c1f61e 100644 --- a/docs/examples/tablesdb/get-row.md +++ b/docs/examples/tablesdb/get-row.md @@ -16,4 +16,6 @@ Row result = await tablesDB.GetRow( rowId: "", queries: new List(), // optional transactionId: "" // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/get-status.md b/docs/examples/tablesdb/get-status.md index 73917886..5cc588fb 100644 --- a/docs/examples/tablesdb/get-status.md +++ b/docs/examples/tablesdb/get-status.md @@ -12,4 +12,6 @@ TablesDB tablesDB = new TablesDB(client); DatabaseStatus result = await tablesDB.GetStatus( databaseId: "" -);``` +); + +``` diff --git a/docs/examples/tablesdb/get-table.md b/docs/examples/tablesdb/get-table.md index 9932f84c..e5f5c4e4 100644 --- a/docs/examples/tablesdb/get-table.md +++ b/docs/examples/tablesdb/get-table.md @@ -13,4 +13,6 @@ TablesDB tablesDB = new TablesDB(client); Table result = await tablesDB.GetTable( databaseId: "", tableId: "" -);``` +); + +``` diff --git a/docs/examples/tablesdb/get-transaction.md b/docs/examples/tablesdb/get-transaction.md index a3d72b1a..9bfeeb63 100644 --- a/docs/examples/tablesdb/get-transaction.md +++ b/docs/examples/tablesdb/get-transaction.md @@ -12,4 +12,6 @@ TablesDB tablesDB = new TablesDB(client); Transaction result = await tablesDB.GetTransaction( transactionId: "" -);``` +); + +``` diff --git a/docs/examples/tablesdb/get.md b/docs/examples/tablesdb/get.md index 85e7223f..daa759ab 100644 --- a/docs/examples/tablesdb/get.md +++ b/docs/examples/tablesdb/get.md @@ -12,4 +12,6 @@ TablesDB tablesDB = new TablesDB(client); Database result = await tablesDB.Get( databaseId: "" -);``` +); + +``` diff --git a/docs/examples/tablesdb/increment-row-column.md b/docs/examples/tablesdb/increment-row-column.md index fc594b90..16d13fbc 100644 --- a/docs/examples/tablesdb/increment-row-column.md +++ b/docs/examples/tablesdb/increment-row-column.md @@ -14,8 +14,10 @@ Row result = await tablesDB.IncrementRowColumn( databaseId: "", tableId: "", rowId: "", - column: "", - value: 0, // optional - max: 0, // optional + column: "", + value: 1, // optional + max: 100, // optional transactionId: "" // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/list-columns.md b/docs/examples/tablesdb/list-columns.md index 5d459077..fdb00a25 100644 --- a/docs/examples/tablesdb/list-columns.md +++ b/docs/examples/tablesdb/list-columns.md @@ -15,4 +15,6 @@ ColumnList result = await tablesDB.ListColumns( tableId: "", queries: new List(), // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/list-indexes.md b/docs/examples/tablesdb/list-indexes.md index 3942b400..f2b039a4 100644 --- a/docs/examples/tablesdb/list-indexes.md +++ b/docs/examples/tablesdb/list-indexes.md @@ -15,4 +15,6 @@ ColumnIndexList result = await tablesDB.ListIndexes( tableId: "", queries: new List(), // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/list-migrations.md b/docs/examples/tablesdb/list-migrations.md index 4fce8998..a7b88cb9 100644 --- a/docs/examples/tablesdb/list-migrations.md +++ b/docs/examples/tablesdb/list-migrations.md @@ -12,4 +12,6 @@ TablesDB tablesDB = new TablesDB(client); DatabaseMigrationList result = await tablesDB.ListMigrations( databaseId: "" -);``` +); + +``` diff --git a/docs/examples/tablesdb/list-operations.md b/docs/examples/tablesdb/list-operations.md index a4599ac5..daaa2868 100644 --- a/docs/examples/tablesdb/list-operations.md +++ b/docs/examples/tablesdb/list-operations.md @@ -12,7 +12,9 @@ TablesDB tablesDB = new TablesDB(client); DedicatedDatabaseOperationList result = await tablesDB.ListOperations( databaseId: "", - status: "running", // optional + status: "queued", // optional limit: 1, // optional offset: 0 // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/list-rows.md b/docs/examples/tablesdb/list-rows.md index e9186378..66e085fd 100644 --- a/docs/examples/tablesdb/list-rows.md +++ b/docs/examples/tablesdb/list-rows.md @@ -17,4 +17,6 @@ RowList result = await tablesDB.ListRows( transactionId: "", // optional total: false, // optional ttl: 0 // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/list-specifications.md b/docs/examples/tablesdb/list-specifications.md index 4672e263..262b9fd3 100644 --- a/docs/examples/tablesdb/list-specifications.md +++ b/docs/examples/tablesdb/list-specifications.md @@ -11,4 +11,6 @@ Client client = new Client() TablesDB tablesDB = new TablesDB(client); DedicatedDatabaseSpecificationList result = await tablesDB.ListSpecifications(); + + ``` diff --git a/docs/examples/tablesdb/list-tables.md b/docs/examples/tablesdb/list-tables.md index 1d8c95c2..89c2e7b5 100644 --- a/docs/examples/tablesdb/list-tables.md +++ b/docs/examples/tablesdb/list-tables.md @@ -15,4 +15,6 @@ TableList result = await tablesDB.ListTables( queries: new List(), // optional search: "", // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/list-transactions.md b/docs/examples/tablesdb/list-transactions.md index fe7b4a43..6d7db9ab 100644 --- a/docs/examples/tablesdb/list-transactions.md +++ b/docs/examples/tablesdb/list-transactions.md @@ -12,4 +12,6 @@ TablesDB tablesDB = new TablesDB(client); TransactionList result = await tablesDB.ListTransactions( queries: new List() // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/list.md b/docs/examples/tablesdb/list.md index f3d19ac7..6f082930 100644 --- a/docs/examples/tablesdb/list.md +++ b/docs/examples/tablesdb/list.md @@ -14,4 +14,6 @@ DatabaseList result = await tablesDB.List( queries: new List(), // optional 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 1ac27c47..381d02b2 100644 --- a/docs/examples/tablesdb/update-big-int-column.md +++ b/docs/examples/tablesdb/update-big-int-column.md @@ -13,10 +13,12 @@ TablesDB tablesDB = new TablesDB(client); ColumnBigint result = await tablesDB.UpdateBigIntColumn( databaseId: "", tableId: "", - key: "", + key: "", required: false, default: 0, min: 0, // optional - max: 0, // optional - newKey: "" // optional -);``` + max: 1000000, // optional + newKey: "" // optional +); + +``` diff --git a/docs/examples/tablesdb/update-boolean-column.md b/docs/examples/tablesdb/update-boolean-column.md index 4c7763fd..5f7685ec 100644 --- a/docs/examples/tablesdb/update-boolean-column.md +++ b/docs/examples/tablesdb/update-boolean-column.md @@ -13,8 +13,10 @@ TablesDB tablesDB = new TablesDB(client); ColumnBoolean result = await tablesDB.UpdateBooleanColumn( databaseId: "", tableId: "", - key: "", + key: "", required: false, default: false, - newKey: "" // optional -);``` + newKey: "" // optional +); + +``` diff --git a/docs/examples/tablesdb/update-datetime-column.md b/docs/examples/tablesdb/update-datetime-column.md index efd202c5..f659279c 100644 --- a/docs/examples/tablesdb/update-datetime-column.md +++ b/docs/examples/tablesdb/update-datetime-column.md @@ -13,8 +13,10 @@ TablesDB tablesDB = new TablesDB(client); ColumnDatetime result = await tablesDB.UpdateDatetimeColumn( databaseId: "", tableId: "", - key: "", + key: "", required: false, default: "2020-10-15T06:38:00.000+00:00", - newKey: "" // optional -);``` + newKey: "" // optional +); + +``` diff --git a/docs/examples/tablesdb/update-email-column.md b/docs/examples/tablesdb/update-email-column.md index 6661c900..c8f5d912 100644 --- a/docs/examples/tablesdb/update-email-column.md +++ b/docs/examples/tablesdb/update-email-column.md @@ -13,8 +13,10 @@ TablesDB tablesDB = new TablesDB(client); ColumnEmail result = await tablesDB.UpdateEmailColumn( databaseId: "", tableId: "", - key: "", + key: "", required: false, default: "email@example.com", - newKey: "" // optional -);``` + newKey: "" // optional +); + +``` diff --git a/docs/examples/tablesdb/update-enum-column.md b/docs/examples/tablesdb/update-enum-column.md index 30024727..404fc413 100644 --- a/docs/examples/tablesdb/update-enum-column.md +++ b/docs/examples/tablesdb/update-enum-column.md @@ -13,9 +13,11 @@ TablesDB tablesDB = new TablesDB(client); ColumnEnum result = await tablesDB.UpdateEnumColumn( databaseId: "", tableId: "", - key: "", - elements: new List(), + key: "", + elements: ["active", "inactive"], required: false, - default: "", - newKey: "" // optional -);``` + default: "active", + newKey: "" // optional +); + +``` diff --git a/docs/examples/tablesdb/update-float-column.md b/docs/examples/tablesdb/update-float-column.md index 24f28a92..7983743e 100644 --- a/docs/examples/tablesdb/update-float-column.md +++ b/docs/examples/tablesdb/update-float-column.md @@ -13,10 +13,12 @@ TablesDB tablesDB = new TablesDB(client); ColumnFloat result = await tablesDB.UpdateFloatColumn( databaseId: "", tableId: "", - key: "", + key: "", required: false, - default: 0, + default: 10.5, min: 0, // optional - max: 0, // optional - newKey: "" // optional -);``` + max: 100, // optional + newKey: "" // optional +); + +``` diff --git a/docs/examples/tablesdb/update-integer-column.md b/docs/examples/tablesdb/update-integer-column.md index 0390d353..22b8ab20 100644 --- a/docs/examples/tablesdb/update-integer-column.md +++ b/docs/examples/tablesdb/update-integer-column.md @@ -13,10 +13,12 @@ TablesDB tablesDB = new TablesDB(client); ColumnInteger result = await tablesDB.UpdateIntegerColumn( databaseId: "", tableId: "", - key: "", + key: "", required: false, - default: 0, + default: 10, min: 0, // optional - max: 0, // optional - newKey: "" // optional -);``` + max: 100, // optional + newKey: "" // optional +); + +``` diff --git a/docs/examples/tablesdb/update-ip-column.md b/docs/examples/tablesdb/update-ip-column.md index 218342f5..30a9c595 100644 --- a/docs/examples/tablesdb/update-ip-column.md +++ b/docs/examples/tablesdb/update-ip-column.md @@ -13,8 +13,10 @@ TablesDB tablesDB = new TablesDB(client); ColumnIp result = await tablesDB.UpdateIpColumn( databaseId: "", tableId: "", - key: "", + key: "", required: false, - default: "", - newKey: "" // optional -);``` + default: "192.0.2.0", + newKey: "" // optional +); + +``` diff --git a/docs/examples/tablesdb/update-line-column.md b/docs/examples/tablesdb/update-line-column.md index 8aac5599..91291e3f 100644 --- a/docs/examples/tablesdb/update-line-column.md +++ b/docs/examples/tablesdb/update-line-column.md @@ -13,8 +13,10 @@ TablesDB tablesDB = new TablesDB(client); ColumnLine result = await tablesDB.UpdateLineColumn( databaseId: "", tableId: "", - key: "", + key: "", required: false, default: [[1, 2], [3, 4], [5, 6]], // optional - newKey: "" // optional -);``` + newKey: "" // optional +); + +``` diff --git a/docs/examples/tablesdb/update-longtext-column.md b/docs/examples/tablesdb/update-longtext-column.md index d7abb4f4..c240a496 100644 --- a/docs/examples/tablesdb/update-longtext-column.md +++ b/docs/examples/tablesdb/update-longtext-column.md @@ -13,8 +13,10 @@ TablesDB tablesDB = new TablesDB(client); ColumnLongtext result = await tablesDB.UpdateLongtextColumn( databaseId: "", tableId: "", - key: "", + key: "", required: false, - default: "", - newKey: "" // optional -);``` + default: "Hello World", + newKey: "" // optional +); + +``` diff --git a/docs/examples/tablesdb/update-mediumtext-column.md b/docs/examples/tablesdb/update-mediumtext-column.md index 3a8a490f..592d8afa 100644 --- a/docs/examples/tablesdb/update-mediumtext-column.md +++ b/docs/examples/tablesdb/update-mediumtext-column.md @@ -13,8 +13,10 @@ TablesDB tablesDB = new TablesDB(client); ColumnMediumtext result = await tablesDB.UpdateMediumtextColumn( databaseId: "", tableId: "", - key: "", + key: "", required: false, - default: "", - newKey: "" // optional -);``` + default: "Hello World", + newKey: "" // optional +); + +``` diff --git a/docs/examples/tablesdb/update-point-column.md b/docs/examples/tablesdb/update-point-column.md index a976260a..4e2dcc07 100644 --- a/docs/examples/tablesdb/update-point-column.md +++ b/docs/examples/tablesdb/update-point-column.md @@ -13,8 +13,10 @@ TablesDB tablesDB = new TablesDB(client); ColumnPoint result = await tablesDB.UpdatePointColumn( databaseId: "", tableId: "", - key: "", + key: "", required: false, default: [1, 2], // optional - newKey: "" // optional -);``` + newKey: "" // optional +); + +``` diff --git a/docs/examples/tablesdb/update-polygon-column.md b/docs/examples/tablesdb/update-polygon-column.md index f19a0717..5ecd1b80 100644 --- a/docs/examples/tablesdb/update-polygon-column.md +++ b/docs/examples/tablesdb/update-polygon-column.md @@ -13,8 +13,10 @@ TablesDB tablesDB = new TablesDB(client); ColumnPolygon result = await tablesDB.UpdatePolygonColumn( databaseId: "", tableId: "", - key: "", + key: "", required: false, default: [[[1, 2], [3, 4], [5, 6], [1, 2]]], // optional - newKey: "" // optional -);``` + newKey: "" // optional +); + +``` diff --git a/docs/examples/tablesdb/update-relationship-column.md b/docs/examples/tablesdb/update-relationship-column.md index 36cc97d2..8d75dd0a 100644 --- a/docs/examples/tablesdb/update-relationship-column.md +++ b/docs/examples/tablesdb/update-relationship-column.md @@ -14,7 +14,9 @@ TablesDB tablesDB = new TablesDB(client); ColumnRelationship result = await tablesDB.UpdateRelationshipColumn( databaseId: "", tableId: "", - key: "", + key: "", onDelete: RelationMutate.Cascade, // optional - newKey: "" // optional -);``` + newKey: "" // optional +); + +``` diff --git a/docs/examples/tablesdb/update-row.md b/docs/examples/tablesdb/update-row.md index 54e6ca16..03f71f61 100644 --- a/docs/examples/tablesdb/update-row.md +++ b/docs/examples/tablesdb/update-row.md @@ -23,4 +23,6 @@ Row result = await tablesDB.UpdateRow( }, // optional permissions: new List { Permission.Read(Role.Any()) }, // optional transactionId: "" // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/update-rows.md b/docs/examples/tablesdb/update-rows.md index 0fe6b38b..9e4c497b 100644 --- a/docs/examples/tablesdb/update-rows.md +++ b/docs/examples/tablesdb/update-rows.md @@ -22,4 +22,6 @@ RowList result = await tablesDB.UpdateRows( }, // optional queries: new List(), // optional transactionId: "" // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/update-string-column.md b/docs/examples/tablesdb/update-string-column.md index c0b860db..bf0849e2 100644 --- a/docs/examples/tablesdb/update-string-column.md +++ b/docs/examples/tablesdb/update-string-column.md @@ -13,9 +13,11 @@ TablesDB tablesDB = new TablesDB(client); ColumnString result = await tablesDB.UpdateStringColumn( databaseId: "", tableId: "", - key: "", + key: "", required: false, - default: "", + default: "Hello World", size: 1, // optional - newKey: "" // optional -);``` + newKey: "" // optional +); + +``` diff --git a/docs/examples/tablesdb/update-table.md b/docs/examples/tablesdb/update-table.md index fd23907e..e7a22821 100644 --- a/docs/examples/tablesdb/update-table.md +++ b/docs/examples/tablesdb/update-table.md @@ -18,4 +18,6 @@ Table result = await tablesDB.UpdateTable( rowSecurity: false, // optional enabled: false, // optional purge: false // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/update-text-column.md b/docs/examples/tablesdb/update-text-column.md index da4fefaa..0ee26e04 100644 --- a/docs/examples/tablesdb/update-text-column.md +++ b/docs/examples/tablesdb/update-text-column.md @@ -13,8 +13,10 @@ TablesDB tablesDB = new TablesDB(client); ColumnText result = await tablesDB.UpdateTextColumn( databaseId: "", tableId: "", - key: "", + key: "", required: false, - default: "", - newKey: "" // optional -);``` + default: "Hello World", + newKey: "" // optional +); + +``` diff --git a/docs/examples/tablesdb/update-transaction.md b/docs/examples/tablesdb/update-transaction.md index 99e6a017..2010f673 100644 --- a/docs/examples/tablesdb/update-transaction.md +++ b/docs/examples/tablesdb/update-transaction.md @@ -14,4 +14,6 @@ Transaction result = await tablesDB.UpdateTransaction( transactionId: "", 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 10761c90..f32ce01a 100644 --- a/docs/examples/tablesdb/update-url-column.md +++ b/docs/examples/tablesdb/update-url-column.md @@ -13,8 +13,10 @@ TablesDB tablesDB = new TablesDB(client); ColumnUrl result = await tablesDB.UpdateUrlColumn( databaseId: "", tableId: "", - key: "", + key: "", required: false, default: "https://example.com", - newKey: "" // optional -);``` + newKey: "" // optional +); + +``` diff --git a/docs/examples/tablesdb/update-varchar-column.md b/docs/examples/tablesdb/update-varchar-column.md index 948be687..3cd1f9c0 100644 --- a/docs/examples/tablesdb/update-varchar-column.md +++ b/docs/examples/tablesdb/update-varchar-column.md @@ -13,9 +13,11 @@ TablesDB tablesDB = new TablesDB(client); ColumnVarchar result = await tablesDB.UpdateVarcharColumn( databaseId: "", tableId: "", - key: "", + key: "", required: false, - default: "", + default: "Hello World", size: 1, // optional - newKey: "" // optional -);``` + newKey: "" // optional +); + +``` diff --git a/docs/examples/tablesdb/update.md b/docs/examples/tablesdb/update.md index 132a1681..8b28a996 100644 --- a/docs/examples/tablesdb/update.md +++ b/docs/examples/tablesdb/update.md @@ -17,4 +17,6 @@ Database result = await tablesDB.Update( specification: "serverless", // optional replicas: 0, // optional syncMode: "async" // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/upsert-row.md b/docs/examples/tablesdb/upsert-row.md index 5f3c4d28..ef38e305 100644 --- a/docs/examples/tablesdb/upsert-row.md +++ b/docs/examples/tablesdb/upsert-row.md @@ -23,4 +23,6 @@ Row result = await tablesDB.UpsertRow( }, // optional permissions: new List { Permission.Read(Role.Any()) }, // optional transactionId: "" // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/upsert-rows.md b/docs/examples/tablesdb/upsert-rows.md index b1fbe191..41d3bcd8 100644 --- a/docs/examples/tablesdb/upsert-rows.md +++ b/docs/examples/tablesdb/upsert-rows.md @@ -15,4 +15,6 @@ RowList result = await tablesDB.UpsertRows( tableId: "", rows: new List(), transactionId: "" // optional -);``` +); + +``` diff --git a/docs/examples/teams/create-installation.md b/docs/examples/teams/create-installation.md index 8cc34ef6..217d0a23 100644 --- a/docs/examples/teams/create-installation.md +++ b/docs/examples/teams/create-installation.md @@ -14,4 +14,6 @@ AppInstallation result = await teams.CreateInstallation( teamId: "", appId: "", authorizationDetails: "" // optional -);``` +); + +``` diff --git a/docs/examples/teams/create-membership.md b/docs/examples/teams/create-membership.md index f107bbc5..1092050b 100644 --- a/docs/examples/teams/create-membership.md +++ b/docs/examples/teams/create-membership.md @@ -18,4 +18,6 @@ Membership result = await teams.CreateMembership( phone: "+12065550100", // optional url: "https://example.com", // optional name: "" // optional -);``` +); + +``` diff --git a/docs/examples/teams/create.md b/docs/examples/teams/create.md index ead315a9..fdc1e09c 100644 --- a/docs/examples/teams/create.md +++ b/docs/examples/teams/create.md @@ -14,4 +14,6 @@ Team result = await teams.Create( teamId: "", name: "", roles: new List() // optional -);``` +); + +``` diff --git a/docs/examples/teams/delete-installation.md b/docs/examples/teams/delete-installation.md index b2a63291..d9d4263a 100644 --- a/docs/examples/teams/delete-installation.md +++ b/docs/examples/teams/delete-installation.md @@ -13,4 +13,6 @@ Teams teams = new Teams(client); await teams.DeleteInstallation( teamId: "", installationId: "" -);``` +); + +``` diff --git a/docs/examples/teams/delete-membership.md b/docs/examples/teams/delete-membership.md index ac7ff432..e7b8bb31 100644 --- a/docs/examples/teams/delete-membership.md +++ b/docs/examples/teams/delete-membership.md @@ -13,4 +13,6 @@ Teams teams = new Teams(client); await teams.DeleteMembership( teamId: "", membershipId: "" -);``` +); + +``` diff --git a/docs/examples/teams/delete.md b/docs/examples/teams/delete.md index 67f20dee..b1054418 100644 --- a/docs/examples/teams/delete.md +++ b/docs/examples/teams/delete.md @@ -12,4 +12,6 @@ Teams teams = new Teams(client); await teams.Delete( teamId: "" -);``` +); + +``` diff --git a/docs/examples/teams/get-installation.md b/docs/examples/teams/get-installation.md index 48546fe8..e23c4781 100644 --- a/docs/examples/teams/get-installation.md +++ b/docs/examples/teams/get-installation.md @@ -13,4 +13,6 @@ Teams teams = new Teams(client); AppInstallation result = await teams.GetInstallation( teamId: "", installationId: "" -);``` +); + +``` diff --git a/docs/examples/teams/get-membership.md b/docs/examples/teams/get-membership.md index f8c0cd0b..f359df1a 100644 --- a/docs/examples/teams/get-membership.md +++ b/docs/examples/teams/get-membership.md @@ -13,4 +13,6 @@ Teams teams = new Teams(client); Membership result = await teams.GetMembership( teamId: "", membershipId: "" -);``` +); + +``` diff --git a/docs/examples/teams/get-prefs.md b/docs/examples/teams/get-prefs.md index b8a790a1..95a8c288 100644 --- a/docs/examples/teams/get-prefs.md +++ b/docs/examples/teams/get-prefs.md @@ -12,4 +12,6 @@ Teams teams = new Teams(client); Preferences result = await teams.GetPrefs( teamId: "" -);``` +); + +``` diff --git a/docs/examples/teams/get.md b/docs/examples/teams/get.md index 0ad3fd3c..900d932d 100644 --- a/docs/examples/teams/get.md +++ b/docs/examples/teams/get.md @@ -12,4 +12,6 @@ Teams teams = new Teams(client); Team result = await teams.Get( teamId: "" -);``` +); + +``` diff --git a/docs/examples/teams/list-installations.md b/docs/examples/teams/list-installations.md index 7f29bdca..133f4278 100644 --- a/docs/examples/teams/list-installations.md +++ b/docs/examples/teams/list-installations.md @@ -14,4 +14,6 @@ AppInstallationList result = await teams.ListInstallations( teamId: "", queries: new List(), // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/teams/list-memberships.md b/docs/examples/teams/list-memberships.md index 85fe50cd..64c25747 100644 --- a/docs/examples/teams/list-memberships.md +++ b/docs/examples/teams/list-memberships.md @@ -15,4 +15,6 @@ MembershipList result = await teams.ListMemberships( queries: new List(), // optional search: "", // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/teams/list.md b/docs/examples/teams/list.md index d345222a..571c8663 100644 --- a/docs/examples/teams/list.md +++ b/docs/examples/teams/list.md @@ -14,4 +14,6 @@ TeamList result = await teams.List( queries: new List(), // optional search: "", // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/teams/update-installation.md b/docs/examples/teams/update-installation.md index d64faf09..7fa98101 100644 --- a/docs/examples/teams/update-installation.md +++ b/docs/examples/teams/update-installation.md @@ -14,4 +14,6 @@ AppInstallation result = await teams.UpdateInstallation( teamId: "", installationId: "", authorizationDetails: "" // optional -);``` +); + +``` diff --git a/docs/examples/teams/update-membership-status.md b/docs/examples/teams/update-membership-status.md index 05d763d3..1f172dab 100644 --- a/docs/examples/teams/update-membership-status.md +++ b/docs/examples/teams/update-membership-status.md @@ -15,4 +15,6 @@ Membership result = await teams.UpdateMembershipStatus( membershipId: "", userId: "", secret: "" -);``` +); + +``` diff --git a/docs/examples/teams/update-membership.md b/docs/examples/teams/update-membership.md index 6aef545f..ff4ad455 100644 --- a/docs/examples/teams/update-membership.md +++ b/docs/examples/teams/update-membership.md @@ -14,4 +14,6 @@ Membership result = await teams.UpdateMembership( teamId: "", membershipId: "", roles: new List() -);``` +); + +``` diff --git a/docs/examples/teams/update-name.md b/docs/examples/teams/update-name.md index e3161e1b..6f42ce5c 100644 --- a/docs/examples/teams/update-name.md +++ b/docs/examples/teams/update-name.md @@ -13,4 +13,6 @@ Teams teams = new Teams(client); Team result = await teams.UpdateName( teamId: "", name: "" -);``` +); + +``` diff --git a/docs/examples/teams/update-prefs.md b/docs/examples/teams/update-prefs.md index fdfa9e0d..b2dbac7a 100644 --- a/docs/examples/teams/update-prefs.md +++ b/docs/examples/teams/update-prefs.md @@ -13,4 +13,6 @@ Teams teams = new Teams(client); Preferences result = await teams.UpdatePrefs( teamId: "", prefs: [object] -);``` +); + +``` diff --git a/docs/examples/tokens/create-file-token.md b/docs/examples/tokens/create-file-token.md index 4960c042..baf4c376 100644 --- a/docs/examples/tokens/create-file-token.md +++ b/docs/examples/tokens/create-file-token.md @@ -14,4 +14,6 @@ ResourceToken result = await tokens.CreateFileToken( bucketId: "", fileId: "", expire: "2020-10-15T06:38:00.000+00:00" // optional -);``` +); + +``` diff --git a/docs/examples/tokens/delete.md b/docs/examples/tokens/delete.md index 22004e28..9b186358 100644 --- a/docs/examples/tokens/delete.md +++ b/docs/examples/tokens/delete.md @@ -12,4 +12,6 @@ Tokens tokens = new Tokens(client); await tokens.Delete( tokenId: "" -);``` +); + +``` diff --git a/docs/examples/tokens/get.md b/docs/examples/tokens/get.md index 274b3432..5466ae87 100644 --- a/docs/examples/tokens/get.md +++ b/docs/examples/tokens/get.md @@ -12,4 +12,6 @@ Tokens tokens = new Tokens(client); ResourceToken result = await tokens.Get( tokenId: "" -);``` +); + +``` diff --git a/docs/examples/tokens/list.md b/docs/examples/tokens/list.md index 0cc4dc4b..45e027d4 100644 --- a/docs/examples/tokens/list.md +++ b/docs/examples/tokens/list.md @@ -15,4 +15,6 @@ ResourceTokenList result = await tokens.List( fileId: "", queries: new List(), // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/tokens/update.md b/docs/examples/tokens/update.md index 6cd7dee0..041dce97 100644 --- a/docs/examples/tokens/update.md +++ b/docs/examples/tokens/update.md @@ -13,4 +13,6 @@ Tokens tokens = new Tokens(client); ResourceToken result = await tokens.Update( tokenId: "", 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 0962eff6..6c4ba635 100644 --- a/docs/examples/users/create-argon-2-user.md +++ b/docs/examples/users/create-argon-2-user.md @@ -15,4 +15,6 @@ User result = await users.CreateArgon2User( email: "email@example.com", password: "password", name: "" // optional -);``` +); + +``` diff --git a/docs/examples/users/create-bcrypt-user.md b/docs/examples/users/create-bcrypt-user.md index bdcfd9a8..d4a70e5b 100644 --- a/docs/examples/users/create-bcrypt-user.md +++ b/docs/examples/users/create-bcrypt-user.md @@ -15,4 +15,6 @@ User result = await users.CreateBcryptUser( email: "email@example.com", password: "password", name: "" // optional -);``` +); + +``` diff --git a/docs/examples/users/create-jwt.md b/docs/examples/users/create-jwt.md index 2c6d9770..0841f4ea 100644 --- a/docs/examples/users/create-jwt.md +++ b/docs/examples/users/create-jwt.md @@ -12,6 +12,8 @@ Users users = new Users(client); JWT result = await users.CreateJWT( userId: "", - sessionId: "", // optional + 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 5fc94ca7..26825711 100644 --- a/docs/examples/users/create-md-5-user.md +++ b/docs/examples/users/create-md-5-user.md @@ -15,4 +15,6 @@ User result = await users.CreateMD5User( email: "email@example.com", password: "password", name: "" // optional -);``` +); + +``` diff --git a/docs/examples/users/create-mfa-recovery-codes.md b/docs/examples/users/create-mfa-recovery-codes.md index 453e66c2..02a34ab9 100644 --- a/docs/examples/users/create-mfa-recovery-codes.md +++ b/docs/examples/users/create-mfa-recovery-codes.md @@ -12,4 +12,6 @@ Users users = new Users(client); MfaRecoveryCodes result = await users.CreateMFARecoveryCodes( userId: "" -);``` +); + +``` diff --git a/docs/examples/users/create-ph-pass-user.md b/docs/examples/users/create-ph-pass-user.md index 0d6b7fae..efcc9f27 100644 --- a/docs/examples/users/create-ph-pass-user.md +++ b/docs/examples/users/create-ph-pass-user.md @@ -15,4 +15,6 @@ User result = await users.CreatePHPassUser( email: "email@example.com", password: "password", name: "" // optional -);``` +); + +``` diff --git a/docs/examples/users/create-scrypt-modified-user.md b/docs/examples/users/create-scrypt-modified-user.md index 640cdb8f..687282b2 100644 --- a/docs/examples/users/create-scrypt-modified-user.md +++ b/docs/examples/users/create-scrypt-modified-user.md @@ -18,4 +18,6 @@ User result = await users.CreateScryptModifiedUser( passwordSaltSeparator: "", passwordSignerKey: "", name: "" // optional -);``` +); + +``` diff --git a/docs/examples/users/create-scrypt-user.md b/docs/examples/users/create-scrypt-user.md index 47f4d8e1..ee7e61a1 100644 --- a/docs/examples/users/create-scrypt-user.md +++ b/docs/examples/users/create-scrypt-user.md @@ -15,9 +15,11 @@ User result = await users.CreateScryptUser( email: "email@example.com", password: "password", passwordSalt: "", - passwordCpu: 0, - passwordMemory: 0, - passwordParallel: 0, - passwordLength: 0, + passwordCpu: 8, + passwordMemory: 65536, + passwordParallel: 1, + passwordLength: 64, name: "" // optional -);``` +); + +``` diff --git a/docs/examples/users/create-session.md b/docs/examples/users/create-session.md index 78cd1d2b..5ca7121f 100644 --- a/docs/examples/users/create-session.md +++ b/docs/examples/users/create-session.md @@ -12,4 +12,6 @@ Users users = new Users(client); Session result = await users.CreateSession( userId: "" -);``` +); + +``` diff --git a/docs/examples/users/create-sha-user.md b/docs/examples/users/create-sha-user.md index 9c8d13b7..8dd3a160 100644 --- a/docs/examples/users/create-sha-user.md +++ b/docs/examples/users/create-sha-user.md @@ -17,4 +17,6 @@ User result = await users.CreateSHAUser( password: "password", passwordVersion: PasswordHash.Sha1, // optional name: "" // optional -);``` +); + +``` diff --git a/docs/examples/users/create-target.md b/docs/examples/users/create-target.md index 17129125..281996df 100644 --- a/docs/examples/users/create-target.md +++ b/docs/examples/users/create-target.md @@ -18,4 +18,6 @@ Target result = await users.CreateTarget( identifier: "", providerId: "", // optional name: "" // optional -);``` +); + +``` diff --git a/docs/examples/users/create-token.md b/docs/examples/users/create-token.md index 5e8fd9e3..3d929346 100644 --- a/docs/examples/users/create-token.md +++ b/docs/examples/users/create-token.md @@ -14,4 +14,6 @@ Token result = await users.CreateToken( userId: "", length: 4, // optional expire: 60 // optional -);``` +); + +``` diff --git a/docs/examples/users/create.md b/docs/examples/users/create.md index dd8d684c..fb2a8095 100644 --- a/docs/examples/users/create.md +++ b/docs/examples/users/create.md @@ -16,4 +16,6 @@ User result = await users.Create( phone: "+12065550100", // optional password: "password", // optional name: "" // optional -);``` +); + +``` diff --git a/docs/examples/users/delete-identity.md b/docs/examples/users/delete-identity.md index 1237f3a4..bc55fed8 100644 --- a/docs/examples/users/delete-identity.md +++ b/docs/examples/users/delete-identity.md @@ -12,4 +12,6 @@ Users users = new Users(client); await users.DeleteIdentity( identityId: "" -);``` +); + +``` diff --git a/docs/examples/users/delete-mfa-authenticator.md b/docs/examples/users/delete-mfa-authenticator.md index 7b311319..82ddb00f 100644 --- a/docs/examples/users/delete-mfa-authenticator.md +++ b/docs/examples/users/delete-mfa-authenticator.md @@ -14,4 +14,6 @@ Users users = new Users(client); await users.DeleteMFAAuthenticator( userId: "", type: AuthenticatorType.Totp -);``` +); + +``` diff --git a/docs/examples/users/delete-session.md b/docs/examples/users/delete-session.md index 5d0282d5..c0cbbf02 100644 --- a/docs/examples/users/delete-session.md +++ b/docs/examples/users/delete-session.md @@ -13,4 +13,6 @@ Users users = new Users(client); await users.DeleteSession( userId: "", sessionId: "" -);``` +); + +``` diff --git a/docs/examples/users/delete-sessions.md b/docs/examples/users/delete-sessions.md index 26b2cac1..6fcb9d0c 100644 --- a/docs/examples/users/delete-sessions.md +++ b/docs/examples/users/delete-sessions.md @@ -12,4 +12,6 @@ Users users = new Users(client); await users.DeleteSessions( userId: "" -);``` +); + +``` diff --git a/docs/examples/users/delete-target.md b/docs/examples/users/delete-target.md index 60bbc5a6..b496d645 100644 --- a/docs/examples/users/delete-target.md +++ b/docs/examples/users/delete-target.md @@ -13,4 +13,6 @@ Users users = new Users(client); await users.DeleteTarget( userId: "", targetId: "" -);``` +); + +``` diff --git a/docs/examples/users/delete.md b/docs/examples/users/delete.md index f1ee25ff..426c3007 100644 --- a/docs/examples/users/delete.md +++ b/docs/examples/users/delete.md @@ -12,4 +12,6 @@ Users users = new Users(client); await users.Delete( userId: "" -);``` +); + +``` diff --git a/docs/examples/users/get-mfa-challenge.md b/docs/examples/users/get-mfa-challenge.md index 810ea136..98f2131b 100644 --- a/docs/examples/users/get-mfa-challenge.md +++ b/docs/examples/users/get-mfa-challenge.md @@ -13,4 +13,6 @@ Users users = new Users(client); MfaChallengeSecret result = await users.GetMFAChallenge( userId: "", challengeId: "" -);``` +); + +``` diff --git a/docs/examples/users/get-mfa-recovery-codes.md b/docs/examples/users/get-mfa-recovery-codes.md index 34dca016..b2c1e98a 100644 --- a/docs/examples/users/get-mfa-recovery-codes.md +++ b/docs/examples/users/get-mfa-recovery-codes.md @@ -12,4 +12,6 @@ Users users = new Users(client); MfaRecoveryCodes result = await users.GetMFARecoveryCodes( userId: "" -);``` +); + +``` diff --git a/docs/examples/users/get-prefs.md b/docs/examples/users/get-prefs.md index 183bf14a..70f55411 100644 --- a/docs/examples/users/get-prefs.md +++ b/docs/examples/users/get-prefs.md @@ -12,4 +12,6 @@ Users users = new Users(client); Preferences result = await users.GetPrefs( userId: "" -);``` +); + +``` diff --git a/docs/examples/users/get-target.md b/docs/examples/users/get-target.md index 428e9248..3011e569 100644 --- a/docs/examples/users/get-target.md +++ b/docs/examples/users/get-target.md @@ -13,4 +13,6 @@ Users users = new Users(client); Target result = await users.GetTarget( userId: "", targetId: "" -);``` +); + +``` diff --git a/docs/examples/users/get.md b/docs/examples/users/get.md index f1de9cd0..047ed83c 100644 --- a/docs/examples/users/get.md +++ b/docs/examples/users/get.md @@ -12,4 +12,6 @@ Users users = new Users(client); User result = await users.Get( userId: "" -);``` +); + +``` diff --git a/docs/examples/users/list-identities.md b/docs/examples/users/list-identities.md index 3c8cdd62..08ee96bd 100644 --- a/docs/examples/users/list-identities.md +++ b/docs/examples/users/list-identities.md @@ -14,4 +14,6 @@ IdentityList result = await users.ListIdentities( queries: new List(), // optional search: "", // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/users/list-logs.md b/docs/examples/users/list-logs.md index b1faf3dc..ec0ff9ac 100644 --- a/docs/examples/users/list-logs.md +++ b/docs/examples/users/list-logs.md @@ -14,4 +14,6 @@ LogList result = await users.ListLogs( userId: "", queries: new List(), // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/users/list-memberships.md b/docs/examples/users/list-memberships.md index b72ebb37..ad3e77a2 100644 --- a/docs/examples/users/list-memberships.md +++ b/docs/examples/users/list-memberships.md @@ -15,4 +15,6 @@ MembershipList result = await users.ListMemberships( queries: new List(), // optional search: "", // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/users/list-mfa-factors.md b/docs/examples/users/list-mfa-factors.md index 18f888f2..c1f7365e 100644 --- a/docs/examples/users/list-mfa-factors.md +++ b/docs/examples/users/list-mfa-factors.md @@ -12,4 +12,6 @@ Users users = new Users(client); MfaFactors result = await users.ListMFAFactors( userId: "" -);``` +); + +``` diff --git a/docs/examples/users/list-sessions.md b/docs/examples/users/list-sessions.md index 3c888dda..49593956 100644 --- a/docs/examples/users/list-sessions.md +++ b/docs/examples/users/list-sessions.md @@ -13,4 +13,6 @@ Users users = new Users(client); SessionList result = await users.ListSessions( userId: "", total: false // optional -);``` +); + +``` diff --git a/docs/examples/users/list-targets.md b/docs/examples/users/list-targets.md index d825f0b1..d867b06f 100644 --- a/docs/examples/users/list-targets.md +++ b/docs/examples/users/list-targets.md @@ -14,4 +14,6 @@ TargetList result = await users.ListTargets( userId: "", queries: new List(), // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/users/list.md b/docs/examples/users/list.md index 24407b55..8f0ad9d5 100644 --- a/docs/examples/users/list.md +++ b/docs/examples/users/list.md @@ -14,4 +14,6 @@ UserList result = await users.List( queries: new List(), // optional search: "", // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/users/update-email-verification.md b/docs/examples/users/update-email-verification.md index 1a9bee68..0f6233c3 100644 --- a/docs/examples/users/update-email-verification.md +++ b/docs/examples/users/update-email-verification.md @@ -13,4 +13,6 @@ Users users = new Users(client); User result = await users.UpdateEmailVerification( userId: "", emailVerification: false -);``` +); + +``` diff --git a/docs/examples/users/update-email.md b/docs/examples/users/update-email.md index 971db635..be7bc521 100644 --- a/docs/examples/users/update-email.md +++ b/docs/examples/users/update-email.md @@ -13,4 +13,6 @@ Users users = new Users(client); User result = await users.UpdateEmail( userId: "", email: "email@example.com" -);``` +); + +``` diff --git a/docs/examples/users/update-impersonator.md b/docs/examples/users/update-impersonator.md index 908bad5f..91d94e78 100644 --- a/docs/examples/users/update-impersonator.md +++ b/docs/examples/users/update-impersonator.md @@ -13,4 +13,6 @@ Users users = new Users(client); User result = await users.UpdateImpersonator( userId: "", impersonator: false -);``` +); + +``` diff --git a/docs/examples/users/update-labels.md b/docs/examples/users/update-labels.md index 745fcde0..f6c0b554 100644 --- a/docs/examples/users/update-labels.md +++ b/docs/examples/users/update-labels.md @@ -13,4 +13,6 @@ Users users = new Users(client); User result = await users.UpdateLabels( userId: "", labels: new List() -);``` +); + +``` diff --git a/docs/examples/users/update-mfa-recovery-codes.md b/docs/examples/users/update-mfa-recovery-codes.md index f2c59a7d..78018690 100644 --- a/docs/examples/users/update-mfa-recovery-codes.md +++ b/docs/examples/users/update-mfa-recovery-codes.md @@ -12,4 +12,6 @@ Users users = new Users(client); MfaRecoveryCodes result = await users.UpdateMFARecoveryCodes( userId: "" -);``` +); + +``` diff --git a/docs/examples/users/update-mfa.md b/docs/examples/users/update-mfa.md index ea9ae97f..4e51f9f1 100644 --- a/docs/examples/users/update-mfa.md +++ b/docs/examples/users/update-mfa.md @@ -13,4 +13,6 @@ Users users = new Users(client); User result = await users.UpdateMFA( userId: "", mfa: false -);``` +); + +``` diff --git a/docs/examples/users/update-name.md b/docs/examples/users/update-name.md index 874476e9..4a58aa86 100644 --- a/docs/examples/users/update-name.md +++ b/docs/examples/users/update-name.md @@ -13,4 +13,6 @@ Users users = new Users(client); User result = await users.UpdateName( userId: "", name: "" -);``` +); + +``` diff --git a/docs/examples/users/update-password.md b/docs/examples/users/update-password.md index 17e3a35c..4306cd73 100644 --- a/docs/examples/users/update-password.md +++ b/docs/examples/users/update-password.md @@ -13,4 +13,6 @@ Users users = new Users(client); User result = await users.UpdatePassword( userId: "", password: "password" -);``` +); + +``` diff --git a/docs/examples/users/update-phone-verification.md b/docs/examples/users/update-phone-verification.md index fce805ce..81fedf8a 100644 --- a/docs/examples/users/update-phone-verification.md +++ b/docs/examples/users/update-phone-verification.md @@ -13,4 +13,6 @@ Users users = new Users(client); User result = await users.UpdatePhoneVerification( userId: "", phoneVerification: false -);``` +); + +``` diff --git a/docs/examples/users/update-phone.md b/docs/examples/users/update-phone.md index dce430d0..de2a0723 100644 --- a/docs/examples/users/update-phone.md +++ b/docs/examples/users/update-phone.md @@ -13,4 +13,6 @@ Users users = new Users(client); User result = await users.UpdatePhone( userId: "", number: "+12065550100" -);``` +); + +``` diff --git a/docs/examples/users/update-prefs.md b/docs/examples/users/update-prefs.md index e6ebf0d0..db20bfc8 100644 --- a/docs/examples/users/update-prefs.md +++ b/docs/examples/users/update-prefs.md @@ -13,4 +13,6 @@ Users users = new Users(client); Preferences result = await users.UpdatePrefs( userId: "", prefs: [object] -);``` +); + +``` diff --git a/docs/examples/users/update-status.md b/docs/examples/users/update-status.md index 04057430..bd9f4839 100644 --- a/docs/examples/users/update-status.md +++ b/docs/examples/users/update-status.md @@ -13,4 +13,6 @@ Users users = new Users(client); User result = await users.UpdateStatus( userId: "", status: false -);``` +); + +``` diff --git a/docs/examples/users/update-target.md b/docs/examples/users/update-target.md index 9104e974..a2c18419 100644 --- a/docs/examples/users/update-target.md +++ b/docs/examples/users/update-target.md @@ -16,4 +16,6 @@ Target result = await users.UpdateTarget( identifier: "", // optional providerId: "", // optional name: "" // optional -);``` +); + +``` diff --git a/docs/examples/vectorsdb/create-collection.md b/docs/examples/vectorsdb/create-collection.md new file mode 100644 index 00000000..b0cebcd4 --- /dev/null +++ b/docs/examples/vectorsdb/create-collection.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 + +VectorsDB vectorsDB = new VectorsDB(client); + +VectorsdbCollection result = await vectorsDB.CreateCollection( + databaseId: "", + collectionId: "", + name: "", + dimension: 1, + permissions: new List { 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 new file mode 100644 index 00000000..3fce530d --- /dev/null +++ b/docs/examples/vectorsdb/create-document.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 + .SetSession(""); // The user session to authenticate with + +VectorsDB vectorsDB = new VectorsDB(client); + +Document result = await vectorsDB.CreateDocument( + databaseId: "", + collectionId: "", + documentId: "", + data: new { + embeddings = new[] { 0.12, -0.55, 0.88, 1.02 }, + metadata = { key = "value" } + }, + permissions: new List { Permission.Read(Role.Any()) } // optional +); + +``` diff --git a/docs/examples/vectorsdb/create-documents.md b/docs/examples/vectorsdb/create-documents.md new file mode 100644 index 00000000..9f2c9b98 --- /dev/null +++ b/docs/examples/vectorsdb/create-documents.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 + .SetKey(""); // Your secret API key + +VectorsDB vectorsDB = new VectorsDB(client); + +DocumentList result = await vectorsDB.CreateDocuments( + databaseId: "", + collectionId: "", + documents: new List() +); + +``` diff --git a/docs/examples/vectorsdb/create-failover.md b/docs/examples/vectorsdb/create-failover.md new file mode 100644 index 00000000..dd50d8dc --- /dev/null +++ b/docs/examples/vectorsdb/create-failover.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 + +VectorsDB vectorsDB = new VectorsDB(client); + +DedicatedDatabase result = await vectorsDB.CreateFailover( + databaseId: "", + targetReplicaId: "" // optional +); + +``` diff --git a/docs/examples/vectorsdb/create-index.md b/docs/examples/vectorsdb/create-index.md new file mode 100644 index 00000000..5adac04c --- /dev/null +++ b/docs/examples/vectorsdb/create-index.md @@ -0,0 +1,24 @@ +```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 + +VectorsDB vectorsDB = new VectorsDB(client); + +Index result = await vectorsDB.CreateIndex( + databaseId: "", + collectionId: "", + key: "", + type: VectorsDBIndexType.HnswEuclidean, + attributes: new List(), + orders: new List<OrderBy> { OrderBy.Asc }, // optional + lengths: new List() // optional +); + +``` diff --git a/docs/examples/vectorsdb/create-operations.md b/docs/examples/vectorsdb/create-operations.md new file mode 100644 index 00000000..346c7d24 --- /dev/null +++ b/docs/examples/vectorsdb/create-operations.md @@ -0,0 +1,28 @@ +```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 + +VectorsDB vectorsDB = new VectorsDB(client); + +Transaction result = await vectorsDB.CreateOperations( + transactionId: "", + operations: [ + { + "action": "create", + "databaseId": "", + "collectionId": "", + "documentId": "", + "data": { + "name": "Walter O'Brien" + } + } + ] // optional +); + +``` diff --git a/docs/examples/vectorsdb/create-query.md b/docs/examples/vectorsdb/create-query.md new file mode 100644 index 00000000..bcc28eda --- /dev/null +++ b/docs/examples/vectorsdb/create-query.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 + .SetSession(""); // The user session to authenticate with + +VectorsDB vectorsDB = new VectorsDB(client); + +DocumentList result = await vectorsDB.CreateQuery( + databaseId: "", + collectionId: "", + queries: new List(), // optional + transactionId: "", // optional + total: false, // optional + ttl: 0 // optional +); + +``` diff --git a/docs/examples/vectorsdb/create-transaction.md b/docs/examples/vectorsdb/create-transaction.md new file mode 100644 index 00000000..133e6bbd --- /dev/null +++ b/docs/examples/vectorsdb/create-transaction.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 + +VectorsDB vectorsDB = new VectorsDB(client); + +Transaction result = await vectorsDB.CreateTransaction( + ttl: 60 // optional +); + +``` diff --git a/docs/examples/vectorsdb/create.md b/docs/examples/vectorsdb/create.md new file mode 100644 index 00000000..5ef6db08 --- /dev/null +++ b/docs/examples/vectorsdb/create.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 + +VectorsDB vectorsDB = new VectorsDB(client); + +Database result = await vectorsDB.Create( + databaseId: "", + name: "", + enabled: false, // optional + specification: "serverless", // optional + replicas: 0, // optional + syncMode: "async" // optional +); + +``` diff --git a/docs/examples/vectorsdb/delete-collection.md b/docs/examples/vectorsdb/delete-collection.md new file mode 100644 index 00000000..563f025d --- /dev/null +++ b/docs/examples/vectorsdb/delete-collection.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 + +VectorsDB vectorsDB = new VectorsDB(client); + +await vectorsDB.DeleteCollection( + databaseId: "", + collectionId: "" +); + +``` diff --git a/docs/examples/vectorsdb/delete-document.md b/docs/examples/vectorsdb/delete-document.md new file mode 100644 index 00000000..78ccb33c --- /dev/null +++ b/docs/examples/vectorsdb/delete-document.md @@ -0,0 +1,20 @@ +```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 + +VectorsDB vectorsDB = new VectorsDB(client); + +await vectorsDB.DeleteDocument( + databaseId: "", + collectionId: "", + documentId: "", + transactionId: "" // optional +); + +``` diff --git a/docs/examples/vectorsdb/delete-documents.md b/docs/examples/vectorsdb/delete-documents.md new file mode 100644 index 00000000..e7d21a4b --- /dev/null +++ b/docs/examples/vectorsdb/delete-documents.md @@ -0,0 +1,20 @@ +```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 + +VectorsDB vectorsDB = new VectorsDB(client); + +await vectorsDB.DeleteDocuments( + databaseId: "", + collectionId: "", + queries: new List(), // optional + transactionId: "" // optional +); + +``` diff --git a/docs/examples/vectorsdb/delete-index.md b/docs/examples/vectorsdb/delete-index.md new file mode 100644 index 00000000..7764d3ce --- /dev/null +++ b/docs/examples/vectorsdb/delete-index.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 + .SetKey(""); // Your secret API key + +VectorsDB vectorsDB = new VectorsDB(client); + +await vectorsDB.DeleteIndex( + databaseId: "", + collectionId: "", + key: "" +); + +``` diff --git a/docs/examples/vectorsdb/delete-transaction.md b/docs/examples/vectorsdb/delete-transaction.md new file mode 100644 index 00000000..2d706dd2 --- /dev/null +++ b/docs/examples/vectorsdb/delete-transaction.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 + +VectorsDB vectorsDB = new VectorsDB(client); + +await vectorsDB.DeleteTransaction( + transactionId: "" +); + +``` diff --git a/docs/examples/vectorsdb/delete.md b/docs/examples/vectorsdb/delete.md new file mode 100644 index 00000000..0f43900d --- /dev/null +++ b/docs/examples/vectorsdb/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 + +VectorsDB vectorsDB = new VectorsDB(client); + +await vectorsDB.Delete( + databaseId: "" +); + +``` diff --git a/docs/examples/vectorsdb/get-collection.md b/docs/examples/vectorsdb/get-collection.md new file mode 100644 index 00000000..9111b740 --- /dev/null +++ b/docs/examples/vectorsdb/get-collection.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 + +VectorsDB vectorsDB = new VectorsDB(client); + +VectorsdbCollection result = await vectorsDB.GetCollection( + databaseId: "", + collectionId: "" +); + +``` diff --git a/docs/examples/vectorsdb/get-document.md b/docs/examples/vectorsdb/get-document.md new file mode 100644 index 00000000..98762a93 --- /dev/null +++ b/docs/examples/vectorsdb/get-document.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 + .SetSession(""); // The user session to authenticate with + +VectorsDB vectorsDB = new VectorsDB(client); + +Document result = await vectorsDB.GetDocument( + databaseId: "", + collectionId: "", + documentId: "", + queries: new List(), // optional + transactionId: "" // optional +); + +``` diff --git a/docs/examples/vectorsdb/get-index.md b/docs/examples/vectorsdb/get-index.md new file mode 100644 index 00000000..6c2d1dfb --- /dev/null +++ b/docs/examples/vectorsdb/get-index.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 + .SetKey(""); // Your secret API key + +VectorsDB vectorsDB = new VectorsDB(client); + +Index result = await vectorsDB.GetIndex( + databaseId: "", + collectionId: "", + key: "" +); + +``` diff --git a/docs/examples/vectorsdb/get-replicas.md b/docs/examples/vectorsdb/get-replicas.md new file mode 100644 index 00000000..b1a849f3 --- /dev/null +++ b/docs/examples/vectorsdb/get-replicas.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 + +VectorsDB vectorsDB = new VectorsDB(client); + +DedicatedDatabaseReplicas result = await vectorsDB.GetReplicas( + databaseId: "" +); + +``` diff --git a/docs/examples/vectorsdb/get-status.md b/docs/examples/vectorsdb/get-status.md new file mode 100644 index 00000000..e019656d --- /dev/null +++ b/docs/examples/vectorsdb/get-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 + +VectorsDB vectorsDB = new VectorsDB(client); + +DatabaseStatus result = await vectorsDB.GetStatus( + databaseId: "" +); + +``` diff --git a/docs/examples/vectorsdb/get-transaction.md b/docs/examples/vectorsdb/get-transaction.md new file mode 100644 index 00000000..4cd0b3fd --- /dev/null +++ b/docs/examples/vectorsdb/get-transaction.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 + +VectorsDB vectorsDB = new VectorsDB(client); + +Transaction result = await vectorsDB.GetTransaction( + transactionId: "" +); + +``` diff --git a/docs/examples/vectorsdb/get.md b/docs/examples/vectorsdb/get.md new file mode 100644 index 00000000..5b605e57 --- /dev/null +++ b/docs/examples/vectorsdb/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 + +VectorsDB vectorsDB = new VectorsDB(client); + +Database result = await vectorsDB.Get( + databaseId: "" +); + +``` diff --git a/docs/examples/vectorsdb/list-collections.md b/docs/examples/vectorsdb/list-collections.md new file mode 100644 index 00000000..5e9f2737 --- /dev/null +++ b/docs/examples/vectorsdb/list-collections.md @@ -0,0 +1,20 @@ +```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 + +VectorsDB vectorsDB = new VectorsDB(client); + +VectorsdbCollectionList result = await vectorsDB.ListCollections( + databaseId: "", + queries: new List(), // optional + search: "", // optional + total: false // optional +); + +``` diff --git a/docs/examples/vectorsdb/list-documents.md b/docs/examples/vectorsdb/list-documents.md new file mode 100644 index 00000000..93411673 --- /dev/null +++ b/docs/examples/vectorsdb/list-documents.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 + .SetSession(""); // The user session to authenticate with + +VectorsDB vectorsDB = new VectorsDB(client); + +DocumentList result = await vectorsDB.ListDocuments( + databaseId: "", + collectionId: "", + queries: new List(), // optional + transactionId: "", // optional + total: false, // optional + ttl: 0 // optional +); + +``` diff --git a/docs/examples/vectorsdb/list-indexes.md b/docs/examples/vectorsdb/list-indexes.md new file mode 100644 index 00000000..acf0af7a --- /dev/null +++ b/docs/examples/vectorsdb/list-indexes.md @@ -0,0 +1,20 @@ +```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 + +VectorsDB vectorsDB = new VectorsDB(client); + +IndexList result = await vectorsDB.ListIndexes( + databaseId: "", + collectionId: "", + queries: new List(), // optional + total: false // optional +); + +``` diff --git a/docs/examples/vectorsdb/list-operations.md b/docs/examples/vectorsdb/list-operations.md new file mode 100644 index 00000000..90a4327f --- /dev/null +++ b/docs/examples/vectorsdb/list-operations.md @@ -0,0 +1,20 @@ +```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 + +VectorsDB vectorsDB = new VectorsDB(client); + +DedicatedDatabaseOperationList result = await vectorsDB.ListOperations( + databaseId: "", + status: "queued", // optional + limit: 1, // optional + offset: 0 // optional +); + +``` diff --git a/docs/examples/vectorsdb/list-specifications.md b/docs/examples/vectorsdb/list-specifications.md new file mode 100644 index 00000000..652d2324 --- /dev/null +++ b/docs/examples/vectorsdb/list-specifications.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 + .SetKey(""); // Your secret API key + +VectorsDB vectorsDB = new VectorsDB(client); + +DedicatedDatabaseSpecificationList result = await vectorsDB.ListSpecifications(); + + +``` diff --git a/docs/examples/vectorsdb/list-transactions.md b/docs/examples/vectorsdb/list-transactions.md new file mode 100644 index 00000000..54ada0e6 --- /dev/null +++ b/docs/examples/vectorsdb/list-transactions.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 + +VectorsDB vectorsDB = new VectorsDB(client); + +TransactionList result = await vectorsDB.ListTransactions( + queries: new List() // optional +); + +``` diff --git a/docs/examples/vectorsdb/list.md b/docs/examples/vectorsdb/list.md new file mode 100644 index 00000000..f2c0e930 --- /dev/null +++ b/docs/examples/vectorsdb/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 + +VectorsDB vectorsDB = new VectorsDB(client); + +DatabaseList result = await vectorsDB.List( + queries: new List(), // optional + total: false // optional +); + +``` diff --git a/docs/examples/vectorsdb/update-collection.md b/docs/examples/vectorsdb/update-collection.md new file mode 100644 index 00000000..bcadbda2 --- /dev/null +++ b/docs/examples/vectorsdb/update-collection.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 + +VectorsDB vectorsDB = new VectorsDB(client); + +VectorsdbCollection result = await vectorsDB.UpdateCollection( + databaseId: "", + collectionId: "", + name: "", + dimension: 1, // optional + permissions: new List { 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 new file mode 100644 index 00000000..d1d0d078 --- /dev/null +++ b/docs/examples/vectorsdb/update-document.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 + .SetSession(""); // The user session to authenticate with + +VectorsDB vectorsDB = new VectorsDB(client); + +Document result = await vectorsDB.UpdateDocument( + databaseId: "", + collectionId: "", + documentId: "", + data: [object], // optional + permissions: new List { Permission.Read(Role.Any()) }, // optional + transactionId: "" // optional +); + +``` diff --git a/docs/examples/vectorsdb/update-documents.md b/docs/examples/vectorsdb/update-documents.md new file mode 100644 index 00000000..5833aac1 --- /dev/null +++ b/docs/examples/vectorsdb/update-documents.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 + +VectorsDB vectorsDB = new VectorsDB(client); + +DocumentList result = await vectorsDB.UpdateDocuments( + databaseId: "", + collectionId: "", + data: [object], // optional + queries: new List(), // optional + transactionId: "" // optional +); + +``` diff --git a/docs/examples/vectorsdb/update-transaction.md b/docs/examples/vectorsdb/update-transaction.md new file mode 100644 index 00000000..65320cc2 --- /dev/null +++ b/docs/examples/vectorsdb/update-transaction.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 + .SetKey(""); // Your secret API key + +VectorsDB vectorsDB = new VectorsDB(client); + +Transaction result = await vectorsDB.UpdateTransaction( + transactionId: "", + commit: false, // optional + rollback: false // optional +); + +``` diff --git a/docs/examples/vectorsdb/update.md b/docs/examples/vectorsdb/update.md new file mode 100644 index 00000000..c8184ece --- /dev/null +++ b/docs/examples/vectorsdb/update.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 + +VectorsDB vectorsDB = new VectorsDB(client); + +Database result = await vectorsDB.Update( + databaseId: "", + name: "", + enabled: false, // optional + specification: "serverless", // optional + replicas: 0, // optional + syncMode: "async" // optional +); + +``` diff --git a/docs/examples/vectorsdb/upsert-document.md b/docs/examples/vectorsdb/upsert-document.md new file mode 100644 index 00000000..edb18673 --- /dev/null +++ b/docs/examples/vectorsdb/upsert-document.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 + .SetSession(""); // The user session to authenticate with + +VectorsDB vectorsDB = new VectorsDB(client); + +Document result = await vectorsDB.UpsertDocument( + databaseId: "", + collectionId: "", + documentId: "", + data: [object], // optional + permissions: new List { Permission.Read(Role.Any()) }, // optional + transactionId: "" // optional +); + +``` diff --git a/docs/examples/vectorsdb/upsert-documents.md b/docs/examples/vectorsdb/upsert-documents.md new file mode 100644 index 00000000..d9209fd9 --- /dev/null +++ b/docs/examples/vectorsdb/upsert-documents.md @@ -0,0 +1,20 @@ +```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 + +VectorsDB vectorsDB = new VectorsDB(client); + +DocumentList result = await vectorsDB.UpsertDocuments( + databaseId: "", + collectionId: "", + documents: new List(), + transactionId: "" // optional +); + +``` diff --git a/docs/examples/webhooks/create.md b/docs/examples/webhooks/create.md index c3e9f558..28a5222f 100644 --- a/docs/examples/webhooks/create.md +++ b/docs/examples/webhooks/create.md @@ -12,7 +12,7 @@ Webhooks webhooks = new Webhooks(client); Webhook result = await webhooks.Create( webhookId: "", - url: "", + url: "https://example.com/webhook", name: "", events: new List(), enabled: false, // optional @@ -20,4 +20,6 @@ Webhook result = await webhooks.Create( authUsername: "", // optional authPassword: "password", // optional secret: "" // optional -);``` +); + +``` diff --git a/docs/examples/webhooks/delete.md b/docs/examples/webhooks/delete.md index a9aac880..8cb5a401 100644 --- a/docs/examples/webhooks/delete.md +++ b/docs/examples/webhooks/delete.md @@ -12,4 +12,6 @@ Webhooks webhooks = new Webhooks(client); await webhooks.Delete( webhookId: "" -);``` +); + +``` diff --git a/docs/examples/webhooks/get.md b/docs/examples/webhooks/get.md index f9c6835a..2b6ce7dd 100644 --- a/docs/examples/webhooks/get.md +++ b/docs/examples/webhooks/get.md @@ -12,4 +12,6 @@ Webhooks webhooks = new Webhooks(client); Webhook result = await webhooks.Get( webhookId: "" -);``` +); + +``` diff --git a/docs/examples/webhooks/list.md b/docs/examples/webhooks/list.md index 94db7d62..c8c4b065 100644 --- a/docs/examples/webhooks/list.md +++ b/docs/examples/webhooks/list.md @@ -13,4 +13,6 @@ Webhooks webhooks = new Webhooks(client); WebhookList result = await webhooks.List( queries: new List(), // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/webhooks/update-secret.md b/docs/examples/webhooks/update-secret.md index c6b4a167..c6d94551 100644 --- a/docs/examples/webhooks/update-secret.md +++ b/docs/examples/webhooks/update-secret.md @@ -13,4 +13,6 @@ Webhooks webhooks = new Webhooks(client); Webhook result = await webhooks.UpdateSecret( webhookId: "", secret: "" // optional -);``` +); + +``` diff --git a/docs/examples/webhooks/update.md b/docs/examples/webhooks/update.md index d3485855..795cfafe 100644 --- a/docs/examples/webhooks/update.md +++ b/docs/examples/webhooks/update.md @@ -13,10 +13,12 @@ Webhooks webhooks = new Webhooks(client); Webhook result = await webhooks.Update( webhookId: "", name: "", - url: "", + url: "https://example.com/webhook", events: new List(), enabled: false, // optional tls: false, // optional authUsername: "", // optional authPassword: "password" // optional -);``` +); + +```