-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #542 from PinguApps/388-create-core-for-databases-api
create core for databases api
- Loading branch information
Showing
279 changed files
with
15,040 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
using System; | ||
using System.Diagnostics.CodeAnalysis; | ||
using System.Threading.Tasks; | ||
using PinguApps.Appwrite.Client.Internals; | ||
using PinguApps.Appwrite.Shared; | ||
using PinguApps.Appwrite.Shared.Requests.Databases; | ||
using PinguApps.Appwrite.Shared.Responses; | ||
|
||
namespace PinguApps.Appwrite.Client.Clients; | ||
|
||
/// <inheritdoc/> | ||
public class DatabasesClient : SessionAwareClientBase, IDatabasesClient | ||
{ | ||
private readonly IDatabasesApi _databasesApi; | ||
|
||
internal DatabasesClient(IDatabasesApi databasesApi) | ||
{ | ||
_databasesApi = databasesApi; | ||
} | ||
|
||
[ExcludeFromCodeCoverage] | ||
/// <inheritdoc/> | ||
public Task<AppwriteResult<DocumentsList>> ListDocuments(ListDocumentsRequest request) => throw new NotImplementedException(); | ||
|
||
[ExcludeFromCodeCoverage] | ||
/// <inheritdoc/> | ||
public Task<AppwriteResult<Document>> CreateDocument(CreateDocumentRequest request) => throw new NotImplementedException(); | ||
|
||
[ExcludeFromCodeCoverage] | ||
/// <inheritdoc/> | ||
public Task<AppwriteResult> DeleteDocument(DeleteDocumentRequest request) => throw new NotImplementedException(); | ||
|
||
[ExcludeFromCodeCoverage] | ||
/// <inheritdoc/> | ||
public Task<AppwriteResult<Document>> GetDocument(GetDocumentRequest request) => throw new NotImplementedException(); | ||
|
||
[ExcludeFromCodeCoverage] | ||
/// <inheritdoc/> | ||
public Task<AppwriteResult<Document>> UpdateDocument(UpdateDocumentRequest request) => throw new NotImplementedException(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using System; | ||
using System.Threading.Tasks; | ||
using PinguApps.Appwrite.Shared; | ||
using PinguApps.Appwrite.Shared.Requests.Databases; | ||
using PinguApps.Appwrite.Shared.Responses; | ||
|
||
namespace PinguApps.Appwrite.Client.Clients; | ||
|
||
/// <summary> | ||
/// <para>The Databases service allows you to create structured collections of documents, query and filter lists of documents, and manage an advanced set of read and write access permissions.</para> | ||
/// <para>All data returned by the Databases service are represented as structured JSON documents.</para> | ||
/// <para>The Databases service can contain multiple databases, each database can contain multiple collections. A collection is a group of similarly structured documents. The accepted structure of documents is defined by <see href="https://appwrite.io/docs/products/databases/collections#attributes">collection attributes</see>. The collection attributes help you ensure all your user-submitted data is validated and stored according to the collection structure.</para> | ||
/// <para>Using Appwrite permissions architecture, you can assign read or write access to each collection or document in your project for either a specific user, team, user role, or even grant it with public access (any). You can learn more about <see href="https://appwrite.io/docs/products/databases/permissions">how Appwrite handles permissions and access control</see>.</para> | ||
/// <para><see href="https://appwrite.io/docs/references/1.6.x/server-rest/databases">Appwrite Docs</see></para> | ||
/// </summary> | ||
public interface IDatabasesClient | ||
{ | ||
[Obsolete("Endpoint not yet implemented.")] | ||
Task<AppwriteResult<Document>> CreateDocument(CreateDocumentRequest request); | ||
|
||
[Obsolete("Endpoint not yet implemented.")] | ||
Task<AppwriteResult> DeleteDocument(DeleteDocumentRequest request); | ||
|
||
[Obsolete("Endpoint not yet implemented.")] | ||
Task<AppwriteResult<Document>> GetDocument(GetDocumentRequest request); | ||
|
||
[Obsolete("Endpoint not yet implemented.")] | ||
Task<AppwriteResult<DocumentsList>> ListDocuments(ListDocumentsRequest request); | ||
|
||
[Obsolete("Endpoint not yet implemented.")] | ||
Task<AppwriteResult<Document>> UpdateDocument(UpdateDocumentRequest request); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Threading.Tasks; | ||
using PinguApps.Appwrite.Shared.Requests.Databases; | ||
using PinguApps.Appwrite.Shared.Responses; | ||
using Refit; | ||
|
||
namespace PinguApps.Appwrite.Client.Internals; | ||
internal interface IDatabasesApi : IBaseApi | ||
{ | ||
[Get("/databases/{databaseId}/collections/{collectionId}/documents")] | ||
[QueryUriFormat(UriFormat.Unescaped)] | ||
Task<IApiResponse<DocumentsList>> ListDocuments(string databaseId, string collectionId, [Query(CollectionFormat.Multi), AliasAs("queries[]")] IEnumerable<string> queries); | ||
|
||
[Post("/databases/{databaseId}/collections/{collectionId}/documents")] | ||
Task<IApiResponse<Document>> CreateDocument(string databaseId, string collectionId, CreateDocumentRequest request); | ||
|
||
[Delete("/databases/{databaseId}/collections/{collectionId}/documents/{documentId}")] | ||
Task<IApiResponse> DeleteDocument(string databaseId, string collectionId, string documentId); | ||
|
||
[Get("/databases/{databaseId}/collections/{collectionId}/documents/{documentId}")] | ||
[QueryUriFormat(UriFormat.Unescaped)] | ||
Task<IApiResponse<Document>> GetDocument(string databaseId, string collectionId, string documentId, [Query(CollectionFormat.Multi), AliasAs("queries[]")] IEnumerable<string> queries); | ||
|
||
[Patch("/databases/{databaseId}/collections/{collectionId}/documents/{documentId}")] | ||
Task<IApiResponse<Document>> UpdateDocument(string databaseId, string collectionId, string documentId, UpdateDocumentRequest request); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.