https://github.com/qappwrite/qappwrite
https://github.com/qappwrite/qappwrite
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/qappwrite/qappwrite
- Owner: qappwrite
- License: bsd-3-clause
- Created: 2023-05-01T20:01:07.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2023-05-08T19:51:21.000Z (about 2 years ago)
- Last Synced: 2024-11-02T21:31:59.387Z (6 months ago)
- Language: C++
- Size: 162 KB
- Stars: 2
- Watchers: 0
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-appwrite - Unofficial Appwrite Qt Framework SDK
README
# QAppWrite - Qt Framework client API
#
Appwrite
- API version: 1.3.0
Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)
For more information, please visit [https://appwrite.io/support](https://appwrite.io/support)
*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)*
## Requirements
Building the API client library requires:
1. CMake 3.2+
2. Qt
3. C++ Compiler## Getting Started
example.h:
```c++#include
#include "../client/AWAccountApi.h"using namespace test_namespace;
class Example : public QObject {
Q_OBJECT
AWAccountCreateRequest create();
public slots:
void exampleFunction1();
};```
example.cpp:
```c++#include "../client/AWAccountApi.h"
#include "example.h"
#include
#includeAWAccountCreateRequest Example::create(){
AWAccountCreateRequest obj;
return obj;
}void Example::exampleFunction1(){
AWAccountApi apiInstance;
// Configure API key authorization: Project
apiInstance.setApiKey("YOUR API KEY NAME","YOUR API KEY");QEventLoop loop;
connect(&apiInstance, &AWAccountApi::accountCreateSignal, [&]() {
loop.quit();
});
connect(&apiInstance, &AWAccountApi::accountCreateSignalE, [&](QNetworkReply::NetworkError, QString error_str) {
qDebug() << "Error happened while issuing request : " << error_str;
loop.quit();
});AWAccountCreateRequest aw_account_create_request = create(); // AWAccountCreateRequest |
apiInstance.accountCreate(aw_account_create_request);
QTimer::singleShot(5000, &loop, &QEventLoop::quit);
loop.exec();
}```
## Documentation for Servers
Parameterized Servers are supported. Define a server in the API for each endpoint with arbitrary numbers of variables:
```yaml
servers:
- url: http://{server}:{port}/{basePath}
description: Description of the Server
variables:
server:
enum:
- 'appwrite'
- 'qa-appwrite'
- 'dev-appwrite'
default: 'appwrite'
port:
enum:
- '3000'
- '1000'
default: '3000'
basePath:
default: v1
```
To change the default variable, use this function in each Api:
```c++
int setDefaultServerValue(int serverIndex,const QString &operation, const QString &variable,const QString &val);
```
The parameter "serverIndex" will choose a server from the server list for each endpoint. There is always at least one server with index 0. The Parameter "operation" should be the desired endpoint operationid.
Variable is the name of the variable you wish to change and the value is the new default Value.
The function will return -1 when the variable does not exists, -2 if value is not defined in the variable enum and -3 if the operation is not found.If your endpoint has multiple server objects in the servers array, you can set the server that will be used with this function:
```c++
void setServerIndex(const QString &operation, int serverIndex);
```
Parameter "operation" should be your operationid. "serverIndex" is the index you want to set as your default server. The function will check if there is a server with your index.
Here is an example of multiple servers in the servers array. The first server will have index 0 and the second will have index 1.
```yaml
servers:
- url: http://{server}:8080/
description: Description of the Server
variables:
server:
enum:
- 'appwrite'
- 'qa-appwrite'
- 'dev-appwrite'
default: 'appwrite'
- url: https://localhost:8080/v1
```## Documentation for Authorization
Authentication schemes defined for the API:
### Project- **Type**: API key
- **API key parameter name**: X-Appwrite-Project
- **Location**: HTTP header### JWT
- **Type**: API key
- **API key parameter name**: X-Appwrite-JWT
- **Location**: HTTP header### Locale
- **Type**: API key
- **API key parameter name**: X-Appwrite-Locale
- **Location**: HTTP header## Authors
- [Grzegorz Kusmierz](https://github.com/gkusmierz)
## License
BSD-3-Clause for more information visit [BSD-3-Clause](https://raw.githubusercontent.com/appwrite/appwrite/master/LICENSE)