From 6888f5ac45eaec64eba84009724165d5b7127bf8 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 16 Nov 2023 17:17:05 +1300 Subject: [PATCH 1/2] Fix between query output --- README.md | 31 ++- docs/examples/health/get-queue-builds.md | 12 + docs/examples/health/get-queue-databases.md | 12 + docs/examples/health/get-queue-deletes.md | 12 + docs/examples/health/get-queue-mails.md | 12 + docs/examples/health/get-queue-messaging.md | 12 + docs/examples/health/get-queue-migrations.md | 12 + src/Appwrite/Appwrite.csproj | 2 +- src/Appwrite/Client.cs | 4 +- src/Appwrite/Query.cs | 6 +- src/Appwrite/Services/Account.cs | 66 ++--- src/Appwrite/Services/Avatars.cs | 21 +- src/Appwrite/Services/Databases.cs | 96 +++---- src/Appwrite/Services/Functions.cs | 49 ++-- src/Appwrite/Services/Graphql.cs | 4 +- src/Appwrite/Services/Health.cs | 249 +++++++++++++++++-- src/Appwrite/Services/Locale.cs | 14 +- src/Appwrite/Services/Storage.cs | 24 +- src/Appwrite/Services/Teams.cs | 34 +-- src/Appwrite/Services/Users.cs | 86 +++---- 20 files changed, 542 insertions(+), 216 deletions(-) create mode 100644 docs/examples/health/get-queue-builds.md create mode 100644 docs/examples/health/get-queue-databases.md create mode 100644 docs/examples/health/get-queue-deletes.md create mode 100644 docs/examples/health/get-queue-mails.md create mode 100644 docs/examples/health/get-queue-messaging.md create mode 100644 docs/examples/health/get-queue-migrations.md diff --git a/README.md b/README.md index ff8a307..1e90649 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Appwrite .NET SDK ![License](https://img.shields.io/github/license/appwrite/sdk-for-dotnet.svg?style=flat-square) -![Version](https://img.shields.io/badge/api%20version-1.4.2-blue.svg?style=flat-square) +![Version](https://img.shields.io/badge/api%20version-1.4.12-blue.svg?style=flat-square) [![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator) [![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite) [![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord) @@ -17,17 +17,17 @@ Appwrite is an open-source backend as a service server that abstract and simplif 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 0.6.0 +Install-Package Appwrite -Version 0.6.1 # or .NET CLI -dotnet add package Appwrite --version 0.6.0 +dotnet add package Appwrite --version 0.6.1 ``` @@ -86,10 +86,31 @@ You can use the following resources to learn more and get help - 🚂 [Appwrite .NET Playground](https://github.com/appwrite/playground-for-dotnet) +### Preparing Models for Databases API + +For the .NET SDK, we use the `Newtonsoft.Json` library for serialization/deserialization support. The default behavior converts property names from `PascalCase` to `camelCase` on serializing to JSON. In case the names of attributes in your Appwrite collection are not created in `camelCase`, this serializer behavior can cause errors due to mismatches in the names in the serialized JSON and the actual attribute names in your collection. + +The way to fix this is to add the `JsonProperty` attribute to the properties in the POCO class you create for your model. + +For e.g., if you have two attributes, `name` (`string` type) and `release_date` (`DateTime` type), your POCO class would be created as follows: + +```csharp +public class TestModel +{ + [JsonProperty("name")] + public string Name { get; set; } + + [JsonProperty("release_date")] + public DateTime ReleaseDate { get; set; } +} +``` + +The `JsonProperty` attribute will ensure that your data object for the Appwrite database is serialized with the correct names. + ## Contribution This library is auto-generated by Appwrite custom [SDK Generator](https://github.com/appwrite/sdk-generator). To learn more about how you can help us improve this SDK, please check the [contribution guide](https://github.com/appwrite/sdk-generator/blob/master/CONTRIBUTING.md) before sending a pull-request. ## License -Please see the [BSD-3-Clause license](https://raw.githubusercontent.com/appwrite/appwrite/master/LICENSE) file for more information. \ No newline at end of file +Please see the [BSD-3-Clause license](https://raw.githubusercontent.com/appwrite/appwrite/master/LICENSE) file for more information. diff --git a/docs/examples/health/get-queue-builds.md b/docs/examples/health/get-queue-builds.md new file mode 100644 index 0000000..654ab8e --- /dev/null +++ b/docs/examples/health/get-queue-builds.md @@ -0,0 +1,12 @@ +using Appwrite; +using Appwrite.Services; +using Appwrite.Models; + +var client = new Client() + .SetEndPoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("5df5acd0d48c2") // Your project ID + .SetKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key + +var health = new Health(client); + +HealthQueue result = await health.GetQueueBuilds(); \ No newline at end of file diff --git a/docs/examples/health/get-queue-databases.md b/docs/examples/health/get-queue-databases.md new file mode 100644 index 0000000..5bd24a4 --- /dev/null +++ b/docs/examples/health/get-queue-databases.md @@ -0,0 +1,12 @@ +using Appwrite; +using Appwrite.Services; +using Appwrite.Models; + +var client = new Client() + .SetEndPoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("5df5acd0d48c2") // Your project ID + .SetKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key + +var health = new Health(client); + +HealthQueue result = await health.GetQueueDatabases(); \ No newline at end of file diff --git a/docs/examples/health/get-queue-deletes.md b/docs/examples/health/get-queue-deletes.md new file mode 100644 index 0000000..26a692c --- /dev/null +++ b/docs/examples/health/get-queue-deletes.md @@ -0,0 +1,12 @@ +using Appwrite; +using Appwrite.Services; +using Appwrite.Models; + +var client = new Client() + .SetEndPoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("5df5acd0d48c2") // Your project ID + .SetKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key + +var health = new Health(client); + +HealthQueue result = await health.GetQueueDeletes(); \ No newline at end of file diff --git a/docs/examples/health/get-queue-mails.md b/docs/examples/health/get-queue-mails.md new file mode 100644 index 0000000..41e09a2 --- /dev/null +++ b/docs/examples/health/get-queue-mails.md @@ -0,0 +1,12 @@ +using Appwrite; +using Appwrite.Services; +using Appwrite.Models; + +var client = new Client() + .SetEndPoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("5df5acd0d48c2") // Your project ID + .SetKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key + +var health = new Health(client); + +HealthQueue result = await health.GetQueueMails(); \ No newline at end of file diff --git a/docs/examples/health/get-queue-messaging.md b/docs/examples/health/get-queue-messaging.md new file mode 100644 index 0000000..52b7aaf --- /dev/null +++ b/docs/examples/health/get-queue-messaging.md @@ -0,0 +1,12 @@ +using Appwrite; +using Appwrite.Services; +using Appwrite.Models; + +var client = new Client() + .SetEndPoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("5df5acd0d48c2") // Your project ID + .SetKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key + +var health = new Health(client); + +HealthQueue result = await health.GetQueueMessaging(); \ No newline at end of file diff --git a/docs/examples/health/get-queue-migrations.md b/docs/examples/health/get-queue-migrations.md new file mode 100644 index 0000000..49b0597 --- /dev/null +++ b/docs/examples/health/get-queue-migrations.md @@ -0,0 +1,12 @@ +using Appwrite; +using Appwrite.Services; +using Appwrite.Models; + +var client = new Client() + .SetEndPoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("5df5acd0d48c2") // Your project ID + .SetKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key + +var health = new Health(client); + +HealthQueue result = await health.GetQueueMigrations(); \ No newline at end of file diff --git a/src/Appwrite/Appwrite.csproj b/src/Appwrite/Appwrite.csproj index 738f237..b205360 100644 --- a/src/Appwrite/Appwrite.csproj +++ b/src/Appwrite/Appwrite.csproj @@ -2,7 +2,7 @@ netstandard2.0;net461 Appwrite - 0.6.0 + 0.6.1 Appwrite Team Appwrite Team diff --git a/src/Appwrite/Client.cs b/src/Appwrite/Client.cs index 4858fc1..738c349 100644 --- a/src/Appwrite/Client.cs +++ b/src/Appwrite/Client.cs @@ -58,11 +58,11 @@ public Client( _headers = new Dictionary() { { "content-type", "application/json" }, - { "user-agent" , "AppwriteDotNetSDK/0.6.0 (${Environment.OSVersion.Platform}; ${Environment.OSVersion.VersionString})"}, + { "user-agent" , "AppwriteDotNetSDK/0.6.1 (${Environment.OSVersion.Platform}; ${Environment.OSVersion.VersionString})"}, { "x-sdk-name", ".NET" }, { "x-sdk-platform", "server" }, { "x-sdk-language", "dotnet" }, - { "x-sdk-version", "0.6.0"}, { "X-Appwrite-Response-Format", "1.4.0" } + { "x-sdk-version", "0.6.1"}, { "X-Appwrite-Response-Format", "1.4.0" } }; _config = new Dictionary(); diff --git a/src/Appwrite/Query.cs b/src/Appwrite/Query.cs index c940f4d..f10bac2 100644 --- a/src/Appwrite/Query.cs +++ b/src/Appwrite/Query.cs @@ -63,17 +63,17 @@ public static string EndsWith(string attribute, string value) public static string Between(string attribute, string start, string end) { - return AddQuery(attribute, "between", new List { start, end }); + return $"between(\"{attribute}\", \"{start}\", \"{end}\")"; } public static string Between(string attribute, int start, int end) { - return AddQuery(attribute, "between", new List { start, end }); + return $"between(\"{attribute}\", {start}, {end})"; } public static string Between(string attribute, double start, double end) { - return AddQuery(attribute, "between", new List { start, end }); + return $"between(\"{attribute}\", {start}, {end})"; } public static string Select(List attributes) diff --git a/src/Appwrite/Services/Account.cs b/src/Appwrite/Services/Account.cs index 7e7a6b3..32130bd 100644 --- a/src/Appwrite/Services/Account.cs +++ b/src/Appwrite/Services/Account.cs @@ -14,7 +14,7 @@ public Account(Client client) : base(client) } /// - /// Get Account + /// Get account /// /// Get the currently logged in user. /// @@ -48,7 +48,7 @@ static Models.User Convert(Dictionary it) => } /// - /// Update Email + /// Update email /// /// Update currently logged in user account email address. After changing user /// address, the user confirmation status will get reset. A new confirmation @@ -158,7 +158,7 @@ public Task DeleteIdentity(string identityId) } /// - /// List Logs + /// List logs /// /// Get the list of latest security activity logs for the currently logged in /// user. Each log returns user IP address, location and date and time of log. @@ -194,7 +194,7 @@ static Models.LogList Convert(Dictionary it) => } /// - /// Update Name + /// Update name /// /// Update currently logged in user account name. /// @@ -229,7 +229,7 @@ static Models.User Convert(Dictionary it) => } /// - /// Update Password + /// Update password /// /// Update currently logged in user password. For validation, user is required /// to pass in the new password, and the old password. For users created with @@ -267,12 +267,12 @@ static Models.User Convert(Dictionary it) => } /// - /// Update Phone + /// Update phone /// /// Update the currently logged in user's phone number. After updating the /// phone number, the phone verification status will be reset. A confirmation /// SMS is not sent automatically, however you can use the [POST - /// /account/verification/phone](/docs/client/account#accountCreatePhoneVerification) + /// /account/verification/phone](https://appwrite.io/docs/references/cloud/client-web/account#createPhoneVerification) /// endpoint to send a confirmation SMS. /// /// @@ -307,7 +307,7 @@ static Models.User Convert(Dictionary it) => } /// - /// Get Account Preferences + /// Get account preferences /// /// Get the preferences as a key-value object for the currently logged in user. /// @@ -341,7 +341,7 @@ static Models.Preferences Convert(Dictionary it) => } /// - /// Update Preferences + /// Update preferences /// /// Update currently logged in user account preferences. The object you pass is /// stored as is, and replaces any previous value. The maximum allowed prefs @@ -378,16 +378,16 @@ static Models.User Convert(Dictionary it) => } /// - /// Create Password Recovery + /// Create password recovery /// /// Sends the user an email with a temporary secret key for password reset. /// When the user clicks the confirmation link he is redirected back to your /// app password reset URL with the secret key and email address values /// attached to the URL query string. Use the query string params to submit a /// request to the [PUT - /// /account/recovery](/docs/client/account#accountUpdateRecovery) endpoint to - /// complete the process. The verification link sent to the user's email - /// address is valid for 1 hour. + /// /account/recovery](https://appwrite.io/docs/references/cloud/client-web/account#updateRecovery) + /// endpoint to complete the process. The verification link sent to the user's + /// email address is valid for 1 hour. /// /// public Task CreateRecovery(string email, string url) @@ -421,12 +421,13 @@ static Models.Token Convert(Dictionary it) => } /// - /// Create Password Recovery (confirmation) + /// Create password recovery (confirmation) /// /// Use this endpoint to complete the user account password reset. Both the /// **userId** and **secret** arguments will be passed as query parameters to /// the redirect URL you have provided when sending your request to the [POST - /// /account/recovery](/docs/client/account#accountCreateRecovery) endpoint. + /// /account/recovery](https://appwrite.io/docs/references/cloud/client-web/account#createRecovery) + /// endpoint. /// /// Please note that in order to avoid a [Redirect /// Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) @@ -467,7 +468,7 @@ static Models.Token Convert(Dictionary it) => } /// - /// List Sessions + /// List sessions /// /// Get the list of active sessions across different devices for the currently /// logged in user. @@ -502,7 +503,7 @@ static Models.SessionList Convert(Dictionary it) => } /// - /// Delete Sessions + /// Delete sessions /// /// Delete all sessions from the user account and remove any sessions cookies /// from the end client. @@ -534,7 +535,7 @@ public Task DeleteSessions() } /// - /// Get Session + /// Get session /// /// Use this endpoint to get a logged in user's session using a Session ID. /// Inputting 'current' will return the current session being used. @@ -570,7 +571,7 @@ static Models.Session Convert(Dictionary it) => } /// - /// Update OAuth Session (Refresh Tokens) + /// Update OAuth session (refresh tokens) /// /// Access tokens have limited lifespan and expire to mitigate security risks. /// If session was created using an OAuth provider, this route can be used to @@ -607,12 +608,13 @@ static Models.Session Convert(Dictionary it) => } /// - /// Delete Session + /// Delete session /// /// Logout the user. Use 'current' as the session ID to logout on this device, /// use a session ID to logout on another device. If you're looking to logout /// the user on all devices, use [Delete - /// Sessions](/docs/client/account#accountDeleteSessions) instead. + /// Sessions](https://appwrite.io/docs/references/cloud/client-web/account#deleteSessions) + /// instead. /// /// public Task DeleteSession(string sessionId) @@ -642,7 +644,7 @@ public Task DeleteSession(string sessionId) } /// - /// Update Status + /// Update status /// /// Block the currently logged in user account. Behind the scene, the user /// record is not deleted but permanently blocked from any access. To @@ -678,7 +680,7 @@ static Models.User Convert(Dictionary it) => } /// - /// Create Email Verification + /// Create email verification /// /// Use this endpoint to send a verification message to your user email address /// to confirm they are the valid owners of that address. Both the **userId** @@ -687,8 +689,8 @@ static Models.User Convert(Dictionary it) => /// should redirect the user back to your app and allow you to complete the /// verification process by verifying both the **userId** and **secret** /// parameters. Learn more about how to [complete the verification - /// process](/docs/client/account#accountUpdateEmailVerification). The - /// verification link sent to the user's email address is valid for 7 days. + /// process](https://appwrite.io/docs/references/cloud/client-web/account#updateVerification). + /// The verification link sent to the user's email address is valid for 7 days. /// /// Please note that in order to avoid a [Redirect /// Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), @@ -727,7 +729,7 @@ static Models.Token Convert(Dictionary it) => } /// - /// Create Email Verification (confirmation) + /// Create email verification (confirmation) /// /// Use this endpoint to complete the user email verification process. Use both /// the **userId** and **secret** parameters that were attached to your app URL @@ -766,14 +768,16 @@ static Models.Token Convert(Dictionary it) => } /// - /// Create Phone Verification + /// Create phone verification /// /// Use this endpoint to send a verification SMS to the currently logged in /// user. This endpoint is meant for use after updating a user's phone number - /// using the [accountUpdatePhone](/docs/client/account#accountUpdatePhone) + /// using the + /// [accountUpdatePhone](https://appwrite.io/docs/references/cloud/client-web/account#updatePhone) /// endpoint. Learn more about how to [complete the verification - /// process](/docs/client/account#accountUpdatePhoneVerification). The - /// verification code sent to the user's phone number is valid for 15 minutes. + /// process](https://appwrite.io/docs/references/cloud/client-web/account#updatePhoneVerification). + /// The verification code sent to the user's phone number is valid for 15 + /// minutes. /// /// public Task CreatePhoneVerification() @@ -805,7 +809,7 @@ static Models.Token Convert(Dictionary it) => } /// - /// Create Phone Verification (confirmation) + /// Create phone verification (confirmation) /// /// Use this endpoint to complete the user phone verification process. Use the /// **userId** and **secret** that were sent to your user's phone number to diff --git a/src/Appwrite/Services/Avatars.cs b/src/Appwrite/Services/Avatars.cs index f79593d..965d3ae 100644 --- a/src/Appwrite/Services/Avatars.cs +++ b/src/Appwrite/Services/Avatars.cs @@ -14,12 +14,13 @@ public Avatars(Client client) : base(client) } /// - /// Get Browser Icon + /// Get browser icon /// /// You can use this endpoint to show different browser icons to your users. /// The code argument receives the browser code as it appears in your user [GET - /// /account/sessions](/docs/client/account#accountGetSessions) endpoint. Use - /// width, height and quality arguments to change the output settings. + /// /account/sessions](https://appwrite.io/docs/references/cloud/client-web/account#getSessions) + /// endpoint. Use width, height and quality arguments to change the output + /// settings. /// /// When one dimension is specified and the other is 0, the image is scaled /// with preserved aspect ratio. If both dimensions are 0, the API provides an @@ -54,7 +55,7 @@ public Task GetBrowser(string code, long? width = null, long? height = n } /// - /// Get Credit Card Icon + /// Get credit card icon /// /// The credit card endpoint will return you the icon of the credit card /// provider you need. Use width, height and quality arguments to change the @@ -94,7 +95,7 @@ public Task GetCreditCard(string code, long? width = null, long? height } /// - /// Get Favicon + /// Get favicon /// /// Use this endpoint to fetch the favorite icon (AKA favicon) of any remote /// website URL. @@ -125,12 +126,12 @@ public Task GetFavicon(string url) } /// - /// Get Country Flag + /// Get country flag /// /// You can use this endpoint to show different country flags icons to your /// users. The code argument receives the 2 letter country code. Use width, /// height and quality arguments to change the output settings. Country codes - /// follow the [ISO 3166-1](http://en.wikipedia.org/wiki/ISO_3166-1) standard. + /// follow the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) standard. /// /// When one dimension is specified and the other is 0, the image is scaled /// with preserved aspect ratio. If both dimensions are 0, the API provides an @@ -166,7 +167,7 @@ public Task GetFlag(string code, long? width = null, long? height = null } /// - /// Get Image from URL + /// Get image from URL /// /// Use this endpoint to fetch a remote image URL and crop it to any image size /// you want. This endpoint is very useful if you need to crop and display @@ -206,7 +207,7 @@ public Task GetImage(string url, long? width = null, long? height = null } /// - /// Get User Initials + /// Get user initials /// /// Use this endpoint to show your user initials avatar icon on your website or /// app. By default, this route will try to print your logged-in user name or @@ -253,7 +254,7 @@ public Task GetInitials(string? name = null, long? width = null, long? h } /// - /// Get QR Code + /// Get QR code /// /// Converts a given plain text to a QR code image. You can use the query /// parameters to change the size and style of the resulting image. diff --git a/src/Appwrite/Services/Databases.cs b/src/Appwrite/Services/Databases.cs index ab5997f..f44abe0 100644 --- a/src/Appwrite/Services/Databases.cs +++ b/src/Appwrite/Services/Databases.cs @@ -14,7 +14,7 @@ public Databases(Client client) : base(client) } /// - /// List Databases + /// List databases /// /// Get a list of all databases from the current Appwrite project. You can use /// the search parameter to filter your results. @@ -51,7 +51,7 @@ static Models.DatabaseList Convert(Dictionary it) => } /// - /// Create Database + /// Create database /// /// Create a new Database. /// @@ -89,7 +89,7 @@ static Models.Database Convert(Dictionary it) => } /// - /// Get Database + /// Get database /// /// Get a database by its unique ID. This endpoint response returns a JSON /// object with the database metadata. @@ -125,7 +125,7 @@ static Models.Database Convert(Dictionary it) => } /// - /// Update Database + /// Update database /// /// Update a database by its unique ID. /// @@ -162,7 +162,7 @@ static Models.Database Convert(Dictionary it) => } /// - /// Delete Database + /// Delete database /// /// Delete a database by its unique ID. Only API keys with with databases.write /// scope can delete a database. @@ -195,7 +195,7 @@ public Task Delete(string databaseId) } /// - /// List Collections + /// List collections /// /// Get a list of all collections that belong to the provided databaseId. You /// can use the search parameter to filter your results. @@ -233,12 +233,12 @@ static Models.CollectionList Convert(Dictionary it) => } /// - /// Create Collection + /// Create collection /// /// Create a new Collection. Before using this route, you should create a new /// database resource using either a [server - /// integration](/docs/server/databases#databasesCreateCollection) API or - /// directly from your database console. + /// integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) + /// 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) @@ -276,7 +276,7 @@ static Models.Collection Convert(Dictionary it) => } /// - /// Get Collection + /// Get collection /// /// Get a collection by its unique ID. This endpoint response returns a JSON /// object with the collection metadata. @@ -313,7 +313,7 @@ static Models.Collection Convert(Dictionary it) => } /// - /// Update Collection + /// Update collection /// /// Update a collection by its unique ID. /// @@ -353,7 +353,7 @@ static Models.Collection Convert(Dictionary it) => } /// - /// Delete Collection + /// Delete collection /// /// Delete a collection by its unique ID. Only users with write permissions /// have access to delete this resource. @@ -387,7 +387,7 @@ public Task DeleteCollection(string databaseId, string collectionId) } /// - /// List Attributes + /// List attributes /// public Task ListAttributes(string databaseId, string collectionId, List? queries = null) { @@ -421,7 +421,7 @@ static Models.AttributeList Convert(Dictionary it) => } /// - /// Create Boolean Attribute + /// Create boolean attribute /// /// Create a boolean attribute. /// @@ -462,7 +462,7 @@ static Models.AttributeBoolean Convert(Dictionary it) => } /// - /// Update Boolean Attribute + /// Update boolean attribute /// public Task UpdateBooleanAttribute(string databaseId, string collectionId, string key, bool required, bool xdefault) { @@ -498,7 +498,7 @@ static Models.AttributeBoolean Convert(Dictionary it) => } /// - /// Create DateTime Attribute + /// Create datetime attribute /// public Task CreateDatetimeAttribute(string databaseId, string collectionId, string key, bool required, string? xdefault = null, bool? array = null) { @@ -535,7 +535,7 @@ static Models.AttributeDatetime Convert(Dictionary it) => } /// - /// Update DateTime Attribute + /// Update dateTime attribute /// public Task UpdateDatetimeAttribute(string databaseId, string collectionId, string key, bool required, string xdefault) { @@ -571,7 +571,7 @@ static Models.AttributeDatetime Convert(Dictionary it) => } /// - /// Create Email Attribute + /// Create email attribute /// /// Create an email attribute. /// @@ -612,7 +612,7 @@ static Models.AttributeEmail Convert(Dictionary it) => } /// - /// Update Email Attribute + /// Update email attribute /// /// Update an email attribute. Changing the `default` value will not update /// already existing documents. @@ -653,7 +653,7 @@ static Models.AttributeEmail Convert(Dictionary it) => } /// - /// Create Enum Attribute + /// Create enum attribute /// public Task CreateEnumAttribute(string databaseId, string collectionId, string key, List elements, bool required, string? xdefault = null, bool? array = null) { @@ -691,7 +691,7 @@ static Models.AttributeEnum Convert(Dictionary it) => } /// - /// Update Enum Attribute + /// Update enum attribute /// /// Update an enum attribute. Changing the `default` value will not update /// already existing documents. @@ -733,7 +733,7 @@ static Models.AttributeEnum Convert(Dictionary it) => } /// - /// Create Float Attribute + /// Create float attribute /// /// Create a float attribute. Optionally, minimum and maximum values can be /// provided. @@ -777,7 +777,7 @@ static Models.AttributeFloat Convert(Dictionary it) => } /// - /// Update Float Attribute + /// Update float attribute /// /// Update a float attribute. Changing the `default` value will not update /// already existing documents. @@ -820,7 +820,7 @@ static Models.AttributeFloat Convert(Dictionary it) => } /// - /// Create Integer Attribute + /// Create integer attribute /// /// Create an integer attribute. Optionally, minimum and maximum values can be /// provided. @@ -864,7 +864,7 @@ static Models.AttributeInteger Convert(Dictionary it) => } /// - /// Update Integer Attribute + /// Update integer attribute /// /// Update an integer attribute. Changing the `default` value will not update /// already existing documents. @@ -907,7 +907,7 @@ static Models.AttributeInteger Convert(Dictionary it) => } /// - /// Create IP Address Attribute + /// Create IP address attribute /// /// Create IP address attribute. /// @@ -948,7 +948,7 @@ static Models.AttributeIp Convert(Dictionary it) => } /// - /// Update IP Address Attribute + /// Update IP address attribute /// /// Update an ip attribute. Changing the `default` value will not update /// already existing documents. @@ -989,10 +989,10 @@ static Models.AttributeIp Convert(Dictionary it) => } /// - /// Create Relationship Attribute + /// Create relationship attribute /// /// Create relationship attribute. [Learn more about relationship - /// attributes](/docs/databases-relationships#relationship-attributes). + /// attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes). /// /// /// @@ -1033,7 +1033,7 @@ static Models.AttributeRelationship Convert(Dictionary it) => } /// - /// Create String Attribute + /// Create string attribute /// /// Create a string attribute. /// @@ -1076,7 +1076,7 @@ static Models.AttributeString Convert(Dictionary it) => } /// - /// Update String Attribute + /// Update string attribute /// /// Update a string attribute. Changing the `default` value will not update /// already existing documents. @@ -1117,7 +1117,7 @@ static Models.AttributeString Convert(Dictionary it) => } /// - /// Create URL Attribute + /// Create URL attribute /// /// Create a URL attribute. /// @@ -1158,7 +1158,7 @@ static Models.AttributeUrl Convert(Dictionary it) => } /// - /// Update URL Attribute + /// Update URL attribute /// /// Update an url attribute. Changing the `default` value will not update /// already existing documents. @@ -1199,7 +1199,7 @@ static Models.AttributeUrl Convert(Dictionary it) => } /// - /// Get Attribute + /// Get attribute /// public Task GetAttribute(string databaseId, string collectionId, string key) { @@ -1230,7 +1230,7 @@ public Task GetAttribute(string databaseId, string collectionId, string } /// - /// Delete Attribute + /// Delete attribute /// public Task DeleteAttribute(string databaseId, string collectionId, string key) { @@ -1261,10 +1261,10 @@ public Task DeleteAttribute(string databaseId, string collectionId, stri } /// - /// Update Relationship Attribute + /// Update relationship attribute /// /// Update relationship attribute. [Learn more about relationship - /// attributes](/docs/databases-relationships#relationship-attributes). + /// attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes). /// /// /// @@ -1301,7 +1301,7 @@ static Models.AttributeRelationship Convert(Dictionary it) => } /// - /// List Documents + /// List documents /// /// Get a list of all the user's documents in a given collection. You can use /// the query params to filter your results. @@ -1339,12 +1339,12 @@ static Models.DocumentList Convert(Dictionary it) => } /// - /// Create Document + /// Create document /// /// Create a new Document. Before using this route, you should create a new /// collection resource using either a [server - /// integration](/docs/server/databases#databasesCreateCollection) API or - /// directly from your database console. + /// integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) + /// API or directly from your database console. /// /// public Task CreateDocument(string databaseId, string collectionId, string documentId, object data, List? permissions = null) @@ -1381,7 +1381,7 @@ static Models.Document Convert(Dictionary it) => } /// - /// Get Document + /// Get document /// /// Get a document by its unique ID. This endpoint response returns a JSON /// object with the document data. @@ -1420,7 +1420,7 @@ static Models.Document Convert(Dictionary it) => } /// - /// Update Document + /// Update document /// /// Update a document by its unique ID. Using the patch method you can pass /// only specific fields that will get updated. @@ -1460,7 +1460,7 @@ static Models.Document Convert(Dictionary it) => } /// - /// Delete Document + /// Delete document /// /// Delete a document by its unique ID. /// @@ -1494,7 +1494,7 @@ public Task DeleteDocument(string databaseId, string collectionId, strin } /// - /// List Indexes + /// List indexes /// public Task ListIndexes(string databaseId, string collectionId, List? queries = null) { @@ -1528,7 +1528,7 @@ static Models.IndexList Convert(Dictionary it) => } /// - /// Create Index + /// Create index /// public Task CreateIndex(string databaseId, string collectionId, string key, string type, List attributes, List? orders = null) { @@ -1565,7 +1565,7 @@ static Models.Index Convert(Dictionary it) => } /// - /// Get Index + /// Get index /// public Task GetIndex(string databaseId, string collectionId, string key) { @@ -1599,7 +1599,7 @@ static Models.Index Convert(Dictionary it) => } /// - /// Delete Index + /// Delete index /// public Task DeleteIndex(string databaseId, string collectionId, string key) { diff --git a/src/Appwrite/Services/Functions.cs b/src/Appwrite/Services/Functions.cs index 81abcd5..a9e93ee 100644 --- a/src/Appwrite/Services/Functions.cs +++ b/src/Appwrite/Services/Functions.cs @@ -14,7 +14,7 @@ public Functions(Client client) : base(client) } /// - /// List Functions + /// List functions /// /// Get a list of all the project's functions. You can use the query params to /// filter your results. @@ -51,11 +51,12 @@ static Models.FunctionList Convert(Dictionary it) => } /// - /// Create Function + /// Create function /// /// Create a new function. You can pass a list of - /// [permissions](/docs/permissions) to allow different project users or team - /// with access to execute the function using the client API. + /// [permissions](https://appwrite.io/docs/permissions) to allow different + /// project users or team with access to execute the function using the client + /// API. /// /// public Task Create(string functionId, string name, string runtime, List? execute = null, List? events = null, string? schedule = null, long? timeout = null, bool? enabled = null, bool? logging = null, string? entrypoint = null, string? commands = null, string? installationId = null, string? providerRepositoryId = null, string? providerBranch = null, bool? providerSilentMode = null, string? providerRootDirectory = null, string? templateRepository = null, string? templateOwner = null, string? templateRootDirectory = null, string? templateBranch = null) @@ -141,7 +142,7 @@ static Models.RuntimeList Convert(Dictionary it) => } /// - /// Get Function + /// Get function /// /// Get a function by its unique ID. /// @@ -176,7 +177,7 @@ static Models.Function Convert(Dictionary it) => } /// - /// Update Function + /// Update function /// /// Update function by its unique ID. /// @@ -226,7 +227,7 @@ static Models.Function Convert(Dictionary it) => } /// - /// Delete Function + /// Delete function /// /// Delete a function by its unique ID. /// @@ -258,7 +259,7 @@ public Task Delete(string functionId) } /// - /// List Deployments + /// List deployments /// /// Get a list of all the project's code deployments. You can use the query /// params to filter your results. @@ -296,7 +297,7 @@ static Models.DeploymentList Convert(Dictionary it) => } /// - /// Create Deployment + /// Create deployment /// /// Create a new function code deployment. Use this endpoint to upload a new /// version of your code function. To execute your newly uploaded code, you'll @@ -305,7 +306,7 @@ static Models.DeploymentList Convert(Dictionary it) => /// This endpoint accepts a tar.gz file compressed with your code. Make sure to /// include any dependencies your code has within the compressed file. You can /// learn more about code packaging in the [Appwrite Cloud Functions - /// tutorial](/docs/functions). + /// tutorial](https://appwrite.io/docs/functions). /// /// Use the "command" param to set the entrypoint used to execute your code. /// @@ -348,7 +349,7 @@ static Models.Deployment Convert(Dictionary it) => } /// - /// Get Deployment + /// Get deployment /// /// Get a code deployment by its unique ID. /// @@ -384,7 +385,7 @@ static Models.Deployment Convert(Dictionary it) => } /// - /// Update Function Deployment + /// Update function deployment /// /// Update the function code deployment ID using the unique function ID. Use /// this endpoint to switch the code deployment that should be executed by the @@ -422,7 +423,7 @@ static Models.Function Convert(Dictionary it) => } /// - /// Delete Deployment + /// Delete deployment /// /// Delete a code deployment by its unique ID. /// @@ -455,7 +456,7 @@ public Task DeleteDeployment(string functionId, string deploymentId) } /// - /// Create Build + /// Create build /// /// Create a new build for an Appwrite Function deployment. This endpoint can /// be used to retry a failed build. @@ -491,6 +492,10 @@ public Task CreateBuild(string functionId, string deploymentId, string b /// /// Download Deployment + /// + /// Get a Deployment's contents by its unique ID. This endpoint supports range + /// requests for partial or streaming file download. + /// /// public Task DownloadDeployment(string functionId, string deploymentId) { @@ -517,7 +522,7 @@ public Task DownloadDeployment(string functionId, string deploymentId) } /// - /// List Executions + /// List executions /// /// Get a list of all the current user function execution logs. You can use the /// query params to filter your results. @@ -555,7 +560,7 @@ static Models.ExecutionList Convert(Dictionary it) => } /// - /// Create Execution + /// Create execution /// /// Trigger a function execution. The returned object will return you the /// current execution status. You can ping the `Get Execution` endpoint to get @@ -598,7 +603,7 @@ static Models.Execution Convert(Dictionary it) => } /// - /// Get Execution + /// Get execution /// /// Get a function execution log by its unique ID. /// @@ -634,7 +639,7 @@ static Models.Execution Convert(Dictionary it) => } /// - /// List Variables + /// List variables /// /// Get a list of all variables of a specific function. /// @@ -669,7 +674,7 @@ static Models.VariableList Convert(Dictionary it) => } /// - /// Create Variable + /// Create variable /// /// Create a new function environment variable. These variables can be accessed /// in the function at runtime as environment variables. @@ -707,7 +712,7 @@ static Models.Variable Convert(Dictionary it) => } /// - /// Get Variable + /// Get variable /// /// Get a variable by its unique ID. /// @@ -743,7 +748,7 @@ static Models.Variable Convert(Dictionary it) => } /// - /// Update Variable + /// Update variable /// /// Update variable by its unique ID. /// @@ -781,7 +786,7 @@ static Models.Variable Convert(Dictionary it) => } /// - /// Delete Variable + /// Delete variable /// /// Delete a variable by its unique ID. /// diff --git a/src/Appwrite/Services/Graphql.cs b/src/Appwrite/Services/Graphql.cs index 6982eaf..89e5ad0 100644 --- a/src/Appwrite/Services/Graphql.cs +++ b/src/Appwrite/Services/Graphql.cs @@ -14,7 +14,7 @@ public Graphql(Client client) : base(client) } /// - /// GraphQL Endpoint + /// GraphQL endpoint /// /// Execute a GraphQL mutation. /// @@ -50,7 +50,7 @@ static object Convert(Dictionary it) => } /// - /// GraphQL Endpoint + /// GraphQL endpoint /// /// Execute a GraphQL mutation. /// diff --git a/src/Appwrite/Services/Health.cs b/src/Appwrite/Services/Health.cs index 75a2827..6c1786c 100644 --- a/src/Appwrite/Services/Health.cs +++ b/src/Appwrite/Services/Health.cs @@ -48,7 +48,7 @@ static Models.HealthStatus Convert(Dictionary it) => } /// - /// Get Antivirus + /// Get antivirus /// /// Check the Appwrite Antivirus server is up and connection is successful. /// @@ -82,7 +82,7 @@ static Models.HealthAntivirus Convert(Dictionary it) => } /// - /// Get Cache + /// Get cache /// /// Check the Appwrite in-memory cache servers are up and connection is /// successful. @@ -151,7 +151,7 @@ static Models.HealthStatus Convert(Dictionary it) => } /// - /// Get PubSub + /// Get pubsub /// /// Check the Appwrite pub-sub servers are up and connection is successful. /// @@ -185,7 +185,7 @@ static Models.HealthStatus Convert(Dictionary it) => } /// - /// Get Queue + /// Get queue /// /// Check the Appwrite queue messaging servers are up and connection is /// successful. @@ -220,19 +220,129 @@ static Models.HealthStatus Convert(Dictionary it) => } /// - /// Get Certificates Queue + /// Get builds queue + /// + /// Get the number of builds that are waiting to be processed in the Appwrite + /// internal queue server. + /// + /// + public Task GetQueueBuilds(long? threshold = null) + { + var apiPath = "/health/queue/builds"; + + var apiParameters = new Dictionary() + { + { "threshold", threshold } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + + static Models.HealthQueue Convert(Dictionary it) => + Models.HealthQueue.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 certificates queue /// /// Get the number of certificates that are waiting to be issued against /// [Letsencrypt](https://letsencrypt.org/) in the Appwrite internal queue /// server. /// /// - public Task GetQueueCertificates() + public Task GetQueueCertificates(long? threshold = null) { var apiPath = "/health/queue/certificates"; var apiParameters = new Dictionary() { + { "threshold", threshold } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + + static Models.HealthQueue Convert(Dictionary it) => + Models.HealthQueue.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 databases queue + /// + /// Get the number of database changes that are waiting to be processed in the + /// Appwrite internal queue server. + /// + /// + public Task GetQueueDatabases(string? name = null, long? threshold = null) + { + var apiPath = "/health/queue/databases"; + + var apiParameters = new Dictionary() + { + { "name", name }, + { "threshold", threshold } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + + static Models.HealthQueue Convert(Dictionary it) => + Models.HealthQueue.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 deletes queue + /// + /// Get the number of background destructive changes that are waiting to be + /// processed in the Appwrite internal queue server. + /// + /// + public Task GetQueueDeletes(long? threshold = null) + { + var apiPath = "/health/queue/deletes"; + + var apiParameters = new Dictionary() + { + { "threshold", threshold } }; var apiHeaders = new Dictionary() @@ -256,14 +366,15 @@ static Models.HealthQueue Convert(Dictionary it) => } /// - /// Get Functions Queue + /// Get functions queue /// - public Task GetQueueFunctions() + public Task GetQueueFunctions(long? threshold = null) { var apiPath = "/health/queue/functions"; var apiParameters = new Dictionary() { + { "threshold", threshold } }; var apiHeaders = new Dictionary() @@ -287,18 +398,127 @@ static Models.HealthQueue Convert(Dictionary it) => } /// - /// Get Logs Queue + /// Get logs queue /// /// Get the number of logs that are waiting to be processed in the Appwrite /// internal queue server. /// /// - public Task GetQueueLogs() + public Task GetQueueLogs(long? threshold = null) { var apiPath = "/health/queue/logs"; var apiParameters = new Dictionary() { + { "threshold", threshold } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + + static Models.HealthQueue Convert(Dictionary it) => + Models.HealthQueue.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 mails queue + /// + /// Get the number of mails that are waiting to be processed in the Appwrite + /// internal queue server. + /// + /// + public Task GetQueueMails(long? threshold = null) + { + var apiPath = "/health/queue/mails"; + + var apiParameters = new Dictionary() + { + { "threshold", threshold } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + + static Models.HealthQueue Convert(Dictionary it) => + Models.HealthQueue.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 messaging queue + /// + /// Get the number of messages that are waiting to be processed in the Appwrite + /// internal queue server. + /// + /// + public Task GetQueueMessaging(long? threshold = null) + { + var apiPath = "/health/queue/messaging"; + + var apiParameters = new Dictionary() + { + { "threshold", threshold } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + + static Models.HealthQueue Convert(Dictionary it) => + Models.HealthQueue.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 migrations queue + /// + /// Get the number of migrations that are waiting to be processed in the + /// Appwrite internal queue server. + /// + /// + public Task GetQueueMigrations(long? threshold = null) + { + var apiPath = "/health/queue/migrations"; + + var apiParameters = new Dictionary() + { + { "threshold", threshold } }; var apiHeaders = new Dictionary() @@ -322,18 +542,19 @@ static Models.HealthQueue Convert(Dictionary it) => } /// - /// Get Webhooks Queue + /// Get webhooks queue /// /// Get the number of webhooks that are waiting to be processed in the Appwrite /// internal queue server. /// /// - public Task GetQueueWebhooks() + public Task GetQueueWebhooks(long? threshold = null) { var apiPath = "/health/queue/webhooks"; var apiParameters = new Dictionary() { + { "threshold", threshold } }; var apiHeaders = new Dictionary() @@ -357,7 +578,7 @@ static Models.HealthQueue Convert(Dictionary it) => } /// - /// Get Local Storage + /// Get local storage /// /// Check the Appwrite local storage device is up and connection is successful. /// @@ -391,7 +612,7 @@ static Models.HealthStatus Convert(Dictionary it) => } /// - /// Get Time + /// Get time /// /// Check the Appwrite server time is synced with Google remote NTP server. We /// use this technology to smoothly handle leap seconds with no disruptive diff --git a/src/Appwrite/Services/Locale.cs b/src/Appwrite/Services/Locale.cs index 8db2b3e..cae54b2 100644 --- a/src/Appwrite/Services/Locale.cs +++ b/src/Appwrite/Services/Locale.cs @@ -14,7 +14,7 @@ public Locale(Client client) : base(client) } /// - /// Get User Locale + /// Get user locale /// /// Get the current user location based on IP. Returns an object with user /// country code, country name, continent name, continent code, ip address and @@ -88,7 +88,7 @@ static Models.LocaleCodeList Convert(Dictionary it) => } /// - /// List Continents + /// List continents /// /// List of all continents. You can use the locale header to get the data in a /// supported language. @@ -123,7 +123,7 @@ static Models.ContinentList Convert(Dictionary it) => } /// - /// List Countries + /// List countries /// /// List of all countries. You can use the locale header to get the data in a /// supported language. @@ -158,7 +158,7 @@ static Models.CountryList Convert(Dictionary it) => } /// - /// List EU Countries + /// List EU countries /// /// List of all countries that are currently members of the EU. You can use the /// locale header to get the data in a supported language. @@ -193,7 +193,7 @@ static Models.CountryList Convert(Dictionary it) => } /// - /// List Countries Phone Codes + /// List countries phone codes /// /// List of all countries phone codes. You can use the locale header to get the /// data in a supported language. @@ -228,7 +228,7 @@ static Models.PhoneList Convert(Dictionary it) => } /// - /// List Currencies + /// List currencies /// /// List of all currencies, including currency symbol, name, plural, and /// decimal digits for all major and minor currencies. You can use the locale @@ -264,7 +264,7 @@ static Models.CurrencyList Convert(Dictionary it) => } /// - /// List Languages + /// List languages /// /// List of all languages classified by ISO 639-1 including 2-letter code, name /// in English, and name in the respective language. diff --git a/src/Appwrite/Services/Storage.cs b/src/Appwrite/Services/Storage.cs index 38f29eb..40e0a7d 100644 --- a/src/Appwrite/Services/Storage.cs +++ b/src/Appwrite/Services/Storage.cs @@ -95,7 +95,7 @@ static Models.Bucket Convert(Dictionary it) => } /// - /// Get Bucket + /// Get bucket /// /// Get a storage bucket by its unique ID. This endpoint response returns a /// JSON object with the storage bucket metadata. @@ -131,7 +131,7 @@ static Models.Bucket Convert(Dictionary it) => } /// - /// Update Bucket + /// Update bucket /// /// Update a storage bucket by its unique ID. /// @@ -175,7 +175,7 @@ static Models.Bucket Convert(Dictionary it) => } /// - /// Delete Bucket + /// Delete bucket /// /// Delete a storage bucket by its unique ID. /// @@ -207,7 +207,7 @@ public Task DeleteBucket(string bucketId) } /// - /// List Files + /// List files /// /// Get a list of all the user files. You can use the query params to filter /// your results. @@ -245,12 +245,12 @@ static Models.FileList Convert(Dictionary it) => } /// - /// Create File + /// Create file /// /// Create a new file. Before using this route, you should create a new bucket /// resource using either a [server - /// integration](/docs/server/storage#storageCreateBucket) API or directly from - /// your Appwrite console. + /// integration](https://appwrite.io/docs/server/storage#storageCreateBucket) + /// API or directly from your Appwrite console. /// /// Larger files should be uploaded using multiple requests with the /// [content-range](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Range) @@ -304,7 +304,7 @@ static Models.File Convert(Dictionary it) => } /// - /// Get File + /// Get file /// /// Get a file by its unique ID. This endpoint response returns a JSON object /// with the file metadata. @@ -341,7 +341,7 @@ static Models.File Convert(Dictionary it) => } /// - /// Update File + /// Update file /// /// Update a file by its unique ID. Only users with write permissions have /// access to update this resource. @@ -414,7 +414,7 @@ public Task DeleteFile(string bucketId, string fileId) } /// - /// Get File for Download + /// Get file for download /// /// Get a file content by its unique ID. The endpoint response return with a /// 'Content-Disposition: attachment' header that tells the browser to start @@ -446,7 +446,7 @@ public Task GetFileDownload(string bucketId, string fileId) } /// - /// Get File Preview + /// Get file preview /// /// Get a file preview image. Currently, this method supports preview for image /// files (jpg, png, and gif), other supported formats, like pdf, docs, slides, @@ -491,7 +491,7 @@ public Task GetFilePreview(string bucketId, string fileId, long? width = } /// - /// Get File for View + /// Get file for view /// /// Get a file content by its unique ID. This endpoint is similar to the /// download method but returns with no 'Content-Disposition: attachment' diff --git a/src/Appwrite/Services/Teams.cs b/src/Appwrite/Services/Teams.cs index e026c24..76f1de6 100644 --- a/src/Appwrite/Services/Teams.cs +++ b/src/Appwrite/Services/Teams.cs @@ -14,7 +14,7 @@ public Teams(Client client) : base(client) } /// - /// List Teams + /// List teams /// /// Get a list of all the teams in which the current user is a member. You can /// use the parameters to filter your results. @@ -51,7 +51,7 @@ static Models.TeamList Convert(Dictionary it) => } /// - /// Create Team + /// Create team /// /// Create a new team. The user who creates the team will automatically be /// assigned as the owner of the team. Only the users with the owner role can @@ -90,7 +90,7 @@ static Models.Team Convert(Dictionary it) => } /// - /// Get Team + /// Get team /// /// Get a team by its ID. All team members have read access for this resource. /// @@ -125,7 +125,7 @@ static Models.Team Convert(Dictionary it) => } /// - /// Update Name + /// Update name /// /// Update the team's name by its unique ID. /// @@ -161,7 +161,7 @@ static Models.Team Convert(Dictionary it) => } /// - /// Delete Team + /// Delete team /// /// Delete a team using its ID. Only team members with the owner role can /// delete the team. @@ -194,7 +194,7 @@ public Task Delete(string teamId) } /// - /// List Team Memberships + /// List team memberships /// /// Use this endpoint to list a team's members using the team's ID. All team /// members have read access to this endpoint. @@ -232,7 +232,7 @@ static Models.MembershipList Convert(Dictionary it) => } /// - /// Create Team Membership + /// Create team membership /// /// Invite a new member to join your team. Provide an ID for existing users, or /// invite unregistered users using an email or phone number. If initiated from @@ -247,8 +247,8 @@ static Models.MembershipList Convert(Dictionary it) => /// /// Use the `url` parameter to redirect the user from the invitation email to /// your app. After the user is redirected, use the [Update Team Membership - /// Status](/docs/client/teams#teamsUpdateMembershipStatus) endpoint to allow - /// the user to accept the invitation to the team. + /// Status](https://appwrite.io/docs/references/cloud/client-web/teams#updateMembershipStatus) + /// endpoint to allow the user to accept the invitation to the team. /// /// Please note that to avoid a [Redirect /// Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) @@ -293,7 +293,7 @@ static Models.Membership Convert(Dictionary it) => } /// - /// Get Team Membership + /// Get team membership /// /// Get a team member by the membership unique id. All team members have read /// access for this resource. @@ -330,11 +330,11 @@ static Models.Membership Convert(Dictionary it) => } /// - /// Update Membership + /// Update membership /// /// Modify the roles of a team member. Only team members with the owner role /// have access to this endpoint. Learn more about [roles and - /// permissions](/docs/permissions). + /// permissions](https://appwrite.io/docs/permissions). /// /// /// @@ -370,7 +370,7 @@ static Models.Membership Convert(Dictionary it) => } /// - /// Delete Team Membership + /// Delete team membership /// /// This endpoint allows a user to leave a team or for a team owner to delete /// the membership of any other team member. You can also use this endpoint to @@ -405,7 +405,7 @@ public Task DeleteMembership(string teamId, string membershipId) } /// - /// Update Team Membership Status + /// Update team membership status /// /// Use this endpoint to allow a user to accept an invitation to join a team /// after being redirected back to your app from the invitation email received @@ -449,11 +449,11 @@ static Models.Membership Convert(Dictionary it) => } /// - /// Get Team Preferences + /// Get team preferences /// /// Get the team's shared preferences by its unique ID. If a preference doesn't /// need to be shared by all team members, prefer storing them in [user - /// preferences](/docs/client/account#accountGetPrefs). + /// preferences](https://appwrite.io/docs/references/cloud/client-web/account#getPrefs). /// /// public Task GetPrefs(string teamId) @@ -486,7 +486,7 @@ static Models.Preferences Convert(Dictionary it) => } /// - /// Update Preferences + /// Update preferences /// /// Update the team's preferences by its unique ID. The object you pass is /// stored as is and replaces any previous value. The maximum allowed prefs diff --git a/src/Appwrite/Services/Users.cs b/src/Appwrite/Services/Users.cs index 202b62f..985f888 100644 --- a/src/Appwrite/Services/Users.cs +++ b/src/Appwrite/Services/Users.cs @@ -14,7 +14,7 @@ public Users(Client client) : base(client) } /// - /// List Users + /// List users /// /// Get a list of all the project's users. You can use the query params to /// filter your results. @@ -51,7 +51,7 @@ static Models.UserList Convert(Dictionary it) => } /// - /// Create User + /// Create user /// /// Create a new user. /// @@ -90,12 +90,12 @@ static Models.User Convert(Dictionary it) => } /// - /// Create User with Argon2 Password + /// Create user with Argon2 password /// /// Create a new user. Password provided must be hashed with the /// [Argon2](https://en.wikipedia.org/wiki/Argon2) algorithm. Use the [POST - /// /users](/docs/server/users#usersCreate) endpoint to create users with a - /// plain text password. + /// /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to + /// create users with a plain text password. /// /// public Task CreateArgon2User(string userId, string email, string password, string? name = null) @@ -131,12 +131,12 @@ static Models.User Convert(Dictionary it) => } /// - /// Create User with Bcrypt Password + /// Create user with bcrypt password /// /// Create a new user. Password provided must be hashed with the /// [Bcrypt](https://en.wikipedia.org/wiki/Bcrypt) algorithm. Use the [POST - /// /users](/docs/server/users#usersCreate) endpoint to create users with a - /// plain text password. + /// /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to + /// create users with a plain text password. /// /// public Task CreateBcryptUser(string userId, string email, string password, string? name = null) @@ -240,12 +240,12 @@ public Task DeleteIdentity(string identityId) } /// - /// Create User with MD5 Password + /// Create user with MD5 password /// /// Create a new user. Password provided must be hashed with the /// [MD5](https://en.wikipedia.org/wiki/MD5) algorithm. Use the [POST - /// /users](/docs/server/users#usersCreate) endpoint to create users with a - /// plain text password. + /// /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to + /// create users with a plain text password. /// /// public Task CreateMD5User(string userId, string email, string password, string? name = null) @@ -281,12 +281,12 @@ static Models.User Convert(Dictionary it) => } /// - /// Create User with PHPass Password + /// Create user with PHPass password /// /// Create a new user. Password provided must be hashed with the /// [PHPass](https://www.openwall.com/phpass/) algorithm. Use the [POST - /// /users](/docs/server/users#usersCreate) endpoint to create users with a - /// plain text password. + /// /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to + /// create users with a plain text password. /// /// public Task CreatePHPassUser(string userId, string email, string password, string? name = null) @@ -322,12 +322,12 @@ static Models.User Convert(Dictionary it) => } /// - /// Create User with Scrypt Password + /// Create user with Scrypt password /// /// Create a new user. Password provided must be hashed with the /// [Scrypt](https://github.com/Tarsnap/scrypt) algorithm. Use the [POST - /// /users](/docs/server/users#usersCreate) endpoint to create users with a - /// plain text password. + /// /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to + /// create users with a plain text password. /// /// public Task CreateScryptUser(string userId, string email, string password, string passwordSalt, long passwordCpu, long passwordMemory, long passwordParallel, long passwordLength, string? name = null) @@ -368,12 +368,13 @@ static Models.User Convert(Dictionary it) => } /// - /// Create User with Scrypt Modified Password + /// Create user with Scrypt modified password /// /// Create a new user. Password provided must be hashed with the [Scrypt /// Modified](https://gist.github.com/Meldiron/eecf84a0225eccb5a378d45bb27462cc) - /// algorithm. Use the [POST /users](/docs/server/users#usersCreate) endpoint - /// to create users with a plain text password. + /// algorithm. Use the [POST + /// /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to + /// create users with a plain text password. /// /// public Task CreateScryptModifiedUser(string userId, string email, string password, string passwordSalt, string passwordSaltSeparator, string passwordSignerKey, string? name = null) @@ -412,12 +413,12 @@ static Models.User Convert(Dictionary it) => } /// - /// Create User with SHA Password + /// Create user with SHA password /// /// Create a new user. Password provided must be hashed with the /// [SHA](https://en.wikipedia.org/wiki/Secure_Hash_Algorithm) algorithm. Use - /// the [POST /users](/docs/server/users#usersCreate) endpoint to create users - /// with a plain text password. + /// the [POST /users](https://appwrite.io/docs/server/users#usersCreate) + /// endpoint to create users with a plain text password. /// /// public Task CreateSHAUser(string userId, string email, string password, string? passwordVersion = null, string? name = null) @@ -454,7 +455,7 @@ static Models.User Convert(Dictionary it) => } /// - /// Get User + /// Get user /// /// Get a user by its unique ID. /// @@ -489,12 +490,13 @@ static Models.User Convert(Dictionary it) => } /// - /// Delete User + /// Delete user /// /// Delete a user by its unique ID, thereby releasing it's ID. Since ID is /// released and can be reused, all user-related resources like documents or /// storage files should be deleted before user deletion. If you want to keep - /// ID reserved, use the [updateStatus](/docs/server/users#usersUpdateStatus) + /// ID reserved, use the + /// [updateStatus](https://appwrite.io/docs/server/users#usersUpdateStatus) /// endpoint instead. /// /// @@ -525,7 +527,7 @@ public Task Delete(string userId) } /// - /// Update Email + /// Update email /// /// Update the user email by its unique ID. /// @@ -561,14 +563,14 @@ static Models.User Convert(Dictionary it) => } /// - /// Update User Labels + /// Update user labels /// /// Update the user labels by its unique ID. /// /// Labels can be used to grant access to resources. While teams are a way for /// user's to share access to a resource, labels can be defined by the /// developer to grant access without an invitation. See the [Permissions - /// docs](/docs/permissions) for more info. + /// docs](https://appwrite.io/docs/permissions) for more info. /// /// public Task UpdateLabels(string userId, List labels) @@ -602,7 +604,7 @@ static Models.User Convert(Dictionary it) => } /// - /// List User Logs + /// List user logs /// /// Get the user activity logs list by its unique ID. /// @@ -638,7 +640,7 @@ static Models.LogList Convert(Dictionary it) => } /// - /// List User Memberships + /// List user memberships /// /// Get the user membership list by its unique ID. /// @@ -673,7 +675,7 @@ static Models.MembershipList Convert(Dictionary it) => } /// - /// Update Name + /// Update name /// /// Update the user name by its unique ID. /// @@ -709,7 +711,7 @@ static Models.User Convert(Dictionary it) => } /// - /// Update Password + /// Update password /// /// Update the user password by its unique ID. /// @@ -745,7 +747,7 @@ static Models.User Convert(Dictionary it) => } /// - /// Update Phone + /// Update phone /// /// Update the user phone by its unique ID. /// @@ -781,7 +783,7 @@ static Models.User Convert(Dictionary it) => } /// - /// Get User Preferences + /// Get user preferences /// /// Get the user preferences by its unique ID. /// @@ -816,7 +818,7 @@ static Models.Preferences Convert(Dictionary it) => } /// - /// Update User Preferences + /// Update user preferences /// /// Update the user preferences by its unique ID. The object you pass is stored /// as is, and replaces any previous value. The maximum allowed prefs size is @@ -854,7 +856,7 @@ static Models.Preferences Convert(Dictionary it) => } /// - /// List User Sessions + /// List user sessions /// /// Get the user sessions list by its unique ID. /// @@ -889,7 +891,7 @@ static Models.SessionList Convert(Dictionary it) => } /// - /// Delete User Sessions + /// Delete user sessions /// /// Delete all user's sessions by using the user's unique ID. /// @@ -921,7 +923,7 @@ public Task DeleteSessions(string userId) } /// - /// Delete User Session + /// Delete user session /// /// Delete a user sessions by its unique ID. /// @@ -954,7 +956,7 @@ public Task DeleteSession(string userId, string sessionId) } /// - /// Update User Status + /// Update user status /// /// Update the user status by its unique ID. Use this endpoint as an /// alternative to deleting a user if you want to keep user's ID reserved. @@ -991,7 +993,7 @@ static Models.User Convert(Dictionary it) => } /// - /// Update Email Verification + /// Update email verification /// /// Update the user email verification status by its unique ID. /// @@ -1027,7 +1029,7 @@ static Models.User Convert(Dictionary it) => } /// - /// Update Phone Verification + /// Update phone verification /// /// Update the user phone verification status by its unique ID. /// From 7f577e82d96baa20d3698f0d9588d7614356df2b Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 16 Nov 2023 21:32:30 +1300 Subject: [PATCH 2/2] Fix between query output --- README.md | 6 +++--- src/Appwrite/Appwrite.csproj | 2 +- src/Appwrite/Client.cs | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 1e90649..db26150 100644 --- a/README.md +++ b/README.md @@ -17,17 +17,17 @@ Appwrite is an open-source backend as a service server that abstract and simplif 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 0.6.1 +Install-Package Appwrite -Version 0.7.0 # or .NET CLI -dotnet add package Appwrite --version 0.6.1 +dotnet add package Appwrite --version 0.7.0 ``` diff --git a/src/Appwrite/Appwrite.csproj b/src/Appwrite/Appwrite.csproj index b205360..917b289 100644 --- a/src/Appwrite/Appwrite.csproj +++ b/src/Appwrite/Appwrite.csproj @@ -2,7 +2,7 @@ netstandard2.0;net461 Appwrite - 0.6.1 + 0.7.0 Appwrite Team Appwrite Team diff --git a/src/Appwrite/Client.cs b/src/Appwrite/Client.cs index 738c349..50701e0 100644 --- a/src/Appwrite/Client.cs +++ b/src/Appwrite/Client.cs @@ -58,11 +58,11 @@ public Client( _headers = new Dictionary() { { "content-type", "application/json" }, - { "user-agent" , "AppwriteDotNetSDK/0.6.1 (${Environment.OSVersion.Platform}; ${Environment.OSVersion.VersionString})"}, + { "user-agent" , "AppwriteDotNetSDK/0.7.0 (${Environment.OSVersion.Platform}; ${Environment.OSVersion.VersionString})"}, { "x-sdk-name", ".NET" }, { "x-sdk-platform", "server" }, { "x-sdk-language", "dotnet" }, - { "x-sdk-version", "0.6.1"}, { "X-Appwrite-Response-Format", "1.4.0" } + { "x-sdk-version", "0.7.0"}, { "X-Appwrite-Response-Format", "1.4.0" } }; _config = new Dictionary();