From 47e6a2c34dd610a7b166e73d43510f0f768660c0 Mon Sep 17 00:00:00 2001 From: dorcaslitunya Date: Wed, 11 Dec 2024 16:18:42 +0300 Subject: [PATCH 01/10] Add User Rust SDK --- pkg/sdk/rust/.gitignore | 3 + pkg/sdk/rust/.openapi-generator-ignore | 23 + pkg/sdk/rust/.openapi-generator/FILES | 72 ++ pkg/sdk/rust/.openapi-generator/VERSION | 1 + pkg/sdk/rust/.travis.yml | 1 + pkg/sdk/rust/Cargo.toml | 16 + pkg/sdk/rust/README.md | 110 ++ pkg/sdk/rust/docs/AssignReqObj.md | 13 + pkg/sdk/rust/docs/AssignUserReqObj.md | 12 + pkg/sdk/rust/docs/DomainsApi.md | 43 + pkg/sdk/rust/docs/Email.md | 11 + pkg/sdk/rust/docs/Error.md | 11 + pkg/sdk/rust/docs/Group.md | 21 + pkg/sdk/rust/docs/GroupReqObj.md | 15 + pkg/sdk/rust/docs/GroupUpdate.md | 13 + pkg/sdk/rust/docs/GroupsApi.md | 457 +++++++ pkg/sdk/rust/docs/GroupsPage.md | 14 + pkg/sdk/rust/docs/HealthApi.md | 34 + pkg/sdk/rust/docs/HealthRes.md | 15 + pkg/sdk/rust/docs/IssueToken.md | 12 + pkg/sdk/rust/docs/IssueToken200Response.md | 13 + pkg/sdk/rust/docs/Members.md | 20 + pkg/sdk/rust/docs/MembersCredentials.md | 12 + pkg/sdk/rust/docs/MembersPage.md | 14 + .../rust/docs/RequestPasswordResetRequest.md | 12 + pkg/sdk/rust/docs/ResetPasswordRequest.md | 13 + pkg/sdk/rust/docs/User.md | 21 + pkg/sdk/rust/docs/UserCredentials.md | 11 + pkg/sdk/rust/docs/UserProfilePicture.md | 11 + pkg/sdk/rust/docs/UserReqObj.md | 18 + pkg/sdk/rust/docs/UserReqObjCredentials.md | 12 + pkg/sdk/rust/docs/UserRole.md | 11 + pkg/sdk/rust/docs/UserSecret.md | 12 + pkg/sdk/rust/docs/UserTags.md | 11 + pkg/sdk/rust/docs/UserUpdate.md | 13 + pkg/sdk/rust/docs/Username.md | 11 + pkg/sdk/rust/docs/UsersApi.md | 690 +++++++++++ pkg/sdk/rust/docs/UsersPage.md | 14 + pkg/sdk/rust/git_push.sh | 57 + pkg/sdk/rust/src/apis/configuration.rs | 51 + pkg/sdk/rust/src/apis/domains_api.rs | 74 ++ pkg/sdk/rust/src/apis/groups_api.rs | 702 +++++++++++ pkg/sdk/rust/src/apis/health_api.rs | 53 + pkg/sdk/rust/src/apis/mod.rs | 99 ++ pkg/sdk/rust/src/apis/users_api.rs | 1067 +++++++++++++++++ pkg/sdk/rust/src/lib.rs | 11 + pkg/sdk/rust/src/main.rs | 53 + pkg/sdk/rust/src/models/assign_req_obj.rs | 36 + .../rust/src/models/assign_user_req_obj.rs | 32 + pkg/sdk/rust/src/models/email.rs | 28 + pkg/sdk/rust/src/models/error.rs | 28 + pkg/sdk/rust/src/models/group.rs | 68 ++ pkg/sdk/rust/src/models/group_req_obj.rs | 44 + pkg/sdk/rust/src/models/group_update.rs | 36 + pkg/sdk/rust/src/models/groups_page.rs | 39 + pkg/sdk/rust/src/models/health_res.rs | 56 + pkg/sdk/rust/src/models/issue_token.rs | 32 + .../src/models/issue_token_200_response.rs | 36 + pkg/sdk/rust/src/models/members.rs | 63 + .../rust/src/models/members_credentials.rs | 32 + pkg/sdk/rust/src/models/members_page.rs | 39 + pkg/sdk/rust/src/models/mod.rs | 54 + .../models/request_password_reset_request.rs | 32 + .../rust/src/models/reset_password_request.rs | 36 + pkg/sdk/rust/src/models/user.rs | 67 ++ pkg/sdk/rust/src/models/user_credentials.rs | 28 + .../rust/src/models/user_profile_picture.rs | 28 + pkg/sdk/rust/src/models/user_req_obj.rs | 55 + .../src/models/user_req_obj_credentials.rs | 32 + pkg/sdk/rust/src/models/user_role.rs | 42 + pkg/sdk/rust/src/models/user_secret.rs | 32 + pkg/sdk/rust/src/models/user_tags.rs | 28 + pkg/sdk/rust/src/models/user_update.rs | 36 + pkg/sdk/rust/src/models/username.rs | 28 + pkg/sdk/rust/src/models/users_page.rs | 39 + 75 files changed, 5089 insertions(+) create mode 100644 pkg/sdk/rust/.gitignore create mode 100644 pkg/sdk/rust/.openapi-generator-ignore create mode 100644 pkg/sdk/rust/.openapi-generator/FILES create mode 100644 pkg/sdk/rust/.openapi-generator/VERSION create mode 100644 pkg/sdk/rust/.travis.yml create mode 100644 pkg/sdk/rust/Cargo.toml create mode 100644 pkg/sdk/rust/README.md create mode 100644 pkg/sdk/rust/docs/AssignReqObj.md create mode 100644 pkg/sdk/rust/docs/AssignUserReqObj.md create mode 100644 pkg/sdk/rust/docs/DomainsApi.md create mode 100644 pkg/sdk/rust/docs/Email.md create mode 100644 pkg/sdk/rust/docs/Error.md create mode 100644 pkg/sdk/rust/docs/Group.md create mode 100644 pkg/sdk/rust/docs/GroupReqObj.md create mode 100644 pkg/sdk/rust/docs/GroupUpdate.md create mode 100644 pkg/sdk/rust/docs/GroupsApi.md create mode 100644 pkg/sdk/rust/docs/GroupsPage.md create mode 100644 pkg/sdk/rust/docs/HealthApi.md create mode 100644 pkg/sdk/rust/docs/HealthRes.md create mode 100644 pkg/sdk/rust/docs/IssueToken.md create mode 100644 pkg/sdk/rust/docs/IssueToken200Response.md create mode 100644 pkg/sdk/rust/docs/Members.md create mode 100644 pkg/sdk/rust/docs/MembersCredentials.md create mode 100644 pkg/sdk/rust/docs/MembersPage.md create mode 100644 pkg/sdk/rust/docs/RequestPasswordResetRequest.md create mode 100644 pkg/sdk/rust/docs/ResetPasswordRequest.md create mode 100644 pkg/sdk/rust/docs/User.md create mode 100644 pkg/sdk/rust/docs/UserCredentials.md create mode 100644 pkg/sdk/rust/docs/UserProfilePicture.md create mode 100644 pkg/sdk/rust/docs/UserReqObj.md create mode 100644 pkg/sdk/rust/docs/UserReqObjCredentials.md create mode 100644 pkg/sdk/rust/docs/UserRole.md create mode 100644 pkg/sdk/rust/docs/UserSecret.md create mode 100644 pkg/sdk/rust/docs/UserTags.md create mode 100644 pkg/sdk/rust/docs/UserUpdate.md create mode 100644 pkg/sdk/rust/docs/Username.md create mode 100644 pkg/sdk/rust/docs/UsersApi.md create mode 100644 pkg/sdk/rust/docs/UsersPage.md create mode 100644 pkg/sdk/rust/git_push.sh create mode 100644 pkg/sdk/rust/src/apis/configuration.rs create mode 100644 pkg/sdk/rust/src/apis/domains_api.rs create mode 100644 pkg/sdk/rust/src/apis/groups_api.rs create mode 100644 pkg/sdk/rust/src/apis/health_api.rs create mode 100644 pkg/sdk/rust/src/apis/mod.rs create mode 100644 pkg/sdk/rust/src/apis/users_api.rs create mode 100644 pkg/sdk/rust/src/lib.rs create mode 100644 pkg/sdk/rust/src/main.rs create mode 100644 pkg/sdk/rust/src/models/assign_req_obj.rs create mode 100644 pkg/sdk/rust/src/models/assign_user_req_obj.rs create mode 100644 pkg/sdk/rust/src/models/email.rs create mode 100644 pkg/sdk/rust/src/models/error.rs create mode 100644 pkg/sdk/rust/src/models/group.rs create mode 100644 pkg/sdk/rust/src/models/group_req_obj.rs create mode 100644 pkg/sdk/rust/src/models/group_update.rs create mode 100644 pkg/sdk/rust/src/models/groups_page.rs create mode 100644 pkg/sdk/rust/src/models/health_res.rs create mode 100644 pkg/sdk/rust/src/models/issue_token.rs create mode 100644 pkg/sdk/rust/src/models/issue_token_200_response.rs create mode 100644 pkg/sdk/rust/src/models/members.rs create mode 100644 pkg/sdk/rust/src/models/members_credentials.rs create mode 100644 pkg/sdk/rust/src/models/members_page.rs create mode 100644 pkg/sdk/rust/src/models/mod.rs create mode 100644 pkg/sdk/rust/src/models/request_password_reset_request.rs create mode 100644 pkg/sdk/rust/src/models/reset_password_request.rs create mode 100644 pkg/sdk/rust/src/models/user.rs create mode 100644 pkg/sdk/rust/src/models/user_credentials.rs create mode 100644 pkg/sdk/rust/src/models/user_profile_picture.rs create mode 100644 pkg/sdk/rust/src/models/user_req_obj.rs create mode 100644 pkg/sdk/rust/src/models/user_req_obj_credentials.rs create mode 100644 pkg/sdk/rust/src/models/user_role.rs create mode 100644 pkg/sdk/rust/src/models/user_secret.rs create mode 100644 pkg/sdk/rust/src/models/user_tags.rs create mode 100644 pkg/sdk/rust/src/models/user_update.rs create mode 100644 pkg/sdk/rust/src/models/username.rs create mode 100644 pkg/sdk/rust/src/models/users_page.rs diff --git a/pkg/sdk/rust/.gitignore b/pkg/sdk/rust/.gitignore new file mode 100644 index 00000000..6aa10640 --- /dev/null +++ b/pkg/sdk/rust/.gitignore @@ -0,0 +1,3 @@ +/target/ +**/*.rs.bk +Cargo.lock diff --git a/pkg/sdk/rust/.openapi-generator-ignore b/pkg/sdk/rust/.openapi-generator-ignore new file mode 100644 index 00000000..7484ee59 --- /dev/null +++ b/pkg/sdk/rust/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/pkg/sdk/rust/.openapi-generator/FILES b/pkg/sdk/rust/.openapi-generator/FILES new file mode 100644 index 00000000..186dd944 --- /dev/null +++ b/pkg/sdk/rust/.openapi-generator/FILES @@ -0,0 +1,72 @@ +.gitignore +.openapi-generator-ignore +.travis.yml +Cargo.toml +README.md +docs/AssignReqObj.md +docs/AssignUserReqObj.md +docs/DomainsApi.md +docs/Email.md +docs/Error.md +docs/Group.md +docs/GroupReqObj.md +docs/GroupUpdate.md +docs/GroupsApi.md +docs/GroupsPage.md +docs/HealthApi.md +docs/HealthRes.md +docs/IssueToken.md +docs/IssueToken200Response.md +docs/Members.md +docs/MembersCredentials.md +docs/MembersPage.md +docs/RequestPasswordResetRequest.md +docs/ResetPasswordRequest.md +docs/User.md +docs/UserCredentials.md +docs/UserProfilePicture.md +docs/UserReqObj.md +docs/UserReqObjCredentials.md +docs/UserRole.md +docs/UserSecret.md +docs/UserTags.md +docs/UserUpdate.md +docs/Username.md +docs/UsersApi.md +docs/UsersPage.md +git_push.sh +src/apis/configuration.rs +src/apis/domains_api.rs +src/apis/groups_api.rs +src/apis/health_api.rs +src/apis/mod.rs +src/apis/users_api.rs +src/lib.rs +src/models/assign_req_obj.rs +src/models/assign_user_req_obj.rs +src/models/email.rs +src/models/error.rs +src/models/group.rs +src/models/group_req_obj.rs +src/models/group_update.rs +src/models/groups_page.rs +src/models/health_res.rs +src/models/issue_token.rs +src/models/issue_token_200_response.rs +src/models/members.rs +src/models/members_credentials.rs +src/models/members_page.rs +src/models/mod.rs +src/models/request_password_reset_request.rs +src/models/reset_password_request.rs +src/models/user.rs +src/models/user_credentials.rs +src/models/user_profile_picture.rs +src/models/user_req_obj.rs +src/models/user_req_obj_credentials.rs +src/models/user_role.rs +src/models/user_secret.rs +src/models/user_tags.rs +src/models/user_update.rs +src/models/username.rs +src/models/users_page.rs diff --git a/pkg/sdk/rust/.openapi-generator/VERSION b/pkg/sdk/rust/.openapi-generator/VERSION new file mode 100644 index 00000000..758bb9c8 --- /dev/null +++ b/pkg/sdk/rust/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.10.0 diff --git a/pkg/sdk/rust/.travis.yml b/pkg/sdk/rust/.travis.yml new file mode 100644 index 00000000..22761ba7 --- /dev/null +++ b/pkg/sdk/rust/.travis.yml @@ -0,0 +1 @@ +language: rust diff --git a/pkg/sdk/rust/Cargo.toml b/pkg/sdk/rust/Cargo.toml new file mode 100644 index 00000000..90e0174b --- /dev/null +++ b/pkg/sdk/rust/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "openapi" +version = "0.14.0" +authors = ["info@abstractmachines.fr"] +description = "This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) " +license = "Apache 2.0" +edition = "2021" + +[dependencies] +serde = { version = "^1.0", features = ["derive"] } +serde_json = "^1.0" +serde_repr = "^0.1" +url = "^2.5" +uuid = { version = "^1.8", features = ["serde", "v4"] } +reqwest = { version = "^0.12", features = ["json", "multipart"] } +tokio = { version = "1", features = ["full"] } diff --git a/pkg/sdk/rust/README.md b/pkg/sdk/rust/README.md new file mode 100644 index 00000000..4fb31b9c --- /dev/null +++ b/pkg/sdk/rust/README.md @@ -0,0 +1,110 @@ +# Rust API client for openapi + +This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. +Some useful links: +- [The SuperMQ repository](https://github.com/absmach/supermq) + + + +## Overview + +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://openapis.org) from a remote server, you can easily generate an API client. + +- API version: 0.14.0 +- Package version: 0.14.0 +- Generator version: 7.10.0 +- Build package: `org.openapitools.codegen.languages.RustClientCodegen` + +## Installation + +Put the package under your project folder in a directory named `openapi` and add the following to `Cargo.toml` under `[dependencies]`: + +``` +openapi = { path = "./openapi" } +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost:9002* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DomainsApi* | [**domain_id_users_get**](docs/DomainsApi.md#domain_id_users_get) | **GET** /{domainID}/users | List users assigned to domain +*GroupsApi* | [**assign_user**](docs/GroupsApi.md#assign_user) | **POST** /{domainID}/groups/{groupID}/users/assign | Assigns a user to a group +*GroupsApi* | [**create_group**](docs/GroupsApi.md#create_group) | **POST** /{domainID}/groups | Creates new group +*GroupsApi* | [**disable_group**](docs/GroupsApi.md#disable_group) | **POST** /{domainID}/groups/{groupID}/disable | Disables a group +*GroupsApi* | [**domain_id_groups_group_id_delete**](docs/GroupsApi.md#domain_id_groups_group_id_delete) | **DELETE** /{domainID}/groups/{groupID} | Delete group for a group with the given id. +*GroupsApi* | [**enable_group**](docs/GroupsApi.md#enable_group) | **POST** /{domainID}/groups/{groupID}/enable | Enables a group +*GroupsApi* | [**get_group**](docs/GroupsApi.md#get_group) | **GET** /{domainID}/groups/{groupID} | Gets group info. +*GroupsApi* | [**list_children**](docs/GroupsApi.md#list_children) | **GET** /{domainID}/groups/{groupID}/children | List children of a certain group +*GroupsApi* | [**list_groups**](docs/GroupsApi.md#list_groups) | **GET** /{domainID}/groups | Lists groups. +*GroupsApi* | [**list_groups_by_user**](docs/GroupsApi.md#list_groups_by_user) | **GET** /{domainID}/users/{memberID}/groups | Get group associated with the member +*GroupsApi* | [**list_groups_in_channel**](docs/GroupsApi.md#list_groups_in_channel) | **GET** /{domainID}/channels/{memberID}/groups | Get group associated with the member +*GroupsApi* | [**list_parents**](docs/GroupsApi.md#list_parents) | **GET** /{domainID}/groups/{groupID}/parents | List parents of a certain group +*GroupsApi* | [**unassign_user**](docs/GroupsApi.md#unassign_user) | **POST** /{domainID}/groups/{groupID}/users/unassign | Unassigns a user to a group +*GroupsApi* | [**update_group**](docs/GroupsApi.md#update_group) | **PUT** /{domainID}/groups/{groupID} | Updates group data. +*HealthApi* | [**health**](docs/HealthApi.md#health) | **GET** /health | Retrieves service health check info. +*UsersApi* | [**create_user**](docs/UsersApi.md#create_user) | **POST** /users | Registers user account +*UsersApi* | [**disable_user**](docs/UsersApi.md#disable_user) | **POST** /users/{userID}/disable | Disables a user +*UsersApi* | [**enable_user**](docs/UsersApi.md#enable_user) | **POST** /users/{userID}/enable | Enables a user +*UsersApi* | [**get_profile**](docs/UsersApi.md#get_profile) | **GET** /users/profile | Gets info on currently logged in user. +*UsersApi* | [**get_user**](docs/UsersApi.md#get_user) | **GET** /users/{userID} | Retrieves a user +*UsersApi* | [**issue_token**](docs/UsersApi.md#issue_token) | **POST** /users/tokens/issue | Issue Token +*UsersApi* | [**list_users**](docs/UsersApi.md#list_users) | **GET** /users | List users +*UsersApi* | [**list_users_in_channel**](docs/UsersApi.md#list_users_in_channel) | **GET** /{domainID}/channels/{channelID}/users | List users in a channel +*UsersApi* | [**list_users_in_group**](docs/UsersApi.md#list_users_in_group) | **GET** /{domainID}/groups/{groupID}/users | List users in a group +*UsersApi* | [**refresh_token**](docs/UsersApi.md#refresh_token) | **POST** /users/tokens/refresh | Refresh Token +*UsersApi* | [**request_password_reset**](docs/UsersApi.md#request_password_reset) | **POST** /password/reset-request | User password reset request +*UsersApi* | [**reset_password**](docs/UsersApi.md#reset_password) | **PUT** /password/reset | User password reset endpoint +*UsersApi* | [**search_users**](docs/UsersApi.md#search_users) | **GET** /users/search | Search users +*UsersApi* | [**update_email**](docs/UsersApi.md#update_email) | **PATCH** /users/{userID}/email | Updates email of the user. +*UsersApi* | [**update_profile_picture**](docs/UsersApi.md#update_profile_picture) | **PATCH** /users/{userID}/picture | Updates the user's profile picture. +*UsersApi* | [**update_role**](docs/UsersApi.md#update_role) | **PATCH** /users/{userID}/role | Updates the user's role. +*UsersApi* | [**update_secret**](docs/UsersApi.md#update_secret) | **PATCH** /users/secret | Updates secret of currently logged in user. +*UsersApi* | [**update_tags**](docs/UsersApi.md#update_tags) | **PATCH** /users/{userID}/tags | Updates tags of the user. +*UsersApi* | [**update_user**](docs/UsersApi.md#update_user) | **PATCH** /users/{userID} | Updates first, last name and metadata of the user. +*UsersApi* | [**update_username**](docs/UsersApi.md#update_username) | **PATCH** /users/{userID}/username | Updates user's username. +*UsersApi* | [**users_user_id_delete**](docs/UsersApi.md#users_user_id_delete) | **DELETE** /users/{userID} | Delete a user + + +## Documentation For Models + + - [AssignReqObj](docs/AssignReqObj.md) + - [AssignUserReqObj](docs/AssignUserReqObj.md) + - [Email](docs/Email.md) + - [Error](docs/Error.md) + - [Group](docs/Group.md) + - [GroupReqObj](docs/GroupReqObj.md) + - [GroupUpdate](docs/GroupUpdate.md) + - [GroupsPage](docs/GroupsPage.md) + - [HealthRes](docs/HealthRes.md) + - [IssueToken](docs/IssueToken.md) + - [IssueToken200Response](docs/IssueToken200Response.md) + - [Members](docs/Members.md) + - [MembersCredentials](docs/MembersCredentials.md) + - [MembersPage](docs/MembersPage.md) + - [RequestPasswordResetRequest](docs/RequestPasswordResetRequest.md) + - [ResetPasswordRequest](docs/ResetPasswordRequest.md) + - [User](docs/User.md) + - [UserCredentials](docs/UserCredentials.md) + - [UserProfilePicture](docs/UserProfilePicture.md) + - [UserReqObj](docs/UserReqObj.md) + - [UserReqObjCredentials](docs/UserReqObjCredentials.md) + - [UserRole](docs/UserRole.md) + - [UserSecret](docs/UserSecret.md) + - [UserTags](docs/UserTags.md) + - [UserUpdate](docs/UserUpdate.md) + - [Username](docs/Username.md) + - [UsersPage](docs/UsersPage.md) + + +To get access to the crate's generated documentation, use: + +``` +cargo doc --open +``` + +## Author + +info@abstractmachines.fr + diff --git a/pkg/sdk/rust/docs/AssignReqObj.md b/pkg/sdk/rust/docs/AssignReqObj.md new file mode 100644 index 00000000..895b525e --- /dev/null +++ b/pkg/sdk/rust/docs/AssignReqObj.md @@ -0,0 +1,13 @@ +# AssignReqObj + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**members** | **Vec** | Members IDs | +**relation** | **String** | Permission relations. | +**member_kind** | **String** | Member kind. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/pkg/sdk/rust/docs/AssignUserReqObj.md b/pkg/sdk/rust/docs/AssignUserReqObj.md new file mode 100644 index 00000000..9262413e --- /dev/null +++ b/pkg/sdk/rust/docs/AssignUserReqObj.md @@ -0,0 +1,12 @@ +# AssignUserReqObj + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user_ids** | **Vec** | User IDs | +**relation** | **String** | Permission relations. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/pkg/sdk/rust/docs/DomainsApi.md b/pkg/sdk/rust/docs/DomainsApi.md new file mode 100644 index 00000000..3791d439 --- /dev/null +++ b/pkg/sdk/rust/docs/DomainsApi.md @@ -0,0 +1,43 @@ +# \DomainsApi + +All URIs are relative to *http://localhost:9002* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**domain_id_users_get**](DomainsApi.md#domain_id_users_get) | **GET** /{domainID}/users | List users assigned to domain + + + +## domain_id_users_get + +> models::UsersPage domain_id_users_get(domain_id, limit, offset, metadata, status) +List users assigned to domain + +List users assigned to domain that is identified by the domain ID. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**limit** | Option<**i32**> | Size of the subset to retrieve. | |[default to 10] +**offset** | Option<**i32**> | Number of items to skip during retrieval. | |[default to 0] +**metadata** | Option<**String**> | Metadata filter. Filtering is performed matching the parameter with metadata on top level. Parameter is json. | | +**status** | Option<**String**> | User account status. | |[default to enabled] + +### Return type + +[**models::UsersPage**](UsersPage.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/pkg/sdk/rust/docs/Email.md b/pkg/sdk/rust/docs/Email.md new file mode 100644 index 00000000..1abc6702 --- /dev/null +++ b/pkg/sdk/rust/docs/Email.md @@ -0,0 +1,11 @@ +# Email + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**email** | **String** | User email address. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/pkg/sdk/rust/docs/Error.md b/pkg/sdk/rust/docs/Error.md new file mode 100644 index 00000000..8e78862d --- /dev/null +++ b/pkg/sdk/rust/docs/Error.md @@ -0,0 +1,11 @@ +# Error + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error** | Option<**String**> | Error message | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/pkg/sdk/rust/docs/Group.md b/pkg/sdk/rust/docs/Group.md new file mode 100644 index 00000000..c3e986b2 --- /dev/null +++ b/pkg/sdk/rust/docs/Group.md @@ -0,0 +1,21 @@ +# Group + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | Unique group identifier generated by the service. | [optional] +**name** | Option<**String**> | Free-form group name. Group name is unique on the given hierarchy level. | [optional] +**domain_id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | ID of the domain to which the group belongs.. | [optional] +**parent_id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | Group parent identifier. | [optional] +**description** | Option<**String**> | Group description, free form text. | [optional] +**metadata** | Option<[**serde_json::Value**](.md)> | Arbitrary, object-encoded groups's data. | [optional] +**path** | Option<**String**> | Hierarchy path, concatenated ids of group ancestors. | [optional] +**level** | Option<**i32**> | Level in hierarchy, distance from the root group. | [optional] +**created_at** | Option<**String**> | Datetime when the group was created. | [optional] +**updated_at** | Option<**String**> | Datetime when the group was created. | [optional] +**status** | Option<**String**> | Group Status | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/pkg/sdk/rust/docs/GroupReqObj.md b/pkg/sdk/rust/docs/GroupReqObj.md new file mode 100644 index 00000000..399e4131 --- /dev/null +++ b/pkg/sdk/rust/docs/GroupReqObj.md @@ -0,0 +1,15 @@ +# GroupReqObj + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | Free-form group name. Group name is unique on the given hierarchy level. | +**description** | Option<**String**> | Group description, free form text. | [optional] +**parent_id** | Option<**String**> | Id of parent group, it must be existing group. | [optional] +**metadata** | Option<[**serde_json::Value**](.md)> | Arbitrary, object-encoded groups's data. | [optional] +**status** | Option<**String**> | Group Status | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/pkg/sdk/rust/docs/GroupUpdate.md b/pkg/sdk/rust/docs/GroupUpdate.md new file mode 100644 index 00000000..3f215c7e --- /dev/null +++ b/pkg/sdk/rust/docs/GroupUpdate.md @@ -0,0 +1,13 @@ +# GroupUpdate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | Free-form group name. Group name is unique on the given hierarchy level. | +**description** | **String** | Group description, free form text. | +**metadata** | [**serde_json::Value**](.md) | Arbitrary, object-encoded groups's data. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/pkg/sdk/rust/docs/GroupsApi.md b/pkg/sdk/rust/docs/GroupsApi.md new file mode 100644 index 00000000..5edf468e --- /dev/null +++ b/pkg/sdk/rust/docs/GroupsApi.md @@ -0,0 +1,457 @@ +# \GroupsApi + +All URIs are relative to *http://localhost:9002* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**assign_user**](GroupsApi.md#assign_user) | **POST** /{domainID}/groups/{groupID}/users/assign | Assigns a user to a group +[**create_group**](GroupsApi.md#create_group) | **POST** /{domainID}/groups | Creates new group +[**disable_group**](GroupsApi.md#disable_group) | **POST** /{domainID}/groups/{groupID}/disable | Disables a group +[**domain_id_groups_group_id_delete**](GroupsApi.md#domain_id_groups_group_id_delete) | **DELETE** /{domainID}/groups/{groupID} | Delete group for a group with the given id. +[**enable_group**](GroupsApi.md#enable_group) | **POST** /{domainID}/groups/{groupID}/enable | Enables a group +[**get_group**](GroupsApi.md#get_group) | **GET** /{domainID}/groups/{groupID} | Gets group info. +[**list_children**](GroupsApi.md#list_children) | **GET** /{domainID}/groups/{groupID}/children | List children of a certain group +[**list_groups**](GroupsApi.md#list_groups) | **GET** /{domainID}/groups | Lists groups. +[**list_groups_by_user**](GroupsApi.md#list_groups_by_user) | **GET** /{domainID}/users/{memberID}/groups | Get group associated with the member +[**list_groups_in_channel**](GroupsApi.md#list_groups_in_channel) | **GET** /{domainID}/channels/{memberID}/groups | Get group associated with the member +[**list_parents**](GroupsApi.md#list_parents) | **GET** /{domainID}/groups/{groupID}/parents | List parents of a certain group +[**unassign_user**](GroupsApi.md#unassign_user) | **POST** /{domainID}/groups/{groupID}/users/unassign | Unassigns a user to a group +[**update_group**](GroupsApi.md#update_group) | **PUT** /{domainID}/groups/{groupID} | Updates group data. + + + +## assign_user + +> assign_user(domain_id, group_id, assign_user_req_obj) +Assigns a user to a group + +Assigns a specific user to a group that is identifier by the group ID. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**group_id** | **uuid::Uuid** | Unique group identifier. | [required] | +**assign_user_req_obj** | [**AssignUserReqObj**](AssignUserReqObj.md) | JSON-formated document describing the policy related to assigning users to a group | [required] | + +### Return type + + (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## create_group + +> models::Group create_group(domain_id, group_req_obj) +Creates new group + +Creates new group that can be used for grouping entities. New account will be uniquely identified by its identity. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**group_req_obj** | [**GroupReqObj**](GroupReqObj.md) | JSON-formatted document describing the new group to be registered | [required] | + +### Return type + +[**models::Group**](Group.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## disable_group + +> models::Group disable_group(domain_id, group_id) +Disables a group + +Disables a specific group that is identifier by the group ID. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**group_id** | **uuid::Uuid** | Unique group identifier. | [required] | + +### Return type + +[**models::Group**](Group.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## domain_id_groups_group_id_delete + +> domain_id_groups_group_id_delete(domain_id, group_id) +Delete group for a group with the given id. + +Delete group removes a group with the given id from repo and removes all the policies related to this group. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**group_id** | **uuid::Uuid** | Unique group identifier. | [required] | + +### Return type + + (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## enable_group + +> models::Group enable_group(domain_id, group_id) +Enables a group + +Enables a specific group that is identifier by the group ID. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**group_id** | **uuid::Uuid** | Unique group identifier. | [required] | + +### Return type + +[**models::Group**](Group.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_group + +> models::Group get_group(domain_id, group_id) +Gets group info. + +Gets info on a group specified by id. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**group_id** | **uuid::Uuid** | Unique group identifier. | [required] | + +### Return type + +[**models::Group**](Group.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_children + +> models::GroupsPage list_children(domain_id, group_id, limit, offset, level, tree, metadata, name, parent_id) +List children of a certain group + +Lists groups up to a max level of hierarchy that can be fetched in one request ( max level = 5). Result can be filtered by metadata. Groups will be returned as JSON array or JSON tree. Due to performance concerns, result is returned in subsets. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**group_id** | **uuid::Uuid** | Unique group identifier. | [required] | +**limit** | Option<**i32**> | Size of the subset to retrieve. | |[default to 10] +**offset** | Option<**i32**> | Number of items to skip during retrieval. | |[default to 0] +**level** | Option<**i32**> | Level of hierarchy up to which to retrieve groups from given group id. | | +**tree** | Option<**bool**> | Specify type of response, JSON array or tree. | |[default to false] +**metadata** | Option<**String**> | Metadata filter. Filtering is performed matching the parameter with metadata on top level. Parameter is json. | | +**name** | Option<**String**> | Group's name. | | +**parent_id** | Option<**uuid::Uuid**> | Unique parent identifier for a group. | | + +### Return type + +[**models::GroupsPage**](GroupsPage.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_groups + +> models::GroupsPage list_groups(domain_id, limit, offset, level, tree, metadata, name, parent_id) +Lists groups. + +Lists groups up to a max level of hierarchy that can be fetched in one request ( max level = 5). Result can be filtered by metadata. Groups will be returned as JSON array or JSON tree. Due to performance concerns, result is returned in subsets. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**limit** | Option<**i32**> | Size of the subset to retrieve. | |[default to 10] +**offset** | Option<**i32**> | Number of items to skip during retrieval. | |[default to 0] +**level** | Option<**i32**> | Level of hierarchy up to which to retrieve groups from given group id. | | +**tree** | Option<**bool**> | Specify type of response, JSON array or tree. | |[default to false] +**metadata** | Option<**String**> | Metadata filter. Filtering is performed matching the parameter with metadata on top level. Parameter is json. | | +**name** | Option<**String**> | Group's name. | | +**parent_id** | Option<**uuid::Uuid**> | Unique parent identifier for a group. | | + +### Return type + +[**models::GroupsPage**](GroupsPage.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_groups_by_user + +> models::GroupsPage list_groups_by_user(domain_id, member_id, limit, offset, metadata, status, tags) +Get group associated with the member + +Gets groups associated with the user member specified by id. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**member_id** | **uuid::Uuid** | Unique member identifier. | [required] | +**limit** | Option<**i32**> | Size of the subset to retrieve. | |[default to 10] +**offset** | Option<**i32**> | Number of items to skip during retrieval. | |[default to 0] +**metadata** | Option<**String**> | Metadata filter. Filtering is performed matching the parameter with metadata on top level. Parameter is json. | | +**status** | Option<**String**> | User account status. | |[default to enabled] +**tags** | Option<[**Vec**](String.md)> | User tags. | | + +### Return type + +[**models::GroupsPage**](GroupsPage.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_groups_in_channel + +> models::GroupsPage list_groups_in_channel(domain_id, member_id, limit, offset, metadata, status, tags) +Get group associated with the member + +Gets groups associated with the channel member specified by id. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**member_id** | **uuid::Uuid** | Unique member identifier. | [required] | +**limit** | Option<**i32**> | Size of the subset to retrieve. | |[default to 10] +**offset** | Option<**i32**> | Number of items to skip during retrieval. | |[default to 0] +**metadata** | Option<**String**> | Metadata filter. Filtering is performed matching the parameter with metadata on top level. Parameter is json. | | +**status** | Option<**String**> | User account status. | |[default to enabled] +**tags** | Option<[**Vec**](String.md)> | User tags. | | + +### Return type + +[**models::GroupsPage**](GroupsPage.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_parents + +> models::GroupsPage list_parents(domain_id, group_id, limit, offset, level, tree, metadata, name, parent_id) +List parents of a certain group + +Lists groups up to a max level of hierarchy that can be fetched in one request ( max level = 5). Result can be filtered by metadata. Groups will be returned as JSON array or JSON tree. Due to performance concerns, result is returned in subsets. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**group_id** | **uuid::Uuid** | Unique group identifier. | [required] | +**limit** | Option<**i32**> | Size of the subset to retrieve. | |[default to 10] +**offset** | Option<**i32**> | Number of items to skip during retrieval. | |[default to 0] +**level** | Option<**i32**> | Level of hierarchy up to which to retrieve groups from given group id. | | +**tree** | Option<**bool**> | Specify type of response, JSON array or tree. | |[default to false] +**metadata** | Option<**String**> | Metadata filter. Filtering is performed matching the parameter with metadata on top level. Parameter is json. | | +**name** | Option<**String**> | Group's name. | | +**parent_id** | Option<**uuid::Uuid**> | Unique parent identifier for a group. | | + +### Return type + +[**models::GroupsPage**](GroupsPage.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## unassign_user + +> unassign_user(domain_id, group_id, assign_user_req_obj) +Unassigns a user to a group + +Unassigns a specific user to a group that is identifier by the group ID. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**group_id** | **uuid::Uuid** | Unique group identifier. | [required] | +**assign_user_req_obj** | [**AssignUserReqObj**](AssignUserReqObj.md) | JSON-formated document describing the policy related to assigning users to a group | [required] | + +### Return type + + (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## update_group + +> models::Group update_group(domain_id, group_id, group_update) +Updates group data. + +Updates Name, Description or Metadata of a group. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**group_id** | **uuid::Uuid** | Unique group identifier. | [required] | +**group_update** | [**GroupUpdate**](GroupUpdate.md) | JSON-formated document describing the metadata and name of group to be update | [required] | + +### Return type + +[**models::Group**](Group.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/pkg/sdk/rust/docs/GroupsPage.md b/pkg/sdk/rust/docs/GroupsPage.md new file mode 100644 index 00000000..fff04c3b --- /dev/null +++ b/pkg/sdk/rust/docs/GroupsPage.md @@ -0,0 +1,14 @@ +# GroupsPage + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**groups** | [**Vec**](Group.md) | | +**total** | **i32** | Total number of items. | +**offset** | **i32** | Number of items to skip during retrieval. | +**limit** | Option<**i32**> | Maximum number of items to return in one page. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/pkg/sdk/rust/docs/HealthApi.md b/pkg/sdk/rust/docs/HealthApi.md new file mode 100644 index 00000000..99159d8a --- /dev/null +++ b/pkg/sdk/rust/docs/HealthApi.md @@ -0,0 +1,34 @@ +# \HealthApi + +All URIs are relative to *http://localhost:9002* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**health**](HealthApi.md#health) | **GET** /health | Retrieves service health check info. + + + +## health + +> models::HealthRes health() +Retrieves service health check info. + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**models::HealthRes**](HealthRes.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/health+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/pkg/sdk/rust/docs/HealthRes.md b/pkg/sdk/rust/docs/HealthRes.md new file mode 100644 index 00000000..319b16fb --- /dev/null +++ b/pkg/sdk/rust/docs/HealthRes.md @@ -0,0 +1,15 @@ +# HealthRes + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | Option<**String**> | Service status. | [optional] +**version** | Option<**String**> | Service version. | [optional] +**commit** | Option<**String**> | Service commit hash. | [optional] +**description** | Option<**String**> | Service description. | [optional] +**build_time** | Option<**String**> | Service build time. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/pkg/sdk/rust/docs/IssueToken.md b/pkg/sdk/rust/docs/IssueToken.md new file mode 100644 index 00000000..cdc0841c --- /dev/null +++ b/pkg/sdk/rust/docs/IssueToken.md @@ -0,0 +1,12 @@ +# IssueToken + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**identity** | **String** | User identity - email address. | +**secret** | **String** | User secret password. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/pkg/sdk/rust/docs/IssueToken200Response.md b/pkg/sdk/rust/docs/IssueToken200Response.md new file mode 100644 index 00000000..831b2680 --- /dev/null +++ b/pkg/sdk/rust/docs/IssueToken200Response.md @@ -0,0 +1,13 @@ +# IssueToken200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**access_token** | Option<**String**> | User access token. | [optional] +**refresh_token** | Option<**String**> | User refresh token. | [optional] +**access_type** | Option<**String**> | User access token type. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/pkg/sdk/rust/docs/Members.md b/pkg/sdk/rust/docs/Members.md new file mode 100644 index 00000000..a5d7e31b --- /dev/null +++ b/pkg/sdk/rust/docs/Members.md @@ -0,0 +1,20 @@ +# Members + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | User unique identifier. | [optional] +**first_name** | Option<**String**> | User's first name. | [optional] +**last_name** | Option<**String**> | User's last name. | [optional] +**email** | Option<**String**> | User's email address. | [optional] +**tags** | Option<**Vec**> | User tags. | [optional] +**credentials** | Option<[**models::MembersCredentials**](Members_credentials.md)> | | [optional] +**metadata** | Option<[**serde_json::Value**](.md)> | Arbitrary, object-encoded user's data. | [optional] +**status** | Option<**String**> | User Status | [optional] +**created_at** | Option<**String**> | Time when the group was created. | [optional] +**updated_at** | Option<**String**> | Time when the group was created. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/pkg/sdk/rust/docs/MembersCredentials.md b/pkg/sdk/rust/docs/MembersCredentials.md new file mode 100644 index 00000000..e3669de6 --- /dev/null +++ b/pkg/sdk/rust/docs/MembersCredentials.md @@ -0,0 +1,12 @@ +# MembersCredentials + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**username** | Option<**String**> | User's username. | [optional] +**secret** | Option<**String**> | User secret password. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/pkg/sdk/rust/docs/MembersPage.md b/pkg/sdk/rust/docs/MembersPage.md new file mode 100644 index 00000000..66f13666 --- /dev/null +++ b/pkg/sdk/rust/docs/MembersPage.md @@ -0,0 +1,14 @@ +# MembersPage + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**members** | [**Vec**](Members.md) | | +**total** | **i32** | Total number of items. | +**offset** | Option<**i32**> | Number of items to skip during retrieval. | [optional] +**limit** | Option<**i32**> | Maximum number of items to return in one page. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/pkg/sdk/rust/docs/RequestPasswordResetRequest.md b/pkg/sdk/rust/docs/RequestPasswordResetRequest.md new file mode 100644 index 00000000..bc5a0c83 --- /dev/null +++ b/pkg/sdk/rust/docs/RequestPasswordResetRequest.md @@ -0,0 +1,12 @@ +# RequestPasswordResetRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**email** | Option<**String**> | User email. | [optional] +**host** | Option<**String**> | Email host. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/pkg/sdk/rust/docs/ResetPasswordRequest.md b/pkg/sdk/rust/docs/ResetPasswordRequest.md new file mode 100644 index 00000000..976524fb --- /dev/null +++ b/pkg/sdk/rust/docs/ResetPasswordRequest.md @@ -0,0 +1,13 @@ +# ResetPasswordRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**password** | Option<**String**> | New password. | [optional] +**confirm_password** | Option<**String**> | New confirmation password. | [optional] +**token** | Option<**String**> | Reset token generated and sent in email. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/pkg/sdk/rust/docs/User.md b/pkg/sdk/rust/docs/User.md new file mode 100644 index 00000000..58b9da37 --- /dev/null +++ b/pkg/sdk/rust/docs/User.md @@ -0,0 +1,21 @@ +# User + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | User unique identifier. | [optional] +**first_name** | Option<**String**> | User's first name. | [optional] +**last_name** | Option<**String**> | User's last name. | [optional] +**tags** | Option<**Vec**> | User tags. | [optional] +**email** | Option<**String**> | User email for example email address. | [optional] +**credentials** | Option<[**models::UserCredentials**](User_credentials.md)> | | [optional] +**metadata** | Option<[**serde_json::Value**](.md)> | Arbitrary, object-encoded user's data. | [optional] +**profile_picture** | Option<**String**> | User's profile picture URL that is represented as a string. | [optional] +**status** | Option<**String**> | User Status | [optional] +**created_at** | Option<**String**> | Time when the group was created. | [optional] +**updated_at** | Option<**String**> | Time when the group was created. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/pkg/sdk/rust/docs/UserCredentials.md b/pkg/sdk/rust/docs/UserCredentials.md new file mode 100644 index 00000000..036c8628 --- /dev/null +++ b/pkg/sdk/rust/docs/UserCredentials.md @@ -0,0 +1,11 @@ +# UserCredentials + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**username** | Option<**String**> | User's username for example john_doe for Mr John Doe. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/pkg/sdk/rust/docs/UserProfilePicture.md b/pkg/sdk/rust/docs/UserProfilePicture.md new file mode 100644 index 00000000..099e08c4 --- /dev/null +++ b/pkg/sdk/rust/docs/UserProfilePicture.md @@ -0,0 +1,11 @@ +# UserProfilePicture + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**profile_picture** | **String** | User's profile picture URL that is represented as a string. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/pkg/sdk/rust/docs/UserReqObj.md b/pkg/sdk/rust/docs/UserReqObj.md new file mode 100644 index 00000000..0232c189 --- /dev/null +++ b/pkg/sdk/rust/docs/UserReqObj.md @@ -0,0 +1,18 @@ +# UserReqObj + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**first_name** | Option<**String**> | User's first name. | [optional] +**last_name** | Option<**String**> | User's last name. | [optional] +**email** | Option<**String**> | User's email address will be used as its unique identifier. | [optional] +**tags** | Option<**Vec**> | User tags. | [optional] +**credentials** | [**models::UserReqObjCredentials**](UserReqObj_credentials.md) | | +**metadata** | Option<[**serde_json::Value**](.md)> | Arbitrary, object-encoded user's data. | [optional] +**profile_picture** | Option<**String**> | User's profile picture URL that is represented as a string. | [optional] +**status** | Option<**String**> | User Status | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/pkg/sdk/rust/docs/UserReqObjCredentials.md b/pkg/sdk/rust/docs/UserReqObjCredentials.md new file mode 100644 index 00000000..d8cfcdcb --- /dev/null +++ b/pkg/sdk/rust/docs/UserReqObjCredentials.md @@ -0,0 +1,12 @@ +# UserReqObjCredentials + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**username** | Option<**String**> | User's username for example 'admin' will be used as its unique identifier. | [optional] +**secret** | Option<**String**> | Free-form account secret used for acquiring auth token(s). | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/pkg/sdk/rust/docs/UserRole.md b/pkg/sdk/rust/docs/UserRole.md new file mode 100644 index 00000000..7aabe1e1 --- /dev/null +++ b/pkg/sdk/rust/docs/UserRole.md @@ -0,0 +1,11 @@ +# UserRole + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**role** | **String** | User role example. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/pkg/sdk/rust/docs/UserSecret.md b/pkg/sdk/rust/docs/UserSecret.md new file mode 100644 index 00000000..830c8115 --- /dev/null +++ b/pkg/sdk/rust/docs/UserSecret.md @@ -0,0 +1,12 @@ +# UserSecret + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**old_secret** | **String** | Old user secret password. | +**new_secret** | **String** | New user secret password. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/pkg/sdk/rust/docs/UserTags.md b/pkg/sdk/rust/docs/UserTags.md new file mode 100644 index 00000000..dfabd374 --- /dev/null +++ b/pkg/sdk/rust/docs/UserTags.md @@ -0,0 +1,11 @@ +# UserTags + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tags** | Option<**Vec**> | User tags. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/pkg/sdk/rust/docs/UserUpdate.md b/pkg/sdk/rust/docs/UserUpdate.md new file mode 100644 index 00000000..7bdef9fc --- /dev/null +++ b/pkg/sdk/rust/docs/UserUpdate.md @@ -0,0 +1,13 @@ +# UserUpdate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**first_name** | **String** | User's first name. | +**last_name** | **String** | User's last name. | +**metadata** | [**serde_json::Value**](.md) | Arbitrary, object-encoded user's data. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/pkg/sdk/rust/docs/Username.md b/pkg/sdk/rust/docs/Username.md new file mode 100644 index 00000000..8efa755f --- /dev/null +++ b/pkg/sdk/rust/docs/Username.md @@ -0,0 +1,11 @@ +# Username + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**username** | **String** | User's username for example 'admin' will be used as its unique identifier. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/pkg/sdk/rust/docs/UsersApi.md b/pkg/sdk/rust/docs/UsersApi.md new file mode 100644 index 00000000..817d3305 --- /dev/null +++ b/pkg/sdk/rust/docs/UsersApi.md @@ -0,0 +1,690 @@ +# \UsersApi + +All URIs are relative to *http://localhost:9002* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_user**](UsersApi.md#create_user) | **POST** /users | Registers user account +[**disable_user**](UsersApi.md#disable_user) | **POST** /users/{userID}/disable | Disables a user +[**enable_user**](UsersApi.md#enable_user) | **POST** /users/{userID}/enable | Enables a user +[**get_profile**](UsersApi.md#get_profile) | **GET** /users/profile | Gets info on currently logged in user. +[**get_user**](UsersApi.md#get_user) | **GET** /users/{userID} | Retrieves a user +[**issue_token**](UsersApi.md#issue_token) | **POST** /users/tokens/issue | Issue Token +[**list_users**](UsersApi.md#list_users) | **GET** /users | List users +[**list_users_in_channel**](UsersApi.md#list_users_in_channel) | **GET** /{domainID}/channels/{channelID}/users | List users in a channel +[**list_users_in_group**](UsersApi.md#list_users_in_group) | **GET** /{domainID}/groups/{groupID}/users | List users in a group +[**refresh_token**](UsersApi.md#refresh_token) | **POST** /users/tokens/refresh | Refresh Token +[**request_password_reset**](UsersApi.md#request_password_reset) | **POST** /password/reset-request | User password reset request +[**reset_password**](UsersApi.md#reset_password) | **PUT** /password/reset | User password reset endpoint +[**search_users**](UsersApi.md#search_users) | **GET** /users/search | Search users +[**update_email**](UsersApi.md#update_email) | **PATCH** /users/{userID}/email | Updates email of the user. +[**update_profile_picture**](UsersApi.md#update_profile_picture) | **PATCH** /users/{userID}/picture | Updates the user's profile picture. +[**update_role**](UsersApi.md#update_role) | **PATCH** /users/{userID}/role | Updates the user's role. +[**update_secret**](UsersApi.md#update_secret) | **PATCH** /users/secret | Updates secret of currently logged in user. +[**update_tags**](UsersApi.md#update_tags) | **PATCH** /users/{userID}/tags | Updates tags of the user. +[**update_user**](UsersApi.md#update_user) | **PATCH** /users/{userID} | Updates first, last name and metadata of the user. +[**update_username**](UsersApi.md#update_username) | **PATCH** /users/{userID}/username | Updates user's username. +[**users_user_id_delete**](UsersApi.md#users_user_id_delete) | **DELETE** /users/{userID} | Delete a user + + + +## create_user + +> models::User create_user(user_req_obj) +Registers user account + +Registers new user account given email and password. New account will be uniquely identified by its email address. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**user_req_obj** | [**UserReqObj**](UserReqObj.md) | JSON-formatted document describing the new user to be registered | [required] | + +### Return type + +[**models::User**](User.md) + +### Authorization + +[refreshAuth](../README.md#refreshAuth), [bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## disable_user + +> models::User disable_user(user_id) +Disables a user + +Disables a specific user that is identifier by the user ID. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**user_id** | **uuid::Uuid** | Unique user identifier. | [required] | + +### Return type + +[**models::User**](User.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## enable_user + +> models::User enable_user(user_id) +Enables a user + +Enables a specific user that is identifier by the user ID. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**user_id** | **uuid::Uuid** | Unique user identifier. | [required] | + +### Return type + +[**models::User**](User.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_profile + +> models::User get_profile() +Gets info on currently logged in user. + +Gets info on currently logged in user. Info is obtained using authorization token + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**models::User**](User.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_user + +> models::User get_user(user_id) +Retrieves a user + +Retrieves a specific user that is identifier by the user ID. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**user_id** | **uuid::Uuid** | Unique user identifier. | [required] | + +### Return type + +[**models::User**](User.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## issue_token + +> models::IssueToken200Response issue_token(issue_token) +Issue Token + +Issue Access and Refresh Token used for authenticating into the system. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**issue_token** | [**IssueToken**](IssueToken.md) | Login credentials. | [required] | + +### Return type + +[**models::IssueToken200Response**](issueToken_200_response.md) + +### Authorization + +[refreshAuth](../README.md#refreshAuth), [bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_users + +> models::UsersPage list_users(limit, offset, metadata, status, first_name, last_name, username, email, tags) +List users + +Retrieves a list of users. Due to performance concerns, data is retrieved in subsets. The API must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**limit** | Option<**i32**> | Size of the subset to retrieve. | |[default to 10] +**offset** | Option<**i32**> | Number of items to skip during retrieval. | |[default to 0] +**metadata** | Option<**String**> | Metadata filter. Filtering is performed matching the parameter with metadata on top level. Parameter is json. | | +**status** | Option<**String**> | User account status. | |[default to enabled] +**first_name** | Option<**String**> | User's first name. | | +**last_name** | Option<**String**> | User's last name. | | +**username** | Option<**String**> | User's username. | | +**email** | Option<**String**> | User's email address. | | +**tags** | Option<[**Vec**](String.md)> | User tags. | | + +### Return type + +[**models::UsersPage**](UsersPage.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_users_in_channel + +> models::MembersPage list_users_in_channel(domain_id, channel_id, limit, offset, level, tree, metadata, name, parent_id) +List users in a channel + +Retrieves a list of users in a channel. Due to performance concerns, data is retrieved in subsets. The API must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**channel_id** | **uuid::Uuid** | Unique channel identifier. | [required] | +**limit** | Option<**i32**> | Size of the subset to retrieve. | |[default to 10] +**offset** | Option<**i32**> | Number of items to skip during retrieval. | |[default to 0] +**level** | Option<**i32**> | Level of hierarchy up to which to retrieve groups from given group id. | | +**tree** | Option<**bool**> | Specify type of response, JSON array or tree. | |[default to false] +**metadata** | Option<**String**> | Metadata filter. Filtering is performed matching the parameter with metadata on top level. Parameter is json. | | +**name** | Option<**String**> | Channel's name. | | +**parent_id** | Option<**uuid::Uuid**> | Unique parent identifier for a group. | | + +### Return type + +[**models::MembersPage**](MembersPage.md) + +### Authorization + +[refreshAuth](../README.md#refreshAuth), [bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_users_in_group + +> models::MembersPage list_users_in_group(domain_id, group_id, limit, offset, level, tree, metadata, name, parent_id) +List users in a group + +Retrieves a list of users in a group. Due to performance concerns, data is retrieved in subsets. The API must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**group_id** | **uuid::Uuid** | Unique group identifier. | [required] | +**limit** | Option<**i32**> | Size of the subset to retrieve. | |[default to 10] +**offset** | Option<**i32**> | Number of items to skip during retrieval. | |[default to 0] +**level** | Option<**i32**> | Level of hierarchy up to which to retrieve groups from given group id. | | +**tree** | Option<**bool**> | Specify type of response, JSON array or tree. | |[default to false] +**metadata** | Option<**String**> | Metadata filter. Filtering is performed matching the parameter with metadata on top level. Parameter is json. | | +**name** | Option<**String**> | Group's name. | | +**parent_id** | Option<**uuid::Uuid**> | Unique parent identifier for a group. | | + +### Return type + +[**models::MembersPage**](MembersPage.md) + +### Authorization + +[refreshAuth](../README.md#refreshAuth), [bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## refresh_token + +> models::IssueToken200Response refresh_token() +Refresh Token + +Refreshes Access and Refresh Token used for authenticating into the system. + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**models::IssueToken200Response**](issueToken_200_response.md) + +### Authorization + +[refreshAuth](../README.md#refreshAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## request_password_reset + +> request_password_reset(referer, request_password_reset_request) +User password reset request + +Generates a reset token and sends and email with link for resetting password. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**referer** | **String** | Host being sent by browser. | [required] | +**request_password_reset_request** | [**RequestPasswordResetRequest**](RequestPasswordResetRequest.md) | Initiate password request procedure. | [required] | + +### Return type + + (empty response body) + +### Authorization + +[refreshAuth](../README.md#refreshAuth), [bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## reset_password + +> reset_password(reset_password_request) +User password reset endpoint + +When user gets reset token, after he submitted email to `/password/reset-request`, posting a new password along to this endpoint will change password. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**reset_password_request** | Option<[**ResetPasswordRequest**](ResetPasswordRequest.md)> | Password reset request data, new password and token that is appended on password reset link received in email. | | + +### Return type + + (empty response body) + +### Authorization + +[refreshAuth](../README.md#refreshAuth), [bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## search_users + +> models::UsersPage search_users(user_id, limit, offset, username, first_name, last_name, email) +Search users + +Search users by name and identity. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**user_id** | **uuid::Uuid** | Unique user identifier. | [required] | +**limit** | Option<**i32**> | Size of the subset to retrieve. | |[default to 10] +**offset** | Option<**i32**> | Number of items to skip during retrieval. | |[default to 0] +**username** | Option<**String**> | User's username. | | +**first_name** | Option<**String**> | User's first name. | | +**last_name** | Option<**String**> | User's last name. | | +**email** | Option<**String**> | User's email address. | | + +### Return type + +[**models::UsersPage**](UsersPage.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## update_email + +> models::User update_email(user_id, email) +Updates email of the user. + +Updates email of the user with provided ID. Email is updated using authorization token and the new received email. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**user_id** | **uuid::Uuid** | Unique user identifier. | [required] | +**email** | [**Email**](Email.md) | Email change data. User can change its email. | [required] | + +### Return type + +[**models::User**](User.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## update_profile_picture + +> models::User update_profile_picture(user_id, user_profile_picture) +Updates the user's profile picture. + +Updates the user's profile picture with provided ID. Profile picture is updated using authorization token and the new received picture. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**user_id** | **uuid::Uuid** | Unique user identifier. | [required] | +**user_profile_picture** | [**UserProfilePicture**](UserProfilePicture.md) | JSON-formated document describing the profile picture of user to be update | [required] | + +### Return type + +[**models::User**](User.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## update_role + +> models::User update_role(user_id, user_role) +Updates the user's role. + +Updates role for the user with provided ID. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**user_id** | **uuid::Uuid** | Unique user identifier. | [required] | +**user_role** | [**UserRole**](UserRole.md) | JSON-formated document describing the role of the user to be updated | [required] | + +### Return type + +[**models::User**](User.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## update_secret + +> models::User update_secret(user_secret) +Updates secret of currently logged in user. + +Updates secret of currently logged in user. Secret is updated using authorization token and the new received info. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**user_secret** | [**UserSecret**](UserSecret.md) | Secret change data. User can change its secret. | [required] | + +### Return type + +[**models::User**](User.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## update_tags + +> models::User update_tags(user_id, user_tags) +Updates tags of the user. + +Updates tags of the user with provided ID. Tags is updated using authorization token and the new tags received in request. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**user_id** | **uuid::Uuid** | Unique user identifier. | [required] | +**user_tags** | [**UserTags**](UserTags.md) | JSON-formated document describing the tags of user to be update | [required] | + +### Return type + +[**models::User**](User.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## update_user + +> models::User update_user(user_id, user_update) +Updates first, last name and metadata of the user. + +Updates name and metadata of the user with provided ID. Name and metadata is updated using authorization token and the new received info. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**user_id** | **uuid::Uuid** | Unique user identifier. | [required] | +**user_update** | [**UserUpdate**](UserUpdate.md) | JSON-formated document describing the metadata and name of user to be update | [required] | + +### Return type + +[**models::User**](User.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## update_username + +> models::User update_username(user_id, username) +Updates user's username. + +Updates username of the user with provided ID. Username is updated using authorization token and the new received username. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**user_id** | **uuid::Uuid** | Unique user identifier. | [required] | +**username** | [**Username**](Username.md) | JSON-formated document describing the username of the user to be updated | [required] | + +### Return type + +[**models::User**](User.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## users_user_id_delete + +> users_user_id_delete(user_id) +Delete a user + +Delete a specific user that is identifier by the user ID. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**user_id** | **uuid::Uuid** | Unique user identifier. | [required] | + +### Return type + + (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/pkg/sdk/rust/docs/UsersPage.md b/pkg/sdk/rust/docs/UsersPage.md new file mode 100644 index 00000000..d46bd1a5 --- /dev/null +++ b/pkg/sdk/rust/docs/UsersPage.md @@ -0,0 +1,14 @@ +# UsersPage + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**users** | [**Vec**](User.md) | | +**total** | **i32** | Total number of items. | +**offset** | **i32** | Number of items to skip during retrieval. | +**limit** | Option<**i32**> | Maximum number of items to return in one page. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/pkg/sdk/rust/git_push.sh b/pkg/sdk/rust/git_push.sh new file mode 100644 index 00000000..f53a75d4 --- /dev/null +++ b/pkg/sdk/rust/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/pkg/sdk/rust/src/apis/configuration.rs b/pkg/sdk/rust/src/apis/configuration.rs new file mode 100644 index 00000000..013c81a5 --- /dev/null +++ b/pkg/sdk/rust/src/apis/configuration.rs @@ -0,0 +1,51 @@ +/* + * SuperMQ Users Service + * + * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.14.0 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + + + +#[derive(Debug, Clone)] +pub struct Configuration { + pub base_path: String, + pub user_agent: Option, + pub client: reqwest::Client, + pub basic_auth: Option, + pub oauth_access_token: Option, + pub bearer_access_token: Option, + pub api_key: Option, +} + +pub type BasicAuth = (String, Option); + +#[derive(Debug, Clone)] +pub struct ApiKey { + pub prefix: Option, + pub key: String, +} + + +impl Configuration { + pub fn new() -> Configuration { + Configuration::default() + } +} + +impl Default for Configuration { + fn default() -> Self { + Configuration { + base_path: "http://localhost:9002".to_owned(), + user_agent: Some("OpenAPI-Generator/0.14.0/rust".to_owned()), + client: reqwest::Client::new(), + basic_auth: None, + oauth_access_token: None, + bearer_access_token: None, + api_key: None, + } + } +} diff --git a/pkg/sdk/rust/src/apis/domains_api.rs b/pkg/sdk/rust/src/apis/domains_api.rs new file mode 100644 index 00000000..75fe0072 --- /dev/null +++ b/pkg/sdk/rust/src/apis/domains_api.rs @@ -0,0 +1,74 @@ +/* + * SuperMQ Users Service + * + * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.14.0 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`domain_id_users_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DomainIdUsersGetError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + + +/// List users assigned to domain that is identified by the domain ID. +pub async fn domain_id_users_get(configuration: &configuration::Configuration, domain_id: &str, limit: Option, offset: Option, metadata: Option<&str>, status: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/users", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = offset { + local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = metadata { + local_var_req_builder = local_var_req_builder.query(&[("metadata", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = status { + local_var_req_builder = local_var_req_builder.query(&[("status", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/pkg/sdk/rust/src/apis/groups_api.rs b/pkg/sdk/rust/src/apis/groups_api.rs new file mode 100644 index 00000000..15c9f58d --- /dev/null +++ b/pkg/sdk/rust/src/apis/groups_api.rs @@ -0,0 +1,702 @@ +/* + * SuperMQ Users Service + * + * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.14.0 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`assign_user`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AssignUserError { + Status400(), + Status401(), + Status403(), + Status404(), + Status415(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`create_group`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CreateGroupError { + Status400(), + Status401(), + Status403(), + Status404(), + Status409(), + Status415(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`disable_group`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DisableGroupError { + Status400(), + Status401(), + Status403(), + Status404(), + Status409(), + Status415(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`domain_id_groups_group_id_delete`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DomainIdGroupsGroupIdDeleteError { + Status400(), + Status401(), + Status403(), + Status404(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`enable_group`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EnableGroupError { + Status400(), + Status401(), + Status403(), + Status404(), + Status409(), + Status415(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_group`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetGroupError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_children`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListChildrenError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_groups`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListGroupsError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_groups_by_user`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListGroupsByUserError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_groups_in_channel`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListGroupsInChannelError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_parents`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListParentsError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`unassign_user`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UnassignUserError { + Status400(), + Status401(), + Status403(), + Status404(), + Status415(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`update_group`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UpdateGroupError { + Status400(), + Status401(), + Status403(), + Status404(), + Status409(), + Status415(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + + +/// Assigns a specific user to a group that is identifier by the group ID. +pub async fn assign_user(configuration: &configuration::Configuration, domain_id: &str, group_id: &str, assign_user_req_obj: models::AssignUserReqObj) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}/users/assign", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&assign_user_req_obj); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Creates new group that can be used for grouping entities. New account will be uniquely identified by its identity. +pub async fn create_group(configuration: &configuration::Configuration, domain_id: &str, group_req_obj: models::GroupReqObj) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/groups", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&group_req_obj); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Disables a specific group that is identifier by the group ID. +pub async fn disable_group(configuration: &configuration::Configuration, domain_id: &str, group_id: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}/disable", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Delete group removes a group with the given id from repo and removes all the policies related to this group. +pub async fn domain_id_groups_group_id_delete(configuration: &configuration::Configuration, domain_id: &str, group_id: &str) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Enables a specific group that is identifier by the group ID. +pub async fn enable_group(configuration: &configuration::Configuration, domain_id: &str, group_id: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}/enable", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Gets info on a group specified by id. +pub async fn get_group(configuration: &configuration::Configuration, domain_id: &str, group_id: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Lists groups up to a max level of hierarchy that can be fetched in one request ( max level = 5). Result can be filtered by metadata. Groups will be returned as JSON array or JSON tree. Due to performance concerns, result is returned in subsets. +pub async fn list_children(configuration: &configuration::Configuration, domain_id: &str, group_id: &str, limit: Option, offset: Option, level: Option, tree: Option, metadata: Option<&str>, name: Option<&str>, parent_id: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}/children", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = offset { + local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = level { + local_var_req_builder = local_var_req_builder.query(&[("level", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = tree { + local_var_req_builder = local_var_req_builder.query(&[("tree", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = metadata { + local_var_req_builder = local_var_req_builder.query(&[("metadata", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = name { + local_var_req_builder = local_var_req_builder.query(&[("name", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = parent_id { + local_var_req_builder = local_var_req_builder.query(&[("parentID", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Lists groups up to a max level of hierarchy that can be fetched in one request ( max level = 5). Result can be filtered by metadata. Groups will be returned as JSON array or JSON tree. Due to performance concerns, result is returned in subsets. +pub async fn list_groups(configuration: &configuration::Configuration, domain_id: &str, limit: Option, offset: Option, level: Option, tree: Option, metadata: Option<&str>, name: Option<&str>, parent_id: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/groups", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = offset { + local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = level { + local_var_req_builder = local_var_req_builder.query(&[("level", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = tree { + local_var_req_builder = local_var_req_builder.query(&[("tree", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = metadata { + local_var_req_builder = local_var_req_builder.query(&[("metadata", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = name { + local_var_req_builder = local_var_req_builder.query(&[("name", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = parent_id { + local_var_req_builder = local_var_req_builder.query(&[("parentID", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Gets groups associated with the user member specified by id. +pub async fn list_groups_by_user(configuration: &configuration::Configuration, domain_id: &str, member_id: &str, limit: Option, offset: Option, metadata: Option<&str>, status: Option<&str>, tags: Option>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/users/{memberID}/groups", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), memberID=crate::apis::urlencode(member_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = offset { + local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = metadata { + local_var_req_builder = local_var_req_builder.query(&[("metadata", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = status { + local_var_req_builder = local_var_req_builder.query(&[("status", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = tags { + local_var_req_builder = match "multi" { + "multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("tags".to_owned(), p.to_string())).collect::>()), + _ => local_var_req_builder.query(&[("tags", &local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), + }; + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Gets groups associated with the channel member specified by id. +pub async fn list_groups_in_channel(configuration: &configuration::Configuration, domain_id: &str, member_id: &str, limit: Option, offset: Option, metadata: Option<&str>, status: Option<&str>, tags: Option>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/channels/{memberID}/groups", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), memberID=crate::apis::urlencode(member_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = offset { + local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = metadata { + local_var_req_builder = local_var_req_builder.query(&[("metadata", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = status { + local_var_req_builder = local_var_req_builder.query(&[("status", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = tags { + local_var_req_builder = match "multi" { + "multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("tags".to_owned(), p.to_string())).collect::>()), + _ => local_var_req_builder.query(&[("tags", &local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), + }; + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Lists groups up to a max level of hierarchy that can be fetched in one request ( max level = 5). Result can be filtered by metadata. Groups will be returned as JSON array or JSON tree. Due to performance concerns, result is returned in subsets. +pub async fn list_parents(configuration: &configuration::Configuration, domain_id: &str, group_id: &str, limit: Option, offset: Option, level: Option, tree: Option, metadata: Option<&str>, name: Option<&str>, parent_id: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}/parents", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = offset { + local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = level { + local_var_req_builder = local_var_req_builder.query(&[("level", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = tree { + local_var_req_builder = local_var_req_builder.query(&[("tree", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = metadata { + local_var_req_builder = local_var_req_builder.query(&[("metadata", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = name { + local_var_req_builder = local_var_req_builder.query(&[("name", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = parent_id { + local_var_req_builder = local_var_req_builder.query(&[("parentID", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Unassigns a specific user to a group that is identifier by the group ID. +pub async fn unassign_user(configuration: &configuration::Configuration, domain_id: &str, group_id: &str, assign_user_req_obj: models::AssignUserReqObj) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}/users/unassign", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&assign_user_req_obj); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Updates Name, Description or Metadata of a group. +pub async fn update_group(configuration: &configuration::Configuration, domain_id: &str, group_id: &str, group_update: models::GroupUpdate) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&group_update); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/pkg/sdk/rust/src/apis/health_api.rs b/pkg/sdk/rust/src/apis/health_api.rs new file mode 100644 index 00000000..971f546f --- /dev/null +++ b/pkg/sdk/rust/src/apis/health_api.rs @@ -0,0 +1,53 @@ +/* + * SuperMQ Users Service + * + * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.14.0 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`health`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum HealthError { + Status500(models::Error), + UnknownValue(serde_json::Value), +} + + +pub async fn health(configuration: &configuration::Configuration, ) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/health", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/pkg/sdk/rust/src/apis/mod.rs b/pkg/sdk/rust/src/apis/mod.rs new file mode 100644 index 00000000..6b956321 --- /dev/null +++ b/pkg/sdk/rust/src/apis/mod.rs @@ -0,0 +1,99 @@ +use std::error; +use std::fmt; + +#[derive(Debug, Clone)] +pub struct ResponseContent { + pub status: reqwest::StatusCode, + pub content: String, + pub entity: Option, +} + +#[derive(Debug)] +pub enum Error { + Reqwest(reqwest::Error), + Serde(serde_json::Error), + Io(std::io::Error), + ResponseError(ResponseContent), +} + +impl fmt::Display for Error { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + let (module, e) = match self { + Error::Reqwest(e) => ("reqwest", e.to_string()), + Error::Serde(e) => ("serde", e.to_string()), + Error::Io(e) => ("IO", e.to_string()), + Error::ResponseError(e) => ("response", format!("status code {}", e.status)), + }; + write!(f, "error in {}: {}", module, e) + } +} + +impl error::Error for Error { + fn source(&self) -> Option<&(dyn error::Error + 'static)> { + Some(match self { + Error::Reqwest(e) => e, + Error::Serde(e) => e, + Error::Io(e) => e, + Error::ResponseError(_) => return None, + }) + } +} + +impl From for Error { + fn from(e: reqwest::Error) -> Self { + Error::Reqwest(e) + } +} + +impl From for Error { + fn from(e: serde_json::Error) -> Self { + Error::Serde(e) + } +} + +impl From for Error { + fn from(e: std::io::Error) -> Self { + Error::Io(e) + } +} + +pub fn urlencode>(s: T) -> String { + ::url::form_urlencoded::byte_serialize(s.as_ref().as_bytes()).collect() +} + +pub fn parse_deep_object(prefix: &str, value: &serde_json::Value) -> Vec<(String, String)> { + if let serde_json::Value::Object(object) = value { + let mut params = vec![]; + + for (key, value) in object { + match value { + serde_json::Value::Object(_) => params.append(&mut parse_deep_object( + &format!("{}[{}]", prefix, key), + value, + )), + serde_json::Value::Array(array) => { + for (i, value) in array.iter().enumerate() { + params.append(&mut parse_deep_object( + &format!("{}[{}][{}]", prefix, key, i), + value, + )); + } + }, + serde_json::Value::String(s) => params.push((format!("{}[{}]", prefix, key), s.clone())), + _ => params.push((format!("{}[{}]", prefix, key), value.to_string())), + } + } + + return params; + } + + unimplemented!("Only objects are supported with style=deepObject") +} + +pub mod domains_api; +pub mod groups_api; +pub mod health_api; +pub mod users_api; + +pub mod configuration; +pub use self::configuration::Configuration; diff --git a/pkg/sdk/rust/src/apis/users_api.rs b/pkg/sdk/rust/src/apis/users_api.rs new file mode 100644 index 00000000..43a1e4d3 --- /dev/null +++ b/pkg/sdk/rust/src/apis/users_api.rs @@ -0,0 +1,1067 @@ +/* + * SuperMQ Users Service + * + * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.14.0 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`create_user`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CreateUserError { + Status400(), + Status401(), + Status403(), + Status409(), + Status415(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`disable_user`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DisableUserError { + Status400(), + Status401(), + Status403(), + Status404(), + Status409(), + Status415(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`enable_user`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EnableUserError { + Status400(), + Status401(), + Status403(), + Status404(), + Status409(), + Status415(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_profile`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetProfileError { + Status400(), + Status401(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_user`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetUserError { + Status400(), + Status401(), + Status404(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`issue_token`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum IssueTokenError { + Status400(), + Status401(), + Status404(), + Status415(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_users`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListUsersError { + Status400(), + Status401(), + Status404(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_users_in_channel`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListUsersInChannelError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_users_in_group`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListUsersInGroupError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`refresh_token`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RefreshTokenError { + Status400(), + Status401(), + Status404(), + Status415(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`request_password_reset`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RequestPasswordResetError { + Status400(), + Status404(), + Status415(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`reset_password`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ResetPasswordError { + Status400(), + Status401(), + Status404(), + Status415(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`search_users`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SearchUsersError { + Status400(), + Status401(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`update_email`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UpdateEmailError { + Status400(), + Status403(), + Status404(), + Status401(), + Status409(), + Status415(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`update_profile_picture`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UpdateProfilePictureError { + Status400(), + Status403(), + Status404(), + Status401(), + Status415(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`update_role`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UpdateRoleError { + Status400(), + Status403(), + Status404(), + Status401(), + Status415(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`update_secret`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UpdateSecretError { + Status400(), + Status401(), + Status404(), + Status415(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`update_tags`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UpdateTagsError { + Status400(), + Status403(), + Status404(), + Status401(), + Status415(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`update_user`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UpdateUserError { + Status400(), + Status403(), + Status404(), + Status401(), + Status409(), + Status415(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`update_username`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UpdateUsernameError { + Status400(), + Status403(), + Status404(), + Status401(), + Status409(), + Status415(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`users_user_id_delete`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UsersUserIdDeleteError { + Status400(), + Status401(), + Status404(), + Status405(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + + +/// Registers new user account given email and password. New account will be uniquely identified by its email address. +pub async fn create_user(configuration: &configuration::Configuration, user_req_obj: models::UserReqObj) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/users", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&user_req_obj); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Disables a specific user that is identifier by the user ID. +pub async fn disable_user(configuration: &configuration::Configuration, user_id: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/users/{userID}/disable", local_var_configuration.base_path, userID=crate::apis::urlencode(user_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Enables a specific user that is identifier by the user ID. +pub async fn enable_user(configuration: &configuration::Configuration, user_id: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/users/{userID}/enable", local_var_configuration.base_path, userID=crate::apis::urlencode(user_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Gets info on currently logged in user. Info is obtained using authorization token +pub async fn get_profile(configuration: &configuration::Configuration, ) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/users/profile", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Retrieves a specific user that is identifier by the user ID. +pub async fn get_user(configuration: &configuration::Configuration, user_id: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/users/{userID}", local_var_configuration.base_path, userID=crate::apis::urlencode(user_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Issue Access and Refresh Token used for authenticating into the system. +pub async fn issue_token(configuration: &configuration::Configuration, issue_token: models::IssueToken) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/users/tokens/issue", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&issue_token); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Retrieves a list of users. Due to performance concerns, data is retrieved in subsets. The API must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. +pub async fn list_users(configuration: &configuration::Configuration, limit: Option, offset: Option, metadata: Option<&str>, status: Option<&str>, first_name: Option<&str>, last_name: Option<&str>, username: Option<&str>, email: Option<&str>, tags: Option>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/users", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = offset { + local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = metadata { + local_var_req_builder = local_var_req_builder.query(&[("metadata", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = status { + local_var_req_builder = local_var_req_builder.query(&[("status", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = first_name { + local_var_req_builder = local_var_req_builder.query(&[("first_name", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = last_name { + local_var_req_builder = local_var_req_builder.query(&[("last_name", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = username { + local_var_req_builder = local_var_req_builder.query(&[("username", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = email { + local_var_req_builder = local_var_req_builder.query(&[("email", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = tags { + local_var_req_builder = match "multi" { + "multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("tags".to_owned(), p.to_string())).collect::>()), + _ => local_var_req_builder.query(&[("tags", &local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), + }; + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Retrieves a list of users in a channel. Due to performance concerns, data is retrieved in subsets. The API must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. +pub async fn list_users_in_channel(configuration: &configuration::Configuration, domain_id: &str, channel_id: &str, limit: Option, offset: Option, level: Option, tree: Option, metadata: Option<&str>, name: Option<&str>, parent_id: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/channels/{channelID}/users", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), channelID=crate::apis::urlencode(channel_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = offset { + local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = level { + local_var_req_builder = local_var_req_builder.query(&[("level", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = tree { + local_var_req_builder = local_var_req_builder.query(&[("tree", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = metadata { + local_var_req_builder = local_var_req_builder.query(&[("metadata", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = name { + local_var_req_builder = local_var_req_builder.query(&[("name", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = parent_id { + local_var_req_builder = local_var_req_builder.query(&[("parentID", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Retrieves a list of users in a group. Due to performance concerns, data is retrieved in subsets. The API must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. +pub async fn list_users_in_group(configuration: &configuration::Configuration, domain_id: &str, group_id: &str, limit: Option, offset: Option, level: Option, tree: Option, metadata: Option<&str>, name: Option<&str>, parent_id: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}/users", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = offset { + local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = level { + local_var_req_builder = local_var_req_builder.query(&[("level", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = tree { + local_var_req_builder = local_var_req_builder.query(&[("tree", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = metadata { + local_var_req_builder = local_var_req_builder.query(&[("metadata", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = name { + local_var_req_builder = local_var_req_builder.query(&[("name", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = parent_id { + local_var_req_builder = local_var_req_builder.query(&[("parentID", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Refreshes Access and Refresh Token used for authenticating into the system. +pub async fn refresh_token(configuration: &configuration::Configuration, ) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/users/tokens/refresh", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Generates a reset token and sends and email with link for resetting password. +pub async fn request_password_reset(configuration: &configuration::Configuration, referer: &str, request_password_reset_request: models::RequestPasswordResetRequest) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/password/reset-request", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + local_var_req_builder = local_var_req_builder.header("Referer", referer.to_string()); + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&request_password_reset_request); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// When user gets reset token, after he submitted email to `/password/reset-request`, posting a new password along to this endpoint will change password. +pub async fn reset_password(configuration: &configuration::Configuration, reset_password_request: Option) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/password/reset", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&reset_password_request); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +// /// Search users by name and identity. +// pub async fn search_users(configuration: &configuration::Configuration, user_id: &str, limit: Option, offset: Option, username: Option<&str>, first_name: Option<&str>, last_name: Option<&str>, email: Option<&str>) -> Result> { +// let local_var_configuration = configuration; + +// let local_var_client = &local_var_configuration.client; + +// let local_var_uri_str = format!("{}/users/search", local_var_configuration.base_path, userID=crate::apis::urlencode(user_id)); +// let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + +// if let Some(ref local_var_str) = limit { +// local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); +// } +// if let Some(ref local_var_str) = offset { +// local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); +// } +// if let Some(ref local_var_str) = username { +// local_var_req_builder = local_var_req_builder.query(&[("username", &local_var_str.to_string())]); +// } +// if let Some(ref local_var_str) = first_name { +// local_var_req_builder = local_var_req_builder.query(&[("first_name", &local_var_str.to_string())]); +// } +// if let Some(ref local_var_str) = last_name { +// local_var_req_builder = local_var_req_builder.query(&[("last_name", &local_var_str.to_string())]); +// } +// if let Some(ref local_var_str) = email { +// local_var_req_builder = local_var_req_builder.query(&[("email", &local_var_str.to_string())]); +// } +// if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { +// local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); +// } +// if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { +// local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); +// }; + +// let local_var_req = local_var_req_builder.build()?; +// let local_var_resp = local_var_client.execute(local_var_req).await?; + +// let local_var_status = local_var_resp.status(); +// let local_var_content = local_var_resp.text().await?; + +// if !local_var_status.is_client_error() && !local_var_status.is_server_error() { +// serde_json::from_str(&local_var_content).map_err(Error::from) +// } else { +// let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); +// let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; +// Err(Error::ResponseError(local_var_error)) +// } +// } + +/// Updates email of the user with provided ID. Email is updated using authorization token and the new received email. +pub async fn update_email(configuration: &configuration::Configuration, user_id: &str, email: models::Email) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/users/{userID}/email", local_var_configuration.base_path, userID=crate::apis::urlencode(user_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&email); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Updates the user's profile picture with provided ID. Profile picture is updated using authorization token and the new received picture. +pub async fn update_profile_picture(configuration: &configuration::Configuration, user_id: &str, user_profile_picture: models::UserProfilePicture) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/users/{userID}/picture", local_var_configuration.base_path, userID=crate::apis::urlencode(user_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&user_profile_picture); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Updates role for the user with provided ID. +pub async fn update_role(configuration: &configuration::Configuration, user_id: &str, user_role: models::UserRole) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/users/{userID}/role", local_var_configuration.base_path, userID=crate::apis::urlencode(user_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&user_role); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Updates secret of currently logged in user. Secret is updated using authorization token and the new received info. +pub async fn update_secret(configuration: &configuration::Configuration, user_secret: models::UserSecret) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/users/secret", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&user_secret); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Updates tags of the user with provided ID. Tags is updated using authorization token and the new tags received in request. +pub async fn update_tags(configuration: &configuration::Configuration, user_id: &str, user_tags: models::UserTags) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/users/{userID}/tags", local_var_configuration.base_path, userID=crate::apis::urlencode(user_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&user_tags); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Updates name and metadata of the user with provided ID. Name and metadata is updated using authorization token and the new received info. +pub async fn update_user(configuration: &configuration::Configuration, user_id: &str, user_update: models::UserUpdate) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/users/{userID}", local_var_configuration.base_path, userID=crate::apis::urlencode(user_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&user_update); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Updates username of the user with provided ID. Username is updated using authorization token and the new received username. +pub async fn update_username(configuration: &configuration::Configuration, user_id: &str, username: models::Username) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/users/{userID}/username", local_var_configuration.base_path, userID=crate::apis::urlencode(user_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&username); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Delete a specific user that is identifier by the user ID. +pub async fn users_user_id_delete(configuration: &configuration::Configuration, user_id: &str) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/users/{userID}", local_var_configuration.base_path, userID=crate::apis::urlencode(user_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/pkg/sdk/rust/src/lib.rs b/pkg/sdk/rust/src/lib.rs new file mode 100644 index 00000000..e1520628 --- /dev/null +++ b/pkg/sdk/rust/src/lib.rs @@ -0,0 +1,11 @@ +#![allow(unused_imports)] +#![allow(clippy::too_many_arguments)] + +extern crate serde_repr; +extern crate serde; +extern crate serde_json; +extern crate url; +extern crate reqwest; + +pub mod apis; +pub mod models; diff --git a/pkg/sdk/rust/src/main.rs b/pkg/sdk/rust/src/main.rs new file mode 100644 index 00000000..46b9a245 --- /dev/null +++ b/pkg/sdk/rust/src/main.rs @@ -0,0 +1,53 @@ +mod models; +use models::UserReqObj;// Replace with the actual paths to your models +use models::user_req_obj_credentials::UserReqObjCredentials; + +mod apis; +use apis::configuration::Configuration; + use crate::apis::users_api::create_user; +use serde_json::json; + +// Replace with the actual path to your configuration + + + +#[tokio::main] +async fn main() { + // Construct the configuration with the actual API base URL and authorization token + let mut config = Configuration::new(); + config.base_path = "http://localhost:9002".to_string(); + + // Create the credentials, wrapping each field inside Some + let credentials = Box::new(UserReqObjCredentials { + username: Some("admin".to_string()), // Wrap in Some() + secret: Some("password".to_string()), // Wrap in Some() + }); + let metadata = Some(json!({ + "domain": "example.com",})); + + // Create the user request object + let user_req_obj = UserReqObj { + first_name: Some("John".to_string()), + last_name: Some("Doe".to_string()), + email: Some("johnde@example.com".to_string()), + tags: Some(vec!["tag1".to_string(), "tag2".to_string()]), + credentials: credentials, // Boxed credentials + metadata: metadata, + profile_picture: Some("https://example.com/profile.jpg".to_string()), + status: Some("enabled".to_string()), + +}; + + + // Call the `create_user` function + match create_user(&config, user_req_obj).await { + Ok(user) => { + // Success: The user has been created, and `user` contains the response data + println!("User created successfully: {:?}", user); + } + Err(err) => { + // Handle the error (e.g., logging, retrying, etc.) + eprintln!("Error creating user: {:?}", err); + } + } +} \ No newline at end of file diff --git a/pkg/sdk/rust/src/models/assign_req_obj.rs b/pkg/sdk/rust/src/models/assign_req_obj.rs new file mode 100644 index 00000000..50f462a1 --- /dev/null +++ b/pkg/sdk/rust/src/models/assign_req_obj.rs @@ -0,0 +1,36 @@ +/* + * SuperMQ Users Service + * + * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.14.0 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AssignReqObj { + /// Members IDs + #[serde(rename = "members")] + pub members: Vec, + /// Permission relations. + #[serde(rename = "relation")] + pub relation: String, + /// Member kind. + #[serde(rename = "member_kind")] + pub member_kind: String, +} + +impl AssignReqObj { + pub fn new(members: Vec, relation: String, member_kind: String) -> AssignReqObj { + AssignReqObj { + members, + relation, + member_kind, + } + } +} + diff --git a/pkg/sdk/rust/src/models/assign_user_req_obj.rs b/pkg/sdk/rust/src/models/assign_user_req_obj.rs new file mode 100644 index 00000000..10d13261 --- /dev/null +++ b/pkg/sdk/rust/src/models/assign_user_req_obj.rs @@ -0,0 +1,32 @@ +/* + * SuperMQ Users Service + * + * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.14.0 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AssignUserReqObj { + /// User IDs + #[serde(rename = "user_ids")] + pub user_ids: Vec, + /// Permission relations. + #[serde(rename = "relation")] + pub relation: String, +} + +impl AssignUserReqObj { + pub fn new(user_ids: Vec, relation: String) -> AssignUserReqObj { + AssignUserReqObj { + user_ids, + relation, + } + } +} + diff --git a/pkg/sdk/rust/src/models/email.rs b/pkg/sdk/rust/src/models/email.rs new file mode 100644 index 00000000..fbeda7d8 --- /dev/null +++ b/pkg/sdk/rust/src/models/email.rs @@ -0,0 +1,28 @@ +/* + * SuperMQ Users Service + * + * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.14.0 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Email { + /// User email address. + #[serde(rename = "email")] + pub email: String, +} + +impl Email { + pub fn new(email: String) -> Email { + Email { + email, + } + } +} + diff --git a/pkg/sdk/rust/src/models/error.rs b/pkg/sdk/rust/src/models/error.rs new file mode 100644 index 00000000..e808b985 --- /dev/null +++ b/pkg/sdk/rust/src/models/error.rs @@ -0,0 +1,28 @@ +/* + * SuperMQ Users Service + * + * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.14.0 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Error { + /// Error message + #[serde(rename = "error", skip_serializing_if = "Option::is_none")] + pub error: Option, +} + +impl Error { + pub fn new() -> Error { + Error { + error: None, + } + } +} + diff --git a/pkg/sdk/rust/src/models/group.rs b/pkg/sdk/rust/src/models/group.rs new file mode 100644 index 00000000..71978617 --- /dev/null +++ b/pkg/sdk/rust/src/models/group.rs @@ -0,0 +1,68 @@ +/* + * SuperMQ Users Service + * + * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.14.0 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Group { + /// Unique group identifier generated by the service. + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + /// Free-form group name. Group name is unique on the given hierarchy level. + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + /// ID of the domain to which the group belongs.. + #[serde(rename = "domain_id", skip_serializing_if = "Option::is_none")] + pub domain_id: Option, + /// Group parent identifier. + #[serde(rename = "parent_id", skip_serializing_if = "Option::is_none")] + pub parent_id: Option, + /// Group description, free form text. + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option, + /// Arbitrary, object-encoded groups's data. + #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")] + pub metadata: Option, + /// Hierarchy path, concatenated ids of group ancestors. + #[serde(rename = "path", skip_serializing_if = "Option::is_none")] + pub path: Option, + /// Level in hierarchy, distance from the root group. + #[serde(rename = "level", skip_serializing_if = "Option::is_none")] + pub level: Option, + /// Datetime when the group was created. + #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] + pub created_at: Option, + /// Datetime when the group was created. + #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")] + pub updated_at: Option, + /// Group Status + #[serde(rename = "status", skip_serializing_if = "Option::is_none")] + pub status: Option, +} + +impl Group { + pub fn new() -> Group { + Group { + id: None, + name: None, + domain_id: None, + parent_id: None, + description: None, + metadata: None, + path: None, + level: None, + created_at: None, + updated_at: None, + status: None, + } + } +} + diff --git a/pkg/sdk/rust/src/models/group_req_obj.rs b/pkg/sdk/rust/src/models/group_req_obj.rs new file mode 100644 index 00000000..a0bada9a --- /dev/null +++ b/pkg/sdk/rust/src/models/group_req_obj.rs @@ -0,0 +1,44 @@ +/* + * SuperMQ Users Service + * + * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.14.0 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct GroupReqObj { + /// Free-form group name. Group name is unique on the given hierarchy level. + #[serde(rename = "name")] + pub name: String, + /// Group description, free form text. + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option, + /// Id of parent group, it must be existing group. + #[serde(rename = "parent_id", skip_serializing_if = "Option::is_none")] + pub parent_id: Option, + /// Arbitrary, object-encoded groups's data. + #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")] + pub metadata: Option, + /// Group Status + #[serde(rename = "status", skip_serializing_if = "Option::is_none")] + pub status: Option, +} + +impl GroupReqObj { + pub fn new(name: String) -> GroupReqObj { + GroupReqObj { + name, + description: None, + parent_id: None, + metadata: None, + status: None, + } + } +} + diff --git a/pkg/sdk/rust/src/models/group_update.rs b/pkg/sdk/rust/src/models/group_update.rs new file mode 100644 index 00000000..9fd709f2 --- /dev/null +++ b/pkg/sdk/rust/src/models/group_update.rs @@ -0,0 +1,36 @@ +/* + * SuperMQ Users Service + * + * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.14.0 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct GroupUpdate { + /// Free-form group name. Group name is unique on the given hierarchy level. + #[serde(rename = "name")] + pub name: String, + /// Group description, free form text. + #[serde(rename = "description")] + pub description: String, + /// Arbitrary, object-encoded groups's data. + #[serde(rename = "metadata")] + pub metadata: serde_json::Value, +} + +impl GroupUpdate { + pub fn new(name: String, description: String, metadata: serde_json::Value) -> GroupUpdate { + GroupUpdate { + name, + description, + metadata, + } + } +} + diff --git a/pkg/sdk/rust/src/models/groups_page.rs b/pkg/sdk/rust/src/models/groups_page.rs new file mode 100644 index 00000000..62c70541 --- /dev/null +++ b/pkg/sdk/rust/src/models/groups_page.rs @@ -0,0 +1,39 @@ +/* + * SuperMQ Users Service + * + * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.14.0 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct GroupsPage { + #[serde(rename = "groups")] + pub groups: Vec, + /// Total number of items. + #[serde(rename = "total")] + pub total: i32, + /// Number of items to skip during retrieval. + #[serde(rename = "offset")] + pub offset: i32, + /// Maximum number of items to return in one page. + #[serde(rename = "limit", skip_serializing_if = "Option::is_none")] + pub limit: Option, +} + +impl GroupsPage { + pub fn new(groups: Vec, total: i32, offset: i32) -> GroupsPage { + GroupsPage { + groups, + total, + offset, + limit: None, + } + } +} + diff --git a/pkg/sdk/rust/src/models/health_res.rs b/pkg/sdk/rust/src/models/health_res.rs new file mode 100644 index 00000000..107e483a --- /dev/null +++ b/pkg/sdk/rust/src/models/health_res.rs @@ -0,0 +1,56 @@ +/* + * SuperMQ Users Service + * + * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.14.0 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct HealthRes { + /// Service status. + #[serde(rename = "status", skip_serializing_if = "Option::is_none")] + pub status: Option, + /// Service version. + #[serde(rename = "version", skip_serializing_if = "Option::is_none")] + pub version: Option, + /// Service commit hash. + #[serde(rename = "commit", skip_serializing_if = "Option::is_none")] + pub commit: Option, + /// Service description. + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option, + /// Service build time. + #[serde(rename = "build_time", skip_serializing_if = "Option::is_none")] + pub build_time: Option, +} + +impl HealthRes { + pub fn new() -> HealthRes { + HealthRes { + status: None, + version: None, + commit: None, + description: None, + build_time: None, + } + } +} +/// Service status. +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Status { + #[serde(rename = "pass")] + Pass, +} + +impl Default for Status { + fn default() -> Status { + Self::Pass + } +} + diff --git a/pkg/sdk/rust/src/models/issue_token.rs b/pkg/sdk/rust/src/models/issue_token.rs new file mode 100644 index 00000000..ed2453bd --- /dev/null +++ b/pkg/sdk/rust/src/models/issue_token.rs @@ -0,0 +1,32 @@ +/* + * SuperMQ Users Service + * + * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.14.0 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct IssueToken { + /// User identity - email address. + #[serde(rename = "identity")] + pub identity: String, + /// User secret password. + #[serde(rename = "secret")] + pub secret: String, +} + +impl IssueToken { + pub fn new(identity: String, secret: String) -> IssueToken { + IssueToken { + identity, + secret, + } + } +} + diff --git a/pkg/sdk/rust/src/models/issue_token_200_response.rs b/pkg/sdk/rust/src/models/issue_token_200_response.rs new file mode 100644 index 00000000..6629a1b9 --- /dev/null +++ b/pkg/sdk/rust/src/models/issue_token_200_response.rs @@ -0,0 +1,36 @@ +/* + * SuperMQ Users Service + * + * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.14.0 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct IssueToken200Response { + /// User access token. + #[serde(rename = "access_token", skip_serializing_if = "Option::is_none")] + pub access_token: Option, + /// User refresh token. + #[serde(rename = "refresh_token", skip_serializing_if = "Option::is_none")] + pub refresh_token: Option, + /// User access token type. + #[serde(rename = "access_type", skip_serializing_if = "Option::is_none")] + pub access_type: Option, +} + +impl IssueToken200Response { + pub fn new() -> IssueToken200Response { + IssueToken200Response { + access_token: None, + refresh_token: None, + access_type: None, + } + } +} + diff --git a/pkg/sdk/rust/src/models/members.rs b/pkg/sdk/rust/src/models/members.rs new file mode 100644 index 00000000..fe9639b2 --- /dev/null +++ b/pkg/sdk/rust/src/models/members.rs @@ -0,0 +1,63 @@ +/* + * SuperMQ Users Service + * + * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.14.0 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Members { + /// User unique identifier. + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + /// User's first name. + #[serde(rename = "first_name", skip_serializing_if = "Option::is_none")] + pub first_name: Option, + /// User's last name. + #[serde(rename = "last_name", skip_serializing_if = "Option::is_none")] + pub last_name: Option, + /// User's email address. + #[serde(rename = "email", skip_serializing_if = "Option::is_none")] + pub email: Option, + /// User tags. + #[serde(rename = "tags", skip_serializing_if = "Option::is_none")] + pub tags: Option>, + #[serde(rename = "credentials", skip_serializing_if = "Option::is_none")] + pub credentials: Option>, + /// Arbitrary, object-encoded user's data. + #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")] + pub metadata: Option, + /// User Status + #[serde(rename = "status", skip_serializing_if = "Option::is_none")] + pub status: Option, + /// Time when the group was created. + #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] + pub created_at: Option, + /// Time when the group was created. + #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")] + pub updated_at: Option, +} + +impl Members { + pub fn new() -> Members { + Members { + id: None, + first_name: None, + last_name: None, + email: None, + tags: None, + credentials: None, + metadata: None, + status: None, + created_at: None, + updated_at: None, + } + } +} + diff --git a/pkg/sdk/rust/src/models/members_credentials.rs b/pkg/sdk/rust/src/models/members_credentials.rs new file mode 100644 index 00000000..ffb9c498 --- /dev/null +++ b/pkg/sdk/rust/src/models/members_credentials.rs @@ -0,0 +1,32 @@ +/* + * SuperMQ Users Service + * + * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.14.0 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct MembersCredentials { + /// User's username. + #[serde(rename = "username", skip_serializing_if = "Option::is_none")] + pub username: Option, + /// User secret password. + #[serde(rename = "secret", skip_serializing_if = "Option::is_none")] + pub secret: Option, +} + +impl MembersCredentials { + pub fn new() -> MembersCredentials { + MembersCredentials { + username: None, + secret: None, + } + } +} + diff --git a/pkg/sdk/rust/src/models/members_page.rs b/pkg/sdk/rust/src/models/members_page.rs new file mode 100644 index 00000000..928e4bc6 --- /dev/null +++ b/pkg/sdk/rust/src/models/members_page.rs @@ -0,0 +1,39 @@ +/* + * SuperMQ Users Service + * + * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.14.0 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct MembersPage { + #[serde(rename = "members")] + pub members: Vec, + /// Total number of items. + #[serde(rename = "total")] + pub total: i32, + /// Number of items to skip during retrieval. + #[serde(rename = "offset", skip_serializing_if = "Option::is_none")] + pub offset: Option, + /// Maximum number of items to return in one page. + #[serde(rename = "limit", skip_serializing_if = "Option::is_none")] + pub limit: Option, +} + +impl MembersPage { + pub fn new(members: Vec, total: i32) -> MembersPage { + MembersPage { + members, + total, + offset: None, + limit: None, + } + } +} + diff --git a/pkg/sdk/rust/src/models/mod.rs b/pkg/sdk/rust/src/models/mod.rs new file mode 100644 index 00000000..a93319d3 --- /dev/null +++ b/pkg/sdk/rust/src/models/mod.rs @@ -0,0 +1,54 @@ +pub mod assign_req_obj; +pub use self::assign_req_obj::AssignReqObj; +pub mod assign_user_req_obj; +pub use self::assign_user_req_obj::AssignUserReqObj; +pub mod email; +pub use self::email::Email; +pub mod error; +pub use self::error::Error; +pub mod group; +pub use self::group::Group; +pub mod group_req_obj; +pub use self::group_req_obj::GroupReqObj; +pub mod group_update; +pub use self::group_update::GroupUpdate; +pub mod groups_page; +pub use self::groups_page::GroupsPage; +pub mod health_res; +pub use self::health_res::HealthRes; +pub mod issue_token; +pub use self::issue_token::IssueToken; +pub mod issue_token_200_response; +pub use self::issue_token_200_response::IssueToken200Response; +pub mod members; +pub use self::members::Members; +pub mod members_credentials; +pub use self::members_credentials::MembersCredentials; +pub mod members_page; +pub use self::members_page::MembersPage; +pub mod request_password_reset_request; +pub use self::request_password_reset_request::RequestPasswordResetRequest; +pub mod reset_password_request; +pub use self::reset_password_request::ResetPasswordRequest; +pub mod user; +pub use self::user::User; +pub mod user_credentials; +pub use self::user_credentials::UserCredentials; +pub mod user_profile_picture; +pub use self::user_profile_picture::UserProfilePicture; +pub mod user_req_obj; +pub use self::user_req_obj::UserReqObj; +pub mod user_req_obj_credentials; +pub use self::user_req_obj_credentials::UserReqObjCredentials; +pub mod user_role; +pub use self::user_role::UserRole; +pub mod user_secret; +pub use self::user_secret::UserSecret; +pub mod user_tags; +pub use self::user_tags::UserTags; +pub mod user_update; +pub use self::user_update::UserUpdate; +pub mod username; +pub use self::username::Username; +pub mod users_page; +pub use self::users_page::UsersPage; diff --git a/pkg/sdk/rust/src/models/request_password_reset_request.rs b/pkg/sdk/rust/src/models/request_password_reset_request.rs new file mode 100644 index 00000000..b4cd7599 --- /dev/null +++ b/pkg/sdk/rust/src/models/request_password_reset_request.rs @@ -0,0 +1,32 @@ +/* + * SuperMQ Users Service + * + * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.14.0 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct RequestPasswordResetRequest { + /// User email. + #[serde(rename = "email", skip_serializing_if = "Option::is_none")] + pub email: Option, + /// Email host. + #[serde(rename = "host", skip_serializing_if = "Option::is_none")] + pub host: Option, +} + +impl RequestPasswordResetRequest { + pub fn new() -> RequestPasswordResetRequest { + RequestPasswordResetRequest { + email: None, + host: None, + } + } +} + diff --git a/pkg/sdk/rust/src/models/reset_password_request.rs b/pkg/sdk/rust/src/models/reset_password_request.rs new file mode 100644 index 00000000..64a1c7d1 --- /dev/null +++ b/pkg/sdk/rust/src/models/reset_password_request.rs @@ -0,0 +1,36 @@ +/* + * SuperMQ Users Service + * + * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.14.0 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ResetPasswordRequest { + /// New password. + #[serde(rename = "password", skip_serializing_if = "Option::is_none")] + pub password: Option, + /// New confirmation password. + #[serde(rename = "confirm_password", skip_serializing_if = "Option::is_none")] + pub confirm_password: Option, + /// Reset token generated and sent in email. + #[serde(rename = "token", skip_serializing_if = "Option::is_none")] + pub token: Option, +} + +impl ResetPasswordRequest { + pub fn new() -> ResetPasswordRequest { + ResetPasswordRequest { + password: None, + confirm_password: None, + token: None, + } + } +} + diff --git a/pkg/sdk/rust/src/models/user.rs b/pkg/sdk/rust/src/models/user.rs new file mode 100644 index 00000000..d3f75c87 --- /dev/null +++ b/pkg/sdk/rust/src/models/user.rs @@ -0,0 +1,67 @@ +/* + * SuperMQ Users Service + * + * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.14.0 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct User { + /// User unique identifier. + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + /// User's first name. + #[serde(rename = "first_name", skip_serializing_if = "Option::is_none")] + pub first_name: Option, + /// User's last name. + #[serde(rename = "last_name", skip_serializing_if = "Option::is_none")] + pub last_name: Option, + /// User tags. + #[serde(rename = "tags", skip_serializing_if = "Option::is_none")] + pub tags: Option>, + /// User email for example email address. + #[serde(rename = "email", skip_serializing_if = "Option::is_none")] + pub email: Option, + #[serde(rename = "credentials", skip_serializing_if = "Option::is_none")] + pub credentials: Option>, + /// Arbitrary, object-encoded user's data. + #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")] + pub metadata: Option, + /// User's profile picture URL that is represented as a string. + #[serde(rename = "profile_picture", skip_serializing_if = "Option::is_none")] + pub profile_picture: Option, + /// User Status + #[serde(rename = "status", skip_serializing_if = "Option::is_none")] + pub status: Option, + /// Time when the group was created. + #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] + pub created_at: Option, + /// Time when the group was created. + #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")] + pub updated_at: Option, +} + +impl User { + pub fn new() -> User { + User { + id: None, + first_name: None, + last_name: None, + tags: None, + email: None, + credentials: None, + metadata: None, + profile_picture: None, + status: None, + created_at: None, + updated_at: None, + } + } +} + diff --git a/pkg/sdk/rust/src/models/user_credentials.rs b/pkg/sdk/rust/src/models/user_credentials.rs new file mode 100644 index 00000000..37cad0cb --- /dev/null +++ b/pkg/sdk/rust/src/models/user_credentials.rs @@ -0,0 +1,28 @@ +/* + * SuperMQ Users Service + * + * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.14.0 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct UserCredentials { + /// User's username for example john_doe for Mr John Doe. + #[serde(rename = "username", skip_serializing_if = "Option::is_none")] + pub username: Option, +} + +impl UserCredentials { + pub fn new() -> UserCredentials { + UserCredentials { + username: None, + } + } +} + diff --git a/pkg/sdk/rust/src/models/user_profile_picture.rs b/pkg/sdk/rust/src/models/user_profile_picture.rs new file mode 100644 index 00000000..349dc634 --- /dev/null +++ b/pkg/sdk/rust/src/models/user_profile_picture.rs @@ -0,0 +1,28 @@ +/* + * SuperMQ Users Service + * + * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.14.0 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct UserProfilePicture { + /// User's profile picture URL that is represented as a string. + #[serde(rename = "profile_picture")] + pub profile_picture: String, +} + +impl UserProfilePicture { + pub fn new(profile_picture: String) -> UserProfilePicture { + UserProfilePicture { + profile_picture, + } + } +} + diff --git a/pkg/sdk/rust/src/models/user_req_obj.rs b/pkg/sdk/rust/src/models/user_req_obj.rs new file mode 100644 index 00000000..569e9862 --- /dev/null +++ b/pkg/sdk/rust/src/models/user_req_obj.rs @@ -0,0 +1,55 @@ +/* + * SuperMQ Users Service + * + * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.14.0 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct UserReqObj { + /// User's first name. + #[serde(rename = "first_name", skip_serializing_if = "Option::is_none")] + pub first_name: Option, + /// User's last name. + #[serde(rename = "last_name", skip_serializing_if = "Option::is_none")] + pub last_name: Option, + /// User's email address will be used as its unique identifier. + #[serde(rename = "email", skip_serializing_if = "Option::is_none")] + pub email: Option, + /// User tags. + #[serde(rename = "tags", skip_serializing_if = "Option::is_none")] + pub tags: Option>, + #[serde(rename = "credentials")] + pub credentials: Box, + /// Arbitrary, object-encoded user's data. + #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")] + pub metadata: Option, + /// User's profile picture URL that is represented as a string. + #[serde(rename = "profile_picture", skip_serializing_if = "Option::is_none")] + pub profile_picture: Option, + /// User Status + #[serde(rename = "status", skip_serializing_if = "Option::is_none")] + pub status: Option, +} + +impl UserReqObj { + pub fn new(credentials: models::UserReqObjCredentials) -> UserReqObj { + UserReqObj { + first_name: None, + last_name: None, + email: None, + tags: None, + credentials: Box::new(credentials), + metadata: None, + profile_picture: None, + status: None, + } + } +} + diff --git a/pkg/sdk/rust/src/models/user_req_obj_credentials.rs b/pkg/sdk/rust/src/models/user_req_obj_credentials.rs new file mode 100644 index 00000000..4bc0d3aa --- /dev/null +++ b/pkg/sdk/rust/src/models/user_req_obj_credentials.rs @@ -0,0 +1,32 @@ +/* + * SuperMQ Users Service + * + * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.14.0 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct UserReqObjCredentials { + /// User's username for example 'admin' will be used as its unique identifier. + #[serde(rename = "username", skip_serializing_if = "Option::is_none")] + pub username: Option, + /// Free-form account secret used for acquiring auth token(s). + #[serde(rename = "secret", skip_serializing_if = "Option::is_none")] + pub secret: Option, +} + +impl UserReqObjCredentials { + pub fn new() -> UserReqObjCredentials { + UserReqObjCredentials { + username: None, + secret: None, + } + } +} + diff --git a/pkg/sdk/rust/src/models/user_role.rs b/pkg/sdk/rust/src/models/user_role.rs new file mode 100644 index 00000000..a45182ec --- /dev/null +++ b/pkg/sdk/rust/src/models/user_role.rs @@ -0,0 +1,42 @@ +/* + * SuperMQ Users Service + * + * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.14.0 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct UserRole { + /// User role example. + #[serde(rename = "role")] + pub role: Role, +} + +impl UserRole { + pub fn new(role: Role) -> UserRole { + UserRole { + role, + } + } +} +/// User role example. +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Role { + #[serde(rename = "admin")] + Admin, + #[serde(rename = "user")] + User, +} + +impl Default for Role { + fn default() -> Role { + Self::Admin + } +} + diff --git a/pkg/sdk/rust/src/models/user_secret.rs b/pkg/sdk/rust/src/models/user_secret.rs new file mode 100644 index 00000000..302e0ebf --- /dev/null +++ b/pkg/sdk/rust/src/models/user_secret.rs @@ -0,0 +1,32 @@ +/* + * SuperMQ Users Service + * + * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.14.0 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct UserSecret { + /// Old user secret password. + #[serde(rename = "old_secret")] + pub old_secret: String, + /// New user secret password. + #[serde(rename = "new_secret")] + pub new_secret: String, +} + +impl UserSecret { + pub fn new(old_secret: String, new_secret: String) -> UserSecret { + UserSecret { + old_secret, + new_secret, + } + } +} + diff --git a/pkg/sdk/rust/src/models/user_tags.rs b/pkg/sdk/rust/src/models/user_tags.rs new file mode 100644 index 00000000..924c37cc --- /dev/null +++ b/pkg/sdk/rust/src/models/user_tags.rs @@ -0,0 +1,28 @@ +/* + * SuperMQ Users Service + * + * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.14.0 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct UserTags { + /// User tags. + #[serde(rename = "tags", skip_serializing_if = "Option::is_none")] + pub tags: Option>, +} + +impl UserTags { + pub fn new() -> UserTags { + UserTags { + tags: None, + } + } +} + diff --git a/pkg/sdk/rust/src/models/user_update.rs b/pkg/sdk/rust/src/models/user_update.rs new file mode 100644 index 00000000..3d4d69cb --- /dev/null +++ b/pkg/sdk/rust/src/models/user_update.rs @@ -0,0 +1,36 @@ +/* + * SuperMQ Users Service + * + * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.14.0 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct UserUpdate { + /// User's first name. + #[serde(rename = "first_name")] + pub first_name: String, + /// User's last name. + #[serde(rename = "last_name")] + pub last_name: String, + /// Arbitrary, object-encoded user's data. + #[serde(rename = "metadata")] + pub metadata: serde_json::Value, +} + +impl UserUpdate { + pub fn new(first_name: String, last_name: String, metadata: serde_json::Value) -> UserUpdate { + UserUpdate { + first_name, + last_name, + metadata, + } + } +} + diff --git a/pkg/sdk/rust/src/models/username.rs b/pkg/sdk/rust/src/models/username.rs new file mode 100644 index 00000000..8092289d --- /dev/null +++ b/pkg/sdk/rust/src/models/username.rs @@ -0,0 +1,28 @@ +/* + * SuperMQ Users Service + * + * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.14.0 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Username { + /// User's username for example 'admin' will be used as its unique identifier. + #[serde(rename = "username")] + pub username: String, +} + +impl Username { + pub fn new(username: String) -> Username { + Username { + username, + } + } +} + diff --git a/pkg/sdk/rust/src/models/users_page.rs b/pkg/sdk/rust/src/models/users_page.rs new file mode 100644 index 00000000..1f63e6a2 --- /dev/null +++ b/pkg/sdk/rust/src/models/users_page.rs @@ -0,0 +1,39 @@ +/* + * SuperMQ Users Service + * + * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.14.0 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct UsersPage { + #[serde(rename = "users")] + pub users: Vec, + /// Total number of items. + #[serde(rename = "total")] + pub total: i32, + /// Number of items to skip during retrieval. + #[serde(rename = "offset")] + pub offset: i32, + /// Maximum number of items to return in one page. + #[serde(rename = "limit", skip_serializing_if = "Option::is_none")] + pub limit: Option, +} + +impl UsersPage { + pub fn new(users: Vec, total: i32, offset: i32) -> UsersPage { + UsersPage { + users, + total, + offset, + limit: None, + } + } +} + From 622c857df06cac63f02fef16c7b87b4c20799530 Mon Sep 17 00:00:00 2001 From: Dorcas Litunya Date: Thu, 19 Dec 2024 11:49:57 +0300 Subject: [PATCH 02/10] Add other microservices to SDK --- .gitignore | 6 + Cargo.lock | 1731 +++++++++++++++++ Cargo.toml | 21 + auth/.gitignore | 3 + auth/.openapi-generator-ignore | 23 + auth/.openapi-generator/FILES | 20 + auth/.openapi-generator/VERSION | 1 + auth/.travis.yml | 1 + auth/Cargo.toml | 15 + auth/README.md | 54 + auth/docs/HealthApi.md | 34 + auth/docs/HealthInfo.md | 16 + auth/docs/IssueKeyRequest.md | 12 + auth/docs/Key.md | 16 + auth/docs/KeysApi.md | 101 + auth/git_push.sh | 57 + auth/src/apis/configuration.rs | 51 + auth/src/apis/health_api.rs | 53 + auth/src/apis/keys_api.rs | 145 ++ auth/src/apis/mod.rs | 96 + auth/src/lib.rs | 11 + auth/src/models/health_info.rs | 60 + auth/src/models/issue_key_request.rs | 32 + auth/src/models/key.rs | 48 + auth/src/models/mod.rs | 6 + bootstrap/.gitignore | 3 + bootstrap/.openapi-generator-ignore | 23 + bootstrap/.openapi-generator/FILES | 38 + bootstrap/.openapi-generator/VERSION | 1 + bootstrap/.travis.yml | 1 + bootstrap/Cargo.toml | 15 + bootstrap/README.md | 70 + bootstrap/docs/BootstrapConfig.md | 15 + bootstrap/docs/Config.md | 19 + bootstrap/docs/ConfigChannelsInner.md | 13 + bootstrap/docs/ConfigList.md | 14 + bootstrap/docs/ConfigUpdateCerts.md | 14 + bootstrap/docs/ConfigsApi.md | 331 ++++ bootstrap/docs/CreateConfigRequest.md | 19 + bootstrap/docs/HealthApi.md | 34 + bootstrap/docs/HealthInfo.md | 16 + bootstrap/docs/State.md | 13 + bootstrap/docs/UpdateConfigCertsRequest.md | 13 + .../docs/UpdateConfigConnectionsRequest.md | 11 + bootstrap/docs/UpdateConfigRequest.md | 12 + bootstrap/docs/UpdateConfigStateRequest.md | 11 + bootstrap/git_push.sh | 57 + bootstrap/src/apis/configs_api.rs | 475 +++++ bootstrap/src/apis/configuration.rs | 51 + bootstrap/src/apis/health_api.rs | 53 + bootstrap/src/apis/mod.rs | 96 + bootstrap/src/lib.rs | 11 + bootstrap/src/models/bootstrap_config.rs | 43 + bootstrap/src/models/config.rs | 58 + bootstrap/src/models/config_channels_inner.rs | 36 + bootstrap/src/models/config_list.rs | 39 + bootstrap/src/models/config_update_certs.rs | 40 + bootstrap/src/models/create_config_request.rs | 56 + bootstrap/src/models/health_info.rs | 60 + bootstrap/src/models/mod.rs | 24 + bootstrap/src/models/state.rs | 37 + .../src/models/update_config_certs_request.rs | 33 + .../update_config_connections_request.rs | 27 + bootstrap/src/models/update_config_request.rs | 30 + .../src/models/update_config_state_request.rs | 27 + certs/.gitignore | 3 + certs/.openapi-generator-ignore | 23 + certs/.openapi-generator/FILES | 28 + certs/.openapi-generator/VERSION | 1 + certs/.travis.yml | 1 + certs/Cargo.toml | 15 + certs/README.md | 59 + certs/docs/Cert.md | 16 + certs/docs/CertsApi.md | 136 ++ certs/docs/CertsPage.md | 14 + certs/docs/CreateCertRequest.md | 12 + certs/docs/HealthApi.md | 34 + certs/docs/HealthInfo.md | 16 + certs/docs/Revoke.md | 11 + certs/docs/Serial.md | 11 + certs/docs/SerialsPage.md | 14 + certs/git_push.sh | 57 + certs/src/apis/certs_api.rs | 195 ++ certs/src/apis/configuration.rs | 51 + certs/src/apis/health_api.rs | 53 + certs/src/apis/mod.rs | 96 + certs/src/lib.rs | 11 + certs/src/models/cert.rs | 48 + certs/src/models/certs_page.rs | 39 + certs/src/models/create_cert_request.rs | 30 + certs/src/models/health_info.rs | 60 + certs/src/models/mod.rs | 14 + certs/src/models/revoke.rs | 28 + certs/src/models/serial.rs | 28 + certs/src/models/serials_page.rs | 40 + channels/.gitignore | 3 + channels/.openapi-generator-ignore | 23 + channels/.openapi-generator/FILES | 36 + channels/.openapi-generator/VERSION | 1 + channels/.travis.yml | 1 + channels/Cargo.toml | 15 + channels/README.md | 73 + channels/docs/Channel.md | 21 + channels/docs/ChannelConnectionReqSchema.md | 12 + channels/docs/ChannelReqObj.md | 15 + channels/docs/ChannelUpdate.md | 13 + channels/docs/ChannelUpdateTags.md | 11 + channels/docs/ChannelsApi.md | 367 ++++ channels/docs/ChannelsPage.md | 14 + channels/docs/ConnectionReqSchema.md | 13 + channels/docs/ConnectionsApi.md | 138 ++ channels/docs/Error.md | 11 + channels/docs/HealthApi.md | 34 + channels/docs/HealthRes.md | 15 + channels/docs/ParentGroupReqObj.md | 11 + channels/git_push.sh | 57 + channels/src/apis/channels_api.rs | 529 +++++ channels/src/apis/configuration.rs | 51 + channels/src/apis/connections_api.rs | 202 ++ channels/src/apis/health_api.rs | 53 + channels/src/apis/mod.rs | 97 + channels/src/lib.rs | 11 + channels/src/models/channel.rs | 68 + .../models/channel_connection_req_schema.rs | 32 + channels/src/models/channel_req_obj.rs | 44 + channels/src/models/channel_update.rs | 36 + channels/src/models/channel_update_tags.rs | 28 + channels/src/models/channels_page.rs | 39 + channels/src/models/connection_req_schema.rs | 36 + channels/src/models/error.rs | 28 + channels/src/models/health_res.rs | 56 + channels/src/models/mod.rs | 20 + channels/src/models/parent_group_req_obj.rs | 28 + clients/.gitignore | 3 + clients/.openapi-generator-ignore | 23 + clients/.openapi-generator/FILES | 58 + clients/.openapi-generator/VERSION | 1 + clients/.travis.yml | 1 + clients/Cargo.toml | 15 + clients/README.md | 96 + clients/docs/AvailableActionsObj.md | 11 + clients/docs/Client.md | 19 + clients/docs/ClientCredentials.md | 12 + clients/docs/ClientReqObj.md | 15 + clients/docs/ClientReqObjCredentials.md | 12 + clients/docs/ClientSecret.md | 11 + clients/docs/ClientTags.md | 11 + clients/docs/ClientUpdate.md | 12 + clients/docs/ClientWithEmptySecret.md | 19 + .../docs/ClientWithEmptySecretCredentials.md | 12 + clients/docs/ClientsApi.md | 440 +++++ clients/docs/ClientsPage.md | 14 + clients/docs/CreateRoleObj.md | 13 + clients/docs/Error.md | 11 + clients/docs/HealthApi.md | 34 + clients/docs/HealthRes.md | 15 + clients/docs/NewRole.md | 17 + clients/docs/ParentGroupReqObj.md | 11 + clients/docs/Role.md | 17 + clients/docs/RoleActionsObj.md | 11 + clients/docs/RoleMembersObj.md | 11 + clients/docs/RolesApi.md | 474 +++++ clients/docs/RolesPage.md | 14 + clients/docs/UpdateRoleObj.md | 11 + clients/git_push.sh | 57 + clients/src/apis/clients_api.rs | 647 ++++++ clients/src/apis/configuration.rs | 51 + clients/src/apis/health_api.rs | 53 + clients/src/apis/mod.rs | 97 + clients/src/apis/roles_api.rs | 646 ++++++ clients/src/lib.rs | 11 + clients/src/models/available_actions_obj.rs | 28 + clients/src/models/client.rs | 59 + clients/src/models/client_credentials.rs | 32 + clients/src/models/client_req_obj.rs | 43 + .../src/models/client_req_obj_credentials.rs | 32 + clients/src/models/client_secret.rs | 28 + clients/src/models/client_tags.rs | 28 + clients/src/models/client_update.rs | 32 + .../src/models/client_with_empty_secret.rs | 59 + .../client_with_empty_secret_credentials.rs | 32 + clients/src/models/clients_page.rs | 39 + clients/src/models/create_role_obj.rs | 36 + clients/src/models/error.rs | 28 + clients/src/models/health_res.rs | 56 + clients/src/models/mod.rs | 42 + clients/src/models/new_role.rs | 52 + clients/src/models/parent_group_req_obj.rs | 28 + clients/src/models/role.rs | 52 + clients/src/models/role_actions_obj.rs | 28 + clients/src/models/role_members_obj.rs | 28 + clients/src/models/roles_page.rs | 40 + clients/src/models/update_role_obj.rs | 28 + domains/.gitignore | 3 + domains/.openapi-generator-ignore | 23 + domains/.openapi-generator/FILES | 42 + domains/.openapi-generator/VERSION | 1 + domains/.travis.yml | 1 + domains/Cargo.toml | 15 + domains/README.md | 82 + domains/docs/AvailableActionsObj.md | 11 + domains/docs/CreateRoleObj.md | 13 + domains/docs/Domain.md | 20 + domains/docs/DomainReqObj.md | 14 + domains/docs/DomainUpdate.md | 14 + domains/docs/DomainsApi.md | 231 +++ domains/docs/DomainsPage.md | 14 + domains/docs/HealthApi.md | 34 + domains/docs/HealthInfo.md | 16 + domains/docs/NewRole.md | 17 + domains/docs/Role.md | 17 + domains/docs/RoleActionsObj.md | 11 + domains/docs/RoleMembersObj.md | 11 + domains/docs/RolesApi.md | 461 +++++ domains/docs/RolesPage.md | 14 + domains/docs/UpdateRoleObj.md | 11 + domains/git_push.sh | 57 + domains/src/apis/configuration.rs | 51 + domains/src/apis/domains_api.rs | 350 ++++ domains/src/apis/health_api.rs | 53 + domains/src/apis/mod.rs | 97 + domains/src/apis/roles_api.rs | 646 ++++++ domains/src/lib.rs | 11 + domains/src/models/available_actions_obj.rs | 28 + domains/src/models/create_role_obj.rs | 36 + domains/src/models/domain.rs | 64 + domains/src/models/domain_req_obj.rs | 40 + domains/src/models/domain_update.rs | 40 + domains/src/models/domains_page.rs | 39 + domains/src/models/health_info.rs | 60 + domains/src/models/mod.rs | 26 + domains/src/models/new_role.rs | 52 + domains/src/models/role.rs | 52 + domains/src/models/role_actions_obj.rs | 28 + domains/src/models/role_members_obj.rs | 28 + domains/src/models/roles_page.rs | 40 + domains/src/models/update_role_obj.rs | 28 + groups/.gitignore | 3 + groups/.openapi-generator-ignore | 23 + groups/.openapi-generator/FILES | 56 + groups/.openapi-generator/VERSION | 1 + groups/.travis.yml | 1 + groups/Cargo.toml | 15 + groups/README.md | 96 + groups/docs/AvailableActionsObj.md | 11 + groups/docs/ChildrenGroupReqObj.md | 11 + groups/docs/CreateRoleObj.md | 13 + groups/docs/Error.md | 11 + groups/docs/Group.md | 21 + groups/docs/GroupReqObj.md | 15 + groups/docs/GroupUpdate.md | 13 + groups/docs/GroupsApi.md | 477 +++++ groups/docs/GroupsHierarchyPage.md | 13 + groups/docs/GroupsPage.md | 14 + groups/docs/HealthApi.md | 34 + groups/docs/HealthRes.md | 15 + groups/docs/Members.md | 20 + groups/docs/MembersCredentials.md | 12 + groups/docs/MembersPage.md | 14 + groups/docs/NewRole.md | 17 + groups/docs/ParentGroupReqObj.md | 11 + groups/docs/Role.md | 17 + groups/docs/RoleActionsObj.md | 11 + groups/docs/RoleMembersObj.md | 11 + groups/docs/RolesApi.md | 474 +++++ groups/docs/RolesPage.md | 14 + groups/docs/UpdateRoleObj.md | 11 + groups/git_push.sh | 57 + groups/src/apis/configuration.rs | 51 + groups/src/apis/groups_api.rs | 704 +++++++ groups/src/apis/health_api.rs | 53 + groups/src/apis/mod.rs | 97 + groups/src/apis/roles_api.rs | 646 ++++++ groups/src/lib.rs | 11 + groups/src/models/available_actions_obj.rs | 28 + groups/src/models/children_group_req_obj.rs | 28 + groups/src/models/create_role_obj.rs | 36 + groups/src/models/error.rs | 28 + groups/src/models/group.rs | 68 + groups/src/models/group_req_obj.rs | 44 + groups/src/models/group_update.rs | 36 + groups/src/models/groups_hierarchy_page.rs | 35 + groups/src/models/groups_page.rs | 39 + groups/src/models/health_res.rs | 56 + groups/src/models/members.rs | 63 + groups/src/models/members_credentials.rs | 32 + groups/src/models/members_page.rs | 39 + groups/src/models/mod.rs | 40 + groups/src/models/new_role.rs | 52 + groups/src/models/parent_group_req_obj.rs | 28 + groups/src/models/role.rs | 52 + groups/src/models/role_actions_obj.rs | 28 + groups/src/models/role_members_obj.rs | 28 + groups/src/models/roles_page.rs | 40 + groups/src/models/update_role_obj.rs | 28 + http/.gitignore | 3 + http/.openapi-generator-ignore | 23 + http/.openapi-generator/FILES | 18 + http/.openapi-generator/VERSION | 1 + http/.travis.yml | 1 + http/Cargo.toml | 15 + http/README.md | 51 + http/docs/HealthApi.md | 34 + http/docs/HealthInfo.md | 16 + http/docs/MessagesApi.md | 40 + http/docs/SenMlRecord.md | 25 + http/git_push.sh | 57 + http/src/apis/configuration.rs | 51 + http/src/apis/health_api.rs | 53 + http/src/apis/messages_api.rs | 65 + http/src/apis/mod.rs | 96 + http/src/lib.rs | 11 + http/src/models/health_info.rs | 60 + http/src/models/mod.rs | 4 + http/src/models/sen_ml_record.rs | 84 + invitations/.gitignore | 3 + invitations/.openapi-generator-ignore | 23 + invitations/.openapi-generator/FILES | 26 + invitations/.openapi-generator/VERSION | 1 + invitations/.travis.yml | 1 + invitations/Cargo.toml | 15 + invitations/README.md | 60 + invitations/docs/AcceptInvitationRequest.md | 11 + invitations/docs/Error.md | 11 + invitations/docs/HealthApi.md | 34 + invitations/docs/HealthRes.md | 15 + invitations/docs/Invitation.md | 17 + invitations/docs/InvitationPage.md | 14 + invitations/docs/InvitationsApi.md | 202 ++ invitations/docs/SendInvitationReqObj.md | 14 + invitations/git_push.sh | 57 + invitations/src/apis/configuration.rs | 51 + invitations/src/apis/health_api.rs | 53 + invitations/src/apis/invitations_api.rs | 300 +++ invitations/src/apis/mod.rs | 96 + invitations/src/lib.rs | 11 + .../src/models/accept_invitation_request.rs | 28 + invitations/src/models/error.rs | 28 + invitations/src/models/health_res.rs | 56 + invitations/src/models/invitation.rs | 82 + invitations/src/models/invitation_page.rs | 39 + invitations/src/models/mod.rs | 12 + .../src/models/send_invitation_req_obj.rs | 70 + journal/.gitignore | 3 + journal/.openapi-generator-ignore | 23 + journal/.openapi-generator/FILES | 22 + journal/.openapi-generator/VERSION | 1 + journal/.travis.yml | 1 + journal/Cargo.toml | 15 + journal/README.md | 54 + journal/docs/Error.md | 11 + journal/docs/HealthApi.md | 34 + journal/docs/HealthInfo.md | 16 + journal/docs/Journal.md | 14 + journal/docs/JournalLogApi.md | 88 + journal/docs/JournalPage.md | 14 + journal/git_push.sh | 57 + journal/src/apis/configuration.rs | 51 + journal/src/apis/health_api.rs | 53 + journal/src/apis/journal_log_api.rs | 154 ++ journal/src/apis/mod.rs | 96 + journal/src/lib.rs | 11 + journal/src/models/error.rs | 28 + journal/src/models/health_info.rs | 60 + journal/src/models/journal.rs | 40 + journal/src/models/journal_page.rs | 39 + journal/src/models/mod.rs | 8 + notifiers/.gitignore | 3 + notifiers/.openapi-generator-ignore | 23 + notifiers/.openapi-generator/FILES | 22 + notifiers/.openapi-generator/VERSION | 1 + notifiers/.travis.yml | 1 + notifiers/Cargo.toml | 15 + notifiers/README.md | 56 + notifiers/docs/CreateSubscription.md | 12 + notifiers/docs/HealthApi.md | 34 + notifiers/docs/HealthInfo.md | 16 + notifiers/docs/NotifiersApi.md | 135 ++ notifiers/docs/Page.md | 14 + notifiers/docs/Subscription.md | 14 + notifiers/git_push.sh | 57 + notifiers/src/apis/configuration.rs | 51 + notifiers/src/apis/health_api.rs | 53 + notifiers/src/apis/mod.rs | 96 + notifiers/src/apis/notifiers_api.rs | 207 ++ notifiers/src/lib.rs | 11 + notifiers/src/models/create_subscription.rs | 32 + notifiers/src/models/health_info.rs | 60 + notifiers/src/models/mod.rs | 8 + notifiers/src/models/page.rs | 39 + notifiers/src/models/subscription.rs | 40 + openapitools.json | 7 + provision/.gitignore | 3 + provision/.openapi-generator-ignore | 23 + provision/.openapi-generator/FILES | 18 + provision/.openapi-generator/VERSION | 1 + provision/.travis.yml | 1 + provision/Cargo.toml | 15 + provision/README.md | 52 + provision/docs/DomainIdMappingPostRequest.md | 13 + provision/docs/HealthApi.md | 34 + provision/docs/HealthInfo.md | 16 + provision/docs/ProvisionApi.md | 71 + provision/git_push.sh | 57 + provision/src/apis/configuration.rs | 51 + provision/src/apis/health_api.rs | 53 + provision/src/apis/mod.rs | 96 + provision/src/apis/provision_api.rs | 106 + provision/src/lib.rs | 11 + .../__domain_id__mapping_post_request.rs | 33 + provision/src/models/health_info.rs | 60 + provision/src/models/mod.rs | 4 + readers/.gitignore | 3 + readers/.openapi-generator-ignore | 23 + readers/.openapi-generator/FILES | 20 + readers/.openapi-generator/VERSION | 1 + readers/.travis.yml | 1 + readers/Cargo.toml | 15 + readers/README.md | 52 + readers/docs/HealthApi.md | 34 + readers/docs/HealthInfo.md | 16 + readers/docs/MessagesPage.md | 14 + readers/docs/MessagesPageMessagesInner.md | 22 + readers/docs/ReadersApi.md | 51 + readers/git_push.sh | 57 + readers/src/apis/configuration.rs | 51 + readers/src/apis/health_api.rs | 53 + readers/src/apis/mod.rs | 96 + readers/src/apis/readers_api.rs | 98 + readers/src/lib.rs | 11 + readers/src/models/health_info.rs | 60 + readers/src/models/messages_page.rs | 39 + .../models/messages_page_messages_inner.rs | 72 + readers/src/models/mod.rs | 6 + twins/.gitignore | 3 + twins/.openapi-generator-ignore | 23 + twins/.openapi-generator/FILES | 32 + twins/.openapi-generator/VERSION | 1 + twins/.travis.yml | 1 + twins/Cargo.toml | 15 + twins/README.md | 62 + twins/docs/Attribute.md | 14 + twins/docs/Definition.md | 12 + twins/docs/HealthApi.md | 34 + twins/docs/HealthInfo.md | 16 + twins/docs/State.md | 14 + twins/docs/StatesApi.md | 41 + twins/docs/StatesPage.md | 14 + twins/docs/TwinReqObj.md | 13 + twins/docs/TwinResObj.md | 18 + twins/docs/TwinsApi.md | 165 ++ twins/docs/TwinsPage.md | 14 + twins/git_push.sh | 57 + twins/src/apis/configuration.rs | 51 + twins/src/apis/health_api.rs | 53 + twins/src/apis/mod.rs | 97 + twins/src/apis/states_api.rs | 67 + twins/src/apis/twins_api.rs | 247 +++ twins/src/lib.rs | 11 + twins/src/models/attribute.rs | 40 + twins/src/models/definition.rs | 31 + twins/src/models/health_info.rs | 60 + twins/src/models/mod.rs | 16 + twins/src/models/state.rs | 40 + twins/src/models/states_page.rs | 39 + twins/src/models/twin_req_obj.rs | 35 + twins/src/models/twin_res_obj.rs | 55 + twins/src/models/twins_page.rs | 39 + users/.gitignore | 3 + users/.openapi-generator-ignore | 23 + users/.openapi-generator/FILES | 60 + users/.openapi-generator/VERSION | 1 + users/.travis.yml | 1 + users/Cargo.toml | 16 + users/README.md | 94 + users/docs/AssignReqObj.md | 13 + users/docs/AssignUserReqObj.md | 12 + users/docs/Email.md | 11 + users/docs/Error.md | 11 + users/docs/HealthApi.md | 34 + users/docs/HealthRes.md | 15 + users/docs/IssueToken.md | 12 + users/docs/IssueToken200Response.md | 13 + users/docs/Members.md | 20 + users/docs/MembersCredentials.md | 12 + users/docs/MembersPage.md | 14 + users/docs/RequestPasswordResetRequest.md | 12 + users/docs/ResetPasswordRequest.md | 13 + users/docs/User.md | 21 + users/docs/UserCredentials.md | 11 + users/docs/UserProfilePicture.md | 11 + users/docs/UserReqObj.md | 18 + users/docs/UserReqObjCredentials.md | 12 + users/docs/UserRole.md | 11 + users/docs/UserSecret.md | 12 + users/docs/UserTags.md | 11 + users/docs/UserUpdate.md | 13 + users/docs/Username.md | 11 + users/docs/UsersApi.md | 764 ++++++++ users/docs/UsersPage.md | 14 + users/git_push.sh | 57 + users/src/apis/configuration.rs | 51 + users/src/apis/health_api.rs | 53 + users/src/apis/mod.rs | 96 + users/src/apis/users_api.rs | 1195 ++++++++++++ users/src/lib.rs | 11 + users/src/main.rs | 104 + users/src/models/assign_req_obj.rs | 36 + users/src/models/assign_user_req_obj.rs | 32 + users/src/models/email.rs | 28 + users/src/models/error.rs | 28 + users/src/models/health_res.rs | 56 + users/src/models/issue_token.rs | 32 + users/src/models/issue_token_200_response.rs | 36 + users/src/models/members.rs | 63 + users/src/models/members_credentials.rs | 32 + users/src/models/members_page.rs | 39 + users/src/models/mod.rs | 46 + .../models/request_password_reset_request.rs | 32 + users/src/models/reset_password_request.rs | 36 + users/src/models/user.rs | 67 + users/src/models/user_credentials.rs | 28 + users/src/models/user_profile_picture.rs | 28 + users/src/models/user_req_obj.rs | 55 + users/src/models/user_req_obj_credentials.rs | 32 + users/src/models/user_role.rs | 42 + users/src/models/user_secret.rs | 32 + users/src/models/user_tags.rs | 28 + users/src/models/user_update.rs | 36 + users/src/models/username.rs | 28 + users/src/models/users_page.rs | 39 + 531 files changed, 29216 insertions(+) create mode 100644 Cargo.lock create mode 100644 Cargo.toml create mode 100644 auth/.gitignore create mode 100644 auth/.openapi-generator-ignore create mode 100644 auth/.openapi-generator/FILES create mode 100644 auth/.openapi-generator/VERSION create mode 100644 auth/.travis.yml create mode 100644 auth/Cargo.toml create mode 100644 auth/README.md create mode 100644 auth/docs/HealthApi.md create mode 100644 auth/docs/HealthInfo.md create mode 100644 auth/docs/IssueKeyRequest.md create mode 100644 auth/docs/Key.md create mode 100644 auth/docs/KeysApi.md create mode 100644 auth/git_push.sh create mode 100644 auth/src/apis/configuration.rs create mode 100644 auth/src/apis/health_api.rs create mode 100644 auth/src/apis/keys_api.rs create mode 100644 auth/src/apis/mod.rs create mode 100644 auth/src/lib.rs create mode 100644 auth/src/models/health_info.rs create mode 100644 auth/src/models/issue_key_request.rs create mode 100644 auth/src/models/key.rs create mode 100644 auth/src/models/mod.rs create mode 100644 bootstrap/.gitignore create mode 100644 bootstrap/.openapi-generator-ignore create mode 100644 bootstrap/.openapi-generator/FILES create mode 100644 bootstrap/.openapi-generator/VERSION create mode 100644 bootstrap/.travis.yml create mode 100644 bootstrap/Cargo.toml create mode 100644 bootstrap/README.md create mode 100644 bootstrap/docs/BootstrapConfig.md create mode 100644 bootstrap/docs/Config.md create mode 100644 bootstrap/docs/ConfigChannelsInner.md create mode 100644 bootstrap/docs/ConfigList.md create mode 100644 bootstrap/docs/ConfigUpdateCerts.md create mode 100644 bootstrap/docs/ConfigsApi.md create mode 100644 bootstrap/docs/CreateConfigRequest.md create mode 100644 bootstrap/docs/HealthApi.md create mode 100644 bootstrap/docs/HealthInfo.md create mode 100644 bootstrap/docs/State.md create mode 100644 bootstrap/docs/UpdateConfigCertsRequest.md create mode 100644 bootstrap/docs/UpdateConfigConnectionsRequest.md create mode 100644 bootstrap/docs/UpdateConfigRequest.md create mode 100644 bootstrap/docs/UpdateConfigStateRequest.md create mode 100644 bootstrap/git_push.sh create mode 100644 bootstrap/src/apis/configs_api.rs create mode 100644 bootstrap/src/apis/configuration.rs create mode 100644 bootstrap/src/apis/health_api.rs create mode 100644 bootstrap/src/apis/mod.rs create mode 100644 bootstrap/src/lib.rs create mode 100644 bootstrap/src/models/bootstrap_config.rs create mode 100644 bootstrap/src/models/config.rs create mode 100644 bootstrap/src/models/config_channels_inner.rs create mode 100644 bootstrap/src/models/config_list.rs create mode 100644 bootstrap/src/models/config_update_certs.rs create mode 100644 bootstrap/src/models/create_config_request.rs create mode 100644 bootstrap/src/models/health_info.rs create mode 100644 bootstrap/src/models/mod.rs create mode 100644 bootstrap/src/models/state.rs create mode 100644 bootstrap/src/models/update_config_certs_request.rs create mode 100644 bootstrap/src/models/update_config_connections_request.rs create mode 100644 bootstrap/src/models/update_config_request.rs create mode 100644 bootstrap/src/models/update_config_state_request.rs create mode 100644 certs/.gitignore create mode 100644 certs/.openapi-generator-ignore create mode 100644 certs/.openapi-generator/FILES create mode 100644 certs/.openapi-generator/VERSION create mode 100644 certs/.travis.yml create mode 100644 certs/Cargo.toml create mode 100644 certs/README.md create mode 100644 certs/docs/Cert.md create mode 100644 certs/docs/CertsApi.md create mode 100644 certs/docs/CertsPage.md create mode 100644 certs/docs/CreateCertRequest.md create mode 100644 certs/docs/HealthApi.md create mode 100644 certs/docs/HealthInfo.md create mode 100644 certs/docs/Revoke.md create mode 100644 certs/docs/Serial.md create mode 100644 certs/docs/SerialsPage.md create mode 100644 certs/git_push.sh create mode 100644 certs/src/apis/certs_api.rs create mode 100644 certs/src/apis/configuration.rs create mode 100644 certs/src/apis/health_api.rs create mode 100644 certs/src/apis/mod.rs create mode 100644 certs/src/lib.rs create mode 100644 certs/src/models/cert.rs create mode 100644 certs/src/models/certs_page.rs create mode 100644 certs/src/models/create_cert_request.rs create mode 100644 certs/src/models/health_info.rs create mode 100644 certs/src/models/mod.rs create mode 100644 certs/src/models/revoke.rs create mode 100644 certs/src/models/serial.rs create mode 100644 certs/src/models/serials_page.rs create mode 100644 channels/.gitignore create mode 100644 channels/.openapi-generator-ignore create mode 100644 channels/.openapi-generator/FILES create mode 100644 channels/.openapi-generator/VERSION create mode 100644 channels/.travis.yml create mode 100644 channels/Cargo.toml create mode 100644 channels/README.md create mode 100644 channels/docs/Channel.md create mode 100644 channels/docs/ChannelConnectionReqSchema.md create mode 100644 channels/docs/ChannelReqObj.md create mode 100644 channels/docs/ChannelUpdate.md create mode 100644 channels/docs/ChannelUpdateTags.md create mode 100644 channels/docs/ChannelsApi.md create mode 100644 channels/docs/ChannelsPage.md create mode 100644 channels/docs/ConnectionReqSchema.md create mode 100644 channels/docs/ConnectionsApi.md create mode 100644 channels/docs/Error.md create mode 100644 channels/docs/HealthApi.md create mode 100644 channels/docs/HealthRes.md create mode 100644 channels/docs/ParentGroupReqObj.md create mode 100644 channels/git_push.sh create mode 100644 channels/src/apis/channels_api.rs create mode 100644 channels/src/apis/configuration.rs create mode 100644 channels/src/apis/connections_api.rs create mode 100644 channels/src/apis/health_api.rs create mode 100644 channels/src/apis/mod.rs create mode 100644 channels/src/lib.rs create mode 100644 channels/src/models/channel.rs create mode 100644 channels/src/models/channel_connection_req_schema.rs create mode 100644 channels/src/models/channel_req_obj.rs create mode 100644 channels/src/models/channel_update.rs create mode 100644 channels/src/models/channel_update_tags.rs create mode 100644 channels/src/models/channels_page.rs create mode 100644 channels/src/models/connection_req_schema.rs create mode 100644 channels/src/models/error.rs create mode 100644 channels/src/models/health_res.rs create mode 100644 channels/src/models/mod.rs create mode 100644 channels/src/models/parent_group_req_obj.rs create mode 100644 clients/.gitignore create mode 100644 clients/.openapi-generator-ignore create mode 100644 clients/.openapi-generator/FILES create mode 100644 clients/.openapi-generator/VERSION create mode 100644 clients/.travis.yml create mode 100644 clients/Cargo.toml create mode 100644 clients/README.md create mode 100644 clients/docs/AvailableActionsObj.md create mode 100644 clients/docs/Client.md create mode 100644 clients/docs/ClientCredentials.md create mode 100644 clients/docs/ClientReqObj.md create mode 100644 clients/docs/ClientReqObjCredentials.md create mode 100644 clients/docs/ClientSecret.md create mode 100644 clients/docs/ClientTags.md create mode 100644 clients/docs/ClientUpdate.md create mode 100644 clients/docs/ClientWithEmptySecret.md create mode 100644 clients/docs/ClientWithEmptySecretCredentials.md create mode 100644 clients/docs/ClientsApi.md create mode 100644 clients/docs/ClientsPage.md create mode 100644 clients/docs/CreateRoleObj.md create mode 100644 clients/docs/Error.md create mode 100644 clients/docs/HealthApi.md create mode 100644 clients/docs/HealthRes.md create mode 100644 clients/docs/NewRole.md create mode 100644 clients/docs/ParentGroupReqObj.md create mode 100644 clients/docs/Role.md create mode 100644 clients/docs/RoleActionsObj.md create mode 100644 clients/docs/RoleMembersObj.md create mode 100644 clients/docs/RolesApi.md create mode 100644 clients/docs/RolesPage.md create mode 100644 clients/docs/UpdateRoleObj.md create mode 100644 clients/git_push.sh create mode 100644 clients/src/apis/clients_api.rs create mode 100644 clients/src/apis/configuration.rs create mode 100644 clients/src/apis/health_api.rs create mode 100644 clients/src/apis/mod.rs create mode 100644 clients/src/apis/roles_api.rs create mode 100644 clients/src/lib.rs create mode 100644 clients/src/models/available_actions_obj.rs create mode 100644 clients/src/models/client.rs create mode 100644 clients/src/models/client_credentials.rs create mode 100644 clients/src/models/client_req_obj.rs create mode 100644 clients/src/models/client_req_obj_credentials.rs create mode 100644 clients/src/models/client_secret.rs create mode 100644 clients/src/models/client_tags.rs create mode 100644 clients/src/models/client_update.rs create mode 100644 clients/src/models/client_with_empty_secret.rs create mode 100644 clients/src/models/client_with_empty_secret_credentials.rs create mode 100644 clients/src/models/clients_page.rs create mode 100644 clients/src/models/create_role_obj.rs create mode 100644 clients/src/models/error.rs create mode 100644 clients/src/models/health_res.rs create mode 100644 clients/src/models/mod.rs create mode 100644 clients/src/models/new_role.rs create mode 100644 clients/src/models/parent_group_req_obj.rs create mode 100644 clients/src/models/role.rs create mode 100644 clients/src/models/role_actions_obj.rs create mode 100644 clients/src/models/role_members_obj.rs create mode 100644 clients/src/models/roles_page.rs create mode 100644 clients/src/models/update_role_obj.rs create mode 100644 domains/.gitignore create mode 100644 domains/.openapi-generator-ignore create mode 100644 domains/.openapi-generator/FILES create mode 100644 domains/.openapi-generator/VERSION create mode 100644 domains/.travis.yml create mode 100644 domains/Cargo.toml create mode 100644 domains/README.md create mode 100644 domains/docs/AvailableActionsObj.md create mode 100644 domains/docs/CreateRoleObj.md create mode 100644 domains/docs/Domain.md create mode 100644 domains/docs/DomainReqObj.md create mode 100644 domains/docs/DomainUpdate.md create mode 100644 domains/docs/DomainsApi.md create mode 100644 domains/docs/DomainsPage.md create mode 100644 domains/docs/HealthApi.md create mode 100644 domains/docs/HealthInfo.md create mode 100644 domains/docs/NewRole.md create mode 100644 domains/docs/Role.md create mode 100644 domains/docs/RoleActionsObj.md create mode 100644 domains/docs/RoleMembersObj.md create mode 100644 domains/docs/RolesApi.md create mode 100644 domains/docs/RolesPage.md create mode 100644 domains/docs/UpdateRoleObj.md create mode 100644 domains/git_push.sh create mode 100644 domains/src/apis/configuration.rs create mode 100644 domains/src/apis/domains_api.rs create mode 100644 domains/src/apis/health_api.rs create mode 100644 domains/src/apis/mod.rs create mode 100644 domains/src/apis/roles_api.rs create mode 100644 domains/src/lib.rs create mode 100644 domains/src/models/available_actions_obj.rs create mode 100644 domains/src/models/create_role_obj.rs create mode 100644 domains/src/models/domain.rs create mode 100644 domains/src/models/domain_req_obj.rs create mode 100644 domains/src/models/domain_update.rs create mode 100644 domains/src/models/domains_page.rs create mode 100644 domains/src/models/health_info.rs create mode 100644 domains/src/models/mod.rs create mode 100644 domains/src/models/new_role.rs create mode 100644 domains/src/models/role.rs create mode 100644 domains/src/models/role_actions_obj.rs create mode 100644 domains/src/models/role_members_obj.rs create mode 100644 domains/src/models/roles_page.rs create mode 100644 domains/src/models/update_role_obj.rs create mode 100644 groups/.gitignore create mode 100644 groups/.openapi-generator-ignore create mode 100644 groups/.openapi-generator/FILES create mode 100644 groups/.openapi-generator/VERSION create mode 100644 groups/.travis.yml create mode 100644 groups/Cargo.toml create mode 100644 groups/README.md create mode 100644 groups/docs/AvailableActionsObj.md create mode 100644 groups/docs/ChildrenGroupReqObj.md create mode 100644 groups/docs/CreateRoleObj.md create mode 100644 groups/docs/Error.md create mode 100644 groups/docs/Group.md create mode 100644 groups/docs/GroupReqObj.md create mode 100644 groups/docs/GroupUpdate.md create mode 100644 groups/docs/GroupsApi.md create mode 100644 groups/docs/GroupsHierarchyPage.md create mode 100644 groups/docs/GroupsPage.md create mode 100644 groups/docs/HealthApi.md create mode 100644 groups/docs/HealthRes.md create mode 100644 groups/docs/Members.md create mode 100644 groups/docs/MembersCredentials.md create mode 100644 groups/docs/MembersPage.md create mode 100644 groups/docs/NewRole.md create mode 100644 groups/docs/ParentGroupReqObj.md create mode 100644 groups/docs/Role.md create mode 100644 groups/docs/RoleActionsObj.md create mode 100644 groups/docs/RoleMembersObj.md create mode 100644 groups/docs/RolesApi.md create mode 100644 groups/docs/RolesPage.md create mode 100644 groups/docs/UpdateRoleObj.md create mode 100644 groups/git_push.sh create mode 100644 groups/src/apis/configuration.rs create mode 100644 groups/src/apis/groups_api.rs create mode 100644 groups/src/apis/health_api.rs create mode 100644 groups/src/apis/mod.rs create mode 100644 groups/src/apis/roles_api.rs create mode 100644 groups/src/lib.rs create mode 100644 groups/src/models/available_actions_obj.rs create mode 100644 groups/src/models/children_group_req_obj.rs create mode 100644 groups/src/models/create_role_obj.rs create mode 100644 groups/src/models/error.rs create mode 100644 groups/src/models/group.rs create mode 100644 groups/src/models/group_req_obj.rs create mode 100644 groups/src/models/group_update.rs create mode 100644 groups/src/models/groups_hierarchy_page.rs create mode 100644 groups/src/models/groups_page.rs create mode 100644 groups/src/models/health_res.rs create mode 100644 groups/src/models/members.rs create mode 100644 groups/src/models/members_credentials.rs create mode 100644 groups/src/models/members_page.rs create mode 100644 groups/src/models/mod.rs create mode 100644 groups/src/models/new_role.rs create mode 100644 groups/src/models/parent_group_req_obj.rs create mode 100644 groups/src/models/role.rs create mode 100644 groups/src/models/role_actions_obj.rs create mode 100644 groups/src/models/role_members_obj.rs create mode 100644 groups/src/models/roles_page.rs create mode 100644 groups/src/models/update_role_obj.rs create mode 100644 http/.gitignore create mode 100644 http/.openapi-generator-ignore create mode 100644 http/.openapi-generator/FILES create mode 100644 http/.openapi-generator/VERSION create mode 100644 http/.travis.yml create mode 100644 http/Cargo.toml create mode 100644 http/README.md create mode 100644 http/docs/HealthApi.md create mode 100644 http/docs/HealthInfo.md create mode 100644 http/docs/MessagesApi.md create mode 100644 http/docs/SenMlRecord.md create mode 100644 http/git_push.sh create mode 100644 http/src/apis/configuration.rs create mode 100644 http/src/apis/health_api.rs create mode 100644 http/src/apis/messages_api.rs create mode 100644 http/src/apis/mod.rs create mode 100644 http/src/lib.rs create mode 100644 http/src/models/health_info.rs create mode 100644 http/src/models/mod.rs create mode 100644 http/src/models/sen_ml_record.rs create mode 100644 invitations/.gitignore create mode 100644 invitations/.openapi-generator-ignore create mode 100644 invitations/.openapi-generator/FILES create mode 100644 invitations/.openapi-generator/VERSION create mode 100644 invitations/.travis.yml create mode 100644 invitations/Cargo.toml create mode 100644 invitations/README.md create mode 100644 invitations/docs/AcceptInvitationRequest.md create mode 100644 invitations/docs/Error.md create mode 100644 invitations/docs/HealthApi.md create mode 100644 invitations/docs/HealthRes.md create mode 100644 invitations/docs/Invitation.md create mode 100644 invitations/docs/InvitationPage.md create mode 100644 invitations/docs/InvitationsApi.md create mode 100644 invitations/docs/SendInvitationReqObj.md create mode 100644 invitations/git_push.sh create mode 100644 invitations/src/apis/configuration.rs create mode 100644 invitations/src/apis/health_api.rs create mode 100644 invitations/src/apis/invitations_api.rs create mode 100644 invitations/src/apis/mod.rs create mode 100644 invitations/src/lib.rs create mode 100644 invitations/src/models/accept_invitation_request.rs create mode 100644 invitations/src/models/error.rs create mode 100644 invitations/src/models/health_res.rs create mode 100644 invitations/src/models/invitation.rs create mode 100644 invitations/src/models/invitation_page.rs create mode 100644 invitations/src/models/mod.rs create mode 100644 invitations/src/models/send_invitation_req_obj.rs create mode 100644 journal/.gitignore create mode 100644 journal/.openapi-generator-ignore create mode 100644 journal/.openapi-generator/FILES create mode 100644 journal/.openapi-generator/VERSION create mode 100644 journal/.travis.yml create mode 100644 journal/Cargo.toml create mode 100644 journal/README.md create mode 100644 journal/docs/Error.md create mode 100644 journal/docs/HealthApi.md create mode 100644 journal/docs/HealthInfo.md create mode 100644 journal/docs/Journal.md create mode 100644 journal/docs/JournalLogApi.md create mode 100644 journal/docs/JournalPage.md create mode 100644 journal/git_push.sh create mode 100644 journal/src/apis/configuration.rs create mode 100644 journal/src/apis/health_api.rs create mode 100644 journal/src/apis/journal_log_api.rs create mode 100644 journal/src/apis/mod.rs create mode 100644 journal/src/lib.rs create mode 100644 journal/src/models/error.rs create mode 100644 journal/src/models/health_info.rs create mode 100644 journal/src/models/journal.rs create mode 100644 journal/src/models/journal_page.rs create mode 100644 journal/src/models/mod.rs create mode 100644 notifiers/.gitignore create mode 100644 notifiers/.openapi-generator-ignore create mode 100644 notifiers/.openapi-generator/FILES create mode 100644 notifiers/.openapi-generator/VERSION create mode 100644 notifiers/.travis.yml create mode 100644 notifiers/Cargo.toml create mode 100644 notifiers/README.md create mode 100644 notifiers/docs/CreateSubscription.md create mode 100644 notifiers/docs/HealthApi.md create mode 100644 notifiers/docs/HealthInfo.md create mode 100644 notifiers/docs/NotifiersApi.md create mode 100644 notifiers/docs/Page.md create mode 100644 notifiers/docs/Subscription.md create mode 100644 notifiers/git_push.sh create mode 100644 notifiers/src/apis/configuration.rs create mode 100644 notifiers/src/apis/health_api.rs create mode 100644 notifiers/src/apis/mod.rs create mode 100644 notifiers/src/apis/notifiers_api.rs create mode 100644 notifiers/src/lib.rs create mode 100644 notifiers/src/models/create_subscription.rs create mode 100644 notifiers/src/models/health_info.rs create mode 100644 notifiers/src/models/mod.rs create mode 100644 notifiers/src/models/page.rs create mode 100644 notifiers/src/models/subscription.rs create mode 100644 openapitools.json create mode 100644 provision/.gitignore create mode 100644 provision/.openapi-generator-ignore create mode 100644 provision/.openapi-generator/FILES create mode 100644 provision/.openapi-generator/VERSION create mode 100644 provision/.travis.yml create mode 100644 provision/Cargo.toml create mode 100644 provision/README.md create mode 100644 provision/docs/DomainIdMappingPostRequest.md create mode 100644 provision/docs/HealthApi.md create mode 100644 provision/docs/HealthInfo.md create mode 100644 provision/docs/ProvisionApi.md create mode 100644 provision/git_push.sh create mode 100644 provision/src/apis/configuration.rs create mode 100644 provision/src/apis/health_api.rs create mode 100644 provision/src/apis/mod.rs create mode 100644 provision/src/apis/provision_api.rs create mode 100644 provision/src/lib.rs create mode 100644 provision/src/models/__domain_id__mapping_post_request.rs create mode 100644 provision/src/models/health_info.rs create mode 100644 provision/src/models/mod.rs create mode 100644 readers/.gitignore create mode 100644 readers/.openapi-generator-ignore create mode 100644 readers/.openapi-generator/FILES create mode 100644 readers/.openapi-generator/VERSION create mode 100644 readers/.travis.yml create mode 100644 readers/Cargo.toml create mode 100644 readers/README.md create mode 100644 readers/docs/HealthApi.md create mode 100644 readers/docs/HealthInfo.md create mode 100644 readers/docs/MessagesPage.md create mode 100644 readers/docs/MessagesPageMessagesInner.md create mode 100644 readers/docs/ReadersApi.md create mode 100644 readers/git_push.sh create mode 100644 readers/src/apis/configuration.rs create mode 100644 readers/src/apis/health_api.rs create mode 100644 readers/src/apis/mod.rs create mode 100644 readers/src/apis/readers_api.rs create mode 100644 readers/src/lib.rs create mode 100644 readers/src/models/health_info.rs create mode 100644 readers/src/models/messages_page.rs create mode 100644 readers/src/models/messages_page_messages_inner.rs create mode 100644 readers/src/models/mod.rs create mode 100644 twins/.gitignore create mode 100644 twins/.openapi-generator-ignore create mode 100644 twins/.openapi-generator/FILES create mode 100644 twins/.openapi-generator/VERSION create mode 100644 twins/.travis.yml create mode 100644 twins/Cargo.toml create mode 100644 twins/README.md create mode 100644 twins/docs/Attribute.md create mode 100644 twins/docs/Definition.md create mode 100644 twins/docs/HealthApi.md create mode 100644 twins/docs/HealthInfo.md create mode 100644 twins/docs/State.md create mode 100644 twins/docs/StatesApi.md create mode 100644 twins/docs/StatesPage.md create mode 100644 twins/docs/TwinReqObj.md create mode 100644 twins/docs/TwinResObj.md create mode 100644 twins/docs/TwinsApi.md create mode 100644 twins/docs/TwinsPage.md create mode 100644 twins/git_push.sh create mode 100644 twins/src/apis/configuration.rs create mode 100644 twins/src/apis/health_api.rs create mode 100644 twins/src/apis/mod.rs create mode 100644 twins/src/apis/states_api.rs create mode 100644 twins/src/apis/twins_api.rs create mode 100644 twins/src/lib.rs create mode 100644 twins/src/models/attribute.rs create mode 100644 twins/src/models/definition.rs create mode 100644 twins/src/models/health_info.rs create mode 100644 twins/src/models/mod.rs create mode 100644 twins/src/models/state.rs create mode 100644 twins/src/models/states_page.rs create mode 100644 twins/src/models/twin_req_obj.rs create mode 100644 twins/src/models/twin_res_obj.rs create mode 100644 twins/src/models/twins_page.rs create mode 100644 users/.gitignore create mode 100644 users/.openapi-generator-ignore create mode 100644 users/.openapi-generator/FILES create mode 100644 users/.openapi-generator/VERSION create mode 100644 users/.travis.yml create mode 100644 users/Cargo.toml create mode 100644 users/README.md create mode 100644 users/docs/AssignReqObj.md create mode 100644 users/docs/AssignUserReqObj.md create mode 100644 users/docs/Email.md create mode 100644 users/docs/Error.md create mode 100644 users/docs/HealthApi.md create mode 100644 users/docs/HealthRes.md create mode 100644 users/docs/IssueToken.md create mode 100644 users/docs/IssueToken200Response.md create mode 100644 users/docs/Members.md create mode 100644 users/docs/MembersCredentials.md create mode 100644 users/docs/MembersPage.md create mode 100644 users/docs/RequestPasswordResetRequest.md create mode 100644 users/docs/ResetPasswordRequest.md create mode 100644 users/docs/User.md create mode 100644 users/docs/UserCredentials.md create mode 100644 users/docs/UserProfilePicture.md create mode 100644 users/docs/UserReqObj.md create mode 100644 users/docs/UserReqObjCredentials.md create mode 100644 users/docs/UserRole.md create mode 100644 users/docs/UserSecret.md create mode 100644 users/docs/UserTags.md create mode 100644 users/docs/UserUpdate.md create mode 100644 users/docs/Username.md create mode 100644 users/docs/UsersApi.md create mode 100644 users/docs/UsersPage.md create mode 100644 users/git_push.sh create mode 100644 users/src/apis/configuration.rs create mode 100644 users/src/apis/health_api.rs create mode 100644 users/src/apis/mod.rs create mode 100644 users/src/apis/users_api.rs create mode 100644 users/src/lib.rs create mode 100644 users/src/main.rs create mode 100644 users/src/models/assign_req_obj.rs create mode 100644 users/src/models/assign_user_req_obj.rs create mode 100644 users/src/models/email.rs create mode 100644 users/src/models/error.rs create mode 100644 users/src/models/health_res.rs create mode 100644 users/src/models/issue_token.rs create mode 100644 users/src/models/issue_token_200_response.rs create mode 100644 users/src/models/members.rs create mode 100644 users/src/models/members_credentials.rs create mode 100644 users/src/models/members_page.rs create mode 100644 users/src/models/mod.rs create mode 100644 users/src/models/request_password_reset_request.rs create mode 100644 users/src/models/reset_password_request.rs create mode 100644 users/src/models/user.rs create mode 100644 users/src/models/user_credentials.rs create mode 100644 users/src/models/user_profile_picture.rs create mode 100644 users/src/models/user_req_obj.rs create mode 100644 users/src/models/user_req_obj_credentials.rs create mode 100644 users/src/models/user_role.rs create mode 100644 users/src/models/user_secret.rs create mode 100644 users/src/models/user_tags.rs create mode 100644 users/src/models/user_update.rs create mode 100644 users/src/models/username.rs create mode 100644 users/src/models/users_page.rs diff --git a/.gitignore b/.gitignore index 6f72f892..8c9ed157 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,9 @@ go.work.sum # env file .env + +# Ignore Zone.Identifier files +*:Zone.Identifier + +# Ignore the target folder where build artifacts are stored +target/ \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 00000000..b65ca449 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,1731 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "addr2line" +version = "0.24.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" + +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + +[[package]] +name = "auth-openapi" +version = "0.15.1" +dependencies = [ + "reqwest", + "serde", + "serde_json", + "serde_repr", + "url", + "uuid", +] + +[[package]] +name = "autocfg" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" + +[[package]] +name = "backtrace" +version = "0.3.74" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" +dependencies = [ + "addr2line", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", + "windows-targets", +] + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "bitflags" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" + +[[package]] +name = "bootstrap-openapi" +version = "0.15.1" +dependencies = [ + "reqwest", + "serde", + "serde_json", + "serde_repr", + "url", + "uuid", +] + +[[package]] +name = "bumpalo" +version = "3.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" + +[[package]] +name = "bytes" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "325918d6fe32f23b19878fe4b34794ae41fc19ddbe53b10571a4874d44ffd39b" + +[[package]] +name = "cc" +version = "1.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9157bbaa6b165880c27a4293a474c91cdcf265cc68cc829bf10be0964a391caf" +dependencies = [ + "shlex", +] + +[[package]] +name = "certs-openapi" +version = "0.15.1" +dependencies = [ + "reqwest", + "serde", + "serde_json", + "serde_repr", + "url", + "uuid", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "channels-openapi" +version = "0.15.1" +dependencies = [ + "reqwest", + "serde", + "serde_json", + "serde_repr", + "url", + "uuid", +] + +[[package]] +name = "clients-openapi" +version = "0.15.1" +dependencies = [ + "reqwest", + "serde", + "serde_json", + "serde_repr", + "url", + "uuid", +] + +[[package]] +name = "core-foundation" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "domains-openapi" +version = "0.15.1" +dependencies = [ + "reqwest", + "serde", + "serde_json", + "serde_repr", + "url", + "uuid", +] + +[[package]] +name = "encoding_rs" +version = "0.8.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "errno" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" +dependencies = [ + "libc", + "windows-sys 0.59.0", +] + +[[package]] +name = "fastrand" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + +[[package]] +name = "form_urlencoded" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "futures-channel" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" +dependencies = [ + "futures-core", +] + +[[package]] +name = "futures-core" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" + +[[package]] +name = "futures-sink" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" + +[[package]] +name = "futures-task" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" + +[[package]] +name = "futures-util" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" +dependencies = [ + "futures-core", + "futures-task", + "pin-project-lite", + "pin-utils", +] + +[[package]] +name = "getrandom" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "gimli" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" + +[[package]] +name = "groups-openapi" +version = "0.15.1" +dependencies = [ + "reqwest", + "serde", + "serde_json", + "serde_repr", + "url", + "uuid", +] + +[[package]] +name = "h2" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccae279728d634d083c00f6099cb58f01cc99c145b84b8be2f6c74618d79922e" +dependencies = [ + "atomic-waker", + "bytes", + "fnv", + "futures-core", + "futures-sink", + "http", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "hashbrown" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" + +[[package]] +name = "http" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f16ca2af56261c99fba8bac40a10251ce8188205a4c448fbb745a2e4daa76fea" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" +dependencies = [ + "bytes", + "http", +] + +[[package]] +name = "http-body-util" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" +dependencies = [ + "bytes", + "futures-util", + "http", + "http-body", + "pin-project-lite", +] + +[[package]] +name = "http-openapi" +version = "0.15.1" +dependencies = [ + "reqwest", + "serde", + "serde_json", + "serde_repr", + "url", + "uuid", +] + +[[package]] +name = "httparse" +version = "1.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d71d3574edd2771538b901e6549113b4006ece66150fb69c0fb6d9a2adae946" + +[[package]] +name = "hyper" +version = "1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "256fb8d4bd6413123cc9d91832d78325c48ff41677595be797d90f42969beae0" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "itoa", + "pin-project-lite", + "smallvec", + "tokio", + "want", +] + +[[package]] +name = "hyper-rustls" +version = "0.27.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6884a48c6826ec44f524c7456b163cebe9e55a18d7b5e307cb4f100371cc767" +dependencies = [ + "futures-util", + "http", + "hyper", + "hyper-util", + "rustls", + "rustls-pki-types", + "tokio", + "tokio-rustls", + "tower-service", +] + +[[package]] +name = "hyper-tls" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" +dependencies = [ + "bytes", + "http-body-util", + "hyper", + "hyper-util", + "native-tls", + "tokio", + "tokio-native-tls", + "tower-service", +] + +[[package]] +name = "hyper-util" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df2dcfbe0677734ab2f3ffa7fa7bfd4706bfdc1ef393f2ee30184aed67e631b4" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "http", + "http-body", + "hyper", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", +] + +[[package]] +name = "icu_collections" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locid" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locid_transform" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locid_transform_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" + +[[package]] +name = "icu_normalizer" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" + +[[package]] +name = "icu_properties" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" + +[[package]] +name = "icu_provider" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_provider_macros" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "idna" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + +[[package]] +name = "indexmap" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" +dependencies = [ + "equivalent", + "hashbrown", +] + +[[package]] +name = "invitations-openapi" +version = "0.15.1" +dependencies = [ + "reqwest", + "serde", + "serde_json", + "serde_repr", + "url", + "uuid", +] + +[[package]] +name = "ipnet" +version = "2.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddc24109865250148c2e0f3d25d4f0f479571723792d3802153c60922a4fb708" + +[[package]] +name = "itoa" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" + +[[package]] +name = "journal-openapi" +version = "0.15.1" +dependencies = [ + "reqwest", + "serde", + "serde_json", + "serde_repr", + "url", + "uuid", +] + +[[package]] +name = "js-sys" +version = "0.3.76" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6717b6b5b077764fb5966237269cb3c64edddde4b14ce42647430a78ced9e7b7" +dependencies = [ + "once_cell", + "wasm-bindgen", +] + +[[package]] +name = "libc" +version = "0.2.168" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aaeb2981e0606ca11d79718f8bb01164f1d6ed75080182d3abf017e6d244b6d" + +[[package]] +name = "linux-raw-sys" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" + +[[package]] +name = "litemap" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" + +[[package]] +name = "lock_api" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" + +[[package]] +name = "memchr" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "mime_guess" +version = "2.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e" +dependencies = [ + "mime", + "unicase", +] + +[[package]] +name = "miniz_oxide" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ffbe83022cedc1d264172192511ae958937694cd57ce297164951b8b3568394" +dependencies = [ + "adler2", +] + +[[package]] +name = "mio" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" +dependencies = [ + "libc", + "wasi", + "windows-sys 0.52.0", +] + +[[package]] +name = "native-tls" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" +dependencies = [ + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] + +[[package]] +name = "notifiers-openapi" +version = "0.15.1" +dependencies = [ + "reqwest", + "serde", + "serde_json", + "serde_repr", + "url", + "uuid", +] + +[[package]] +name = "object" +version = "0.36.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" + +[[package]] +name = "openssl" +version = "0.10.68" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6174bc48f102d208783c2c84bf931bb75927a617866870de8a4ea85597f871f5" +dependencies = [ + "bitflags", + "cfg-if", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + +[[package]] +name = "openssl-sys" +version = "0.9.104" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45abf306cbf99debc8195b66b7346498d7b10c210de50418b5ccd7ceba08c741" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "parking_lot" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets", +] + +[[package]] +name = "percent-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[package]] +name = "pin-project-lite" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkg-config" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" + +[[package]] +name = "proc-macro2" +version = "1.0.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "provision-openapi" +version = "0.15.1" +dependencies = [ + "reqwest", + "serde", + "serde_json", + "serde_repr", + "url", + "uuid", +] + +[[package]] +name = "quote" +version = "1.0.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "readers-openapi" +version = "0.15.1" +dependencies = [ + "reqwest", + "serde", + "serde_json", + "serde_repr", + "url", + "uuid", +] + +[[package]] +name = "redox_syscall" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" +dependencies = [ + "bitflags", +] + +[[package]] +name = "reqwest" +version = "0.12.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a77c62af46e79de0a562e1a9849205ffcb7fc1238876e9bd743357570e04046f" +dependencies = [ + "base64", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-rustls", + "hyper-tls", + "hyper-util", + "ipnet", + "js-sys", + "log", + "mime", + "mime_guess", + "native-tls", + "once_cell", + "percent-encoding", + "pin-project-lite", + "rustls-pemfile", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper", + "system-configuration", + "tokio", + "tokio-native-tls", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "windows-registry", +] + +[[package]] +name = "ring" +version = "0.17.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" +dependencies = [ + "cc", + "cfg-if", + "getrandom", + "libc", + "spin", + "untrusted", + "windows-sys 0.52.0", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" + +[[package]] +name = "rustix" +version = "0.38.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f93dc38ecbab2eb790ff964bb77fa94faf256fd3e73285fd7ba0903b76bedb85" +dependencies = [ + "bitflags", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.59.0", +] + +[[package]] +name = "rustls" +version = "0.23.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5065c3f250cbd332cd894be57c40fa52387247659b14a2d6041d121547903b1b" +dependencies = [ + "once_cell", + "rustls-pki-types", + "rustls-webpki", + "subtle", + "zeroize", +] + +[[package]] +name = "rustls-pemfile" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" +dependencies = [ + "rustls-pki-types", +] + +[[package]] +name = "rustls-pki-types" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2bf47e6ff922db3825eb750c4e2ff784c6ff8fb9e13046ef6a1d1c5401b0b37" + +[[package]] +name = "rustls-webpki" +version = "0.102.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" +dependencies = [ + "ring", + "rustls-pki-types", + "untrusted", +] + +[[package]] +name = "ryu" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" + +[[package]] +name = "schannel" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f29ebaa345f945cec9fbbc532eb307f0fdad8161f281b6369539c8d84876b3d" +dependencies = [ + "windows-sys 0.59.0", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "security-framework" +version = "2.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" +dependencies = [ + "bitflags", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1863fd3768cd83c56a7f60faa4dc0d403f1b6df0a38c3c25f44b7894e45370d5" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "serde" +version = "1.0.216" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b9781016e935a97e8beecf0c933758c97a5520d32930e460142b4cd80c6338e" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.216" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46f859dbbf73865c6627ed570e78961cd3ac92407a2d117204c49232485da55e" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.133" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7fceb2473b9166b2294ef05efcb65a3db80803f0b03ef86a5fc88a2b85ee377" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] + +[[package]] +name = "serde_repr" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "signal-hook-registry" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" +dependencies = [ + "libc", +] + +[[package]] +name = "slab" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg", +] + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + +[[package]] +name = "socket2" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c970269d99b64e60ec3bd6ad27270092a5394c4e309314b18ae3fe575695fbe8" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] +name = "syn" +version = "2.0.90" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "919d3b74a5dd0ccd15aeb8f93e7006bd9e14c295087c9896a110f490752bcf31" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "sync_wrapper" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" +dependencies = [ + "futures-core", +] + +[[package]] +name = "synstructure" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "system-configuration" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" +dependencies = [ + "bitflags", + "core-foundation", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "tempfile" +version = "3.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28cce251fcbc87fac86a866eeb0d6c2d536fc16d06f184bb61aeae11aa4cee0c" +dependencies = [ + "cfg-if", + "fastrand", + "once_cell", + "rustix", + "windows-sys 0.59.0", +] + +[[package]] +name = "tinystr" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "tokio" +version = "1.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cec9b21b0450273377fc97bd4c33a8acffc8c996c987a7c5b319a0083707551" +dependencies = [ + "backtrace", + "bytes", + "libc", + "mio", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "windows-sys 0.52.0", +] + +[[package]] +name = "tokio-macros" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tokio-native-tls" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" +dependencies = [ + "native-tls", + "tokio", +] + +[[package]] +name = "tokio-rustls" +version = "0.26.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f6d0975eaace0cf0fcadee4e4aaa5da15b5c079146f2cffb67c113be122bf37" +dependencies = [ + "rustls", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.7.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7fcaa8d55a2bdd6b83ace262b016eca0d79ee02818c5c1bcdf0305114081078" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tower-service" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" + +[[package]] +name = "tracing" +version = "0.1.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" +dependencies = [ + "pin-project-lite", + "tracing-core", +] + +[[package]] +name = "tracing-core" +version = "0.1.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" +dependencies = [ + "once_cell", +] + +[[package]] +name = "try-lock" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" + +[[package]] +name = "twins-openapi" +version = "0.15.1" +dependencies = [ + "reqwest", + "serde", + "serde_json", + "serde_repr", + "url", + "uuid", +] + +[[package]] +name = "unicase" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e51b68083f157f853b6379db119d1c1be0e6e4dec98101079dec41f6f5cf6df" + +[[package]] +name = "unicode-ident" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" + +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + +[[package]] +name = "url" +version = "2.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "users-openapi" +version = "0.15.1" +dependencies = [ + "reqwest", + "serde", + "serde_json", + "serde_repr", + "tokio", + "url", + "uuid", +] + +[[package]] +name = "utf16_iter" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + +[[package]] +name = "uuid" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8c5f0a0af699448548ad1a2fbf920fb4bee257eae39953ba95cb84891a0446a" +dependencies = [ + "getrandom", + "serde", +] + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.99" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a474f6281d1d70c17ae7aa6a613c87fce69a127e2624002df63dcb39d6cf6396" +dependencies = [ + "cfg-if", + "once_cell", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.99" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f89bb38646b4f81674e8f5c3fb81b562be1fd936d84320f3264486418519c79" +dependencies = [ + "bumpalo", + "log", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.49" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38176d9b44ea84e9184eff0bc34cc167ed044f816accfe5922e54d84cf48eca2" +dependencies = [ + "cfg-if", + "js-sys", + "once_cell", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.99" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2cc6181fd9a7492eef6fef1f33961e3695e4579b9872a6f7c83aee556666d4fe" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.99" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30d7a95b763d3c45903ed6c81f156801839e5ee968bb07e534c44df0fcd330c2" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.99" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "943aab3fdaaa029a6e0271b35ea10b72b943135afe9bffca82384098ad0e06a6" + +[[package]] +name = "web-sys" +version = "0.3.76" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04dd7223427d52553d3702c004d3b2fe07c148165faa56313cb00211e31c12bc" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "windows-registry" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e400001bb720a623c1c69032f8e3e4cf09984deec740f007dd2b03ec864804b0" +dependencies = [ + "windows-result", + "windows-strings", + "windows-targets", +] + +[[package]] +name = "windows-result" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-strings" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" +dependencies = [ + "windows-result", + "windows-targets", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" + +[[package]] +name = "yoke" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "zerofrom" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" + +[[package]] +name = "zerovec" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 00000000..036ac3b0 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,21 @@ +[workspace] +members = [ + "auth", + "bootstrap", + "certs", + "channels", + "clients", + "domains", + "groups", + "http", + "invitations", + "journal", + "notifiers", + "provision", + "readers", + "twins", + "users" + +] + +tokio = { version = "1", features = ["full"] } \ No newline at end of file diff --git a/auth/.gitignore b/auth/.gitignore new file mode 100644 index 00000000..6aa10640 --- /dev/null +++ b/auth/.gitignore @@ -0,0 +1,3 @@ +/target/ +**/*.rs.bk +Cargo.lock diff --git a/auth/.openapi-generator-ignore b/auth/.openapi-generator-ignore new file mode 100644 index 00000000..7484ee59 --- /dev/null +++ b/auth/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/auth/.openapi-generator/FILES b/auth/.openapi-generator/FILES new file mode 100644 index 00000000..b5ce70fc --- /dev/null +++ b/auth/.openapi-generator/FILES @@ -0,0 +1,20 @@ +.gitignore +.openapi-generator-ignore +.travis.yml +Cargo.toml +README.md +docs/HealthApi.md +docs/HealthInfo.md +docs/IssueKeyRequest.md +docs/Key.md +docs/KeysApi.md +git_push.sh +src/apis/configuration.rs +src/apis/health_api.rs +src/apis/keys_api.rs +src/apis/mod.rs +src/lib.rs +src/models/health_info.rs +src/models/issue_key_request.rs +src/models/key.rs +src/models/mod.rs diff --git a/auth/.openapi-generator/VERSION b/auth/.openapi-generator/VERSION new file mode 100644 index 00000000..758bb9c8 --- /dev/null +++ b/auth/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.10.0 diff --git a/auth/.travis.yml b/auth/.travis.yml new file mode 100644 index 00000000..22761ba7 --- /dev/null +++ b/auth/.travis.yml @@ -0,0 +1 @@ +language: rust diff --git a/auth/Cargo.toml b/auth/Cargo.toml new file mode 100644 index 00000000..f1490cca --- /dev/null +++ b/auth/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "auth-openapi" +version = "0.15.1" +authors = ["info@abstractmachines.fr"] +description = "This is the Auth Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) " +license = "Apache 2.0" +edition = "2021" + +[dependencies] +serde = { version = "^1.0", features = ["derive"] } +serde_json = "^1.0" +serde_repr = "^0.1" +url = "^2.5" +uuid = { version = "^1.8", features = ["serde", "v4"] } +reqwest = { version = "^0.12", features = ["json", "multipart"] } diff --git a/auth/README.md b/auth/README.md new file mode 100644 index 00000000..e02118ce --- /dev/null +++ b/auth/README.md @@ -0,0 +1,54 @@ +# Rust API client for openapi + +This is the Auth Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. +Some useful links: +- [The SuperMQ repository](https://github.com/absmach/supermq) + + + +## Overview + +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://openapis.org) from a remote server, you can easily generate an API client. + +- API version: 0.15.1 +- Package version: 0.15.1 +- Generator version: 7.10.0 +- Build package: `org.openapitools.codegen.languages.RustClientCodegen` + +## Installation + +Put the package under your project folder in a directory named `openapi` and add the following to `Cargo.toml` under `[dependencies]`: + +``` +openapi = { path = "./openapi" } +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost:9001* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*HealthApi* | [**health_get**](docs/HealthApi.md#health_get) | **GET** /health | Retrieves service health check info. +*KeysApi* | [**get_key**](docs/KeysApi.md#get_key) | **GET** /keys/{keyID} | Gets API key details. +*KeysApi* | [**issue_key**](docs/KeysApi.md#issue_key) | **POST** /keys | Issue API key +*KeysApi* | [**revoke_key**](docs/KeysApi.md#revoke_key) | **DELETE** /keys/{keyID} | Revoke API key + + +## Documentation For Models + + - [HealthInfo](docs/HealthInfo.md) + - [IssueKeyRequest](docs/IssueKeyRequest.md) + - [Key](docs/Key.md) + + +To get access to the crate's generated documentation, use: + +``` +cargo doc --open +``` + +## Author + +info@abstractmachines.fr + diff --git a/auth/docs/HealthApi.md b/auth/docs/HealthApi.md new file mode 100644 index 00000000..72a6cd65 --- /dev/null +++ b/auth/docs/HealthApi.md @@ -0,0 +1,34 @@ +# \HealthApi + +All URIs are relative to *http://localhost:9001* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**health_get**](HealthApi.md#health_get) | **GET** /health | Retrieves service health check info. + + + +## health_get + +> models::HealthInfo health_get() +Retrieves service health check info. + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**models::HealthInfo**](health_info.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/health+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/auth/docs/HealthInfo.md b/auth/docs/HealthInfo.md new file mode 100644 index 00000000..ee8f5c6b --- /dev/null +++ b/auth/docs/HealthInfo.md @@ -0,0 +1,16 @@ +# HealthInfo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | Option<**String**> | Service status. | [optional] +**version** | Option<**String**> | Service version. | [optional] +**commit** | Option<**String**> | Service commit hash. | [optional] +**description** | Option<**String**> | Service description. | [optional] +**build_time** | Option<**String**> | Service build time. | [optional] +**instance_id** | Option<**String**> | Service instance ID. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/auth/docs/IssueKeyRequest.md b/auth/docs/IssueKeyRequest.md new file mode 100644 index 00000000..40a55b68 --- /dev/null +++ b/auth/docs/IssueKeyRequest.md @@ -0,0 +1,12 @@ +# IssueKeyRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**r#type** | Option<**i32**> | API key type. Keys of different type are processed differently. | [optional] +**duration** | Option<**f64**> | Number of seconds issued token is valid for. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/auth/docs/Key.md b/auth/docs/Key.md new file mode 100644 index 00000000..4e045d67 --- /dev/null +++ b/auth/docs/Key.md @@ -0,0 +1,16 @@ +# Key + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | API key unique identifier | [optional] +**issuer_id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | In ID of the entity that issued the token. | [optional] +**r#type** | Option<**i32**> | API key type. Keys of different type are processed differently. | [optional] +**subject** | Option<**String**> | User's email or service identifier of API key subject. | [optional] +**issued_at** | Option<**String**> | Time when the key is generated. | [optional] +**expires_at** | Option<**String**> | Time when the Key expires. If this field is missing, that means that Key is valid indefinitely. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/auth/docs/KeysApi.md b/auth/docs/KeysApi.md new file mode 100644 index 00000000..f73b4ccc --- /dev/null +++ b/auth/docs/KeysApi.md @@ -0,0 +1,101 @@ +# \KeysApi + +All URIs are relative to *http://localhost:9001* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_key**](KeysApi.md#get_key) | **GET** /keys/{keyID} | Gets API key details. +[**issue_key**](KeysApi.md#issue_key) | **POST** /keys | Issue API key +[**revoke_key**](KeysApi.md#revoke_key) | **DELETE** /keys/{keyID} | Revoke API key + + + +## get_key + +> models::Key get_key(key_id) +Gets API key details. + +Gets API key details for the given key. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**key_id** | **uuid::Uuid** | API Key ID. | [required] | + +### Return type + +[**models::Key**](Key.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## issue_key + +> issue_key(issue_key_request) +Issue API key + +Generates a new API key. Thew new API key will be uniquely identified by its ID. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**issue_key_request** | [**IssueKeyRequest**](IssueKeyRequest.md) | JSON-formatted document describing key request. | [required] | + +### Return type + + (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## revoke_key + +> revoke_key(key_id) +Revoke API key + +Revoke API key identified by the given ID. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**key_id** | **uuid::Uuid** | API Key ID. | [required] | + +### Return type + + (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/auth/git_push.sh b/auth/git_push.sh new file mode 100644 index 00000000..f53a75d4 --- /dev/null +++ b/auth/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/auth/src/apis/configuration.rs b/auth/src/apis/configuration.rs new file mode 100644 index 00000000..2f545195 --- /dev/null +++ b/auth/src/apis/configuration.rs @@ -0,0 +1,51 @@ +/* + * SuperMQ Auth Service + * + * This is the Auth Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + + + +#[derive(Debug, Clone)] +pub struct Configuration { + pub base_path: String, + pub user_agent: Option, + pub client: reqwest::Client, + pub basic_auth: Option, + pub oauth_access_token: Option, + pub bearer_access_token: Option, + pub api_key: Option, +} + +pub type BasicAuth = (String, Option); + +#[derive(Debug, Clone)] +pub struct ApiKey { + pub prefix: Option, + pub key: String, +} + + +impl Configuration { + pub fn new() -> Configuration { + Configuration::default() + } +} + +impl Default for Configuration { + fn default() -> Self { + Configuration { + base_path: "http://localhost:9001".to_owned(), + user_agent: Some("OpenAPI-Generator/0.15.1/rust".to_owned()), + client: reqwest::Client::new(), + basic_auth: None, + oauth_access_token: None, + bearer_access_token: None, + api_key: None, + } + } +} diff --git a/auth/src/apis/health_api.rs b/auth/src/apis/health_api.rs new file mode 100644 index 00000000..ea1aca7e --- /dev/null +++ b/auth/src/apis/health_api.rs @@ -0,0 +1,53 @@ +/* + * SuperMQ Auth Service + * + * This is the Auth Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`health_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum HealthGetError { + Status500(), + UnknownValue(serde_json::Value), +} + + +pub async fn health_get(configuration: &configuration::Configuration, ) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/health", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/auth/src/apis/keys_api.rs b/auth/src/apis/keys_api.rs new file mode 100644 index 00000000..7023d210 --- /dev/null +++ b/auth/src/apis/keys_api.rs @@ -0,0 +1,145 @@ +/* + * SuperMQ Auth Service + * + * This is the Auth Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`get_key`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetKeyError { + Status400(), + Status401(), + Status404(), + Status500(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`issue_key`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum IssueKeyError { + Status400(), + Status401(), + Status409(), + Status415(), + Status500(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`revoke_key`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RevokeKeyError { + Status401(), + Status404(), + Status500(), + UnknownValue(serde_json::Value), +} + + +/// Gets API key details for the given key. +pub async fn get_key(configuration: &configuration::Configuration, key_id: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/keys/{keyID}", local_var_configuration.base_path, keyID=crate::apis::urlencode(key_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Generates a new API key. Thew new API key will be uniquely identified by its ID. +pub async fn issue_key(configuration: &configuration::Configuration, issue_key_request: models::IssueKeyRequest) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/keys", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&issue_key_request); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Revoke API key identified by the given ID. +pub async fn revoke_key(configuration: &configuration::Configuration, key_id: &str) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/keys/{keyID}", local_var_configuration.base_path, keyID=crate::apis::urlencode(key_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/auth/src/apis/mod.rs b/auth/src/apis/mod.rs new file mode 100644 index 00000000..8e7db9cd --- /dev/null +++ b/auth/src/apis/mod.rs @@ -0,0 +1,96 @@ +use std::error; +use std::fmt; + +#[derive(Debug, Clone)] +pub struct ResponseContent { + pub status: reqwest::StatusCode, + pub content: String, + pub entity: Option, +} + +#[derive(Debug)] +pub enum Error { + Reqwest(reqwest::Error), + Serde(serde_json::Error), + Io(std::io::Error), + ResponseError(ResponseContent), +} + +impl fmt::Display for Error { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + let (module, e) = match self { + Error::Reqwest(e) => ("reqwest", e.to_string()), + Error::Serde(e) => ("serde", e.to_string()), + Error::Io(e) => ("IO", e.to_string()), + Error::ResponseError(e) => ("response", format!("status code {}", e.status)), + }; + write!(f, "error in {}: {}", module, e) + } +} + +impl error::Error for Error { + fn source(&self) -> Option<&(dyn error::Error + 'static)> { + Some(match self { + Error::Reqwest(e) => e, + Error::Serde(e) => e, + Error::Io(e) => e, + Error::ResponseError(_) => return None, + }) + } +} + +impl From for Error { + fn from(e: reqwest::Error) -> Self { + Error::Reqwest(e) + } +} + +impl From for Error { + fn from(e: serde_json::Error) -> Self { + Error::Serde(e) + } +} + +impl From for Error { + fn from(e: std::io::Error) -> Self { + Error::Io(e) + } +} + +pub fn urlencode>(s: T) -> String { + ::url::form_urlencoded::byte_serialize(s.as_ref().as_bytes()).collect() +} + +pub fn parse_deep_object(prefix: &str, value: &serde_json::Value) -> Vec<(String, String)> { + if let serde_json::Value::Object(object) = value { + let mut params = vec![]; + + for (key, value) in object { + match value { + serde_json::Value::Object(_) => params.append(&mut parse_deep_object( + &format!("{}[{}]", prefix, key), + value, + )), + serde_json::Value::Array(array) => { + for (i, value) in array.iter().enumerate() { + params.append(&mut parse_deep_object( + &format!("{}[{}][{}]", prefix, key, i), + value, + )); + } + }, + serde_json::Value::String(s) => params.push((format!("{}[{}]", prefix, key), s.clone())), + _ => params.push((format!("{}[{}]", prefix, key), value.to_string())), + } + } + + return params; + } + + unimplemented!("Only objects are supported with style=deepObject") +} + +pub mod health_api; +pub mod keys_api; + +pub mod configuration; diff --git a/auth/src/lib.rs b/auth/src/lib.rs new file mode 100644 index 00000000..e1520628 --- /dev/null +++ b/auth/src/lib.rs @@ -0,0 +1,11 @@ +#![allow(unused_imports)] +#![allow(clippy::too_many_arguments)] + +extern crate serde_repr; +extern crate serde; +extern crate serde_json; +extern crate url; +extern crate reqwest; + +pub mod apis; +pub mod models; diff --git a/auth/src/models/health_info.rs b/auth/src/models/health_info.rs new file mode 100644 index 00000000..57989142 --- /dev/null +++ b/auth/src/models/health_info.rs @@ -0,0 +1,60 @@ +/* + * SuperMQ Auth Service + * + * This is the Auth Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct HealthInfo { + /// Service status. + #[serde(rename = "status", skip_serializing_if = "Option::is_none")] + pub status: Option, + /// Service version. + #[serde(rename = "version", skip_serializing_if = "Option::is_none")] + pub version: Option, + /// Service commit hash. + #[serde(rename = "commit", skip_serializing_if = "Option::is_none")] + pub commit: Option, + /// Service description. + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option, + /// Service build time. + #[serde(rename = "build_time", skip_serializing_if = "Option::is_none")] + pub build_time: Option, + /// Service instance ID. + #[serde(rename = "instance_id", skip_serializing_if = "Option::is_none")] + pub instance_id: Option, +} + +impl HealthInfo { + pub fn new() -> HealthInfo { + HealthInfo { + status: None, + version: None, + commit: None, + description: None, + build_time: None, + instance_id: None, + } + } +} +/// Service status. +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Status { + #[serde(rename = "pass")] + Pass, +} + +impl Default for Status { + fn default() -> Status { + Self::Pass + } +} + diff --git a/auth/src/models/issue_key_request.rs b/auth/src/models/issue_key_request.rs new file mode 100644 index 00000000..9175420f --- /dev/null +++ b/auth/src/models/issue_key_request.rs @@ -0,0 +1,32 @@ +/* + * SuperMQ Auth Service + * + * This is the Auth Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct IssueKeyRequest { + /// API key type. Keys of different type are processed differently. + #[serde(rename = "type", skip_serializing_if = "Option::is_none")] + pub r#type: Option, + /// Number of seconds issued token is valid for. + #[serde(rename = "duration", skip_serializing_if = "Option::is_none")] + pub duration: Option, +} + +impl IssueKeyRequest { + pub fn new() -> IssueKeyRequest { + IssueKeyRequest { + r#type: None, + duration: None, + } + } +} + diff --git a/auth/src/models/key.rs b/auth/src/models/key.rs new file mode 100644 index 00000000..17e947fa --- /dev/null +++ b/auth/src/models/key.rs @@ -0,0 +1,48 @@ +/* + * SuperMQ Auth Service + * + * This is the Auth Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Key { + /// API key unique identifier + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + /// In ID of the entity that issued the token. + #[serde(rename = "issuer_id", skip_serializing_if = "Option::is_none")] + pub issuer_id: Option, + /// API key type. Keys of different type are processed differently. + #[serde(rename = "type", skip_serializing_if = "Option::is_none")] + pub r#type: Option, + /// User's email or service identifier of API key subject. + #[serde(rename = "subject", skip_serializing_if = "Option::is_none")] + pub subject: Option, + /// Time when the key is generated. + #[serde(rename = "issued_at", skip_serializing_if = "Option::is_none")] + pub issued_at: Option, + /// Time when the Key expires. If this field is missing, that means that Key is valid indefinitely. + #[serde(rename = "expires_at", skip_serializing_if = "Option::is_none")] + pub expires_at: Option, +} + +impl Key { + pub fn new() -> Key { + Key { + id: None, + issuer_id: None, + r#type: None, + subject: None, + issued_at: None, + expires_at: None, + } + } +} + diff --git a/auth/src/models/mod.rs b/auth/src/models/mod.rs new file mode 100644 index 00000000..96615106 --- /dev/null +++ b/auth/src/models/mod.rs @@ -0,0 +1,6 @@ +pub mod health_info; +pub use self::health_info::HealthInfo; +pub mod issue_key_request; +pub use self::issue_key_request::IssueKeyRequest; +pub mod key; +pub use self::key::Key; diff --git a/bootstrap/.gitignore b/bootstrap/.gitignore new file mode 100644 index 00000000..6aa10640 --- /dev/null +++ b/bootstrap/.gitignore @@ -0,0 +1,3 @@ +/target/ +**/*.rs.bk +Cargo.lock diff --git a/bootstrap/.openapi-generator-ignore b/bootstrap/.openapi-generator-ignore new file mode 100644 index 00000000..7484ee59 --- /dev/null +++ b/bootstrap/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/bootstrap/.openapi-generator/FILES b/bootstrap/.openapi-generator/FILES new file mode 100644 index 00000000..3e242e18 --- /dev/null +++ b/bootstrap/.openapi-generator/FILES @@ -0,0 +1,38 @@ +.gitignore +.openapi-generator-ignore +.travis.yml +Cargo.toml +README.md +docs/BootstrapConfig.md +docs/Config.md +docs/ConfigChannelsInner.md +docs/ConfigList.md +docs/ConfigUpdateCerts.md +docs/ConfigsApi.md +docs/CreateConfigRequest.md +docs/HealthApi.md +docs/HealthInfo.md +docs/State.md +docs/UpdateConfigCertsRequest.md +docs/UpdateConfigConnectionsRequest.md +docs/UpdateConfigRequest.md +docs/UpdateConfigStateRequest.md +git_push.sh +src/apis/configs_api.rs +src/apis/configuration.rs +src/apis/health_api.rs +src/apis/mod.rs +src/lib.rs +src/models/bootstrap_config.rs +src/models/config.rs +src/models/config_channels_inner.rs +src/models/config_list.rs +src/models/config_update_certs.rs +src/models/create_config_request.rs +src/models/health_info.rs +src/models/mod.rs +src/models/state.rs +src/models/update_config_certs_request.rs +src/models/update_config_connections_request.rs +src/models/update_config_request.rs +src/models/update_config_state_request.rs diff --git a/bootstrap/.openapi-generator/VERSION b/bootstrap/.openapi-generator/VERSION new file mode 100644 index 00000000..758bb9c8 --- /dev/null +++ b/bootstrap/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.10.0 diff --git a/bootstrap/.travis.yml b/bootstrap/.travis.yml new file mode 100644 index 00000000..22761ba7 --- /dev/null +++ b/bootstrap/.travis.yml @@ -0,0 +1 @@ +language: rust diff --git a/bootstrap/Cargo.toml b/bootstrap/Cargo.toml new file mode 100644 index 00000000..7870931d --- /dev/null +++ b/bootstrap/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "bootstrap-openapi" +version = "0.15.1" +authors = ["info@abstractmachines.fr"] +description = "HTTP API for managing platform clients configuration. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) " +license = "Apache 2.0" +edition = "2021" + +[dependencies] +serde = { version = "^1.0", features = ["derive"] } +serde_json = "^1.0" +serde_repr = "^0.1" +url = "^2.5" +uuid = { version = "^1.8", features = ["serde", "v4"] } +reqwest = { version = "^0.12", features = ["json", "multipart"] } diff --git a/bootstrap/README.md b/bootstrap/README.md new file mode 100644 index 00000000..ea96ac88 --- /dev/null +++ b/bootstrap/README.md @@ -0,0 +1,70 @@ +# Rust API client for openapi + +HTTP API for managing platform clients configuration. +Some useful links: +- [The SuperMQ repository](https://github.com/absmach/supermq) + + + +## Overview + +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://openapis.org) from a remote server, you can easily generate an API client. + +- API version: 0.15.1 +- Package version: 0.15.1 +- Generator version: 7.10.0 +- Build package: `org.openapitools.codegen.languages.RustClientCodegen` + +## Installation + +Put the package under your project folder in a directory named `openapi` and add the following to `Cargo.toml` under `[dependencies]`: + +``` +openapi = { path = "./openapi" } +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost:9013* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*ConfigsApi* | [**create_config**](docs/ConfigsApi.md#create_config) | **POST** /{domainID}/clients/configs | Adds new config +*ConfigsApi* | [**get_bootstrap_config**](docs/ConfigsApi.md#get_bootstrap_config) | **GET** /clients/bootstrap/{externalId} | Retrieves configuration. +*ConfigsApi* | [**get_config**](docs/ConfigsApi.md#get_config) | **GET** /{domainID}/clients/configs/{configId} | Retrieves config info (with channels). +*ConfigsApi* | [**get_configs**](docs/ConfigsApi.md#get_configs) | **GET** /{domainID}/clients/configs | Retrieves managed configs +*ConfigsApi* | [**get_secure_bootstrap_config**](docs/ConfigsApi.md#get_secure_bootstrap_config) | **GET** /clients/bootstrap/secure/{externalId} | Retrieves configuration. +*ConfigsApi* | [**remove_config**](docs/ConfigsApi.md#remove_config) | **DELETE** /{domainID}/clients/configs/{configId} | Removes a Config +*ConfigsApi* | [**update_config**](docs/ConfigsApi.md#update_config) | **PUT** /{domainID}/clients/configs/{configId} | Updates config info +*ConfigsApi* | [**update_config_certs**](docs/ConfigsApi.md#update_config_certs) | **PATCH** /{domainID}/clients/configs/certs/{configId} | Updates certs +*ConfigsApi* | [**update_config_connections**](docs/ConfigsApi.md#update_config_connections) | **PUT** /{domainID}/clients/configs/connections/{configId} | Updates channels the client is connected to +*ConfigsApi* | [**update_config_state**](docs/ConfigsApi.md#update_config_state) | **PUT** /{domainID}/clients/state/{configId} | Updates Config state. +*HealthApi* | [**health_get**](docs/HealthApi.md#health_get) | **GET** /health | Retrieves service health check info. + + +## Documentation For Models + + - [BootstrapConfig](docs/BootstrapConfig.md) + - [Config](docs/Config.md) + - [ConfigChannelsInner](docs/ConfigChannelsInner.md) + - [ConfigList](docs/ConfigList.md) + - [ConfigUpdateCerts](docs/ConfigUpdateCerts.md) + - [CreateConfigRequest](docs/CreateConfigRequest.md) + - [HealthInfo](docs/HealthInfo.md) + - [State](docs/State.md) + - [UpdateConfigCertsRequest](docs/UpdateConfigCertsRequest.md) + - [UpdateConfigConnectionsRequest](docs/UpdateConfigConnectionsRequest.md) + - [UpdateConfigRequest](docs/UpdateConfigRequest.md) + - [UpdateConfigStateRequest](docs/UpdateConfigStateRequest.md) + + +To get access to the crate's generated documentation, use: + +``` +cargo doc --open +``` + +## Author + +info@abstractmachines.fr + diff --git a/bootstrap/docs/BootstrapConfig.md b/bootstrap/docs/BootstrapConfig.md new file mode 100644 index 00000000..a90d0495 --- /dev/null +++ b/bootstrap/docs/BootstrapConfig.md @@ -0,0 +1,15 @@ +# BootstrapConfig + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**client_id** | [**uuid::Uuid**](uuid::Uuid.md) | Corresponding SuperMQ Client ID. | +**client_key** | [**uuid::Uuid**](uuid::Uuid.md) | Corresponding SuperMQ Client key. | +**channels** | **Vec** | | +**content** | **String** | Free-form custom configuration. | +**client_cert** | Option<**String**> | Client certificate. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/bootstrap/docs/Config.md b/bootstrap/docs/Config.md new file mode 100644 index 00000000..31e509bd --- /dev/null +++ b/bootstrap/docs/Config.md @@ -0,0 +1,19 @@ +# Config + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**client_id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | Corresponding SuperMQ Client ID. | [optional] +**magistrala_secret** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | Corresponding SuperMQ Client key. | [optional] +**channels** | Option<[**Vec**](Config_channels_inner.md)> | | [optional] +**external_id** | **String** | External ID (MAC address or some unique identifier). | +**external_key** | **String** | External key. | +**content** | Option<**String**> | Free-form custom configuration. | [optional] +**state** | Option<[**models::State**](State.md)> | | [optional] +**client_cert** | Option<**String**> | Client certificate. | [optional] +**ca_cert** | Option<**String**> | Issuing CA certificate. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/bootstrap/docs/ConfigChannelsInner.md b/bootstrap/docs/ConfigChannelsInner.md new file mode 100644 index 00000000..c5eebad4 --- /dev/null +++ b/bootstrap/docs/ConfigChannelsInner.md @@ -0,0 +1,13 @@ +# ConfigChannelsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | Channel unique identifier. | [optional] +**name** | Option<**String**> | Name of the Channel. | [optional] +**metadata** | Option<[**serde_json::Value**](.md)> | Custom metadata related to the Channel. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/bootstrap/docs/ConfigList.md b/bootstrap/docs/ConfigList.md new file mode 100644 index 00000000..c9295b8f --- /dev/null +++ b/bootstrap/docs/ConfigList.md @@ -0,0 +1,14 @@ +# ConfigList + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**total** | Option<**i32**> | Total number of results. | [optional] +**offset** | Option<**i32**> | Number of items to skip during retrieval. | [optional][default to 0] +**limit** | Option<**i32**> | Size of the subset to retrieve. | [optional][default to 10] +**configs** | [**Vec**](Config.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/bootstrap/docs/ConfigUpdateCerts.md b/bootstrap/docs/ConfigUpdateCerts.md new file mode 100644 index 00000000..7bd616c9 --- /dev/null +++ b/bootstrap/docs/ConfigUpdateCerts.md @@ -0,0 +1,14 @@ +# ConfigUpdateCerts + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**client_id** | [**uuid::Uuid**](uuid::Uuid.md) | Corresponding SuperMQ Client ID. | +**client_cert** | Option<**String**> | Client certificate. | [optional] +**client_key** | **String** | Key for the client_cert. | +**ca_cert** | Option<**String**> | Issuing CA certificate. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/bootstrap/docs/ConfigsApi.md b/bootstrap/docs/ConfigsApi.md new file mode 100644 index 00000000..bd125a22 --- /dev/null +++ b/bootstrap/docs/ConfigsApi.md @@ -0,0 +1,331 @@ +# \ConfigsApi + +All URIs are relative to *http://localhost:9013* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_config**](ConfigsApi.md#create_config) | **POST** /{domainID}/clients/configs | Adds new config +[**get_bootstrap_config**](ConfigsApi.md#get_bootstrap_config) | **GET** /clients/bootstrap/{externalId} | Retrieves configuration. +[**get_config**](ConfigsApi.md#get_config) | **GET** /{domainID}/clients/configs/{configId} | Retrieves config info (with channels). +[**get_configs**](ConfigsApi.md#get_configs) | **GET** /{domainID}/clients/configs | Retrieves managed configs +[**get_secure_bootstrap_config**](ConfigsApi.md#get_secure_bootstrap_config) | **GET** /clients/bootstrap/secure/{externalId} | Retrieves configuration. +[**remove_config**](ConfigsApi.md#remove_config) | **DELETE** /{domainID}/clients/configs/{configId} | Removes a Config +[**update_config**](ConfigsApi.md#update_config) | **PUT** /{domainID}/clients/configs/{configId} | Updates config info +[**update_config_certs**](ConfigsApi.md#update_config_certs) | **PATCH** /{domainID}/clients/configs/certs/{configId} | Updates certs +[**update_config_connections**](ConfigsApi.md#update_config_connections) | **PUT** /{domainID}/clients/configs/connections/{configId} | Updates channels the client is connected to +[**update_config_state**](ConfigsApi.md#update_config_state) | **PUT** /{domainID}/clients/state/{configId} | Updates Config state. + + + +## create_config + +> create_config(domain_id, create_config_request) +Adds new config + +Adds new config to the list of config owned by user identified using the provided access token. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**create_config_request** | [**CreateConfigRequest**](CreateConfigRequest.md) | JSON-formatted document describing the new config. | [required] | + +### Return type + + (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_bootstrap_config + +> models::BootstrapConfig get_bootstrap_config(external_id) +Retrieves configuration. + +Retrieves a configuration with given external ID and external key. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**external_id** | **String** | Unique Config identifier provided by external entity. | [required] | + +### Return type + +[**models::BootstrapConfig**](BootstrapConfig.md) + +### Authorization + +[bootstrapAuth](../README.md#bootstrapAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_config + +> models::Config get_config(domain_id, config_id) +Retrieves config info (with channels). + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**config_id** | **uuid::Uuid** | Unique Config identifier. It's the ID of the corresponding Client. | [required] | + +### Return type + +[**models::Config**](Config.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_configs + +> models::ConfigList get_configs(domain_id, limit, offset, state, name) +Retrieves managed configs + +Retrieves a list of managed configs. Due to performance concerns, data is retrieved in subsets. The API configs must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**limit** | Option<**i32**> | Size of the subset to retrieve. | |[default to 10] +**offset** | Option<**i32**> | Number of items to skip during retrieval. | |[default to 0] +**state** | Option<[**State**](.md)> | A state of items | | +**name** | Option<**String**> | Name of the config. Search by name is partial-match and case-insensitive. | | + +### Return type + +[**models::ConfigList**](ConfigList.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_secure_bootstrap_config + +> models::BootstrapConfig get_secure_bootstrap_config(external_id) +Retrieves configuration. + +Retrieves a configuration with given external ID and encrypted external key. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**external_id** | **String** | Unique Config identifier provided by external entity. | [required] | + +### Return type + +[**models::BootstrapConfig**](BootstrapConfig.md) + +### Authorization + +[bootstrapEncAuth](../README.md#bootstrapEncAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## remove_config + +> remove_config(domain_id, config_id) +Removes a Config + +Removes a Config. In case of successful removal the service will ensure that the removed config is disconnected from all of the SuperMQ channels. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**config_id** | **uuid::Uuid** | Unique Config identifier. It's the ID of the corresponding Client. | [required] | + +### Return type + + (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## update_config + +> update_config(domain_id, config_id, update_config_request) +Updates config info + +Update is performed by replacing the current resource data with values provided in a request payload. Note that the owner, ID, external ID, external key, SuperMQ Client ID and key cannot be changed. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**config_id** | **uuid::Uuid** | Unique Config identifier. It's the ID of the corresponding Client. | [required] | +**update_config_request** | Option<[**UpdateConfigRequest**](UpdateConfigRequest.md)> | JSON-formatted document describing the updated client. | | + +### Return type + + (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## update_config_certs + +> models::ConfigUpdateCerts update_config_certs(domain_id, config_id, update_config_certs_request) +Updates certs + +Update is performed by replacing the current certificate data with values provided in a request payload. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**config_id** | **uuid::Uuid** | Unique Config identifier. It's the ID of the corresponding Client. | [required] | +**update_config_certs_request** | Option<[**UpdateConfigCertsRequest**](UpdateConfigCertsRequest.md)> | JSON-formatted document describing the updated client. | | + +### Return type + +[**models::ConfigUpdateCerts**](ConfigUpdateCerts.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## update_config_connections + +> update_config_connections(domain_id, config_id, update_config_connections_request) +Updates channels the client is connected to + +Update connections performs update of the channel list corresponding Client is connected to. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**config_id** | **uuid::Uuid** | Unique Config identifier. It's the ID of the corresponding Client. | [required] | +**update_config_connections_request** | Option<[**UpdateConfigConnectionsRequest**](UpdateConfigConnectionsRequest.md)> | Array if IDs the client is be connected to. | | + +### Return type + + (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## update_config_state + +> update_config_state(domain_id, config_id, update_config_state_request) +Updates Config state. + +Updating state represents enabling/disabling Config, i.e. connecting and disconnecting corresponding SuperMQ Client to the list of Channels. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**config_id** | **uuid::Uuid** | Unique Config identifier. It's the ID of the corresponding Client. | [required] | +**update_config_state_request** | Option<[**UpdateConfigStateRequest**](UpdateConfigStateRequest.md)> | Update the state of the Config. | | + +### Return type + + (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/bootstrap/docs/CreateConfigRequest.md b/bootstrap/docs/CreateConfigRequest.md new file mode 100644 index 00000000..ccc0089e --- /dev/null +++ b/bootstrap/docs/CreateConfigRequest.md @@ -0,0 +1,19 @@ +# CreateConfigRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**external_id** | **String** | External ID (MAC address or some unique identifier). | +**external_key** | **String** | External key. | +**client_id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | ID of the corresponding SuperMQ Client. | [optional] +**channels** | Option<[**Vec**](uuid::Uuid.md)> | | [optional] +**content** | Option<**String**> | | [optional] +**name** | Option<**String**> | | [optional] +**client_cert** | Option<**String**> | Client Certificate. | [optional] +**client_key** | Option<**String**> | Client Private Key. | [optional] +**ca_cert** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/bootstrap/docs/HealthApi.md b/bootstrap/docs/HealthApi.md new file mode 100644 index 00000000..dc7ff32d --- /dev/null +++ b/bootstrap/docs/HealthApi.md @@ -0,0 +1,34 @@ +# \HealthApi + +All URIs are relative to *http://localhost:9013* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**health_get**](HealthApi.md#health_get) | **GET** /health | Retrieves service health check info. + + + +## health_get + +> models::HealthInfo health_get() +Retrieves service health check info. + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**models::HealthInfo**](health_info.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/health+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/bootstrap/docs/HealthInfo.md b/bootstrap/docs/HealthInfo.md new file mode 100644 index 00000000..ee8f5c6b --- /dev/null +++ b/bootstrap/docs/HealthInfo.md @@ -0,0 +1,16 @@ +# HealthInfo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | Option<**String**> | Service status. | [optional] +**version** | Option<**String**> | Service version. | [optional] +**commit** | Option<**String**> | Service commit hash. | [optional] +**description** | Option<**String**> | Service description. | [optional] +**build_time** | Option<**String**> | Service build time. | [optional] +**instance_id** | Option<**String**> | Service instance ID. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/bootstrap/docs/State.md b/bootstrap/docs/State.md new file mode 100644 index 00000000..72082fdb --- /dev/null +++ b/bootstrap/docs/State.md @@ -0,0 +1,13 @@ +# State + +## Enum Variants + +| Name | Value | +|---- | -----| +| Variant0 | 0 | +| Variant1 | 1 | + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/bootstrap/docs/UpdateConfigCertsRequest.md b/bootstrap/docs/UpdateConfigCertsRequest.md new file mode 100644 index 00000000..322c03d5 --- /dev/null +++ b/bootstrap/docs/UpdateConfigCertsRequest.md @@ -0,0 +1,13 @@ +# UpdateConfigCertsRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**client_cert** | Option<**String**> | | [optional] +**client_key** | Option<**String**> | | [optional] +**ca_cert** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/bootstrap/docs/UpdateConfigConnectionsRequest.md b/bootstrap/docs/UpdateConfigConnectionsRequest.md new file mode 100644 index 00000000..253be96c --- /dev/null +++ b/bootstrap/docs/UpdateConfigConnectionsRequest.md @@ -0,0 +1,11 @@ +# UpdateConfigConnectionsRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**channels** | Option<[**Vec**](uuid::Uuid.md)> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/bootstrap/docs/UpdateConfigRequest.md b/bootstrap/docs/UpdateConfigRequest.md new file mode 100644 index 00000000..e3b0ce67 --- /dev/null +++ b/bootstrap/docs/UpdateConfigRequest.md @@ -0,0 +1,12 @@ +# UpdateConfigRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**content** | **String** | | +**name** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/bootstrap/docs/UpdateConfigStateRequest.md b/bootstrap/docs/UpdateConfigStateRequest.md new file mode 100644 index 00000000..964b8f6a --- /dev/null +++ b/bootstrap/docs/UpdateConfigStateRequest.md @@ -0,0 +1,11 @@ +# UpdateConfigStateRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**state** | Option<[**models::State**](State.md)> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/bootstrap/git_push.sh b/bootstrap/git_push.sh new file mode 100644 index 00000000..f53a75d4 --- /dev/null +++ b/bootstrap/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/bootstrap/src/apis/configs_api.rs b/bootstrap/src/apis/configs_api.rs new file mode 100644 index 00000000..9b55b89f --- /dev/null +++ b/bootstrap/src/apis/configs_api.rs @@ -0,0 +1,475 @@ +/* + * SuperMQ Bootstrap service + * + * HTTP API for managing platform clients configuration. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`create_config`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CreateConfigError { + Status400(), + Status401(), + Status403(), + Status404(), + Status409(), + Status415(), + Status422(), + Status500(), + Status503(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_bootstrap_config`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetBootstrapConfigError { + Status400(), + Status401(), + Status404(), + Status422(), + Status500(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_config`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetConfigError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_configs`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetConfigsError { + Status400(), + Status401(), + Status422(), + Status500(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_secure_bootstrap_config`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetSecureBootstrapConfigError { + Status400(), + Status401(), + Status404(), + Status422(), + Status500(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`remove_config`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RemoveConfigError { + Status400(), + Status401(), + Status403(), + Status422(), + Status500(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`update_config`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UpdateConfigError { + Status400(), + Status401(), + Status403(), + Status404(), + Status415(), + Status422(), + Status500(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`update_config_certs`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UpdateConfigCertsError { + Status400(), + Status401(), + Status403(), + Status404(), + Status415(), + Status422(), + Status500(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`update_config_connections`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UpdateConfigConnectionsError { + Status400(), + Status401(), + Status403(), + Status404(), + Status415(), + Status422(), + Status500(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`update_config_state`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UpdateConfigStateError { + Status400(), + Status401(), + Status404(), + Status415(), + Status422(), + Status500(), + UnknownValue(serde_json::Value), +} + + +/// Adds new config to the list of config owned by user identified using the provided access token. +pub async fn create_config(configuration: &configuration::Configuration, domain_id: &str, create_config_request: models::CreateConfigRequest) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/clients/configs", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&create_config_request); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Retrieves a configuration with given external ID and external key. +pub async fn get_bootstrap_config(configuration: &configuration::Configuration, external_id: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/clients/bootstrap/{externalId}", local_var_configuration.base_path, externalId=crate::apis::urlencode(external_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn get_config(configuration: &configuration::Configuration, domain_id: &str, config_id: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/clients/configs/{configId}", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), configId=crate::apis::urlencode(config_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Retrieves a list of managed configs. Due to performance concerns, data is retrieved in subsets. The API configs must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. +pub async fn get_configs(configuration: &configuration::Configuration, domain_id: &str, limit: Option, offset: Option, state: Option, name: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/clients/configs", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = offset { + local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = state { + local_var_req_builder = local_var_req_builder.query(&[("state", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = name { + local_var_req_builder = local_var_req_builder.query(&[("name", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Retrieves a configuration with given external ID and encrypted external key. +pub async fn get_secure_bootstrap_config(configuration: &configuration::Configuration, external_id: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/clients/bootstrap/secure/{externalId}", local_var_configuration.base_path, externalId=crate::apis::urlencode(external_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Removes a Config. In case of successful removal the service will ensure that the removed config is disconnected from all of the SuperMQ channels. +pub async fn remove_config(configuration: &configuration::Configuration, domain_id: &str, config_id: &str) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/clients/configs/{configId}", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), configId=crate::apis::urlencode(config_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Update is performed by replacing the current resource data with values provided in a request payload. Note that the owner, ID, external ID, external key, SuperMQ Client ID and key cannot be changed. +pub async fn update_config(configuration: &configuration::Configuration, domain_id: &str, config_id: &str, update_config_request: Option) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/clients/configs/{configId}", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), configId=crate::apis::urlencode(config_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&update_config_request); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Update is performed by replacing the current certificate data with values provided in a request payload. +pub async fn update_config_certs(configuration: &configuration::Configuration, domain_id: &str, config_id: &str, update_config_certs_request: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/clients/configs/certs/{configId}", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), configId=crate::apis::urlencode(config_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&update_config_certs_request); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Update connections performs update of the channel list corresponding Client is connected to. +pub async fn update_config_connections(configuration: &configuration::Configuration, domain_id: &str, config_id: &str, update_config_connections_request: Option) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/clients/configs/connections/{configId}", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), configId=crate::apis::urlencode(config_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&update_config_connections_request); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Updating state represents enabling/disabling Config, i.e. connecting and disconnecting corresponding SuperMQ Client to the list of Channels. +pub async fn update_config_state(configuration: &configuration::Configuration, domain_id: &str, config_id: &str, update_config_state_request: Option) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/clients/state/{configId}", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), configId=crate::apis::urlencode(config_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&update_config_state_request); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/bootstrap/src/apis/configuration.rs b/bootstrap/src/apis/configuration.rs new file mode 100644 index 00000000..c2bfeae3 --- /dev/null +++ b/bootstrap/src/apis/configuration.rs @@ -0,0 +1,51 @@ +/* + * SuperMQ Bootstrap service + * + * HTTP API for managing platform clients configuration. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + + + +#[derive(Debug, Clone)] +pub struct Configuration { + pub base_path: String, + pub user_agent: Option, + pub client: reqwest::Client, + pub basic_auth: Option, + pub oauth_access_token: Option, + pub bearer_access_token: Option, + pub api_key: Option, +} + +pub type BasicAuth = (String, Option); + +#[derive(Debug, Clone)] +pub struct ApiKey { + pub prefix: Option, + pub key: String, +} + + +impl Configuration { + pub fn new() -> Configuration { + Configuration::default() + } +} + +impl Default for Configuration { + fn default() -> Self { + Configuration { + base_path: "http://localhost:9013".to_owned(), + user_agent: Some("OpenAPI-Generator/0.15.1/rust".to_owned()), + client: reqwest::Client::new(), + basic_auth: None, + oauth_access_token: None, + bearer_access_token: None, + api_key: None, + } + } +} diff --git a/bootstrap/src/apis/health_api.rs b/bootstrap/src/apis/health_api.rs new file mode 100644 index 00000000..bcd54724 --- /dev/null +++ b/bootstrap/src/apis/health_api.rs @@ -0,0 +1,53 @@ +/* + * SuperMQ Bootstrap service + * + * HTTP API for managing platform clients configuration. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`health_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum HealthGetError { + Status500(), + UnknownValue(serde_json::Value), +} + + +pub async fn health_get(configuration: &configuration::Configuration, ) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/health", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/bootstrap/src/apis/mod.rs b/bootstrap/src/apis/mod.rs new file mode 100644 index 00000000..885f9342 --- /dev/null +++ b/bootstrap/src/apis/mod.rs @@ -0,0 +1,96 @@ +use std::error; +use std::fmt; + +#[derive(Debug, Clone)] +pub struct ResponseContent { + pub status: reqwest::StatusCode, + pub content: String, + pub entity: Option, +} + +#[derive(Debug)] +pub enum Error { + Reqwest(reqwest::Error), + Serde(serde_json::Error), + Io(std::io::Error), + ResponseError(ResponseContent), +} + +impl fmt::Display for Error { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + let (module, e) = match self { + Error::Reqwest(e) => ("reqwest", e.to_string()), + Error::Serde(e) => ("serde", e.to_string()), + Error::Io(e) => ("IO", e.to_string()), + Error::ResponseError(e) => ("response", format!("status code {}", e.status)), + }; + write!(f, "error in {}: {}", module, e) + } +} + +impl error::Error for Error { + fn source(&self) -> Option<&(dyn error::Error + 'static)> { + Some(match self { + Error::Reqwest(e) => e, + Error::Serde(e) => e, + Error::Io(e) => e, + Error::ResponseError(_) => return None, + }) + } +} + +impl From for Error { + fn from(e: reqwest::Error) -> Self { + Error::Reqwest(e) + } +} + +impl From for Error { + fn from(e: serde_json::Error) -> Self { + Error::Serde(e) + } +} + +impl From for Error { + fn from(e: std::io::Error) -> Self { + Error::Io(e) + } +} + +pub fn urlencode>(s: T) -> String { + ::url::form_urlencoded::byte_serialize(s.as_ref().as_bytes()).collect() +} + +pub fn parse_deep_object(prefix: &str, value: &serde_json::Value) -> Vec<(String, String)> { + if let serde_json::Value::Object(object) = value { + let mut params = vec![]; + + for (key, value) in object { + match value { + serde_json::Value::Object(_) => params.append(&mut parse_deep_object( + &format!("{}[{}]", prefix, key), + value, + )), + serde_json::Value::Array(array) => { + for (i, value) in array.iter().enumerate() { + params.append(&mut parse_deep_object( + &format!("{}[{}][{}]", prefix, key, i), + value, + )); + } + }, + serde_json::Value::String(s) => params.push((format!("{}[{}]", prefix, key), s.clone())), + _ => params.push((format!("{}[{}]", prefix, key), value.to_string())), + } + } + + return params; + } + + unimplemented!("Only objects are supported with style=deepObject") +} + +pub mod configs_api; +pub mod health_api; + +pub mod configuration; diff --git a/bootstrap/src/lib.rs b/bootstrap/src/lib.rs new file mode 100644 index 00000000..e1520628 --- /dev/null +++ b/bootstrap/src/lib.rs @@ -0,0 +1,11 @@ +#![allow(unused_imports)] +#![allow(clippy::too_many_arguments)] + +extern crate serde_repr; +extern crate serde; +extern crate serde_json; +extern crate url; +extern crate reqwest; + +pub mod apis; +pub mod models; diff --git a/bootstrap/src/models/bootstrap_config.rs b/bootstrap/src/models/bootstrap_config.rs new file mode 100644 index 00000000..90ff859a --- /dev/null +++ b/bootstrap/src/models/bootstrap_config.rs @@ -0,0 +1,43 @@ +/* + * SuperMQ Bootstrap service + * + * HTTP API for managing platform clients configuration. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct BootstrapConfig { + /// Corresponding SuperMQ Client ID. + #[serde(rename = "client_id")] + pub client_id: uuid::Uuid, + /// Corresponding SuperMQ Client key. + #[serde(rename = "client_key")] + pub client_key: uuid::Uuid, + #[serde(rename = "channels")] + pub channels: Vec, + /// Free-form custom configuration. + #[serde(rename = "content")] + pub content: String, + /// Client certificate. + #[serde(rename = "client_cert", skip_serializing_if = "Option::is_none")] + pub client_cert: Option, +} + +impl BootstrapConfig { + pub fn new(client_id: uuid::Uuid, client_key: uuid::Uuid, channels: Vec, content: String) -> BootstrapConfig { + BootstrapConfig { + client_id, + client_key, + channels, + content, + client_cert: None, + } + } +} + diff --git a/bootstrap/src/models/config.rs b/bootstrap/src/models/config.rs new file mode 100644 index 00000000..88fd6bc8 --- /dev/null +++ b/bootstrap/src/models/config.rs @@ -0,0 +1,58 @@ +/* + * SuperMQ Bootstrap service + * + * HTTP API for managing platform clients configuration. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Config { + /// Corresponding SuperMQ Client ID. + #[serde(rename = "client_id", skip_serializing_if = "Option::is_none")] + pub client_id: Option, + /// Corresponding SuperMQ Client key. + #[serde(rename = "magistrala_secret", skip_serializing_if = "Option::is_none")] + pub magistrala_secret: Option, + #[serde(rename = "channels", skip_serializing_if = "Option::is_none")] + pub channels: Option>, + /// External ID (MAC address or some unique identifier). + #[serde(rename = "external_id")] + pub external_id: String, + /// External key. + #[serde(rename = "external_key")] + pub external_key: String, + /// Free-form custom configuration. + #[serde(rename = "content", skip_serializing_if = "Option::is_none")] + pub content: Option, + #[serde(rename = "state", skip_serializing_if = "Option::is_none")] + pub state: Option, + /// Client certificate. + #[serde(rename = "client_cert", skip_serializing_if = "Option::is_none")] + pub client_cert: Option, + /// Issuing CA certificate. + #[serde(rename = "ca_cert", skip_serializing_if = "Option::is_none")] + pub ca_cert: Option, +} + +impl Config { + pub fn new(external_id: String, external_key: String) -> Config { + Config { + client_id: None, + magistrala_secret: None, + channels: None, + external_id, + external_key, + content: None, + state: None, + client_cert: None, + ca_cert: None, + } + } +} + diff --git a/bootstrap/src/models/config_channels_inner.rs b/bootstrap/src/models/config_channels_inner.rs new file mode 100644 index 00000000..a62a12f3 --- /dev/null +++ b/bootstrap/src/models/config_channels_inner.rs @@ -0,0 +1,36 @@ +/* + * SuperMQ Bootstrap service + * + * HTTP API for managing platform clients configuration. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ConfigChannelsInner { + /// Channel unique identifier. + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + /// Name of the Channel. + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + /// Custom metadata related to the Channel. + #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")] + pub metadata: Option, +} + +impl ConfigChannelsInner { + pub fn new() -> ConfigChannelsInner { + ConfigChannelsInner { + id: None, + name: None, + metadata: None, + } + } +} + diff --git a/bootstrap/src/models/config_list.rs b/bootstrap/src/models/config_list.rs new file mode 100644 index 00000000..d2b683be --- /dev/null +++ b/bootstrap/src/models/config_list.rs @@ -0,0 +1,39 @@ +/* + * SuperMQ Bootstrap service + * + * HTTP API for managing platform clients configuration. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ConfigList { + /// Total number of results. + #[serde(rename = "total", skip_serializing_if = "Option::is_none")] + pub total: Option, + /// Number of items to skip during retrieval. + #[serde(rename = "offset", skip_serializing_if = "Option::is_none")] + pub offset: Option, + /// Size of the subset to retrieve. + #[serde(rename = "limit", skip_serializing_if = "Option::is_none")] + pub limit: Option, + #[serde(rename = "configs")] + pub configs: Vec, +} + +impl ConfigList { + pub fn new(configs: Vec) -> ConfigList { + ConfigList { + total: None, + offset: None, + limit: None, + configs, + } + } +} + diff --git a/bootstrap/src/models/config_update_certs.rs b/bootstrap/src/models/config_update_certs.rs new file mode 100644 index 00000000..16c4dd3b --- /dev/null +++ b/bootstrap/src/models/config_update_certs.rs @@ -0,0 +1,40 @@ +/* + * SuperMQ Bootstrap service + * + * HTTP API for managing platform clients configuration. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ConfigUpdateCerts { + /// Corresponding SuperMQ Client ID. + #[serde(rename = "client_id")] + pub client_id: uuid::Uuid, + /// Client certificate. + #[serde(rename = "client_cert", skip_serializing_if = "Option::is_none")] + pub client_cert: Option, + /// Key for the client_cert. + #[serde(rename = "client_key")] + pub client_key: String, + /// Issuing CA certificate. + #[serde(rename = "ca_cert", skip_serializing_if = "Option::is_none")] + pub ca_cert: Option, +} + +impl ConfigUpdateCerts { + pub fn new(client_id: uuid::Uuid, client_key: String) -> ConfigUpdateCerts { + ConfigUpdateCerts { + client_id, + client_cert: None, + client_key, + ca_cert: None, + } + } +} + diff --git a/bootstrap/src/models/create_config_request.rs b/bootstrap/src/models/create_config_request.rs new file mode 100644 index 00000000..3b49f5e3 --- /dev/null +++ b/bootstrap/src/models/create_config_request.rs @@ -0,0 +1,56 @@ +/* + * SuperMQ Bootstrap service + * + * HTTP API for managing platform clients configuration. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct CreateConfigRequest { + /// External ID (MAC address or some unique identifier). + #[serde(rename = "external_id")] + pub external_id: String, + /// External key. + #[serde(rename = "external_key")] + pub external_key: String, + /// ID of the corresponding SuperMQ Client. + #[serde(rename = "client_id", skip_serializing_if = "Option::is_none")] + pub client_id: Option, + #[serde(rename = "channels", skip_serializing_if = "Option::is_none")] + pub channels: Option>, + #[serde(rename = "content", skip_serializing_if = "Option::is_none")] + pub content: Option, + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + /// Client Certificate. + #[serde(rename = "client_cert", skip_serializing_if = "Option::is_none")] + pub client_cert: Option, + /// Client Private Key. + #[serde(rename = "client_key", skip_serializing_if = "Option::is_none")] + pub client_key: Option, + #[serde(rename = "ca_cert", skip_serializing_if = "Option::is_none")] + pub ca_cert: Option, +} + +impl CreateConfigRequest { + pub fn new(external_id: String, external_key: String) -> CreateConfigRequest { + CreateConfigRequest { + external_id, + external_key, + client_id: None, + channels: None, + content: None, + name: None, + client_cert: None, + client_key: None, + ca_cert: None, + } + } +} + diff --git a/bootstrap/src/models/health_info.rs b/bootstrap/src/models/health_info.rs new file mode 100644 index 00000000..6be663be --- /dev/null +++ b/bootstrap/src/models/health_info.rs @@ -0,0 +1,60 @@ +/* + * SuperMQ Bootstrap service + * + * HTTP API for managing platform clients configuration. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct HealthInfo { + /// Service status. + #[serde(rename = "status", skip_serializing_if = "Option::is_none")] + pub status: Option, + /// Service version. + #[serde(rename = "version", skip_serializing_if = "Option::is_none")] + pub version: Option, + /// Service commit hash. + #[serde(rename = "commit", skip_serializing_if = "Option::is_none")] + pub commit: Option, + /// Service description. + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option, + /// Service build time. + #[serde(rename = "build_time", skip_serializing_if = "Option::is_none")] + pub build_time: Option, + /// Service instance ID. + #[serde(rename = "instance_id", skip_serializing_if = "Option::is_none")] + pub instance_id: Option, +} + +impl HealthInfo { + pub fn new() -> HealthInfo { + HealthInfo { + status: None, + version: None, + commit: None, + description: None, + build_time: None, + instance_id: None, + } + } +} +/// Service status. +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Status { + #[serde(rename = "pass")] + Pass, +} + +impl Default for Status { + fn default() -> Status { + Self::Pass + } +} + diff --git a/bootstrap/src/models/mod.rs b/bootstrap/src/models/mod.rs new file mode 100644 index 00000000..47d59c9f --- /dev/null +++ b/bootstrap/src/models/mod.rs @@ -0,0 +1,24 @@ +pub mod bootstrap_config; +pub use self::bootstrap_config::BootstrapConfig; +pub mod config; +pub use self::config::Config; +pub mod config_channels_inner; +pub use self::config_channels_inner::ConfigChannelsInner; +pub mod config_list; +pub use self::config_list::ConfigList; +pub mod config_update_certs; +pub use self::config_update_certs::ConfigUpdateCerts; +pub mod create_config_request; +pub use self::create_config_request::CreateConfigRequest; +pub mod health_info; +pub use self::health_info::HealthInfo; +pub mod state; +pub use self::state::State; +pub mod update_config_certs_request; +pub use self::update_config_certs_request::UpdateConfigCertsRequest; +pub mod update_config_connections_request; +pub use self::update_config_connections_request::UpdateConfigConnectionsRequest; +pub mod update_config_request; +pub use self::update_config_request::UpdateConfigRequest; +pub mod update_config_state_request; +pub use self::update_config_state_request::UpdateConfigStateRequest; diff --git a/bootstrap/src/models/state.rs b/bootstrap/src/models/state.rs new file mode 100644 index 00000000..36346572 --- /dev/null +++ b/bootstrap/src/models/state.rs @@ -0,0 +1,37 @@ +/* + * SuperMQ Bootstrap service + * + * HTTP API for managing platform clients configuration. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +use serde_repr::{Serialize_repr,Deserialize_repr}; +/// +#[repr(i64)] +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr)] +pub enum State { + Variant0 = 0, + Variant1 = 1, + +} + +impl std::fmt::Display for State { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{}", match self { + Self::Variant0 => "0", + Self::Variant1 => "1", + }) + } +} +impl Default for State { + fn default() -> State { + Self::Variant0 + } +} + diff --git a/bootstrap/src/models/update_config_certs_request.rs b/bootstrap/src/models/update_config_certs_request.rs new file mode 100644 index 00000000..b882f276 --- /dev/null +++ b/bootstrap/src/models/update_config_certs_request.rs @@ -0,0 +1,33 @@ +/* + * SuperMQ Bootstrap service + * + * HTTP API for managing platform clients configuration. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct UpdateConfigCertsRequest { + #[serde(rename = "client_cert", skip_serializing_if = "Option::is_none")] + pub client_cert: Option, + #[serde(rename = "client_key", skip_serializing_if = "Option::is_none")] + pub client_key: Option, + #[serde(rename = "ca_cert", skip_serializing_if = "Option::is_none")] + pub ca_cert: Option, +} + +impl UpdateConfigCertsRequest { + pub fn new() -> UpdateConfigCertsRequest { + UpdateConfigCertsRequest { + client_cert: None, + client_key: None, + ca_cert: None, + } + } +} + diff --git a/bootstrap/src/models/update_config_connections_request.rs b/bootstrap/src/models/update_config_connections_request.rs new file mode 100644 index 00000000..8f6478e6 --- /dev/null +++ b/bootstrap/src/models/update_config_connections_request.rs @@ -0,0 +1,27 @@ +/* + * SuperMQ Bootstrap service + * + * HTTP API for managing platform clients configuration. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct UpdateConfigConnectionsRequest { + #[serde(rename = "channels", skip_serializing_if = "Option::is_none")] + pub channels: Option>, +} + +impl UpdateConfigConnectionsRequest { + pub fn new() -> UpdateConfigConnectionsRequest { + UpdateConfigConnectionsRequest { + channels: None, + } + } +} + diff --git a/bootstrap/src/models/update_config_request.rs b/bootstrap/src/models/update_config_request.rs new file mode 100644 index 00000000..9302611d --- /dev/null +++ b/bootstrap/src/models/update_config_request.rs @@ -0,0 +1,30 @@ +/* + * SuperMQ Bootstrap service + * + * HTTP API for managing platform clients configuration. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct UpdateConfigRequest { + #[serde(rename = "content")] + pub content: String, + #[serde(rename = "name")] + pub name: String, +} + +impl UpdateConfigRequest { + pub fn new(content: String, name: String) -> UpdateConfigRequest { + UpdateConfigRequest { + content, + name, + } + } +} + diff --git a/bootstrap/src/models/update_config_state_request.rs b/bootstrap/src/models/update_config_state_request.rs new file mode 100644 index 00000000..8b0b1afe --- /dev/null +++ b/bootstrap/src/models/update_config_state_request.rs @@ -0,0 +1,27 @@ +/* + * SuperMQ Bootstrap service + * + * HTTP API for managing platform clients configuration. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct UpdateConfigStateRequest { + #[serde(rename = "state", skip_serializing_if = "Option::is_none")] + pub state: Option, +} + +impl UpdateConfigStateRequest { + pub fn new() -> UpdateConfigStateRequest { + UpdateConfigStateRequest { + state: None, + } + } +} + diff --git a/certs/.gitignore b/certs/.gitignore new file mode 100644 index 00000000..6aa10640 --- /dev/null +++ b/certs/.gitignore @@ -0,0 +1,3 @@ +/target/ +**/*.rs.bk +Cargo.lock diff --git a/certs/.openapi-generator-ignore b/certs/.openapi-generator-ignore new file mode 100644 index 00000000..7484ee59 --- /dev/null +++ b/certs/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/certs/.openapi-generator/FILES b/certs/.openapi-generator/FILES new file mode 100644 index 00000000..a7e76136 --- /dev/null +++ b/certs/.openapi-generator/FILES @@ -0,0 +1,28 @@ +.gitignore +.openapi-generator-ignore +.travis.yml +Cargo.toml +README.md +docs/Cert.md +docs/CertsApi.md +docs/CertsPage.md +docs/CreateCertRequest.md +docs/HealthApi.md +docs/HealthInfo.md +docs/Revoke.md +docs/Serial.md +docs/SerialsPage.md +git_push.sh +src/apis/certs_api.rs +src/apis/configuration.rs +src/apis/health_api.rs +src/apis/mod.rs +src/lib.rs +src/models/cert.rs +src/models/certs_page.rs +src/models/create_cert_request.rs +src/models/health_info.rs +src/models/mod.rs +src/models/revoke.rs +src/models/serial.rs +src/models/serials_page.rs diff --git a/certs/.openapi-generator/VERSION b/certs/.openapi-generator/VERSION new file mode 100644 index 00000000..758bb9c8 --- /dev/null +++ b/certs/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.10.0 diff --git a/certs/.travis.yml b/certs/.travis.yml new file mode 100644 index 00000000..22761ba7 --- /dev/null +++ b/certs/.travis.yml @@ -0,0 +1 @@ +language: rust diff --git a/certs/Cargo.toml b/certs/Cargo.toml new file mode 100644 index 00000000..5cbb502b --- /dev/null +++ b/certs/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "certs-openapi" +version = "0.15.1" +authors = ["info@abstractmachines.fr"] +description = "HTTP API for Certs service Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) " +license = "Apache 2.0" +edition = "2021" + +[dependencies] +serde = { version = "^1.0", features = ["derive"] } +serde_json = "^1.0" +serde_repr = "^0.1" +url = "^2.5" +uuid = { version = "^1.8", features = ["serde", "v4"] } +reqwest = { version = "^0.12", features = ["json", "multipart"] } diff --git a/certs/README.md b/certs/README.md new file mode 100644 index 00000000..1e03afac --- /dev/null +++ b/certs/README.md @@ -0,0 +1,59 @@ +# Rust API client for openapi + +HTTP API for Certs service +Some useful links: +- [The SuperMQ repository](https://github.com/absmach/supermq) + + + +## Overview + +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://openapis.org) from a remote server, you can easily generate an API client. + +- API version: 0.15.1 +- Package version: 0.15.1 +- Generator version: 7.10.0 +- Build package: `org.openapitools.codegen.languages.RustClientCodegen` + +## Installation + +Put the package under your project folder in a directory named `openapi` and add the following to `Cargo.toml` under `[dependencies]`: + +``` +openapi = { path = "./openapi" } +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost:9019* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*CertsApi* | [**create_cert**](docs/CertsApi.md#create_cert) | **POST** /{domainID}/certs | Creates a certificate for client +*CertsApi* | [**get_cert**](docs/CertsApi.md#get_cert) | **GET** /{domainID}/certs/{certID} | Retrieves a certificate +*CertsApi* | [**get_serials**](docs/CertsApi.md#get_serials) | **GET** /{domainID}/serials/{clientID} | Retrieves certificates' serial IDs +*CertsApi* | [**revoke_cert**](docs/CertsApi.md#revoke_cert) | **DELETE** /{domainID}/certs/{certID} | Revokes a certificate +*HealthApi* | [**health_get**](docs/HealthApi.md#health_get) | **GET** /health | Retrieves service health check info. + + +## Documentation For Models + + - [Cert](docs/Cert.md) + - [CertsPage](docs/CertsPage.md) + - [CreateCertRequest](docs/CreateCertRequest.md) + - [HealthInfo](docs/HealthInfo.md) + - [Revoke](docs/Revoke.md) + - [Serial](docs/Serial.md) + - [SerialsPage](docs/SerialsPage.md) + + +To get access to the crate's generated documentation, use: + +``` +cargo doc --open +``` + +## Author + +info@abstractmachines.fr + diff --git a/certs/docs/Cert.md b/certs/docs/Cert.md new file mode 100644 index 00000000..9e8a84fb --- /dev/null +++ b/certs/docs/Cert.md @@ -0,0 +1,16 @@ +# Cert + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**client_id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | Corresponding SuperMQ Client ID. | [optional] +**client_cert** | Option<**String**> | Client Certificate. | [optional] +**client_key** | Option<**String**> | Key for the client_cert. | [optional] +**issuing_ca** | Option<**String**> | CA Certificate that is used to issue client certs, usually intermediate. | [optional] +**serial** | Option<**String**> | Certificate serial | [optional] +**expire** | Option<**String**> | Certificate expiry date | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/certs/docs/CertsApi.md b/certs/docs/CertsApi.md new file mode 100644 index 00000000..b6fff3ec --- /dev/null +++ b/certs/docs/CertsApi.md @@ -0,0 +1,136 @@ +# \CertsApi + +All URIs are relative to *http://localhost:9019* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_cert**](CertsApi.md#create_cert) | **POST** /{domainID}/certs | Creates a certificate for client +[**get_cert**](CertsApi.md#get_cert) | **GET** /{domainID}/certs/{certID} | Retrieves a certificate +[**get_serials**](CertsApi.md#get_serials) | **GET** /{domainID}/serials/{clientID} | Retrieves certificates' serial IDs +[**revoke_cert**](CertsApi.md#revoke_cert) | **DELETE** /{domainID}/certs/{certID} | Revokes a certificate + + + +## create_cert + +> create_cert(domain_id, create_cert_request) +Creates a certificate for client + +Creates a certificate for client + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**create_cert_request** | Option<[**CreateCertRequest**](CreateCertRequest.md)> | Issues a certificate that is required for mTLS. To create a certificate for a client provide a client id, data identifying particular client will be embedded into the Certificate. x509 and ECC certificates are supported when using when Vault is used as PKI. | | + +### Return type + + (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_cert + +> models::Cert get_cert(domain_id, cert_id) +Retrieves a certificate + +Retrieves a certificate for a given cert ID. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**cert_id** | **uuid::Uuid** | Serial of certificate | [required] | + +### Return type + +[**models::Cert**](Cert.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_serials + +> models::SerialsPage get_serials(domain_id, client_id) +Retrieves certificates' serial IDs + +Retrieves a list of certificates' serial IDs for a given client ID. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**client_id** | **uuid::Uuid** | Client ID | [required] | + +### Return type + +[**models::SerialsPage**](SerialsPage.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## revoke_cert + +> models::Revoke revoke_cert(domain_id, cert_id) +Revokes a certificate + +Revokes a certificate for a given cert ID. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**cert_id** | **uuid::Uuid** | Serial of certificate | [required] | + +### Return type + +[**models::Revoke**](Revoke.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/certs/docs/CertsPage.md b/certs/docs/CertsPage.md new file mode 100644 index 00000000..d7d9350b --- /dev/null +++ b/certs/docs/CertsPage.md @@ -0,0 +1,14 @@ +# CertsPage + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**certs** | Option<[**Vec**](Cert.md)> | | [optional] +**total** | Option<**i32**> | Total number of items. | [optional] +**offset** | Option<**i32**> | Number of items to skip during retrieval. | [optional] +**limit** | Option<**i32**> | Maximum number of items to return in one page. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/certs/docs/CreateCertRequest.md b/certs/docs/CreateCertRequest.md new file mode 100644 index 00000000..dfb718ea --- /dev/null +++ b/certs/docs/CreateCertRequest.md @@ -0,0 +1,12 @@ +# CreateCertRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**client_id** | [**uuid::Uuid**](uuid::Uuid.md) | | +**ttl** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/certs/docs/HealthApi.md b/certs/docs/HealthApi.md new file mode 100644 index 00000000..f0aeb8bc --- /dev/null +++ b/certs/docs/HealthApi.md @@ -0,0 +1,34 @@ +# \HealthApi + +All URIs are relative to *http://localhost:9019* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**health_get**](HealthApi.md#health_get) | **GET** /health | Retrieves service health check info. + + + +## health_get + +> models::HealthInfo health_get() +Retrieves service health check info. + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**models::HealthInfo**](health_info.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/health+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/certs/docs/HealthInfo.md b/certs/docs/HealthInfo.md new file mode 100644 index 00000000..ee8f5c6b --- /dev/null +++ b/certs/docs/HealthInfo.md @@ -0,0 +1,16 @@ +# HealthInfo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | Option<**String**> | Service status. | [optional] +**version** | Option<**String**> | Service version. | [optional] +**commit** | Option<**String**> | Service commit hash. | [optional] +**description** | Option<**String**> | Service description. | [optional] +**build_time** | Option<**String**> | Service build time. | [optional] +**instance_id** | Option<**String**> | Service instance ID. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/certs/docs/Revoke.md b/certs/docs/Revoke.md new file mode 100644 index 00000000..50234781 --- /dev/null +++ b/certs/docs/Revoke.md @@ -0,0 +1,11 @@ +# Revoke + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**revocation_time** | Option<**String**> | Certificate revocation time | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/certs/docs/Serial.md b/certs/docs/Serial.md new file mode 100644 index 00000000..b2f8aa4d --- /dev/null +++ b/certs/docs/Serial.md @@ -0,0 +1,11 @@ +# Serial + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**serial** | Option<**String**> | Certificate serial | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/certs/docs/SerialsPage.md b/certs/docs/SerialsPage.md new file mode 100644 index 00000000..53a02dd6 --- /dev/null +++ b/certs/docs/SerialsPage.md @@ -0,0 +1,14 @@ +# SerialsPage + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**serials** | Option<**Vec**> | Certificate serials IDs. | [optional] +**total** | Option<**i32**> | Total number of items. | [optional] +**offset** | Option<**i32**> | Number of items to skip during retrieval. | [optional] +**limit** | Option<**i32**> | Maximum number of items to return in one page. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/certs/git_push.sh b/certs/git_push.sh new file mode 100644 index 00000000..f53a75d4 --- /dev/null +++ b/certs/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/certs/src/apis/certs_api.rs b/certs/src/apis/certs_api.rs new file mode 100644 index 00000000..bddd4701 --- /dev/null +++ b/certs/src/apis/certs_api.rs @@ -0,0 +1,195 @@ +/* + * SuperMQ Certs service + * + * HTTP API for Certs service Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`create_cert`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CreateCertError { + Status400(), + Status401(), + Status403(), + Status415(), + Status422(), + Status500(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_cert`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetCertError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_serials`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetSerialsError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`revoke_cert`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RevokeCertError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(), + UnknownValue(serde_json::Value), +} + + +/// Creates a certificate for client +pub async fn create_cert(configuration: &configuration::Configuration, domain_id: &str, create_cert_request: Option) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/certs", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&create_cert_request); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Retrieves a certificate for a given cert ID. +pub async fn get_cert(configuration: &configuration::Configuration, domain_id: &str, cert_id: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/certs/{certID}", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), certID=crate::apis::urlencode(cert_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Retrieves a list of certificates' serial IDs for a given client ID. +pub async fn get_serials(configuration: &configuration::Configuration, domain_id: &str, client_id: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/serials/{clientID}", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), clientID=crate::apis::urlencode(client_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Revokes a certificate for a given cert ID. +pub async fn revoke_cert(configuration: &configuration::Configuration, domain_id: &str, cert_id: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/certs/{certID}", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), certID=crate::apis::urlencode(cert_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/certs/src/apis/configuration.rs b/certs/src/apis/configuration.rs new file mode 100644 index 00000000..fef368bc --- /dev/null +++ b/certs/src/apis/configuration.rs @@ -0,0 +1,51 @@ +/* + * SuperMQ Certs service + * + * HTTP API for Certs service Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + + + +#[derive(Debug, Clone)] +pub struct Configuration { + pub base_path: String, + pub user_agent: Option, + pub client: reqwest::Client, + pub basic_auth: Option, + pub oauth_access_token: Option, + pub bearer_access_token: Option, + pub api_key: Option, +} + +pub type BasicAuth = (String, Option); + +#[derive(Debug, Clone)] +pub struct ApiKey { + pub prefix: Option, + pub key: String, +} + + +impl Configuration { + pub fn new() -> Configuration { + Configuration::default() + } +} + +impl Default for Configuration { + fn default() -> Self { + Configuration { + base_path: "http://localhost:9019".to_owned(), + user_agent: Some("OpenAPI-Generator/0.15.1/rust".to_owned()), + client: reqwest::Client::new(), + basic_auth: None, + oauth_access_token: None, + bearer_access_token: None, + api_key: None, + } + } +} diff --git a/certs/src/apis/health_api.rs b/certs/src/apis/health_api.rs new file mode 100644 index 00000000..aa6f4ff4 --- /dev/null +++ b/certs/src/apis/health_api.rs @@ -0,0 +1,53 @@ +/* + * SuperMQ Certs service + * + * HTTP API for Certs service Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`health_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum HealthGetError { + Status500(), + UnknownValue(serde_json::Value), +} + + +pub async fn health_get(configuration: &configuration::Configuration, ) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/health", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/certs/src/apis/mod.rs b/certs/src/apis/mod.rs new file mode 100644 index 00000000..807c7e84 --- /dev/null +++ b/certs/src/apis/mod.rs @@ -0,0 +1,96 @@ +use std::error; +use std::fmt; + +#[derive(Debug, Clone)] +pub struct ResponseContent { + pub status: reqwest::StatusCode, + pub content: String, + pub entity: Option, +} + +#[derive(Debug)] +pub enum Error { + Reqwest(reqwest::Error), + Serde(serde_json::Error), + Io(std::io::Error), + ResponseError(ResponseContent), +} + +impl fmt::Display for Error { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + let (module, e) = match self { + Error::Reqwest(e) => ("reqwest", e.to_string()), + Error::Serde(e) => ("serde", e.to_string()), + Error::Io(e) => ("IO", e.to_string()), + Error::ResponseError(e) => ("response", format!("status code {}", e.status)), + }; + write!(f, "error in {}: {}", module, e) + } +} + +impl error::Error for Error { + fn source(&self) -> Option<&(dyn error::Error + 'static)> { + Some(match self { + Error::Reqwest(e) => e, + Error::Serde(e) => e, + Error::Io(e) => e, + Error::ResponseError(_) => return None, + }) + } +} + +impl From for Error { + fn from(e: reqwest::Error) -> Self { + Error::Reqwest(e) + } +} + +impl From for Error { + fn from(e: serde_json::Error) -> Self { + Error::Serde(e) + } +} + +impl From for Error { + fn from(e: std::io::Error) -> Self { + Error::Io(e) + } +} + +pub fn urlencode>(s: T) -> String { + ::url::form_urlencoded::byte_serialize(s.as_ref().as_bytes()).collect() +} + +pub fn parse_deep_object(prefix: &str, value: &serde_json::Value) -> Vec<(String, String)> { + if let serde_json::Value::Object(object) = value { + let mut params = vec![]; + + for (key, value) in object { + match value { + serde_json::Value::Object(_) => params.append(&mut parse_deep_object( + &format!("{}[{}]", prefix, key), + value, + )), + serde_json::Value::Array(array) => { + for (i, value) in array.iter().enumerate() { + params.append(&mut parse_deep_object( + &format!("{}[{}][{}]", prefix, key, i), + value, + )); + } + }, + serde_json::Value::String(s) => params.push((format!("{}[{}]", prefix, key), s.clone())), + _ => params.push((format!("{}[{}]", prefix, key), value.to_string())), + } + } + + return params; + } + + unimplemented!("Only objects are supported with style=deepObject") +} + +pub mod certs_api; +pub mod health_api; + +pub mod configuration; diff --git a/certs/src/lib.rs b/certs/src/lib.rs new file mode 100644 index 00000000..e1520628 --- /dev/null +++ b/certs/src/lib.rs @@ -0,0 +1,11 @@ +#![allow(unused_imports)] +#![allow(clippy::too_many_arguments)] + +extern crate serde_repr; +extern crate serde; +extern crate serde_json; +extern crate url; +extern crate reqwest; + +pub mod apis; +pub mod models; diff --git a/certs/src/models/cert.rs b/certs/src/models/cert.rs new file mode 100644 index 00000000..67d27cdc --- /dev/null +++ b/certs/src/models/cert.rs @@ -0,0 +1,48 @@ +/* + * SuperMQ Certs service + * + * HTTP API for Certs service Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Cert { + /// Corresponding SuperMQ Client ID. + #[serde(rename = "client_id", skip_serializing_if = "Option::is_none")] + pub client_id: Option, + /// Client Certificate. + #[serde(rename = "client_cert", skip_serializing_if = "Option::is_none")] + pub client_cert: Option, + /// Key for the client_cert. + #[serde(rename = "client_key", skip_serializing_if = "Option::is_none")] + pub client_key: Option, + /// CA Certificate that is used to issue client certs, usually intermediate. + #[serde(rename = "issuing_ca", skip_serializing_if = "Option::is_none")] + pub issuing_ca: Option, + /// Certificate serial + #[serde(rename = "serial", skip_serializing_if = "Option::is_none")] + pub serial: Option, + /// Certificate expiry date + #[serde(rename = "expire", skip_serializing_if = "Option::is_none")] + pub expire: Option, +} + +impl Cert { + pub fn new() -> Cert { + Cert { + client_id: None, + client_cert: None, + client_key: None, + issuing_ca: None, + serial: None, + expire: None, + } + } +} + diff --git a/certs/src/models/certs_page.rs b/certs/src/models/certs_page.rs new file mode 100644 index 00000000..070a03d6 --- /dev/null +++ b/certs/src/models/certs_page.rs @@ -0,0 +1,39 @@ +/* + * SuperMQ Certs service + * + * HTTP API for Certs service Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct CertsPage { + #[serde(rename = "certs", skip_serializing_if = "Option::is_none")] + pub certs: Option>, + /// Total number of items. + #[serde(rename = "total", skip_serializing_if = "Option::is_none")] + pub total: Option, + /// Number of items to skip during retrieval. + #[serde(rename = "offset", skip_serializing_if = "Option::is_none")] + pub offset: Option, + /// Maximum number of items to return in one page. + #[serde(rename = "limit", skip_serializing_if = "Option::is_none")] + pub limit: Option, +} + +impl CertsPage { + pub fn new() -> CertsPage { + CertsPage { + certs: None, + total: None, + offset: None, + limit: None, + } + } +} + diff --git a/certs/src/models/create_cert_request.rs b/certs/src/models/create_cert_request.rs new file mode 100644 index 00000000..176da43a --- /dev/null +++ b/certs/src/models/create_cert_request.rs @@ -0,0 +1,30 @@ +/* + * SuperMQ Certs service + * + * HTTP API for Certs service Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct CreateCertRequest { + #[serde(rename = "client_id")] + pub client_id: uuid::Uuid, + #[serde(rename = "ttl")] + pub ttl: String, +} + +impl CreateCertRequest { + pub fn new(client_id: uuid::Uuid, ttl: String) -> CreateCertRequest { + CreateCertRequest { + client_id, + ttl, + } + } +} + diff --git a/certs/src/models/health_info.rs b/certs/src/models/health_info.rs new file mode 100644 index 00000000..b2d7b1a7 --- /dev/null +++ b/certs/src/models/health_info.rs @@ -0,0 +1,60 @@ +/* + * SuperMQ Certs service + * + * HTTP API for Certs service Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct HealthInfo { + /// Service status. + #[serde(rename = "status", skip_serializing_if = "Option::is_none")] + pub status: Option, + /// Service version. + #[serde(rename = "version", skip_serializing_if = "Option::is_none")] + pub version: Option, + /// Service commit hash. + #[serde(rename = "commit", skip_serializing_if = "Option::is_none")] + pub commit: Option, + /// Service description. + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option, + /// Service build time. + #[serde(rename = "build_time", skip_serializing_if = "Option::is_none")] + pub build_time: Option, + /// Service instance ID. + #[serde(rename = "instance_id", skip_serializing_if = "Option::is_none")] + pub instance_id: Option, +} + +impl HealthInfo { + pub fn new() -> HealthInfo { + HealthInfo { + status: None, + version: None, + commit: None, + description: None, + build_time: None, + instance_id: None, + } + } +} +/// Service status. +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Status { + #[serde(rename = "pass")] + Pass, +} + +impl Default for Status { + fn default() -> Status { + Self::Pass + } +} + diff --git a/certs/src/models/mod.rs b/certs/src/models/mod.rs new file mode 100644 index 00000000..20fac969 --- /dev/null +++ b/certs/src/models/mod.rs @@ -0,0 +1,14 @@ +pub mod cert; +pub use self::cert::Cert; +pub mod certs_page; +pub use self::certs_page::CertsPage; +pub mod create_cert_request; +pub use self::create_cert_request::CreateCertRequest; +pub mod health_info; +pub use self::health_info::HealthInfo; +pub mod revoke; +pub use self::revoke::Revoke; +pub mod serial; +pub use self::serial::Serial; +pub mod serials_page; +pub use self::serials_page::SerialsPage; diff --git a/certs/src/models/revoke.rs b/certs/src/models/revoke.rs new file mode 100644 index 00000000..52f474de --- /dev/null +++ b/certs/src/models/revoke.rs @@ -0,0 +1,28 @@ +/* + * SuperMQ Certs service + * + * HTTP API for Certs service Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Revoke { + /// Certificate revocation time + #[serde(rename = "revocation_time", skip_serializing_if = "Option::is_none")] + pub revocation_time: Option, +} + +impl Revoke { + pub fn new() -> Revoke { + Revoke { + revocation_time: None, + } + } +} + diff --git a/certs/src/models/serial.rs b/certs/src/models/serial.rs new file mode 100644 index 00000000..a849378f --- /dev/null +++ b/certs/src/models/serial.rs @@ -0,0 +1,28 @@ +/* + * SuperMQ Certs service + * + * HTTP API for Certs service Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Serial { + /// Certificate serial + #[serde(rename = "serial", skip_serializing_if = "Option::is_none")] + pub serial: Option, +} + +impl Serial { + pub fn new() -> Serial { + Serial { + serial: None, + } + } +} + diff --git a/certs/src/models/serials_page.rs b/certs/src/models/serials_page.rs new file mode 100644 index 00000000..10f04963 --- /dev/null +++ b/certs/src/models/serials_page.rs @@ -0,0 +1,40 @@ +/* + * SuperMQ Certs service + * + * HTTP API for Certs service Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct SerialsPage { + /// Certificate serials IDs. + #[serde(rename = "serials", skip_serializing_if = "Option::is_none")] + pub serials: Option>, + /// Total number of items. + #[serde(rename = "total", skip_serializing_if = "Option::is_none")] + pub total: Option, + /// Number of items to skip during retrieval. + #[serde(rename = "offset", skip_serializing_if = "Option::is_none")] + pub offset: Option, + /// Maximum number of items to return in one page. + #[serde(rename = "limit", skip_serializing_if = "Option::is_none")] + pub limit: Option, +} + +impl SerialsPage { + pub fn new() -> SerialsPage { + SerialsPage { + serials: None, + total: None, + offset: None, + limit: None, + } + } +} + diff --git a/channels/.gitignore b/channels/.gitignore new file mode 100644 index 00000000..6aa10640 --- /dev/null +++ b/channels/.gitignore @@ -0,0 +1,3 @@ +/target/ +**/*.rs.bk +Cargo.lock diff --git a/channels/.openapi-generator-ignore b/channels/.openapi-generator-ignore new file mode 100644 index 00000000..7484ee59 --- /dev/null +++ b/channels/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/channels/.openapi-generator/FILES b/channels/.openapi-generator/FILES new file mode 100644 index 00000000..4258000e --- /dev/null +++ b/channels/.openapi-generator/FILES @@ -0,0 +1,36 @@ +.gitignore +.openapi-generator-ignore +.travis.yml +Cargo.toml +README.md +docs/Channel.md +docs/ChannelConnectionReqSchema.md +docs/ChannelReqObj.md +docs/ChannelUpdate.md +docs/ChannelUpdateTags.md +docs/ChannelsApi.md +docs/ChannelsPage.md +docs/ConnectionReqSchema.md +docs/ConnectionsApi.md +docs/Error.md +docs/HealthApi.md +docs/HealthRes.md +docs/ParentGroupReqObj.md +git_push.sh +src/apis/channels_api.rs +src/apis/configuration.rs +src/apis/connections_api.rs +src/apis/health_api.rs +src/apis/mod.rs +src/lib.rs +src/models/channel.rs +src/models/channel_connection_req_schema.rs +src/models/channel_req_obj.rs +src/models/channel_update.rs +src/models/channel_update_tags.rs +src/models/channels_page.rs +src/models/connection_req_schema.rs +src/models/error.rs +src/models/health_res.rs +src/models/mod.rs +src/models/parent_group_req_obj.rs diff --git a/channels/.openapi-generator/VERSION b/channels/.openapi-generator/VERSION new file mode 100644 index 00000000..758bb9c8 --- /dev/null +++ b/channels/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.10.0 diff --git a/channels/.travis.yml b/channels/.travis.yml new file mode 100644 index 00000000..22761ba7 --- /dev/null +++ b/channels/.travis.yml @@ -0,0 +1 @@ +language: rust diff --git a/channels/Cargo.toml b/channels/Cargo.toml new file mode 100644 index 00000000..3a990402 --- /dev/null +++ b/channels/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "channels-openapi" +version = "0.15.1" +authors = ["info@abstractmachines.fr"] +description = "This is the Channels Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform channels. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) " +license = "Apache 2.0" +edition = "2021" + +[dependencies] +serde = { version = "^1.0", features = ["derive"] } +serde_json = "^1.0" +serde_repr = "^0.1" +url = "^2.5" +uuid = { version = "^1.8", features = ["serde", "v4"] } +reqwest = { version = "^0.12", features = ["json", "multipart"] } diff --git a/channels/README.md b/channels/README.md new file mode 100644 index 00000000..7cabb94f --- /dev/null +++ b/channels/README.md @@ -0,0 +1,73 @@ +# Rust API client for openapi + +This is the Channels Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform channels. You can now help us improve the API whether it's by making changes to the definition itself or to the code. +Some useful links: +- [The SuperMQ repository](https://github.com/absmach/supermq) + + + +## Overview + +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://openapis.org) from a remote server, you can easily generate an API client. + +- API version: 0.15.1 +- Package version: 0.15.1 +- Generator version: 7.10.0 +- Build package: `org.openapitools.codegen.languages.RustClientCodegen` + +## Installation + +Put the package under your project folder in a directory named `openapi` and add the following to `Cargo.toml` under `[dependencies]`: + +``` +openapi = { path = "./openapi" } +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost:9005* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*ChannelsApi* | [**create_channel**](docs/ChannelsApi.md#create_channel) | **POST** /{domainID}/channels | Creates new channel +*ChannelsApi* | [**create_channels**](docs/ChannelsApi.md#create_channels) | **POST** /{domainID}/channels/bulk | Creates new channels +*ChannelsApi* | [**disable_channel**](docs/ChannelsApi.md#disable_channel) | **POST** /{domainID}/channels/{chanID}/disable | Disables a channel +*ChannelsApi* | [**domain_id_channels_chan_id_delete**](docs/ChannelsApi.md#domain_id_channels_chan_id_delete) | **DELETE** /{domainID}/channels/{chanID} | Delete channel for given channel id. +*ChannelsApi* | [**enable_channel**](docs/ChannelsApi.md#enable_channel) | **POST** /{domainID}/channels/{chanID}/enable | Enables a channel +*ChannelsApi* | [**get_channel**](docs/ChannelsApi.md#get_channel) | **GET** /{domainID}/channels/{chanID} | Retrieves channel info. +*ChannelsApi* | [**list_channels**](docs/ChannelsApi.md#list_channels) | **GET** /{domainID}/channels | Lists channels. +*ChannelsApi* | [**remove_channel_parent_group**](docs/ChannelsApi.md#remove_channel_parent_group) | **DELETE** /{domainID}/channels/{chanID}/parent | Removes a parent group from a channel. +*ChannelsApi* | [**set_channel_parent_group**](docs/ChannelsApi.md#set_channel_parent_group) | **POST** /{domainID}/channels/{chanID}/parent | Sets a parent group for a channel +*ChannelsApi* | [**update_channel**](docs/ChannelsApi.md#update_channel) | **PATCH** /{domainID}/channels/{chanID} | Updates channel data. +*ChannelsApi* | [**update_channel_tags**](docs/ChannelsApi.md#update_channel_tags) | **PATCH** /{domainID}/channels/{chanID}/tags | Updates channel tags. +*ConnectionsApi* | [**connect_clients_and_channels**](docs/ConnectionsApi.md#connect_clients_and_channels) | **POST** /{domainID}/channels/connect | Connects client and channel. +*ConnectionsApi* | [**connect_clients_to_channel**](docs/ConnectionsApi.md#connect_clients_to_channel) | **POST** /{domainID}/channels/{chanID}/connect | Connects clients to a channel +*ConnectionsApi* | [**disconnect_clients_and_channels**](docs/ConnectionsApi.md#disconnect_clients_and_channels) | **POST** /{domainID}/channels/disconnect | Disconnects client and channel. +*ConnectionsApi* | [**disconnect_clients_from_channel**](docs/ConnectionsApi.md#disconnect_clients_from_channel) | **POST** /{domainID}/channels/{chanID}/disconnect | Disconnects clients from a channel +*HealthApi* | [**health_get**](docs/HealthApi.md#health_get) | **GET** /health | Retrieves service health check info. + + +## Documentation For Models + + - [Channel](docs/Channel.md) + - [ChannelConnectionReqSchema](docs/ChannelConnectionReqSchema.md) + - [ChannelReqObj](docs/ChannelReqObj.md) + - [ChannelUpdate](docs/ChannelUpdate.md) + - [ChannelUpdateTags](docs/ChannelUpdateTags.md) + - [ChannelsPage](docs/ChannelsPage.md) + - [ConnectionReqSchema](docs/ConnectionReqSchema.md) + - [Error](docs/Error.md) + - [HealthRes](docs/HealthRes.md) + - [ParentGroupReqObj](docs/ParentGroupReqObj.md) + + +To get access to the crate's generated documentation, use: + +``` +cargo doc --open +``` + +## Author + +info@abstractmachines.fr + diff --git a/channels/docs/Channel.md b/channels/docs/Channel.md new file mode 100644 index 00000000..6cc6c7aa --- /dev/null +++ b/channels/docs/Channel.md @@ -0,0 +1,21 @@ +# Channel + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | Unique channel identifier generated by the service. | [optional] +**name** | Option<**String**> | Free-form channel name. Channel name is unique on the given hierarchy level. | [optional] +**domain_id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | ID of the domain to which the group belongs. | [optional] +**parent_id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | Channel parent identifier. | [optional] +**description** | Option<**String**> | Channel description, free form text. | [optional] +**metadata** | Option<[**serde_json::Value**](.md)> | Arbitrary, object-encoded channels's data. | [optional] +**path** | Option<**String**> | Hierarchy path, concatenated ids of channel ancestors. | [optional] +**level** | Option<**i32**> | Level in hierarchy, distance from the root channel. | [optional] +**created_at** | Option<**String**> | Datetime when the channel was created. | [optional] +**updated_at** | Option<**String**> | Datetime when the channel was created. | [optional] +**status** | Option<**String**> | Channel Status | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/channels/docs/ChannelConnectionReqSchema.md b/channels/docs/ChannelConnectionReqSchema.md new file mode 100644 index 00000000..83e0d4c9 --- /dev/null +++ b/channels/docs/ChannelConnectionReqSchema.md @@ -0,0 +1,12 @@ +# ChannelConnectionReqSchema + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**client_ids** | Option<[**Vec**](serde_json::Value.md)> | Client IDs | [optional] +**types** | Option<[**Vec**](serde_json::Value.md)> | Connection types. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/channels/docs/ChannelReqObj.md b/channels/docs/ChannelReqObj.md new file mode 100644 index 00000000..1469bb6a --- /dev/null +++ b/channels/docs/ChannelReqObj.md @@ -0,0 +1,15 @@ +# ChannelReqObj + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | Free-form channel name. Channel name is unique on the given hierarchy level. | +**description** | Option<**String**> | Channel description, free form text. | [optional] +**parent_id** | Option<**String**> | Id of parent channel, it must be existing channel. | [optional] +**metadata** | Option<[**serde_json::Value**](.md)> | Arbitrary, object-encoded channels's data. | [optional] +**status** | Option<**String**> | Channel Status | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/channels/docs/ChannelUpdate.md b/channels/docs/ChannelUpdate.md new file mode 100644 index 00000000..d9f72c9d --- /dev/null +++ b/channels/docs/ChannelUpdate.md @@ -0,0 +1,13 @@ +# ChannelUpdate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | Free-form channel name. Channel name is unique on the given hierarchy level. | +**description** | **String** | Channel description, free form text. | +**metadata** | [**serde_json::Value**](.md) | Arbitrary, object-encoded channels's data. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/channels/docs/ChannelUpdateTags.md b/channels/docs/ChannelUpdateTags.md new file mode 100644 index 00000000..5ab44380 --- /dev/null +++ b/channels/docs/ChannelUpdateTags.md @@ -0,0 +1,11 @@ +# ChannelUpdateTags + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tags** | **Vec** | Channel tags. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/channels/docs/ChannelsApi.md b/channels/docs/ChannelsApi.md new file mode 100644 index 00000000..f391b9e6 --- /dev/null +++ b/channels/docs/ChannelsApi.md @@ -0,0 +1,367 @@ +# \ChannelsApi + +All URIs are relative to *http://localhost:9005* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_channel**](ChannelsApi.md#create_channel) | **POST** /{domainID}/channels | Creates new channel +[**create_channels**](ChannelsApi.md#create_channels) | **POST** /{domainID}/channels/bulk | Creates new channels +[**disable_channel**](ChannelsApi.md#disable_channel) | **POST** /{domainID}/channels/{chanID}/disable | Disables a channel +[**domain_id_channels_chan_id_delete**](ChannelsApi.md#domain_id_channels_chan_id_delete) | **DELETE** /{domainID}/channels/{chanID} | Delete channel for given channel id. +[**enable_channel**](ChannelsApi.md#enable_channel) | **POST** /{domainID}/channels/{chanID}/enable | Enables a channel +[**get_channel**](ChannelsApi.md#get_channel) | **GET** /{domainID}/channels/{chanID} | Retrieves channel info. +[**list_channels**](ChannelsApi.md#list_channels) | **GET** /{domainID}/channels | Lists channels. +[**remove_channel_parent_group**](ChannelsApi.md#remove_channel_parent_group) | **DELETE** /{domainID}/channels/{chanID}/parent | Removes a parent group from a channel. +[**set_channel_parent_group**](ChannelsApi.md#set_channel_parent_group) | **POST** /{domainID}/channels/{chanID}/parent | Sets a parent group for a channel +[**update_channel**](ChannelsApi.md#update_channel) | **PATCH** /{domainID}/channels/{chanID} | Updates channel data. +[**update_channel_tags**](ChannelsApi.md#update_channel_tags) | **PATCH** /{domainID}/channels/{chanID}/tags | Updates channel tags. + + + +## create_channel + +> models::Channel create_channel(domain_id, channel_req_obj) +Creates new channel + +Creates new channel in domain. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**channel_req_obj** | [**ChannelReqObj**](ChannelReqObj.md) | JSON-formatted document describing the new channel to be registered | [required] | + +### Return type + +[**models::Channel**](Channel.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## create_channels + +> Vec create_channels(domain_id, channel_req_obj) +Creates new channels + +Creates new channels in domain. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**channel_req_obj** | [**Vec**](ChannelReqObj.md) | JSON-formatted document describing the new channels to be registered | [required] | + +### Return type + +[**Vec**](Channel.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## disable_channel + +> models::Channel disable_channel(domain_id, chan_id) +Disables a channel + +Disables a specific channel that is identified by the channel ID. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**chan_id** | **uuid::Uuid** | Unique channel identifier. | [required] | + +### Return type + +[**models::Channel**](Channel.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## domain_id_channels_chan_id_delete + +> domain_id_channels_chan_id_delete(domain_id, chan_id) +Delete channel for given channel id. + +Delete channel remove given channel id from repo and removes all the policies related to channel. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**chan_id** | **uuid::Uuid** | Unique channel identifier. | [required] | + +### Return type + + (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## enable_channel + +> models::Channel enable_channel(domain_id, chan_id) +Enables a channel + +Enables a specific channel that is identified by the channel ID. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**chan_id** | **uuid::Uuid** | Unique channel identifier. | [required] | + +### Return type + +[**models::Channel**](Channel.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_channel + +> models::Channel get_channel(domain_id, chan_id) +Retrieves channel info. + +Gets info on a channel specified by id. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**chan_id** | **uuid::Uuid** | Unique channel identifier. | [required] | + +### Return type + +[**models::Channel**](Channel.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_channels + +> models::ChannelsPage list_channels(domain_id, limit, offset, metadata, name) +Lists channels. + +Retrieves a list of channels. Due to performance concerns, data is retrieved in subsets. The API clients must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**limit** | Option<**i32**> | Size of the subset to retrieve. | |[default to 10] +**offset** | Option<**i32**> | Number of items to skip during retrieval. | |[default to 0] +**metadata** | Option<**String**> | Metadata filter. Filtering is performed matching the parameter with metadata on top level. Parameter is json. | | +**name** | Option<**String**> | Channel's name. | | + +### Return type + +[**models::ChannelsPage**](ChannelsPage.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## remove_channel_parent_group + +> remove_channel_parent_group(domain_id, chan_id, parent_group_req_obj) +Removes a parent group from a channel. + +Removes a parent group from a specific channel that is identified by the channel ID. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**chan_id** | **uuid::Uuid** | Unique channel identifier. | [required] | +**parent_group_req_obj** | [**ParentGroupReqObj**](ParentGroupReqObj.md) | JSON-formated document describing the parent group to be set to or removed from a channel. | [required] | + +### Return type + + (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## set_channel_parent_group + +> set_channel_parent_group(domain_id, chan_id, parent_group_req_obj) +Sets a parent group for a channel + +Sets a parent group for a specific channel that is identified by the channel ID. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**chan_id** | **uuid::Uuid** | Unique channel identifier. | [required] | +**parent_group_req_obj** | [**ParentGroupReqObj**](ParentGroupReqObj.md) | JSON-formated document describing the parent group to be set to or removed from a channel. | [required] | + +### Return type + + (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## update_channel + +> models::Channel update_channel(domain_id, chan_id, channel_update) +Updates channel data. + +Update is performed by replacing the current resource data with values provided in a request payload. Note that the channel's ID will not be affected. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**chan_id** | **uuid::Uuid** | Unique channel identifier. | [required] | +**channel_update** | [**ChannelUpdate**](ChannelUpdate.md) | JSON-formated document describing the metadata and name of channel to be updated. | [required] | + +### Return type + +[**models::Channel**](Channel.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## update_channel_tags + +> models::Channel update_channel_tags(domain_id, chan_id, channel_update) +Updates channel tags. + +Update is performed by replacing the current resource data with values provided in a request payload. Note that the channel's ID will not be affected. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**chan_id** | **uuid::Uuid** | Unique channel identifier. | [required] | +**channel_update** | [**ChannelUpdate**](ChannelUpdate.md) | JSON-formated document describing the tags of channel to be updated. | [required] | + +### Return type + +[**models::Channel**](Channel.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/channels/docs/ChannelsPage.md b/channels/docs/ChannelsPage.md new file mode 100644 index 00000000..e804e1de --- /dev/null +++ b/channels/docs/ChannelsPage.md @@ -0,0 +1,14 @@ +# ChannelsPage + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**channels** | [**Vec**](Channel.md) | | +**total** | **i32** | Total number of items. | +**offset** | **i32** | Number of items to skip during retrieval. | +**limit** | Option<**i32**> | Maximum number of items to return in one page. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/channels/docs/ConnectionReqSchema.md b/channels/docs/ConnectionReqSchema.md new file mode 100644 index 00000000..8aa7c76b --- /dev/null +++ b/channels/docs/ConnectionReqSchema.md @@ -0,0 +1,13 @@ +# ConnectionReqSchema + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**channel_ids** | Option<[**Vec**](serde_json::Value.md)> | Channel IDs. | [optional] +**client_ids** | Option<[**Vec**](serde_json::Value.md)> | Client IDs | [optional] +**types** | Option<[**Vec**](serde_json::Value.md)> | Connection types. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/channels/docs/ConnectionsApi.md b/channels/docs/ConnectionsApi.md new file mode 100644 index 00000000..5d38e1f5 --- /dev/null +++ b/channels/docs/ConnectionsApi.md @@ -0,0 +1,138 @@ +# \ConnectionsApi + +All URIs are relative to *http://localhost:9005* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**connect_clients_and_channels**](ConnectionsApi.md#connect_clients_and_channels) | **POST** /{domainID}/channels/connect | Connects client and channel. +[**connect_clients_to_channel**](ConnectionsApi.md#connect_clients_to_channel) | **POST** /{domainID}/channels/{chanID}/connect | Connects clients to a channel +[**disconnect_clients_and_channels**](ConnectionsApi.md#disconnect_clients_and_channels) | **POST** /{domainID}/channels/disconnect | Disconnects client and channel. +[**disconnect_clients_from_channel**](ConnectionsApi.md#disconnect_clients_from_channel) | **POST** /{domainID}/channels/{chanID}/disconnect | Disconnects clients from a channel + + + +## connect_clients_and_channels + +> connect_clients_and_channels(domain_id, connection_req_schema) +Connects client and channel. + +Connect clients specified by IDs to channels specified by IDs. Channel and client are owned by user identified using the provided access token. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**connection_req_schema** | [**ConnectionReqSchema**](ConnectionReqSchema.md) | JSON-formatted document describing the new connection. | [required] | + +### Return type + + (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## connect_clients_to_channel + +> connect_clients_to_channel(domain_id, chan_id, channel_connection_req_schema) +Connects clients to a channel + +Connects clients to a channel that is identified by the channel ID. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**chan_id** | **uuid::Uuid** | Unique channel identifier. | [required] | +**channel_connection_req_schema** | [**ChannelConnectionReqSchema**](ChannelConnectionReqSchema.md) | JSON-formatted document describing the new connection. | [required] | + +### Return type + + (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## disconnect_clients_and_channels + +> disconnect_clients_and_channels(domain_id, connection_req_schema) +Disconnects client and channel. + +Disconnect clients specified by IDs from channels specified by IDs. Channel and client are owned by user identified using the provided access token. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**connection_req_schema** | [**ConnectionReqSchema**](ConnectionReqSchema.md) | JSON-formatted document describing the new connection. | [required] | + +### Return type + + (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## disconnect_clients_from_channel + +> disconnect_clients_from_channel(domain_id, chan_id, channel_connection_req_schema) +Disconnects clients from a channel + +Disconnects clients to a channel that is identified by the channel ID. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**chan_id** | **uuid::Uuid** | Unique channel identifier. | [required] | +**channel_connection_req_schema** | [**ChannelConnectionReqSchema**](ChannelConnectionReqSchema.md) | JSON-formatted document describing the new connection. | [required] | + +### Return type + + (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/channels/docs/Error.md b/channels/docs/Error.md new file mode 100644 index 00000000..8e78862d --- /dev/null +++ b/channels/docs/Error.md @@ -0,0 +1,11 @@ +# Error + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error** | Option<**String**> | Error message | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/channels/docs/HealthApi.md b/channels/docs/HealthApi.md new file mode 100644 index 00000000..1ce8aefe --- /dev/null +++ b/channels/docs/HealthApi.md @@ -0,0 +1,34 @@ +# \HealthApi + +All URIs are relative to *http://localhost:9005* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**health_get**](HealthApi.md#health_get) | **GET** /health | Retrieves service health check info. + + + +## health_get + +> models::HealthRes health_get() +Retrieves service health check info. + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**models::HealthRes**](HealthRes.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/health+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/channels/docs/HealthRes.md b/channels/docs/HealthRes.md new file mode 100644 index 00000000..319b16fb --- /dev/null +++ b/channels/docs/HealthRes.md @@ -0,0 +1,15 @@ +# HealthRes + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | Option<**String**> | Service status. | [optional] +**version** | Option<**String**> | Service version. | [optional] +**commit** | Option<**String**> | Service commit hash. | [optional] +**description** | Option<**String**> | Service description. | [optional] +**build_time** | Option<**String**> | Service build time. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/channels/docs/ParentGroupReqObj.md b/channels/docs/ParentGroupReqObj.md new file mode 100644 index 00000000..61fb46b3 --- /dev/null +++ b/channels/docs/ParentGroupReqObj.md @@ -0,0 +1,11 @@ +# ParentGroupReqObj + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**parent_group_id** | [**uuid::Uuid**](uuid::Uuid.md) | Parent group unique identifier. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/channels/git_push.sh b/channels/git_push.sh new file mode 100644 index 00000000..f53a75d4 --- /dev/null +++ b/channels/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/channels/src/apis/channels_api.rs b/channels/src/apis/channels_api.rs new file mode 100644 index 00000000..fe176d3a --- /dev/null +++ b/channels/src/apis/channels_api.rs @@ -0,0 +1,529 @@ +/* + * SuperMQ Channels Service + * + * This is the Channels Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform channels. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`create_channel`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CreateChannelError { + Status400(), + Status401(), + Status403(), + Status404(), + Status409(), + Status415(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`create_channels`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CreateChannelsError { + Status400(), + Status401(), + Status403(), + Status404(), + Status409(), + Status415(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`disable_channel`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DisableChannelError { + Status400(), + Status401(), + Status403(), + Status404(), + Status409(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`domain_id_channels_chan_id_delete`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DomainIdChannelsChanIdDeleteError { + Status400(), + Status401(), + Status403(), + Status404(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`enable_channel`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EnableChannelError { + Status400(), + Status401(), + Status403(), + Status404(), + Status409(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_channel`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetChannelError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_channels`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListChannelsError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`remove_channel_parent_group`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RemoveChannelParentGroupError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`set_channel_parent_group`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SetChannelParentGroupError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`update_channel`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UpdateChannelError { + Status400(), + Status401(), + Status403(), + Status404(), + Status409(), + Status415(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`update_channel_tags`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UpdateChannelTagsError { + Status400(), + Status401(), + Status403(), + Status404(), + Status409(), + Status415(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + + +/// Creates new channel in domain. +pub async fn create_channel(configuration: &configuration::Configuration, domain_id: &str, channel_req_obj: models::ChannelReqObj) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/channels", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&channel_req_obj); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Creates new channels in domain. +pub async fn create_channels(configuration: &configuration::Configuration, domain_id: &str, channel_req_obj: Vec) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/channels/bulk", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&channel_req_obj); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Disables a specific channel that is identified by the channel ID. +pub async fn disable_channel(configuration: &configuration::Configuration, domain_id: &str, chan_id: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/channels/{chanID}/disable", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), chanID=crate::apis::urlencode(chan_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Delete channel remove given channel id from repo and removes all the policies related to channel. +pub async fn domain_id_channels_chan_id_delete(configuration: &configuration::Configuration, domain_id: &str, chan_id: &str) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/channels/{chanID}", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), chanID=crate::apis::urlencode(chan_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Enables a specific channel that is identified by the channel ID. +pub async fn enable_channel(configuration: &configuration::Configuration, domain_id: &str, chan_id: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/channels/{chanID}/enable", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), chanID=crate::apis::urlencode(chan_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Gets info on a channel specified by id. +pub async fn get_channel(configuration: &configuration::Configuration, domain_id: &str, chan_id: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/channels/{chanID}", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), chanID=crate::apis::urlencode(chan_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Retrieves a list of channels. Due to performance concerns, data is retrieved in subsets. The API clients must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. +pub async fn list_channels(configuration: &configuration::Configuration, domain_id: &str, limit: Option, offset: Option, metadata: Option<&str>, name: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/channels", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = offset { + local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = metadata { + local_var_req_builder = local_var_req_builder.query(&[("metadata", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = name { + local_var_req_builder = local_var_req_builder.query(&[("name", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Removes a parent group from a specific channel that is identified by the channel ID. +pub async fn remove_channel_parent_group(configuration: &configuration::Configuration, domain_id: &str, chan_id: &str, parent_group_req_obj: models::ParentGroupReqObj) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/channels/{chanID}/parent", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), chanID=crate::apis::urlencode(chan_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&parent_group_req_obj); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Sets a parent group for a specific channel that is identified by the channel ID. +pub async fn set_channel_parent_group(configuration: &configuration::Configuration, domain_id: &str, chan_id: &str, parent_group_req_obj: models::ParentGroupReqObj) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/channels/{chanID}/parent", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), chanID=crate::apis::urlencode(chan_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&parent_group_req_obj); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Update is performed by replacing the current resource data with values provided in a request payload. Note that the channel's ID will not be affected. +pub async fn update_channel(configuration: &configuration::Configuration, domain_id: &str, chan_id: &str, channel_update: models::ChannelUpdate) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/channels/{chanID}", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), chanID=crate::apis::urlencode(chan_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&channel_update); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Update is performed by replacing the current resource data with values provided in a request payload. Note that the channel's ID will not be affected. +pub async fn update_channel_tags(configuration: &configuration::Configuration, domain_id: &str, chan_id: &str, channel_update: models::ChannelUpdate) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/channels/{chanID}/tags", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), chanID=crate::apis::urlencode(chan_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&channel_update); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/channels/src/apis/configuration.rs b/channels/src/apis/configuration.rs new file mode 100644 index 00000000..3abd5fa1 --- /dev/null +++ b/channels/src/apis/configuration.rs @@ -0,0 +1,51 @@ +/* + * SuperMQ Channels Service + * + * This is the Channels Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform channels. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + + + +#[derive(Debug, Clone)] +pub struct Configuration { + pub base_path: String, + pub user_agent: Option, + pub client: reqwest::Client, + pub basic_auth: Option, + pub oauth_access_token: Option, + pub bearer_access_token: Option, + pub api_key: Option, +} + +pub type BasicAuth = (String, Option); + +#[derive(Debug, Clone)] +pub struct ApiKey { + pub prefix: Option, + pub key: String, +} + + +impl Configuration { + pub fn new() -> Configuration { + Configuration::default() + } +} + +impl Default for Configuration { + fn default() -> Self { + Configuration { + base_path: "http://localhost:9005".to_owned(), + user_agent: Some("OpenAPI-Generator/0.15.1/rust".to_owned()), + client: reqwest::Client::new(), + basic_auth: None, + oauth_access_token: None, + bearer_access_token: None, + api_key: None, + } + } +} diff --git a/channels/src/apis/connections_api.rs b/channels/src/apis/connections_api.rs new file mode 100644 index 00000000..c65eb65a --- /dev/null +++ b/channels/src/apis/connections_api.rs @@ -0,0 +1,202 @@ +/* + * SuperMQ Channels Service + * + * This is the Channels Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform channels. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`connect_clients_and_channels`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ConnectClientsAndChannelsError { + Status400(), + Status401(), + Status403(), + Status404(), + Status409(), + Status415(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`connect_clients_to_channel`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ConnectClientsToChannelError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`disconnect_clients_and_channels`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DisconnectClientsAndChannelsError { + Status400(), + Status401(), + Status403(), + Status404(), + Status409(), + Status415(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`disconnect_clients_from_channel`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DisconnectClientsFromChannelError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + + +/// Connect clients specified by IDs to channels specified by IDs. Channel and client are owned by user identified using the provided access token. +pub async fn connect_clients_and_channels(configuration: &configuration::Configuration, domain_id: &str, connection_req_schema: models::ConnectionReqSchema) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/channels/connect", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&connection_req_schema); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Connects clients to a channel that is identified by the channel ID. +pub async fn connect_clients_to_channel(configuration: &configuration::Configuration, domain_id: &str, chan_id: &str, channel_connection_req_schema: models::ChannelConnectionReqSchema) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/channels/{chanID}/connect", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), chanID=crate::apis::urlencode(chan_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&channel_connection_req_schema); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Disconnect clients specified by IDs from channels specified by IDs. Channel and client are owned by user identified using the provided access token. +pub async fn disconnect_clients_and_channels(configuration: &configuration::Configuration, domain_id: &str, connection_req_schema: models::ConnectionReqSchema) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/channels/disconnect", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&connection_req_schema); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Disconnects clients to a channel that is identified by the channel ID. +pub async fn disconnect_clients_from_channel(configuration: &configuration::Configuration, domain_id: &str, chan_id: &str, channel_connection_req_schema: models::ChannelConnectionReqSchema) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/channels/{chanID}/disconnect", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), chanID=crate::apis::urlencode(chan_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&channel_connection_req_schema); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/channels/src/apis/health_api.rs b/channels/src/apis/health_api.rs new file mode 100644 index 00000000..8a9a2015 --- /dev/null +++ b/channels/src/apis/health_api.rs @@ -0,0 +1,53 @@ +/* + * SuperMQ Channels Service + * + * This is the Channels Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform channels. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`health_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum HealthGetError { + Status500(models::Error), + UnknownValue(serde_json::Value), +} + + +pub async fn health_get(configuration: &configuration::Configuration, ) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/health", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/channels/src/apis/mod.rs b/channels/src/apis/mod.rs new file mode 100644 index 00000000..b9cec318 --- /dev/null +++ b/channels/src/apis/mod.rs @@ -0,0 +1,97 @@ +use std::error; +use std::fmt; + +#[derive(Debug, Clone)] +pub struct ResponseContent { + pub status: reqwest::StatusCode, + pub content: String, + pub entity: Option, +} + +#[derive(Debug)] +pub enum Error { + Reqwest(reqwest::Error), + Serde(serde_json::Error), + Io(std::io::Error), + ResponseError(ResponseContent), +} + +impl fmt::Display for Error { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + let (module, e) = match self { + Error::Reqwest(e) => ("reqwest", e.to_string()), + Error::Serde(e) => ("serde", e.to_string()), + Error::Io(e) => ("IO", e.to_string()), + Error::ResponseError(e) => ("response", format!("status code {}", e.status)), + }; + write!(f, "error in {}: {}", module, e) + } +} + +impl error::Error for Error { + fn source(&self) -> Option<&(dyn error::Error + 'static)> { + Some(match self { + Error::Reqwest(e) => e, + Error::Serde(e) => e, + Error::Io(e) => e, + Error::ResponseError(_) => return None, + }) + } +} + +impl From for Error { + fn from(e: reqwest::Error) -> Self { + Error::Reqwest(e) + } +} + +impl From for Error { + fn from(e: serde_json::Error) -> Self { + Error::Serde(e) + } +} + +impl From for Error { + fn from(e: std::io::Error) -> Self { + Error::Io(e) + } +} + +pub fn urlencode>(s: T) -> String { + ::url::form_urlencoded::byte_serialize(s.as_ref().as_bytes()).collect() +} + +pub fn parse_deep_object(prefix: &str, value: &serde_json::Value) -> Vec<(String, String)> { + if let serde_json::Value::Object(object) = value { + let mut params = vec![]; + + for (key, value) in object { + match value { + serde_json::Value::Object(_) => params.append(&mut parse_deep_object( + &format!("{}[{}]", prefix, key), + value, + )), + serde_json::Value::Array(array) => { + for (i, value) in array.iter().enumerate() { + params.append(&mut parse_deep_object( + &format!("{}[{}][{}]", prefix, key, i), + value, + )); + } + }, + serde_json::Value::String(s) => params.push((format!("{}[{}]", prefix, key), s.clone())), + _ => params.push((format!("{}[{}]", prefix, key), value.to_string())), + } + } + + return params; + } + + unimplemented!("Only objects are supported with style=deepObject") +} + +pub mod channels_api; +pub mod connections_api; +pub mod health_api; + +pub mod configuration; diff --git a/channels/src/lib.rs b/channels/src/lib.rs new file mode 100644 index 00000000..e1520628 --- /dev/null +++ b/channels/src/lib.rs @@ -0,0 +1,11 @@ +#![allow(unused_imports)] +#![allow(clippy::too_many_arguments)] + +extern crate serde_repr; +extern crate serde; +extern crate serde_json; +extern crate url; +extern crate reqwest; + +pub mod apis; +pub mod models; diff --git a/channels/src/models/channel.rs b/channels/src/models/channel.rs new file mode 100644 index 00000000..9f6cacfb --- /dev/null +++ b/channels/src/models/channel.rs @@ -0,0 +1,68 @@ +/* + * SuperMQ Channels Service + * + * This is the Channels Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform channels. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Channel { + /// Unique channel identifier generated by the service. + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + /// Free-form channel name. Channel name is unique on the given hierarchy level. + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + /// ID of the domain to which the group belongs. + #[serde(rename = "domain_id", skip_serializing_if = "Option::is_none")] + pub domain_id: Option, + /// Channel parent identifier. + #[serde(rename = "parent_id", skip_serializing_if = "Option::is_none")] + pub parent_id: Option, + /// Channel description, free form text. + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option, + /// Arbitrary, object-encoded channels's data. + #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")] + pub metadata: Option, + /// Hierarchy path, concatenated ids of channel ancestors. + #[serde(rename = "path", skip_serializing_if = "Option::is_none")] + pub path: Option, + /// Level in hierarchy, distance from the root channel. + #[serde(rename = "level", skip_serializing_if = "Option::is_none")] + pub level: Option, + /// Datetime when the channel was created. + #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] + pub created_at: Option, + /// Datetime when the channel was created. + #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")] + pub updated_at: Option, + /// Channel Status + #[serde(rename = "status", skip_serializing_if = "Option::is_none")] + pub status: Option, +} + +impl Channel { + pub fn new() -> Channel { + Channel { + id: None, + name: None, + domain_id: None, + parent_id: None, + description: None, + metadata: None, + path: None, + level: None, + created_at: None, + updated_at: None, + status: None, + } + } +} + diff --git a/channels/src/models/channel_connection_req_schema.rs b/channels/src/models/channel_connection_req_schema.rs new file mode 100644 index 00000000..254382a0 --- /dev/null +++ b/channels/src/models/channel_connection_req_schema.rs @@ -0,0 +1,32 @@ +/* + * SuperMQ Channels Service + * + * This is the Channels Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform channels. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ChannelConnectionReqSchema { + /// Client IDs + #[serde(rename = "client_ids", skip_serializing_if = "Option::is_none")] + pub client_ids: Option>, + /// Connection types. + #[serde(rename = "types", skip_serializing_if = "Option::is_none")] + pub types: Option>, +} + +impl ChannelConnectionReqSchema { + pub fn new() -> ChannelConnectionReqSchema { + ChannelConnectionReqSchema { + client_ids: None, + types: None, + } + } +} + diff --git a/channels/src/models/channel_req_obj.rs b/channels/src/models/channel_req_obj.rs new file mode 100644 index 00000000..0e527723 --- /dev/null +++ b/channels/src/models/channel_req_obj.rs @@ -0,0 +1,44 @@ +/* + * SuperMQ Channels Service + * + * This is the Channels Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform channels. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ChannelReqObj { + /// Free-form channel name. Channel name is unique on the given hierarchy level. + #[serde(rename = "name")] + pub name: String, + /// Channel description, free form text. + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option, + /// Id of parent channel, it must be existing channel. + #[serde(rename = "parent_id", skip_serializing_if = "Option::is_none")] + pub parent_id: Option, + /// Arbitrary, object-encoded channels's data. + #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")] + pub metadata: Option, + /// Channel Status + #[serde(rename = "status", skip_serializing_if = "Option::is_none")] + pub status: Option, +} + +impl ChannelReqObj { + pub fn new(name: String) -> ChannelReqObj { + ChannelReqObj { + name, + description: None, + parent_id: None, + metadata: None, + status: None, + } + } +} + diff --git a/channels/src/models/channel_update.rs b/channels/src/models/channel_update.rs new file mode 100644 index 00000000..a1abd567 --- /dev/null +++ b/channels/src/models/channel_update.rs @@ -0,0 +1,36 @@ +/* + * SuperMQ Channels Service + * + * This is the Channels Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform channels. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ChannelUpdate { + /// Free-form channel name. Channel name is unique on the given hierarchy level. + #[serde(rename = "name")] + pub name: String, + /// Channel description, free form text. + #[serde(rename = "description")] + pub description: String, + /// Arbitrary, object-encoded channels's data. + #[serde(rename = "metadata")] + pub metadata: serde_json::Value, +} + +impl ChannelUpdate { + pub fn new(name: String, description: String, metadata: serde_json::Value) -> ChannelUpdate { + ChannelUpdate { + name, + description, + metadata, + } + } +} + diff --git a/channels/src/models/channel_update_tags.rs b/channels/src/models/channel_update_tags.rs new file mode 100644 index 00000000..4f17b7a6 --- /dev/null +++ b/channels/src/models/channel_update_tags.rs @@ -0,0 +1,28 @@ +/* + * SuperMQ Channels Service + * + * This is the Channels Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform channels. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ChannelUpdateTags { + /// Channel tags. + #[serde(rename = "tags")] + pub tags: Vec, +} + +impl ChannelUpdateTags { + pub fn new(tags: Vec) -> ChannelUpdateTags { + ChannelUpdateTags { + tags, + } + } +} + diff --git a/channels/src/models/channels_page.rs b/channels/src/models/channels_page.rs new file mode 100644 index 00000000..1103baaf --- /dev/null +++ b/channels/src/models/channels_page.rs @@ -0,0 +1,39 @@ +/* + * SuperMQ Channels Service + * + * This is the Channels Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform channels. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ChannelsPage { + #[serde(rename = "channels")] + pub channels: Vec, + /// Total number of items. + #[serde(rename = "total")] + pub total: i32, + /// Number of items to skip during retrieval. + #[serde(rename = "offset")] + pub offset: i32, + /// Maximum number of items to return in one page. + #[serde(rename = "limit", skip_serializing_if = "Option::is_none")] + pub limit: Option, +} + +impl ChannelsPage { + pub fn new(channels: Vec, total: i32, offset: i32) -> ChannelsPage { + ChannelsPage { + channels, + total, + offset, + limit: None, + } + } +} + diff --git a/channels/src/models/connection_req_schema.rs b/channels/src/models/connection_req_schema.rs new file mode 100644 index 00000000..7a29d4f5 --- /dev/null +++ b/channels/src/models/connection_req_schema.rs @@ -0,0 +1,36 @@ +/* + * SuperMQ Channels Service + * + * This is the Channels Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform channels. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ConnectionReqSchema { + /// Channel IDs. + #[serde(rename = "channel_ids", skip_serializing_if = "Option::is_none")] + pub channel_ids: Option>, + /// Client IDs + #[serde(rename = "client_ids", skip_serializing_if = "Option::is_none")] + pub client_ids: Option>, + /// Connection types. + #[serde(rename = "types", skip_serializing_if = "Option::is_none")] + pub types: Option>, +} + +impl ConnectionReqSchema { + pub fn new() -> ConnectionReqSchema { + ConnectionReqSchema { + channel_ids: None, + client_ids: None, + types: None, + } + } +} + diff --git a/channels/src/models/error.rs b/channels/src/models/error.rs new file mode 100644 index 00000000..a8297d8b --- /dev/null +++ b/channels/src/models/error.rs @@ -0,0 +1,28 @@ +/* + * SuperMQ Channels Service + * + * This is the Channels Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform channels. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Error { + /// Error message + #[serde(rename = "error", skip_serializing_if = "Option::is_none")] + pub error: Option, +} + +impl Error { + pub fn new() -> Error { + Error { + error: None, + } + } +} + diff --git a/channels/src/models/health_res.rs b/channels/src/models/health_res.rs new file mode 100644 index 00000000..a777ad14 --- /dev/null +++ b/channels/src/models/health_res.rs @@ -0,0 +1,56 @@ +/* + * SuperMQ Channels Service + * + * This is the Channels Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform channels. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct HealthRes { + /// Service status. + #[serde(rename = "status", skip_serializing_if = "Option::is_none")] + pub status: Option, + /// Service version. + #[serde(rename = "version", skip_serializing_if = "Option::is_none")] + pub version: Option, + /// Service commit hash. + #[serde(rename = "commit", skip_serializing_if = "Option::is_none")] + pub commit: Option, + /// Service description. + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option, + /// Service build time. + #[serde(rename = "build_time", skip_serializing_if = "Option::is_none")] + pub build_time: Option, +} + +impl HealthRes { + pub fn new() -> HealthRes { + HealthRes { + status: None, + version: None, + commit: None, + description: None, + build_time: None, + } + } +} +/// Service status. +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Status { + #[serde(rename = "pass")] + Pass, +} + +impl Default for Status { + fn default() -> Status { + Self::Pass + } +} + diff --git a/channels/src/models/mod.rs b/channels/src/models/mod.rs new file mode 100644 index 00000000..2ca51007 --- /dev/null +++ b/channels/src/models/mod.rs @@ -0,0 +1,20 @@ +pub mod channel; +pub use self::channel::Channel; +pub mod channel_connection_req_schema; +pub use self::channel_connection_req_schema::ChannelConnectionReqSchema; +pub mod channel_req_obj; +pub use self::channel_req_obj::ChannelReqObj; +pub mod channel_update; +pub use self::channel_update::ChannelUpdate; +pub mod channel_update_tags; +pub use self::channel_update_tags::ChannelUpdateTags; +pub mod channels_page; +pub use self::channels_page::ChannelsPage; +pub mod connection_req_schema; +pub use self::connection_req_schema::ConnectionReqSchema; +pub mod error; +pub use self::error::Error; +pub mod health_res; +pub use self::health_res::HealthRes; +pub mod parent_group_req_obj; +pub use self::parent_group_req_obj::ParentGroupReqObj; diff --git a/channels/src/models/parent_group_req_obj.rs b/channels/src/models/parent_group_req_obj.rs new file mode 100644 index 00000000..0f1fd1a1 --- /dev/null +++ b/channels/src/models/parent_group_req_obj.rs @@ -0,0 +1,28 @@ +/* + * SuperMQ Channels Service + * + * This is the Channels Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform channels. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ParentGroupReqObj { + /// Parent group unique identifier. + #[serde(rename = "parent_group_id")] + pub parent_group_id: uuid::Uuid, +} + +impl ParentGroupReqObj { + pub fn new(parent_group_id: uuid::Uuid) -> ParentGroupReqObj { + ParentGroupReqObj { + parent_group_id, + } + } +} + diff --git a/clients/.gitignore b/clients/.gitignore new file mode 100644 index 00000000..6aa10640 --- /dev/null +++ b/clients/.gitignore @@ -0,0 +1,3 @@ +/target/ +**/*.rs.bk +Cargo.lock diff --git a/clients/.openapi-generator-ignore b/clients/.openapi-generator-ignore new file mode 100644 index 00000000..7484ee59 --- /dev/null +++ b/clients/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/clients/.openapi-generator/FILES b/clients/.openapi-generator/FILES new file mode 100644 index 00000000..1327833d --- /dev/null +++ b/clients/.openapi-generator/FILES @@ -0,0 +1,58 @@ +.gitignore +.openapi-generator-ignore +.travis.yml +Cargo.toml +README.md +docs/AvailableActionsObj.md +docs/Client.md +docs/ClientCredentials.md +docs/ClientReqObj.md +docs/ClientReqObjCredentials.md +docs/ClientSecret.md +docs/ClientTags.md +docs/ClientUpdate.md +docs/ClientWithEmptySecret.md +docs/ClientWithEmptySecretCredentials.md +docs/ClientsApi.md +docs/ClientsPage.md +docs/CreateRoleObj.md +docs/Error.md +docs/HealthApi.md +docs/HealthRes.md +docs/NewRole.md +docs/ParentGroupReqObj.md +docs/Role.md +docs/RoleActionsObj.md +docs/RoleMembersObj.md +docs/RolesApi.md +docs/RolesPage.md +docs/UpdateRoleObj.md +git_push.sh +src/apis/clients_api.rs +src/apis/configuration.rs +src/apis/health_api.rs +src/apis/mod.rs +src/apis/roles_api.rs +src/lib.rs +src/models/available_actions_obj.rs +src/models/client.rs +src/models/client_credentials.rs +src/models/client_req_obj.rs +src/models/client_req_obj_credentials.rs +src/models/client_secret.rs +src/models/client_tags.rs +src/models/client_update.rs +src/models/client_with_empty_secret.rs +src/models/client_with_empty_secret_credentials.rs +src/models/clients_page.rs +src/models/create_role_obj.rs +src/models/error.rs +src/models/health_res.rs +src/models/mod.rs +src/models/new_role.rs +src/models/parent_group_req_obj.rs +src/models/role.rs +src/models/role_actions_obj.rs +src/models/role_members_obj.rs +src/models/roles_page.rs +src/models/update_role_obj.rs diff --git a/clients/.openapi-generator/VERSION b/clients/.openapi-generator/VERSION new file mode 100644 index 00000000..758bb9c8 --- /dev/null +++ b/clients/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.10.0 diff --git a/clients/.travis.yml b/clients/.travis.yml new file mode 100644 index 00000000..22761ba7 --- /dev/null +++ b/clients/.travis.yml @@ -0,0 +1 @@ +language: rust diff --git a/clients/Cargo.toml b/clients/Cargo.toml new file mode 100644 index 00000000..ce79cfc6 --- /dev/null +++ b/clients/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "clients-openapi" +version = "0.15.1" +authors = ["info@abstractmachines.fr"] +description = "This is the Clients Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform clients. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) " +license = "Apache 2.0" +edition = "2021" + +[dependencies] +serde = { version = "^1.0", features = ["derive"] } +serde_json = "^1.0" +serde_repr = "^0.1" +url = "^2.5" +uuid = { version = "^1.8", features = ["serde", "v4"] } +reqwest = { version = "^0.12", features = ["json", "multipart"] } diff --git a/clients/README.md b/clients/README.md new file mode 100644 index 00000000..c249adf6 --- /dev/null +++ b/clients/README.md @@ -0,0 +1,96 @@ +# Rust API client for openapi + +This is the Clients Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform clients. You can now help us improve the API whether it's by making changes to the definition itself or to the code. +Some useful links: +- [The SuperMQ repository](https://github.com/absmach/supermq) + + + +## Overview + +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://openapis.org) from a remote server, you can easily generate an API client. + +- API version: 0.15.1 +- Package version: 0.15.1 +- Generator version: 7.10.0 +- Build package: `org.openapitools.codegen.languages.RustClientCodegen` + +## Installation + +Put the package under your project folder in a directory named `openapi` and add the following to `Cargo.toml` under `[dependencies]`: + +``` +openapi = { path = "./openapi" } +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost:9006* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*ClientsApi* | [**bulk_create_clients**](docs/ClientsApi.md#bulk_create_clients) | **POST** /{domainID}/clients/bulk | Bulk provisions new clients +*ClientsApi* | [**create_client**](docs/ClientsApi.md#create_client) | **POST** /{domainID}/clients | Adds new client +*ClientsApi* | [**disable_client**](docs/ClientsApi.md#disable_client) | **POST** /{domainID}/clients/{clientID}/disable | Disables a client +*ClientsApi* | [**domain_id_clients_client_id_delete**](docs/ClientsApi.md#domain_id_clients_client_id_delete) | **DELETE** /{domainID}/clients/{clientID} | Delete client for a client with the given id. +*ClientsApi* | [**enable_client**](docs/ClientsApi.md#enable_client) | **POST** /{domainID}/clients/{clientID}/enable | Enables a client +*ClientsApi* | [**get_client**](docs/ClientsApi.md#get_client) | **GET** /{domainID}/clients/{clientID} | Retrieves client info +*ClientsApi* | [**list_clients**](docs/ClientsApi.md#list_clients) | **GET** /{domainID}/clients | Retrieves clients +*ClientsApi* | [**list_user_clients**](docs/ClientsApi.md#list_user_clients) | **GET** /{domainID}/users/{userID}/clients | List clients asssociated with a user. +*ClientsApi* | [**remove_client_parent_group**](docs/ClientsApi.md#remove_client_parent_group) | **DELETE** /{domainID}/clients/{clientID}/parent | Removes a parent group from a client. +*ClientsApi* | [**set_client_parent_group**](docs/ClientsApi.md#set_client_parent_group) | **POST** /{domainID}/clients/{clientID}/parent | Sets a parent group for a client +*ClientsApi* | [**update_client**](docs/ClientsApi.md#update_client) | **PATCH** /{domainID}/clients/{clientID} | Updates name and metadata of the client. +*ClientsApi* | [**update_client_secret**](docs/ClientsApi.md#update_client_secret) | **PATCH** /{domainID}/clients/{clientID}/secret | Updates Secret of the identified client. +*ClientsApi* | [**update_client_tags**](docs/ClientsApi.md#update_client_tags) | **PATCH** /{domainID}/clients/{clientID}/tags | Updates tags the client. +*HealthApi* | [**health_get**](docs/HealthApi.md#health_get) | **GET** /health | Retrieves service health check info. +*RolesApi* | [**add_client_role_action**](docs/RolesApi.md#add_client_role_action) | **POST** /{domainID}/clients/{clientID}/roles/{roleName}/actions | Adds a role action for a client role. +*RolesApi* | [**add_client_role_member**](docs/RolesApi.md#add_client_role_member) | **POST** /{domainID}/clients/{clientID}/roles/{roleName}/members | Adds a member to a client role. +*RolesApi* | [**create_client_role**](docs/RolesApi.md#create_client_role) | **POST** /{domainID}/clients/{clientID}/roles | Creates a role for a client +*RolesApi* | [**delete_all_client_role_actions**](docs/RolesApi.md#delete_all_client_role_actions) | **POST** /{domainID}/clients/{clientID}/roles/{roleName}/actions/delete-all | Deletes all role actions for a client role. +*RolesApi* | [**delete_all_client_role_members**](docs/RolesApi.md#delete_all_client_role_members) | **POST** /{domainID}/clients/{clientID}/roles/{roleName}/members/delete-all | Deletes all members from a client role. +*RolesApi* | [**delete_client_role**](docs/RolesApi.md#delete_client_role) | **DELETE** /{domainID}/clients/{clientID}/roles/{roleName} | Deletes client role. +*RolesApi* | [**delete_client_role_action**](docs/RolesApi.md#delete_client_role_action) | **POST** /{domainID}/clients/{clientID}/roles/{roleName}/actions/delete | Deletes role actions for a client role. +*RolesApi* | [**delete_client_role_members**](docs/RolesApi.md#delete_client_role_members) | **POST** /{domainID}/clients/{clientID}/roles/{roleName}/members/delete | Deletes members from a client role. +*RolesApi* | [**get_client_role**](docs/RolesApi.md#get_client_role) | **GET** /{domainID}/clients/{clientID}/roles/{roleName} | Retrieves client role. +*RolesApi* | [**list_available_actions**](docs/RolesApi.md#list_available_actions) | **GET** /{domainID}/clients/roles/available-actions | Retrieves available actions. +*RolesApi* | [**list_client_role_actions**](docs/RolesApi.md#list_client_role_actions) | **GET** /{domainID}/clients/{clientID}/roles/{roleName}/actions | Lists client role actions. +*RolesApi* | [**list_client_role_members**](docs/RolesApi.md#list_client_role_members) | **GET** /{domainID}/clients/{clientID}/roles/{roleName}/members | Lists client role members. +*RolesApi* | [**list_client_roles**](docs/RolesApi.md#list_client_roles) | **GET** /{domainID}/clients/{clientID}/roles | Retrieves clients roles. +*RolesApi* | [**update_client_role**](docs/RolesApi.md#update_client_role) | **PUT** /{domainID}/clients/{clientID}/roles/{roleName} | Updates client role. + + +## Documentation For Models + + - [AvailableActionsObj](docs/AvailableActionsObj.md) + - [Client](docs/Client.md) + - [ClientCredentials](docs/ClientCredentials.md) + - [ClientReqObj](docs/ClientReqObj.md) + - [ClientReqObjCredentials](docs/ClientReqObjCredentials.md) + - [ClientSecret](docs/ClientSecret.md) + - [ClientTags](docs/ClientTags.md) + - [ClientUpdate](docs/ClientUpdate.md) + - [ClientWithEmptySecret](docs/ClientWithEmptySecret.md) + - [ClientWithEmptySecretCredentials](docs/ClientWithEmptySecretCredentials.md) + - [ClientsPage](docs/ClientsPage.md) + - [CreateRoleObj](docs/CreateRoleObj.md) + - [Error](docs/Error.md) + - [HealthRes](docs/HealthRes.md) + - [NewRole](docs/NewRole.md) + - [ParentGroupReqObj](docs/ParentGroupReqObj.md) + - [Role](docs/Role.md) + - [RoleActionsObj](docs/RoleActionsObj.md) + - [RoleMembersObj](docs/RoleMembersObj.md) + - [RolesPage](docs/RolesPage.md) + - [UpdateRoleObj](docs/UpdateRoleObj.md) + + +To get access to the crate's generated documentation, use: + +``` +cargo doc --open +``` + +## Author + +info@abstractmachines.fr + diff --git a/clients/docs/AvailableActionsObj.md b/clients/docs/AvailableActionsObj.md new file mode 100644 index 00000000..07f6848c --- /dev/null +++ b/clients/docs/AvailableActionsObj.md @@ -0,0 +1,11 @@ +# AvailableActionsObj + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**available_actions** | Option<**Vec**> | List of all available actions. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/clients/docs/Client.md b/clients/docs/Client.md new file mode 100644 index 00000000..35bb2adc --- /dev/null +++ b/clients/docs/Client.md @@ -0,0 +1,19 @@ +# Client + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | Client unique identifier. | [optional] +**name** | Option<**String**> | Client name. | [optional] +**tags** | Option<**Vec**> | Client tags. | [optional] +**domain_id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | ID of the domain to which client belongs. | [optional] +**credentials** | Option<[**models::ClientCredentials**](Client_credentials.md)> | | [optional] +**metadata** | Option<[**serde_json::Value**](.md)> | Arbitrary, object-encoded client's data. | [optional] +**status** | Option<**String**> | Client Status | [optional] +**created_at** | Option<**String**> | Time when the channel was created. | [optional] +**updated_at** | Option<**String**> | Time when the channel was created. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/clients/docs/ClientCredentials.md b/clients/docs/ClientCredentials.md new file mode 100644 index 00000000..08a01a1d --- /dev/null +++ b/clients/docs/ClientCredentials.md @@ -0,0 +1,12 @@ +# ClientCredentials + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**identity** | Option<**String**> | Client Identity for example email address. | [optional] +**secret** | Option<**String**> | Client secret password. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/clients/docs/ClientReqObj.md b/clients/docs/ClientReqObj.md new file mode 100644 index 00000000..ac2744a7 --- /dev/null +++ b/clients/docs/ClientReqObj.md @@ -0,0 +1,15 @@ +# ClientReqObj + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | Option<**String**> | Client name. | [optional] +**tags** | Option<**Vec**> | Client tags. | [optional] +**credentials** | [**models::ClientReqObjCredentials**](ClientReqObj_credentials.md) | | +**metadata** | Option<[**serde_json::Value**](.md)> | Arbitrary, object-encoded client's data. | [optional] +**status** | Option<**String**> | Client Status | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/clients/docs/ClientReqObjCredentials.md b/clients/docs/ClientReqObjCredentials.md new file mode 100644 index 00000000..e25cb3d8 --- /dev/null +++ b/clients/docs/ClientReqObjCredentials.md @@ -0,0 +1,12 @@ +# ClientReqObjCredentials + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**identity** | Option<**String**> | Client's identity will be used as its unique identifier | [optional] +**secret** | Option<**String**> | Free-form account secret used for acquiring auth token(s). | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/clients/docs/ClientSecret.md b/clients/docs/ClientSecret.md new file mode 100644 index 00000000..24c9703e --- /dev/null +++ b/clients/docs/ClientSecret.md @@ -0,0 +1,11 @@ +# ClientSecret + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**secret** | **String** | New client secret. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/clients/docs/ClientTags.md b/clients/docs/ClientTags.md new file mode 100644 index 00000000..359f66a5 --- /dev/null +++ b/clients/docs/ClientTags.md @@ -0,0 +1,11 @@ +# ClientTags + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tags** | Option<**Vec**> | Client tags. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/clients/docs/ClientUpdate.md b/clients/docs/ClientUpdate.md new file mode 100644 index 00000000..a82f229d --- /dev/null +++ b/clients/docs/ClientUpdate.md @@ -0,0 +1,12 @@ +# ClientUpdate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | Client name. | +**metadata** | [**serde_json::Value**](.md) | Arbitrary, object-encoded client's data. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/clients/docs/ClientWithEmptySecret.md b/clients/docs/ClientWithEmptySecret.md new file mode 100644 index 00000000..634c3678 --- /dev/null +++ b/clients/docs/ClientWithEmptySecret.md @@ -0,0 +1,19 @@ +# ClientWithEmptySecret + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | Client unique identifier. | [optional] +**name** | Option<**String**> | Client name. | [optional] +**tags** | Option<**Vec**> | Client tags. | [optional] +**domain_id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | ID of the domain to which client belongs. | [optional] +**credentials** | Option<[**models::ClientWithEmptySecretCredentials**](ClientWithEmptySecret_credentials.md)> | | [optional] +**metadata** | Option<[**serde_json::Value**](.md)> | Arbitrary, object-encoded client's data. | [optional] +**status** | Option<**String**> | Client Status | [optional] +**created_at** | Option<**String**> | Time when the channel was created. | [optional] +**updated_at** | Option<**String**> | Time when the channel was created. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/clients/docs/ClientWithEmptySecretCredentials.md b/clients/docs/ClientWithEmptySecretCredentials.md new file mode 100644 index 00000000..3b1a19b6 --- /dev/null +++ b/clients/docs/ClientWithEmptySecretCredentials.md @@ -0,0 +1,12 @@ +# ClientWithEmptySecretCredentials + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**identity** | Option<**String**> | Client Identity for example email address. | [optional] +**secret** | Option<**String**> | Client secret password. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/clients/docs/ClientsApi.md b/clients/docs/ClientsApi.md new file mode 100644 index 00000000..04f38e43 --- /dev/null +++ b/clients/docs/ClientsApi.md @@ -0,0 +1,440 @@ +# \ClientsApi + +All URIs are relative to *http://localhost:9006* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**bulk_create_clients**](ClientsApi.md#bulk_create_clients) | **POST** /{domainID}/clients/bulk | Bulk provisions new clients +[**create_client**](ClientsApi.md#create_client) | **POST** /{domainID}/clients | Adds new client +[**disable_client**](ClientsApi.md#disable_client) | **POST** /{domainID}/clients/{clientID}/disable | Disables a client +[**domain_id_clients_client_id_delete**](ClientsApi.md#domain_id_clients_client_id_delete) | **DELETE** /{domainID}/clients/{clientID} | Delete client for a client with the given id. +[**enable_client**](ClientsApi.md#enable_client) | **POST** /{domainID}/clients/{clientID}/enable | Enables a client +[**get_client**](ClientsApi.md#get_client) | **GET** /{domainID}/clients/{clientID} | Retrieves client info +[**list_clients**](ClientsApi.md#list_clients) | **GET** /{domainID}/clients | Retrieves clients +[**list_user_clients**](ClientsApi.md#list_user_clients) | **GET** /{domainID}/users/{userID}/clients | List clients asssociated with a user. +[**remove_client_parent_group**](ClientsApi.md#remove_client_parent_group) | **DELETE** /{domainID}/clients/{clientID}/parent | Removes a parent group from a client. +[**set_client_parent_group**](ClientsApi.md#set_client_parent_group) | **POST** /{domainID}/clients/{clientID}/parent | Sets a parent group for a client +[**update_client**](ClientsApi.md#update_client) | **PATCH** /{domainID}/clients/{clientID} | Updates name and metadata of the client. +[**update_client_secret**](ClientsApi.md#update_client_secret) | **PATCH** /{domainID}/clients/{clientID}/secret | Updates Secret of the identified client. +[**update_client_tags**](ClientsApi.md#update_client_tags) | **PATCH** /{domainID}/clients/{clientID}/tags | Updates tags the client. + + + +## bulk_create_clients + +> models::ClientsPage bulk_create_clients(domain_id, client_req_obj) +Bulk provisions new clients + +Adds a list of new clients to the list of clients owned by user identified using the provided access token. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**client_req_obj** | [**Vec**](ClientReqObj.md) | JSON-formatted document describing the new clients. | [required] | + +### Return type + +[**models::ClientsPage**](ClientsPage.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## create_client + +> models::Client create_client(domain_id, client_req_obj) +Adds new client + +Adds new client to the list of clients owned by user identified using the provided access token. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**client_req_obj** | [**ClientReqObj**](ClientReqObj.md) | JSON-formatted document describing the new client to be registered | [required] | + +### Return type + +[**models::Client**](Client.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## disable_client + +> models::Client disable_client(domain_id, client_id) +Disables a client + +Disables a specific client that is identified by the client ID. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**client_id** | **uuid::Uuid** | Unique client identifier. | [required] | + +### Return type + +[**models::Client**](Client.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## domain_id_clients_client_id_delete + +> domain_id_clients_client_id_delete(domain_id, client_id) +Delete client for a client with the given id. + +Delete client removes a client with the given id from repo and removes all the policies related to this client. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**client_id** | **uuid::Uuid** | Unique client identifier. | [required] | + +### Return type + + (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## enable_client + +> models::Client enable_client(domain_id, client_id) +Enables a client + +Enables a specific client that is identified by the client ID. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**client_id** | **uuid::Uuid** | Unique client identifier. | [required] | + +### Return type + +[**models::Client**](Client.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_client + +> models::Client get_client(domain_id, client_id) +Retrieves client info + +Retrieves a specific client that is identified by the client ID. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**client_id** | **uuid::Uuid** | Unique client identifier. | [required] | + +### Return type + +[**models::Client**](Client.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_clients + +> models::ClientsPage list_clients(domain_id, limit, offset, metadata, status, name, tags) +Retrieves clients + +Retrieves a list of clients. Due to performance concerns, data is retrieved in subsets. The API clients must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**limit** | Option<**i32**> | Size of the subset to retrieve. | |[default to 10] +**offset** | Option<**i32**> | Number of items to skip during retrieval. | |[default to 0] +**metadata** | Option<**String**> | Metadata filter. Filtering is performed matching the parameter with metadata on top level. Parameter is json. | | +**status** | Option<**String**> | Client account status. | |[default to enabled] +**name** | Option<**String**> | Client's name. | | +**tags** | Option<[**Vec**](String.md)> | Client tags. | | + +### Return type + +[**models::ClientsPage**](ClientsPage.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_user_clients + +> models::ClientsPage list_user_clients(domain_id, user_id, limit, offset, metadata, status, name, tags) +List clients asssociated with a user. + +Lists clients associated with a user identified by the user ID. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**user_id** | **uuid::Uuid** | Unique user identifier. | [required] | +**limit** | Option<**i32**> | Size of the subset to retrieve. | |[default to 10] +**offset** | Option<**i32**> | Number of items to skip during retrieval. | |[default to 0] +**metadata** | Option<**String**> | Metadata filter. Filtering is performed matching the parameter with metadata on top level. Parameter is json. | | +**status** | Option<**String**> | Client account status. | |[default to enabled] +**name** | Option<**String**> | Client's name. | | +**tags** | Option<[**Vec**](String.md)> | Client tags. | | + +### Return type + +[**models::ClientsPage**](ClientsPage.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## remove_client_parent_group + +> remove_client_parent_group(domain_id, client_id, parent_group_req_obj) +Removes a parent group from a client. + +Removes a parent group from a specific client that is identified by the client ID. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**client_id** | **uuid::Uuid** | Unique client identifier. | [required] | +**parent_group_req_obj** | [**ParentGroupReqObj**](ParentGroupReqObj.md) | JSON-formated document describing the parent group to be set to or removed from a client. | [required] | + +### Return type + + (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## set_client_parent_group + +> set_client_parent_group(domain_id, client_id, parent_group_req_obj) +Sets a parent group for a client + +Sets a parent group for a specific client that is identified by the client ID. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**client_id** | **uuid::Uuid** | Unique client identifier. | [required] | +**parent_group_req_obj** | [**ParentGroupReqObj**](ParentGroupReqObj.md) | JSON-formated document describing the parent group to be set to or removed from a client. | [required] | + +### Return type + + (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## update_client + +> models::Client update_client(domain_id, client_id, client_update) +Updates name and metadata of the client. + +Update is performed by replacing the current resource data with values provided in a request payload. Note that the client's type and ID cannot be changed. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**client_id** | **uuid::Uuid** | Unique client identifier. | [required] | +**client_update** | [**ClientUpdate**](ClientUpdate.md) | JSON-formated document describing the metadata and name of client to be update | [required] | + +### Return type + +[**models::Client**](Client.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## update_client_secret + +> models::Client update_client_secret(domain_id, client_id, client_secret) +Updates Secret of the identified client. + +Updates secret of the identified in client. Secret is updated using authorization token and the new received info. Update is performed by replacing current key with a new one. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**client_id** | **uuid::Uuid** | Unique client identifier. | [required] | +**client_secret** | [**ClientSecret**](ClientSecret.md) | Secret change data. Client can change its secret. | [required] | + +### Return type + +[**models::Client**](Client.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## update_client_tags + +> models::Client update_client_tags(domain_id, client_id, client_tags) +Updates tags the client. + +Updates tags of the client with provided ID. Tags is updated using authorization token and the new tags received in request. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**client_id** | **uuid::Uuid** | Unique client identifier. | [required] | +**client_tags** | [**ClientTags**](ClientTags.md) | JSON-formated document describing the tags of client to be update | [required] | + +### Return type + +[**models::Client**](Client.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/clients/docs/ClientsPage.md b/clients/docs/ClientsPage.md new file mode 100644 index 00000000..cf1357f4 --- /dev/null +++ b/clients/docs/ClientsPage.md @@ -0,0 +1,14 @@ +# ClientsPage + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**clients** | [**Vec**](ClientWithEmptySecret.md) | | +**total** | **i32** | Total number of items. | +**offset** | **i32** | Number of items to skip during retrieval. | +**limit** | Option<**i32**> | Maximum number of items to return in one page. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/clients/docs/CreateRoleObj.md b/clients/docs/CreateRoleObj.md new file mode 100644 index 00000000..59ac3f4f --- /dev/null +++ b/clients/docs/CreateRoleObj.md @@ -0,0 +1,13 @@ +# CreateRoleObj + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**role_name** | Option<**String**> | Role's name. | [optional] +**optional_actions** | Option<**Vec**> | List of optional actions. | [optional] +**optional_members** | Option<**Vec**> | List of optional members. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/clients/docs/Error.md b/clients/docs/Error.md new file mode 100644 index 00000000..8e78862d --- /dev/null +++ b/clients/docs/Error.md @@ -0,0 +1,11 @@ +# Error + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error** | Option<**String**> | Error message | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/clients/docs/HealthApi.md b/clients/docs/HealthApi.md new file mode 100644 index 00000000..e4985ea0 --- /dev/null +++ b/clients/docs/HealthApi.md @@ -0,0 +1,34 @@ +# \HealthApi + +All URIs are relative to *http://localhost:9006* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**health_get**](HealthApi.md#health_get) | **GET** /health | Retrieves service health check info. + + + +## health_get + +> models::HealthRes health_get() +Retrieves service health check info. + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**models::HealthRes**](HealthRes.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/health+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/clients/docs/HealthRes.md b/clients/docs/HealthRes.md new file mode 100644 index 00000000..319b16fb --- /dev/null +++ b/clients/docs/HealthRes.md @@ -0,0 +1,15 @@ +# HealthRes + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | Option<**String**> | Service status. | [optional] +**version** | Option<**String**> | Service version. | [optional] +**commit** | Option<**String**> | Service commit hash. | [optional] +**description** | Option<**String**> | Service description. | [optional] +**build_time** | Option<**String**> | Service build time. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/clients/docs/NewRole.md b/clients/docs/NewRole.md new file mode 100644 index 00000000..8d232bc0 --- /dev/null +++ b/clients/docs/NewRole.md @@ -0,0 +1,17 @@ +# NewRole + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**role_id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | Role unique identifier. | [optional] +**role_name** | Option<**String**> | Role's name. | [optional] +**entity_id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | Entity unique identifier. | [optional] +**created_by** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | Role creator unique identifier. | [optional] +**created_at** | Option<**String**> | Time when the channel was created. | [optional] +**updated_by** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | Role updater unique identifier. | [optional] +**updated_at** | Option<**String**> | Time when the channel was created. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/clients/docs/ParentGroupReqObj.md b/clients/docs/ParentGroupReqObj.md new file mode 100644 index 00000000..61fb46b3 --- /dev/null +++ b/clients/docs/ParentGroupReqObj.md @@ -0,0 +1,11 @@ +# ParentGroupReqObj + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**parent_group_id** | [**uuid::Uuid**](uuid::Uuid.md) | Parent group unique identifier. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/clients/docs/Role.md b/clients/docs/Role.md new file mode 100644 index 00000000..c7a4694f --- /dev/null +++ b/clients/docs/Role.md @@ -0,0 +1,17 @@ +# Role + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**role_id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | Role unique identifier. | [optional] +**role_name** | Option<**String**> | Role's name. | [optional] +**entity_id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | Entity unique identifier. | [optional] +**created_by** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | Role creator unique identifier. | [optional] +**created_at** | Option<**String**> | Time when the channel was created. | [optional] +**updated_by** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | Role updater unique identifier. | [optional] +**updated_at** | Option<**String**> | Time when the channel was created. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/clients/docs/RoleActionsObj.md b/clients/docs/RoleActionsObj.md new file mode 100644 index 00000000..b61a2345 --- /dev/null +++ b/clients/docs/RoleActionsObj.md @@ -0,0 +1,11 @@ +# RoleActionsObj + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**actions** | Option<**Vec**> | List of actions to be added to a role. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/clients/docs/RoleMembersObj.md b/clients/docs/RoleMembersObj.md new file mode 100644 index 00000000..1d9d997a --- /dev/null +++ b/clients/docs/RoleMembersObj.md @@ -0,0 +1,11 @@ +# RoleMembersObj + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**members** | Option<**Vec**> | List of members to be added to a role. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/clients/docs/RolesApi.md b/clients/docs/RolesApi.md new file mode 100644 index 00000000..ee82c3c4 --- /dev/null +++ b/clients/docs/RolesApi.md @@ -0,0 +1,474 @@ +# \RolesApi + +All URIs are relative to *http://localhost:9006* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**add_client_role_action**](RolesApi.md#add_client_role_action) | **POST** /{domainID}/clients/{clientID}/roles/{roleName}/actions | Adds a role action for a client role. +[**add_client_role_member**](RolesApi.md#add_client_role_member) | **POST** /{domainID}/clients/{clientID}/roles/{roleName}/members | Adds a member to a client role. +[**create_client_role**](RolesApi.md#create_client_role) | **POST** /{domainID}/clients/{clientID}/roles | Creates a role for a client +[**delete_all_client_role_actions**](RolesApi.md#delete_all_client_role_actions) | **POST** /{domainID}/clients/{clientID}/roles/{roleName}/actions/delete-all | Deletes all role actions for a client role. +[**delete_all_client_role_members**](RolesApi.md#delete_all_client_role_members) | **POST** /{domainID}/clients/{clientID}/roles/{roleName}/members/delete-all | Deletes all members from a client role. +[**delete_client_role**](RolesApi.md#delete_client_role) | **DELETE** /{domainID}/clients/{clientID}/roles/{roleName} | Deletes client role. +[**delete_client_role_action**](RolesApi.md#delete_client_role_action) | **POST** /{domainID}/clients/{clientID}/roles/{roleName}/actions/delete | Deletes role actions for a client role. +[**delete_client_role_members**](RolesApi.md#delete_client_role_members) | **POST** /{domainID}/clients/{clientID}/roles/{roleName}/members/delete | Deletes members from a client role. +[**get_client_role**](RolesApi.md#get_client_role) | **GET** /{domainID}/clients/{clientID}/roles/{roleName} | Retrieves client role. +[**list_available_actions**](RolesApi.md#list_available_actions) | **GET** /{domainID}/clients/roles/available-actions | Retrieves available actions. +[**list_client_role_actions**](RolesApi.md#list_client_role_actions) | **GET** /{domainID}/clients/{clientID}/roles/{roleName}/actions | Lists client role actions. +[**list_client_role_members**](RolesApi.md#list_client_role_members) | **GET** /{domainID}/clients/{clientID}/roles/{roleName}/members | Lists client role members. +[**list_client_roles**](RolesApi.md#list_client_roles) | **GET** /{domainID}/clients/{clientID}/roles | Retrieves clients roles. +[**update_client_role**](RolesApi.md#update_client_role) | **PUT** /{domainID}/clients/{clientID}/roles/{roleName} | Updates client role. + + + +## add_client_role_action + +> models::RoleActionsObj add_client_role_action(domain_id, client_id, role_name, role_actions_obj) +Adds a role action for a client role. + +Adds a role action for a specific client role that is identified by the role name. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**client_id** | **uuid::Uuid** | Unique client identifier. | [required] | +**role_name** | **String** | Role's name. | [required] | +**role_actions_obj** | [**RoleActionsObj**](RoleActionsObj.md) | JSON- formatted object decsribing an action to be added to a role. | [required] | + +### Return type + +[**models::RoleActionsObj**](RoleActionsObj.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## add_client_role_member + +> models::RoleMembersObj add_client_role_member(domain_id, client_id, role_name, role_members_obj) +Adds a member to a client role. + +Adds a member to a specific client role that is identified by the role name. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**client_id** | **uuid::Uuid** | Unique client identifier. | [required] | +**role_name** | **String** | Role's name. | [required] | +**role_members_obj** | [**RoleMembersObj**](RoleMembersObj.md) | JSON- formatted object decsribing a member to be added to a role. | [required] | + +### Return type + +[**models::RoleMembersObj**](RoleMembersObj.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## create_client_role + +> models::NewRole create_client_role(domain_id, client_id, create_role_obj) +Creates a role for a client + +Creates a role for a specific client that is identified by the client ID. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**client_id** | **uuid::Uuid** | Unique client identifier. | [required] | +**create_role_obj** | [**CreateRoleObj**](CreateRoleObj.md) | JSON- formatted object decsribing a new role to be created. | [required] | + +### Return type + +[**models::NewRole**](NewRole.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## delete_all_client_role_actions + +> delete_all_client_role_actions(domain_id, client_id, role_name) +Deletes all role actions for a client role. + +Deletes all role actions for a specific client role that is identified by the role name. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**client_id** | **uuid::Uuid** | Unique client identifier. | [required] | +**role_name** | **String** | Role's name. | [required] | + +### Return type + + (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## delete_all_client_role_members + +> delete_all_client_role_members(domain_id, client_id, role_name) +Deletes all members from a client role. + +Deletes all members from a specific client role that is identified by the role name. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**client_id** | **uuid::Uuid** | Unique client identifier. | [required] | +**role_name** | **String** | Role's name. | [required] | + +### Return type + + (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## delete_client_role + +> delete_client_role(domain_id, client_id, role_name) +Deletes client role. + +Deletes a specific client role that is identified by the role name. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**client_id** | **uuid::Uuid** | Unique client identifier. | [required] | +**role_name** | **String** | Role's name. | [required] | + +### Return type + + (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## delete_client_role_action + +> delete_client_role_action(domain_id, client_id, role_name, role_actions_obj) +Deletes role actions for a client role. + +Deletes a role action for a specific client role that is identified by the role name. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**client_id** | **uuid::Uuid** | Unique client identifier. | [required] | +**role_name** | **String** | Role's name. | [required] | +**role_actions_obj** | [**RoleActionsObj**](RoleActionsObj.md) | JSON- formatted object decsribing an action to be added to a role. | [required] | + +### Return type + + (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## delete_client_role_members + +> delete_client_role_members(domain_id, client_id, role_name, role_members_obj) +Deletes members from a client role. + +Deletes a member from a specific client role that is identified by the role name. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**client_id** | **uuid::Uuid** | Unique client identifier. | [required] | +**role_name** | **String** | Role's name. | [required] | +**role_members_obj** | [**RoleMembersObj**](RoleMembersObj.md) | JSON- formatted object decsribing a member to be added to a role. | [required] | + +### Return type + + (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_client_role + +> models::Role get_client_role(domain_id, client_id, role_name) +Retrieves client role. + +Retrieves a specific client role that is identified by the role name. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**client_id** | **uuid::Uuid** | Unique client identifier. | [required] | +**role_name** | **String** | Role's name. | [required] | + +### Return type + +[**models::Role**](Role.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_available_actions + +> models::AvailableActionsObj list_available_actions(domain_id) +Retrieves available actions. + +Retrieves a list of available actions. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | + +### Return type + +[**models::AvailableActionsObj**](AvailableActionsObj.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_client_role_actions + +> models::RoleActionsObj list_client_role_actions(domain_id, client_id, role_name) +Lists client role actions. + +Retrieves a list of client role actions. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**client_id** | **uuid::Uuid** | Unique client identifier. | [required] | +**role_name** | **String** | Role's name. | [required] | + +### Return type + +[**models::RoleActionsObj**](RoleActionsObj.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_client_role_members + +> models::RoleMembersObj list_client_role_members(domain_id, client_id, role_name) +Lists client role members. + +Retrieves a list of client role members. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**client_id** | **uuid::Uuid** | Unique client identifier. | [required] | +**role_name** | **String** | Role's name. | [required] | + +### Return type + +[**models::RoleMembersObj**](RoleMembersObj.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_client_roles + +> models::RolesPage list_client_roles(domain_id, client_id, limit, offset) +Retrieves clients roles. + +Retrieves a list of client roles. Due to performance concerns, data is retrieved in subsets. The API clients must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**client_id** | **uuid::Uuid** | Unique client identifier. | [required] | +**limit** | Option<**i32**> | Size of the subset to retrieve. | |[default to 10] +**offset** | Option<**i32**> | Number of items to skip during retrieval. | |[default to 0] + +### Return type + +[**models::RolesPage**](RolesPage.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## update_client_role + +> models::Role update_client_role(domain_id, client_id, role_name, update_role_obj) +Updates client role. + +Updates a specific client role that is identified by the role name. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**client_id** | **uuid::Uuid** | Unique client identifier. | [required] | +**role_name** | **String** | Role's name. | [required] | +**update_role_obj** | [**UpdateRoleObj**](UpdateRoleObj.md) | JSON- formatted object decsribing a role to be updated. | [required] | + +### Return type + +[**models::Role**](Role.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/clients/docs/RolesPage.md b/clients/docs/RolesPage.md new file mode 100644 index 00000000..be544da3 --- /dev/null +++ b/clients/docs/RolesPage.md @@ -0,0 +1,14 @@ +# RolesPage + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**roles** | Option<[**Vec**](Role.md)> | List of roles. | [optional] +**total** | Option<**i32**> | Total number of roles. | [optional] +**offset** | Option<**i32**> | Number of items to skip during retrieval. | [optional] +**limit** | Option<**i32**> | Maximum number of items to return in one page. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/clients/docs/UpdateRoleObj.md b/clients/docs/UpdateRoleObj.md new file mode 100644 index 00000000..050c5b88 --- /dev/null +++ b/clients/docs/UpdateRoleObj.md @@ -0,0 +1,11 @@ +# UpdateRoleObj + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | Option<**String**> | Role's name. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/clients/git_push.sh b/clients/git_push.sh new file mode 100644 index 00000000..f53a75d4 --- /dev/null +++ b/clients/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/clients/src/apis/clients_api.rs b/clients/src/apis/clients_api.rs new file mode 100644 index 00000000..536d5bea --- /dev/null +++ b/clients/src/apis/clients_api.rs @@ -0,0 +1,647 @@ +/* + * SuperMQ Clients Service + * + * This is the Clients Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform clients. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`bulk_create_clients`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum BulkCreateClientsError { + Status400(), + Status401(), + Status403(), + Status404(), + Status415(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`create_client`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CreateClientError { + Status400(), + Status401(), + Status403(), + Status404(), + Status409(), + Status415(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`disable_client`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DisableClientError { + Status400(), + Status401(), + Status403(), + Status404(), + Status409(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`domain_id_clients_client_id_delete`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DomainIdClientsClientIdDeleteError { + Status400(), + Status401(), + Status403(), + Status404(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`enable_client`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EnableClientError { + Status400(), + Status401(), + Status403(), + Status404(), + Status409(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_client`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetClientError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_clients`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListClientsError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_user_clients`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListUserClientsError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`remove_client_parent_group`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RemoveClientParentGroupError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`set_client_parent_group`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SetClientParentGroupError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`update_client`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UpdateClientError { + Status400(), + Status401(), + Status403(), + Status404(), + Status409(), + Status415(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`update_client_secret`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UpdateClientSecretError { + Status400(), + Status401(), + Status403(), + Status404(), + Status409(), + Status415(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`update_client_tags`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UpdateClientTagsError { + Status400(), + Status403(), + Status404(), + Status401(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + + +/// Adds a list of new clients to the list of clients owned by user identified using the provided access token. +pub async fn bulk_create_clients(configuration: &configuration::Configuration, domain_id: &str, client_req_obj: Vec) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/clients/bulk", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&client_req_obj); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Adds new client to the list of clients owned by user identified using the provided access token. +pub async fn create_client(configuration: &configuration::Configuration, domain_id: &str, client_req_obj: models::ClientReqObj) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/clients", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&client_req_obj); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Disables a specific client that is identified by the client ID. +pub async fn disable_client(configuration: &configuration::Configuration, domain_id: &str, client_id: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/clients/{clientID}/disable", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), clientID=crate::apis::urlencode(client_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Delete client removes a client with the given id from repo and removes all the policies related to this client. +pub async fn domain_id_clients_client_id_delete(configuration: &configuration::Configuration, domain_id: &str, client_id: &str) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/clients/{clientID}", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), clientID=crate::apis::urlencode(client_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Enables a specific client that is identified by the client ID. +pub async fn enable_client(configuration: &configuration::Configuration, domain_id: &str, client_id: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/clients/{clientID}/enable", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), clientID=crate::apis::urlencode(client_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Retrieves a specific client that is identified by the client ID. +pub async fn get_client(configuration: &configuration::Configuration, domain_id: &str, client_id: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/clients/{clientID}", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), clientID=crate::apis::urlencode(client_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Retrieves a list of clients. Due to performance concerns, data is retrieved in subsets. The API clients must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. +pub async fn list_clients(configuration: &configuration::Configuration, domain_id: &str, limit: Option, offset: Option, metadata: Option<&str>, status: Option<&str>, name: Option<&str>, tags: Option>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/clients", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = offset { + local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = metadata { + local_var_req_builder = local_var_req_builder.query(&[("metadata", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = status { + local_var_req_builder = local_var_req_builder.query(&[("status", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = name { + local_var_req_builder = local_var_req_builder.query(&[("name", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = tags { + local_var_req_builder = match "multi" { + "multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("tags".to_owned(), p.to_string())).collect::>()), + _ => local_var_req_builder.query(&[("tags", &local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), + }; + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Lists clients associated with a user identified by the user ID. +pub async fn list_user_clients(configuration: &configuration::Configuration, domain_id: &str, user_id: &str, limit: Option, offset: Option, metadata: Option<&str>, status: Option<&str>, name: Option<&str>, tags: Option>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/users/{userID}/clients", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), userID=crate::apis::urlencode(user_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = offset { + local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = metadata { + local_var_req_builder = local_var_req_builder.query(&[("metadata", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = status { + local_var_req_builder = local_var_req_builder.query(&[("status", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = name { + local_var_req_builder = local_var_req_builder.query(&[("name", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = tags { + local_var_req_builder = match "multi" { + "multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("tags".to_owned(), p.to_string())).collect::>()), + _ => local_var_req_builder.query(&[("tags", &local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), + }; + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Removes a parent group from a specific client that is identified by the client ID. +pub async fn remove_client_parent_group(configuration: &configuration::Configuration, domain_id: &str, client_id: &str, parent_group_req_obj: models::ParentGroupReqObj) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/clients/{clientID}/parent", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), clientID=crate::apis::urlencode(client_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&parent_group_req_obj); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Sets a parent group for a specific client that is identified by the client ID. +pub async fn set_client_parent_group(configuration: &configuration::Configuration, domain_id: &str, client_id: &str, parent_group_req_obj: models::ParentGroupReqObj) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/clients/{clientID}/parent", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), clientID=crate::apis::urlencode(client_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&parent_group_req_obj); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Update is performed by replacing the current resource data with values provided in a request payload. Note that the client's type and ID cannot be changed. +pub async fn update_client(configuration: &configuration::Configuration, domain_id: &str, client_id: &str, client_update: models::ClientUpdate) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/clients/{clientID}", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), clientID=crate::apis::urlencode(client_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&client_update); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Updates secret of the identified in client. Secret is updated using authorization token and the new received info. Update is performed by replacing current key with a new one. +pub async fn update_client_secret(configuration: &configuration::Configuration, domain_id: &str, client_id: &str, client_secret: models::ClientSecret) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/clients/{clientID}/secret", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), clientID=crate::apis::urlencode(client_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&client_secret); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Updates tags of the client with provided ID. Tags is updated using authorization token and the new tags received in request. +pub async fn update_client_tags(configuration: &configuration::Configuration, domain_id: &str, client_id: &str, client_tags: models::ClientTags) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/clients/{clientID}/tags", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), clientID=crate::apis::urlencode(client_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&client_tags); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/clients/src/apis/configuration.rs b/clients/src/apis/configuration.rs new file mode 100644 index 00000000..ce858730 --- /dev/null +++ b/clients/src/apis/configuration.rs @@ -0,0 +1,51 @@ +/* + * SuperMQ Clients Service + * + * This is the Clients Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform clients. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + + + +#[derive(Debug, Clone)] +pub struct Configuration { + pub base_path: String, + pub user_agent: Option, + pub client: reqwest::Client, + pub basic_auth: Option, + pub oauth_access_token: Option, + pub bearer_access_token: Option, + pub api_key: Option, +} + +pub type BasicAuth = (String, Option); + +#[derive(Debug, Clone)] +pub struct ApiKey { + pub prefix: Option, + pub key: String, +} + + +impl Configuration { + pub fn new() -> Configuration { + Configuration::default() + } +} + +impl Default for Configuration { + fn default() -> Self { + Configuration { + base_path: "http://localhost:9006".to_owned(), + user_agent: Some("OpenAPI-Generator/0.15.1/rust".to_owned()), + client: reqwest::Client::new(), + basic_auth: None, + oauth_access_token: None, + bearer_access_token: None, + api_key: None, + } + } +} diff --git a/clients/src/apis/health_api.rs b/clients/src/apis/health_api.rs new file mode 100644 index 00000000..a3c17305 --- /dev/null +++ b/clients/src/apis/health_api.rs @@ -0,0 +1,53 @@ +/* + * SuperMQ Clients Service + * + * This is the Clients Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform clients. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`health_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum HealthGetError { + Status500(models::Error), + UnknownValue(serde_json::Value), +} + + +pub async fn health_get(configuration: &configuration::Configuration, ) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/health", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/clients/src/apis/mod.rs b/clients/src/apis/mod.rs new file mode 100644 index 00000000..270df8fd --- /dev/null +++ b/clients/src/apis/mod.rs @@ -0,0 +1,97 @@ +use std::error; +use std::fmt; + +#[derive(Debug, Clone)] +pub struct ResponseContent { + pub status: reqwest::StatusCode, + pub content: String, + pub entity: Option, +} + +#[derive(Debug)] +pub enum Error { + Reqwest(reqwest::Error), + Serde(serde_json::Error), + Io(std::io::Error), + ResponseError(ResponseContent), +} + +impl fmt::Display for Error { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + let (module, e) = match self { + Error::Reqwest(e) => ("reqwest", e.to_string()), + Error::Serde(e) => ("serde", e.to_string()), + Error::Io(e) => ("IO", e.to_string()), + Error::ResponseError(e) => ("response", format!("status code {}", e.status)), + }; + write!(f, "error in {}: {}", module, e) + } +} + +impl error::Error for Error { + fn source(&self) -> Option<&(dyn error::Error + 'static)> { + Some(match self { + Error::Reqwest(e) => e, + Error::Serde(e) => e, + Error::Io(e) => e, + Error::ResponseError(_) => return None, + }) + } +} + +impl From for Error { + fn from(e: reqwest::Error) -> Self { + Error::Reqwest(e) + } +} + +impl From for Error { + fn from(e: serde_json::Error) -> Self { + Error::Serde(e) + } +} + +impl From for Error { + fn from(e: std::io::Error) -> Self { + Error::Io(e) + } +} + +pub fn urlencode>(s: T) -> String { + ::url::form_urlencoded::byte_serialize(s.as_ref().as_bytes()).collect() +} + +pub fn parse_deep_object(prefix: &str, value: &serde_json::Value) -> Vec<(String, String)> { + if let serde_json::Value::Object(object) = value { + let mut params = vec![]; + + for (key, value) in object { + match value { + serde_json::Value::Object(_) => params.append(&mut parse_deep_object( + &format!("{}[{}]", prefix, key), + value, + )), + serde_json::Value::Array(array) => { + for (i, value) in array.iter().enumerate() { + params.append(&mut parse_deep_object( + &format!("{}[{}][{}]", prefix, key, i), + value, + )); + } + }, + serde_json::Value::String(s) => params.push((format!("{}[{}]", prefix, key), s.clone())), + _ => params.push((format!("{}[{}]", prefix, key), value.to_string())), + } + } + + return params; + } + + unimplemented!("Only objects are supported with style=deepObject") +} + +pub mod clients_api; +pub mod health_api; +pub mod roles_api; + +pub mod configuration; diff --git a/clients/src/apis/roles_api.rs b/clients/src/apis/roles_api.rs new file mode 100644 index 00000000..1686f2f0 --- /dev/null +++ b/clients/src/apis/roles_api.rs @@ -0,0 +1,646 @@ +/* + * SuperMQ Clients Service + * + * This is the Clients Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform clients. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`add_client_role_action`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AddClientRoleActionError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`add_client_role_member`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AddClientRoleMemberError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`create_client_role`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CreateClientRoleError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`delete_all_client_role_actions`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DeleteAllClientRoleActionsError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`delete_all_client_role_members`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DeleteAllClientRoleMembersError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`delete_client_role`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DeleteClientRoleError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`delete_client_role_action`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DeleteClientRoleActionError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`delete_client_role_members`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DeleteClientRoleMembersError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_client_role`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetClientRoleError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_available_actions`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListAvailableActionsError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_client_role_actions`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListClientRoleActionsError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_client_role_members`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListClientRoleMembersError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_client_roles`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListClientRolesError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`update_client_role`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UpdateClientRoleError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + + +/// Adds a role action for a specific client role that is identified by the role name. +pub async fn add_client_role_action(configuration: &configuration::Configuration, domain_id: &str, client_id: &str, role_name: &str, role_actions_obj: models::RoleActionsObj) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/clients/{clientID}/roles/{roleName}/actions", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), clientID=crate::apis::urlencode(client_id), roleName=crate::apis::urlencode(role_name)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&role_actions_obj); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Adds a member to a specific client role that is identified by the role name. +pub async fn add_client_role_member(configuration: &configuration::Configuration, domain_id: &str, client_id: &str, role_name: &str, role_members_obj: models::RoleMembersObj) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/clients/{clientID}/roles/{roleName}/members", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), clientID=crate::apis::urlencode(client_id), roleName=crate::apis::urlencode(role_name)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&role_members_obj); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Creates a role for a specific client that is identified by the client ID. +pub async fn create_client_role(configuration: &configuration::Configuration, domain_id: &str, client_id: &str, create_role_obj: models::CreateRoleObj) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/clients/{clientID}/roles", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), clientID=crate::apis::urlencode(client_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&create_role_obj); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Deletes all role actions for a specific client role that is identified by the role name. +pub async fn delete_all_client_role_actions(configuration: &configuration::Configuration, domain_id: &str, client_id: &str, role_name: &str) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/clients/{clientID}/roles/{roleName}/actions/delete-all", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), clientID=crate::apis::urlencode(client_id), roleName=crate::apis::urlencode(role_name)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Deletes all members from a specific client role that is identified by the role name. +pub async fn delete_all_client_role_members(configuration: &configuration::Configuration, domain_id: &str, client_id: &str, role_name: &str) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/clients/{clientID}/roles/{roleName}/members/delete-all", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), clientID=crate::apis::urlencode(client_id), roleName=crate::apis::urlencode(role_name)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Deletes a specific client role that is identified by the role name. +pub async fn delete_client_role(configuration: &configuration::Configuration, domain_id: &str, client_id: &str, role_name: &str) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/clients/{clientID}/roles/{roleName}", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), clientID=crate::apis::urlencode(client_id), roleName=crate::apis::urlencode(role_name)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Deletes a role action for a specific client role that is identified by the role name. +pub async fn delete_client_role_action(configuration: &configuration::Configuration, domain_id: &str, client_id: &str, role_name: &str, role_actions_obj: models::RoleActionsObj) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/clients/{clientID}/roles/{roleName}/actions/delete", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), clientID=crate::apis::urlencode(client_id), roleName=crate::apis::urlencode(role_name)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&role_actions_obj); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Deletes a member from a specific client role that is identified by the role name. +pub async fn delete_client_role_members(configuration: &configuration::Configuration, domain_id: &str, client_id: &str, role_name: &str, role_members_obj: models::RoleMembersObj) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/clients/{clientID}/roles/{roleName}/members/delete", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), clientID=crate::apis::urlencode(client_id), roleName=crate::apis::urlencode(role_name)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&role_members_obj); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Retrieves a specific client role that is identified by the role name. +pub async fn get_client_role(configuration: &configuration::Configuration, domain_id: &str, client_id: &str, role_name: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/clients/{clientID}/roles/{roleName}", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), clientID=crate::apis::urlencode(client_id), roleName=crate::apis::urlencode(role_name)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Retrieves a list of available actions. +pub async fn list_available_actions(configuration: &configuration::Configuration, domain_id: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/clients/roles/available-actions", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Retrieves a list of client role actions. +pub async fn list_client_role_actions(configuration: &configuration::Configuration, domain_id: &str, client_id: &str, role_name: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/clients/{clientID}/roles/{roleName}/actions", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), clientID=crate::apis::urlencode(client_id), roleName=crate::apis::urlencode(role_name)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Retrieves a list of client role members. +pub async fn list_client_role_members(configuration: &configuration::Configuration, domain_id: &str, client_id: &str, role_name: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/clients/{clientID}/roles/{roleName}/members", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), clientID=crate::apis::urlencode(client_id), roleName=crate::apis::urlencode(role_name)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Retrieves a list of client roles. Due to performance concerns, data is retrieved in subsets. The API clients must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. +pub async fn list_client_roles(configuration: &configuration::Configuration, domain_id: &str, client_id: &str, limit: Option, offset: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/clients/{clientID}/roles", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), clientID=crate::apis::urlencode(client_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = offset { + local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Updates a specific client role that is identified by the role name. +pub async fn update_client_role(configuration: &configuration::Configuration, domain_id: &str, client_id: &str, role_name: &str, update_role_obj: models::UpdateRoleObj) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/clients/{clientID}/roles/{roleName}", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), clientID=crate::apis::urlencode(client_id), roleName=crate::apis::urlencode(role_name)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&update_role_obj); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/clients/src/lib.rs b/clients/src/lib.rs new file mode 100644 index 00000000..e1520628 --- /dev/null +++ b/clients/src/lib.rs @@ -0,0 +1,11 @@ +#![allow(unused_imports)] +#![allow(clippy::too_many_arguments)] + +extern crate serde_repr; +extern crate serde; +extern crate serde_json; +extern crate url; +extern crate reqwest; + +pub mod apis; +pub mod models; diff --git a/clients/src/models/available_actions_obj.rs b/clients/src/models/available_actions_obj.rs new file mode 100644 index 00000000..43d4447e --- /dev/null +++ b/clients/src/models/available_actions_obj.rs @@ -0,0 +1,28 @@ +/* + * SuperMQ Clients Service + * + * This is the Clients Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform clients. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AvailableActionsObj { + /// List of all available actions. + #[serde(rename = "available_actions", skip_serializing_if = "Option::is_none")] + pub available_actions: Option>, +} + +impl AvailableActionsObj { + pub fn new() -> AvailableActionsObj { + AvailableActionsObj { + available_actions: None, + } + } +} + diff --git a/clients/src/models/client.rs b/clients/src/models/client.rs new file mode 100644 index 00000000..22da8075 --- /dev/null +++ b/clients/src/models/client.rs @@ -0,0 +1,59 @@ +/* + * SuperMQ Clients Service + * + * This is the Clients Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform clients. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Client { + /// Client unique identifier. + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + /// Client name. + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + /// Client tags. + #[serde(rename = "tags", skip_serializing_if = "Option::is_none")] + pub tags: Option>, + /// ID of the domain to which client belongs. + #[serde(rename = "domain_id", skip_serializing_if = "Option::is_none")] + pub domain_id: Option, + #[serde(rename = "credentials", skip_serializing_if = "Option::is_none")] + pub credentials: Option>, + /// Arbitrary, object-encoded client's data. + #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")] + pub metadata: Option, + /// Client Status + #[serde(rename = "status", skip_serializing_if = "Option::is_none")] + pub status: Option, + /// Time when the channel was created. + #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] + pub created_at: Option, + /// Time when the channel was created. + #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")] + pub updated_at: Option, +} + +impl Client { + pub fn new() -> Client { + Client { + id: None, + name: None, + tags: None, + domain_id: None, + credentials: None, + metadata: None, + status: None, + created_at: None, + updated_at: None, + } + } +} + diff --git a/clients/src/models/client_credentials.rs b/clients/src/models/client_credentials.rs new file mode 100644 index 00000000..42018d6e --- /dev/null +++ b/clients/src/models/client_credentials.rs @@ -0,0 +1,32 @@ +/* + * SuperMQ Clients Service + * + * This is the Clients Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform clients. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ClientCredentials { + /// Client Identity for example email address. + #[serde(rename = "identity", skip_serializing_if = "Option::is_none")] + pub identity: Option, + /// Client secret password. + #[serde(rename = "secret", skip_serializing_if = "Option::is_none")] + pub secret: Option, +} + +impl ClientCredentials { + pub fn new() -> ClientCredentials { + ClientCredentials { + identity: None, + secret: None, + } + } +} + diff --git a/clients/src/models/client_req_obj.rs b/clients/src/models/client_req_obj.rs new file mode 100644 index 00000000..29ac0fd5 --- /dev/null +++ b/clients/src/models/client_req_obj.rs @@ -0,0 +1,43 @@ +/* + * SuperMQ Clients Service + * + * This is the Clients Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform clients. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ClientReqObj { + /// Client name. + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + /// Client tags. + #[serde(rename = "tags", skip_serializing_if = "Option::is_none")] + pub tags: Option>, + #[serde(rename = "credentials")] + pub credentials: Box, + /// Arbitrary, object-encoded client's data. + #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")] + pub metadata: Option, + /// Client Status + #[serde(rename = "status", skip_serializing_if = "Option::is_none")] + pub status: Option, +} + +impl ClientReqObj { + pub fn new(credentials: models::ClientReqObjCredentials) -> ClientReqObj { + ClientReqObj { + name: None, + tags: None, + credentials: Box::new(credentials), + metadata: None, + status: None, + } + } +} + diff --git a/clients/src/models/client_req_obj_credentials.rs b/clients/src/models/client_req_obj_credentials.rs new file mode 100644 index 00000000..72ef3f17 --- /dev/null +++ b/clients/src/models/client_req_obj_credentials.rs @@ -0,0 +1,32 @@ +/* + * SuperMQ Clients Service + * + * This is the Clients Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform clients. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ClientReqObjCredentials { + /// Client's identity will be used as its unique identifier + #[serde(rename = "identity", skip_serializing_if = "Option::is_none")] + pub identity: Option, + /// Free-form account secret used for acquiring auth token(s). + #[serde(rename = "secret", skip_serializing_if = "Option::is_none")] + pub secret: Option, +} + +impl ClientReqObjCredentials { + pub fn new() -> ClientReqObjCredentials { + ClientReqObjCredentials { + identity: None, + secret: None, + } + } +} + diff --git a/clients/src/models/client_secret.rs b/clients/src/models/client_secret.rs new file mode 100644 index 00000000..0724d24d --- /dev/null +++ b/clients/src/models/client_secret.rs @@ -0,0 +1,28 @@ +/* + * SuperMQ Clients Service + * + * This is the Clients Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform clients. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ClientSecret { + /// New client secret. + #[serde(rename = "secret")] + pub secret: String, +} + +impl ClientSecret { + pub fn new(secret: String) -> ClientSecret { + ClientSecret { + secret, + } + } +} + diff --git a/clients/src/models/client_tags.rs b/clients/src/models/client_tags.rs new file mode 100644 index 00000000..b0c41ab9 --- /dev/null +++ b/clients/src/models/client_tags.rs @@ -0,0 +1,28 @@ +/* + * SuperMQ Clients Service + * + * This is the Clients Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform clients. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ClientTags { + /// Client tags. + #[serde(rename = "tags", skip_serializing_if = "Option::is_none")] + pub tags: Option>, +} + +impl ClientTags { + pub fn new() -> ClientTags { + ClientTags { + tags: None, + } + } +} + diff --git a/clients/src/models/client_update.rs b/clients/src/models/client_update.rs new file mode 100644 index 00000000..3b45325b --- /dev/null +++ b/clients/src/models/client_update.rs @@ -0,0 +1,32 @@ +/* + * SuperMQ Clients Service + * + * This is the Clients Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform clients. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ClientUpdate { + /// Client name. + #[serde(rename = "name")] + pub name: String, + /// Arbitrary, object-encoded client's data. + #[serde(rename = "metadata")] + pub metadata: serde_json::Value, +} + +impl ClientUpdate { + pub fn new(name: String, metadata: serde_json::Value) -> ClientUpdate { + ClientUpdate { + name, + metadata, + } + } +} + diff --git a/clients/src/models/client_with_empty_secret.rs b/clients/src/models/client_with_empty_secret.rs new file mode 100644 index 00000000..b53a24fd --- /dev/null +++ b/clients/src/models/client_with_empty_secret.rs @@ -0,0 +1,59 @@ +/* + * SuperMQ Clients Service + * + * This is the Clients Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform clients. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ClientWithEmptySecret { + /// Client unique identifier. + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + /// Client name. + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + /// Client tags. + #[serde(rename = "tags", skip_serializing_if = "Option::is_none")] + pub tags: Option>, + /// ID of the domain to which client belongs. + #[serde(rename = "domain_id", skip_serializing_if = "Option::is_none")] + pub domain_id: Option, + #[serde(rename = "credentials", skip_serializing_if = "Option::is_none")] + pub credentials: Option>, + /// Arbitrary, object-encoded client's data. + #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")] + pub metadata: Option, + /// Client Status + #[serde(rename = "status", skip_serializing_if = "Option::is_none")] + pub status: Option, + /// Time when the channel was created. + #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] + pub created_at: Option, + /// Time when the channel was created. + #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")] + pub updated_at: Option, +} + +impl ClientWithEmptySecret { + pub fn new() -> ClientWithEmptySecret { + ClientWithEmptySecret { + id: None, + name: None, + tags: None, + domain_id: None, + credentials: None, + metadata: None, + status: None, + created_at: None, + updated_at: None, + } + } +} + diff --git a/clients/src/models/client_with_empty_secret_credentials.rs b/clients/src/models/client_with_empty_secret_credentials.rs new file mode 100644 index 00000000..0a8ac490 --- /dev/null +++ b/clients/src/models/client_with_empty_secret_credentials.rs @@ -0,0 +1,32 @@ +/* + * SuperMQ Clients Service + * + * This is the Clients Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform clients. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ClientWithEmptySecretCredentials { + /// Client Identity for example email address. + #[serde(rename = "identity", skip_serializing_if = "Option::is_none")] + pub identity: Option, + /// Client secret password. + #[serde(rename = "secret", skip_serializing_if = "Option::is_none")] + pub secret: Option, +} + +impl ClientWithEmptySecretCredentials { + pub fn new() -> ClientWithEmptySecretCredentials { + ClientWithEmptySecretCredentials { + identity: None, + secret: None, + } + } +} + diff --git a/clients/src/models/clients_page.rs b/clients/src/models/clients_page.rs new file mode 100644 index 00000000..8fd2c2c1 --- /dev/null +++ b/clients/src/models/clients_page.rs @@ -0,0 +1,39 @@ +/* + * SuperMQ Clients Service + * + * This is the Clients Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform clients. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ClientsPage { + #[serde(rename = "clients")] + pub clients: Vec, + /// Total number of items. + #[serde(rename = "total")] + pub total: i32, + /// Number of items to skip during retrieval. + #[serde(rename = "offset")] + pub offset: i32, + /// Maximum number of items to return in one page. + #[serde(rename = "limit", skip_serializing_if = "Option::is_none")] + pub limit: Option, +} + +impl ClientsPage { + pub fn new(clients: Vec, total: i32, offset: i32) -> ClientsPage { + ClientsPage { + clients, + total, + offset, + limit: None, + } + } +} + diff --git a/clients/src/models/create_role_obj.rs b/clients/src/models/create_role_obj.rs new file mode 100644 index 00000000..99d2164f --- /dev/null +++ b/clients/src/models/create_role_obj.rs @@ -0,0 +1,36 @@ +/* + * SuperMQ Clients Service + * + * This is the Clients Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform clients. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct CreateRoleObj { + /// Role's name. + #[serde(rename = "role_name", skip_serializing_if = "Option::is_none")] + pub role_name: Option, + /// List of optional actions. + #[serde(rename = "optional_actions", skip_serializing_if = "Option::is_none")] + pub optional_actions: Option>, + /// List of optional members. + #[serde(rename = "optional_members", skip_serializing_if = "Option::is_none")] + pub optional_members: Option>, +} + +impl CreateRoleObj { + pub fn new() -> CreateRoleObj { + CreateRoleObj { + role_name: None, + optional_actions: None, + optional_members: None, + } + } +} + diff --git a/clients/src/models/error.rs b/clients/src/models/error.rs new file mode 100644 index 00000000..e8929a08 --- /dev/null +++ b/clients/src/models/error.rs @@ -0,0 +1,28 @@ +/* + * SuperMQ Clients Service + * + * This is the Clients Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform clients. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Error { + /// Error message + #[serde(rename = "error", skip_serializing_if = "Option::is_none")] + pub error: Option, +} + +impl Error { + pub fn new() -> Error { + Error { + error: None, + } + } +} + diff --git a/clients/src/models/health_res.rs b/clients/src/models/health_res.rs new file mode 100644 index 00000000..11646d11 --- /dev/null +++ b/clients/src/models/health_res.rs @@ -0,0 +1,56 @@ +/* + * SuperMQ Clients Service + * + * This is the Clients Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform clients. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct HealthRes { + /// Service status. + #[serde(rename = "status", skip_serializing_if = "Option::is_none")] + pub status: Option, + /// Service version. + #[serde(rename = "version", skip_serializing_if = "Option::is_none")] + pub version: Option, + /// Service commit hash. + #[serde(rename = "commit", skip_serializing_if = "Option::is_none")] + pub commit: Option, + /// Service description. + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option, + /// Service build time. + #[serde(rename = "build_time", skip_serializing_if = "Option::is_none")] + pub build_time: Option, +} + +impl HealthRes { + pub fn new() -> HealthRes { + HealthRes { + status: None, + version: None, + commit: None, + description: None, + build_time: None, + } + } +} +/// Service status. +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Status { + #[serde(rename = "pass")] + Pass, +} + +impl Default for Status { + fn default() -> Status { + Self::Pass + } +} + diff --git a/clients/src/models/mod.rs b/clients/src/models/mod.rs new file mode 100644 index 00000000..72ef2812 --- /dev/null +++ b/clients/src/models/mod.rs @@ -0,0 +1,42 @@ +pub mod available_actions_obj; +pub use self::available_actions_obj::AvailableActionsObj; +pub mod client; +pub use self::client::Client; +pub mod client_credentials; +pub use self::client_credentials::ClientCredentials; +pub mod client_req_obj; +pub use self::client_req_obj::ClientReqObj; +pub mod client_req_obj_credentials; +pub use self::client_req_obj_credentials::ClientReqObjCredentials; +pub mod client_secret; +pub use self::client_secret::ClientSecret; +pub mod client_tags; +pub use self::client_tags::ClientTags; +pub mod client_update; +pub use self::client_update::ClientUpdate; +pub mod client_with_empty_secret; +pub use self::client_with_empty_secret::ClientWithEmptySecret; +pub mod client_with_empty_secret_credentials; +pub use self::client_with_empty_secret_credentials::ClientWithEmptySecretCredentials; +pub mod clients_page; +pub use self::clients_page::ClientsPage; +pub mod create_role_obj; +pub use self::create_role_obj::CreateRoleObj; +pub mod error; +pub use self::error::Error; +pub mod health_res; +pub use self::health_res::HealthRes; +pub mod new_role; +pub use self::new_role::NewRole; +pub mod parent_group_req_obj; +pub use self::parent_group_req_obj::ParentGroupReqObj; +pub mod role; +pub use self::role::Role; +pub mod role_actions_obj; +pub use self::role_actions_obj::RoleActionsObj; +pub mod role_members_obj; +pub use self::role_members_obj::RoleMembersObj; +pub mod roles_page; +pub use self::roles_page::RolesPage; +pub mod update_role_obj; +pub use self::update_role_obj::UpdateRoleObj; diff --git a/clients/src/models/new_role.rs b/clients/src/models/new_role.rs new file mode 100644 index 00000000..70b9d423 --- /dev/null +++ b/clients/src/models/new_role.rs @@ -0,0 +1,52 @@ +/* + * SuperMQ Clients Service + * + * This is the Clients Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform clients. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct NewRole { + /// Role unique identifier. + #[serde(rename = "role_id", skip_serializing_if = "Option::is_none")] + pub role_id: Option, + /// Role's name. + #[serde(rename = "role_name", skip_serializing_if = "Option::is_none")] + pub role_name: Option, + /// Entity unique identifier. + #[serde(rename = "entity_id", skip_serializing_if = "Option::is_none")] + pub entity_id: Option, + /// Role creator unique identifier. + #[serde(rename = "created_by", skip_serializing_if = "Option::is_none")] + pub created_by: Option, + /// Time when the channel was created. + #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] + pub created_at: Option, + /// Role updater unique identifier. + #[serde(rename = "updated_by", skip_serializing_if = "Option::is_none")] + pub updated_by: Option, + /// Time when the channel was created. + #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")] + pub updated_at: Option, +} + +impl NewRole { + pub fn new() -> NewRole { + NewRole { + role_id: None, + role_name: None, + entity_id: None, + created_by: None, + created_at: None, + updated_by: None, + updated_at: None, + } + } +} + diff --git a/clients/src/models/parent_group_req_obj.rs b/clients/src/models/parent_group_req_obj.rs new file mode 100644 index 00000000..bf2cb6e0 --- /dev/null +++ b/clients/src/models/parent_group_req_obj.rs @@ -0,0 +1,28 @@ +/* + * SuperMQ Clients Service + * + * This is the Clients Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform clients. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ParentGroupReqObj { + /// Parent group unique identifier. + #[serde(rename = "parent_group_id")] + pub parent_group_id: uuid::Uuid, +} + +impl ParentGroupReqObj { + pub fn new(parent_group_id: uuid::Uuid) -> ParentGroupReqObj { + ParentGroupReqObj { + parent_group_id, + } + } +} + diff --git a/clients/src/models/role.rs b/clients/src/models/role.rs new file mode 100644 index 00000000..3bb1a30b --- /dev/null +++ b/clients/src/models/role.rs @@ -0,0 +1,52 @@ +/* + * SuperMQ Clients Service + * + * This is the Clients Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform clients. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Role { + /// Role unique identifier. + #[serde(rename = "role_id", skip_serializing_if = "Option::is_none")] + pub role_id: Option, + /// Role's name. + #[serde(rename = "role_name", skip_serializing_if = "Option::is_none")] + pub role_name: Option, + /// Entity unique identifier. + #[serde(rename = "entity_id", skip_serializing_if = "Option::is_none")] + pub entity_id: Option, + /// Role creator unique identifier. + #[serde(rename = "created_by", skip_serializing_if = "Option::is_none")] + pub created_by: Option, + /// Time when the channel was created. + #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] + pub created_at: Option, + /// Role updater unique identifier. + #[serde(rename = "updated_by", skip_serializing_if = "Option::is_none")] + pub updated_by: Option, + /// Time when the channel was created. + #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")] + pub updated_at: Option, +} + +impl Role { + pub fn new() -> Role { + Role { + role_id: None, + role_name: None, + entity_id: None, + created_by: None, + created_at: None, + updated_by: None, + updated_at: None, + } + } +} + diff --git a/clients/src/models/role_actions_obj.rs b/clients/src/models/role_actions_obj.rs new file mode 100644 index 00000000..64dacc72 --- /dev/null +++ b/clients/src/models/role_actions_obj.rs @@ -0,0 +1,28 @@ +/* + * SuperMQ Clients Service + * + * This is the Clients Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform clients. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct RoleActionsObj { + /// List of actions to be added to a role. + #[serde(rename = "actions", skip_serializing_if = "Option::is_none")] + pub actions: Option>, +} + +impl RoleActionsObj { + pub fn new() -> RoleActionsObj { + RoleActionsObj { + actions: None, + } + } +} + diff --git a/clients/src/models/role_members_obj.rs b/clients/src/models/role_members_obj.rs new file mode 100644 index 00000000..73c3781d --- /dev/null +++ b/clients/src/models/role_members_obj.rs @@ -0,0 +1,28 @@ +/* + * SuperMQ Clients Service + * + * This is the Clients Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform clients. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct RoleMembersObj { + /// List of members to be added to a role. + #[serde(rename = "members", skip_serializing_if = "Option::is_none")] + pub members: Option>, +} + +impl RoleMembersObj { + pub fn new() -> RoleMembersObj { + RoleMembersObj { + members: None, + } + } +} + diff --git a/clients/src/models/roles_page.rs b/clients/src/models/roles_page.rs new file mode 100644 index 00000000..429198ca --- /dev/null +++ b/clients/src/models/roles_page.rs @@ -0,0 +1,40 @@ +/* + * SuperMQ Clients Service + * + * This is the Clients Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform clients. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct RolesPage { + /// List of roles. + #[serde(rename = "roles", skip_serializing_if = "Option::is_none")] + pub roles: Option>, + /// Total number of roles. + #[serde(rename = "total", skip_serializing_if = "Option::is_none")] + pub total: Option, + /// Number of items to skip during retrieval. + #[serde(rename = "offset", skip_serializing_if = "Option::is_none")] + pub offset: Option, + /// Maximum number of items to return in one page. + #[serde(rename = "limit", skip_serializing_if = "Option::is_none")] + pub limit: Option, +} + +impl RolesPage { + pub fn new() -> RolesPage { + RolesPage { + roles: None, + total: None, + offset: None, + limit: None, + } + } +} + diff --git a/clients/src/models/update_role_obj.rs b/clients/src/models/update_role_obj.rs new file mode 100644 index 00000000..b5c045f6 --- /dev/null +++ b/clients/src/models/update_role_obj.rs @@ -0,0 +1,28 @@ +/* + * SuperMQ Clients Service + * + * This is the Clients Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform clients. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct UpdateRoleObj { + /// Role's name. + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, +} + +impl UpdateRoleObj { + pub fn new() -> UpdateRoleObj { + UpdateRoleObj { + name: None, + } + } +} + diff --git a/domains/.gitignore b/domains/.gitignore new file mode 100644 index 00000000..6aa10640 --- /dev/null +++ b/domains/.gitignore @@ -0,0 +1,3 @@ +/target/ +**/*.rs.bk +Cargo.lock diff --git a/domains/.openapi-generator-ignore b/domains/.openapi-generator-ignore new file mode 100644 index 00000000..7484ee59 --- /dev/null +++ b/domains/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/domains/.openapi-generator/FILES b/domains/.openapi-generator/FILES new file mode 100644 index 00000000..7384a0b3 --- /dev/null +++ b/domains/.openapi-generator/FILES @@ -0,0 +1,42 @@ +.gitignore +.openapi-generator-ignore +.travis.yml +Cargo.toml +README.md +docs/AvailableActionsObj.md +docs/CreateRoleObj.md +docs/Domain.md +docs/DomainReqObj.md +docs/DomainUpdate.md +docs/DomainsApi.md +docs/DomainsPage.md +docs/HealthApi.md +docs/HealthInfo.md +docs/NewRole.md +docs/Role.md +docs/RoleActionsObj.md +docs/RoleMembersObj.md +docs/RolesApi.md +docs/RolesPage.md +docs/UpdateRoleObj.md +git_push.sh +src/apis/configuration.rs +src/apis/domains_api.rs +src/apis/health_api.rs +src/apis/mod.rs +src/apis/roles_api.rs +src/lib.rs +src/models/available_actions_obj.rs +src/models/create_role_obj.rs +src/models/domain.rs +src/models/domain_req_obj.rs +src/models/domain_update.rs +src/models/domains_page.rs +src/models/health_info.rs +src/models/mod.rs +src/models/new_role.rs +src/models/role.rs +src/models/role_actions_obj.rs +src/models/role_members_obj.rs +src/models/roles_page.rs +src/models/update_role_obj.rs diff --git a/domains/.openapi-generator/VERSION b/domains/.openapi-generator/VERSION new file mode 100644 index 00000000..758bb9c8 --- /dev/null +++ b/domains/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.10.0 diff --git a/domains/.travis.yml b/domains/.travis.yml new file mode 100644 index 00000000..22761ba7 --- /dev/null +++ b/domains/.travis.yml @@ -0,0 +1 @@ +language: rust diff --git a/domains/Cargo.toml b/domains/Cargo.toml new file mode 100644 index 00000000..52c07121 --- /dev/null +++ b/domains/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "domains-openapi" +version = "0.15.1" +authors = ["info@abstractmachines.fr"] +description = "This is the Domains Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform domains. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The Magistrala repository](https://github.com/absmach/magistrala) " +license = "Apache 2.0" +edition = "2021" + +[dependencies] +serde = { version = "^1.0", features = ["derive"] } +serde_json = "^1.0" +serde_repr = "^0.1" +url = "^2.5" +uuid = { version = "^1.8", features = ["serde", "v4"] } +reqwest = { version = "^0.12", features = ["json", "multipart"] } diff --git a/domains/README.md b/domains/README.md new file mode 100644 index 00000000..edc6aa97 --- /dev/null +++ b/domains/README.md @@ -0,0 +1,82 @@ +# Rust API client for openapi + +This is the Domains Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform domains. You can now help us improve the API whether it's by making changes to the definition itself or to the code. +Some useful links: +- [The Magistrala repository](https://github.com/absmach/magistrala) + + + +## Overview + +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://openapis.org) from a remote server, you can easily generate an API client. + +- API version: 0.15.1 +- Package version: 0.15.1 +- Generator version: 7.10.0 +- Build package: `org.openapitools.codegen.languages.RustClientCodegen` + +## Installation + +Put the package under your project folder in a directory named `openapi` and add the following to `Cargo.toml` under `[dependencies]`: + +``` +openapi = { path = "./openapi" } +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost:9003* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DomainsApi* | [**domains_domain_id_disable_post**](docs/DomainsApi.md#domains_domain_id_disable_post) | **POST** /domains/{domainID}/disable | Disable a domain +*DomainsApi* | [**domains_domain_id_enable_post**](docs/DomainsApi.md#domains_domain_id_enable_post) | **POST** /domains/{domainID}/enable | Enables a domain +*DomainsApi* | [**domains_domain_id_freeze_post**](docs/DomainsApi.md#domains_domain_id_freeze_post) | **POST** /domains/{domainID}/freeze | Freeze a domain +*DomainsApi* | [**domains_domain_id_get**](docs/DomainsApi.md#domains_domain_id_get) | **GET** /domains/{domainID} | Retrieves domain information +*DomainsApi* | [**domains_domain_id_patch**](docs/DomainsApi.md#domains_domain_id_patch) | **PATCH** /domains/{domainID} | Updates name, metadata, tags and alias of the domain. +*DomainsApi* | [**domains_get**](docs/DomainsApi.md#domains_get) | **GET** /domains | Retrieves list of domains. +*DomainsApi* | [**domains_post**](docs/DomainsApi.md#domains_post) | **POST** /domains | Adds new domain +*HealthApi* | [**health_get**](docs/HealthApi.md#health_get) | **GET** /health | Retrieves service health check info. +*RolesApi* | [**add_domain_role_action**](docs/RolesApi.md#add_domain_role_action) | **POST** /domains/{domainID}/roles/{roleName}/actions | Adds a role action for a domain role. +*RolesApi* | [**add_domain_role_member**](docs/RolesApi.md#add_domain_role_member) | **POST** /domains/{domainID}/roles/{roleName}/members | Adds a member to a domain role. +*RolesApi* | [**create_domain_role**](docs/RolesApi.md#create_domain_role) | **POST** /domains/{domainID}/roles | Creates a role for a domain +*RolesApi* | [**delete_all_domain_role_actions**](docs/RolesApi.md#delete_all_domain_role_actions) | **POST** /domains/{domainID}/roles/{roleName}/actions/delete-all | Deletes all role actions for a domain role. +*RolesApi* | [**delete_all_domain_role_members**](docs/RolesApi.md#delete_all_domain_role_members) | **POST** /domains/{domainID}/roles/{roleName}/members/delete-all | Deletes all members from a domain role. +*RolesApi* | [**delete_domain_role**](docs/RolesApi.md#delete_domain_role) | **DELETE** /domains/{domainID}/roles/{roleName} | Deletes domain role. +*RolesApi* | [**delete_domain_role_action**](docs/RolesApi.md#delete_domain_role_action) | **POST** /domains/{domainID}/roles/{roleName}/actions/delete | Deletes role actions for a domain role. +*RolesApi* | [**delete_domain_role_members**](docs/RolesApi.md#delete_domain_role_members) | **POST** /domains/{domainID}/roles/{roleName}/members/delete | Deletes members from a domain role. +*RolesApi* | [**get_domain_role**](docs/RolesApi.md#get_domain_role) | **GET** /domains/{domainID}/roles/{roleName} | Retrieves domain role. +*RolesApi* | [**list_available_actions**](docs/RolesApi.md#list_available_actions) | **GET** /domains/roles/available-actions | Retrieves available actions. +*RolesApi* | [**list_domain_role_actions**](docs/RolesApi.md#list_domain_role_actions) | **GET** /domains/{domainID}/roles/{roleName}/actions | Lists domain role actions. +*RolesApi* | [**list_domain_role_members**](docs/RolesApi.md#list_domain_role_members) | **GET** /domains/{domainID}/roles/{roleName}/members | Lists domain role members. +*RolesApi* | [**list_domain_roles**](docs/RolesApi.md#list_domain_roles) | **GET** /domains/{domainID}/roles | Retrieves domains roles. +*RolesApi* | [**update_domain_role**](docs/RolesApi.md#update_domain_role) | **PUT** /domains/{domainID}/roles/{roleName} | Updates domain role. + + +## Documentation For Models + + - [AvailableActionsObj](docs/AvailableActionsObj.md) + - [CreateRoleObj](docs/CreateRoleObj.md) + - [Domain](docs/Domain.md) + - [DomainReqObj](docs/DomainReqObj.md) + - [DomainUpdate](docs/DomainUpdate.md) + - [DomainsPage](docs/DomainsPage.md) + - [HealthInfo](docs/HealthInfo.md) + - [NewRole](docs/NewRole.md) + - [Role](docs/Role.md) + - [RoleActionsObj](docs/RoleActionsObj.md) + - [RoleMembersObj](docs/RoleMembersObj.md) + - [RolesPage](docs/RolesPage.md) + - [UpdateRoleObj](docs/UpdateRoleObj.md) + + +To get access to the crate's generated documentation, use: + +``` +cargo doc --open +``` + +## Author + +info@abstractmachines.fr + diff --git a/domains/docs/AvailableActionsObj.md b/domains/docs/AvailableActionsObj.md new file mode 100644 index 00000000..07f6848c --- /dev/null +++ b/domains/docs/AvailableActionsObj.md @@ -0,0 +1,11 @@ +# AvailableActionsObj + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**available_actions** | Option<**Vec**> | List of all available actions. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/domains/docs/CreateRoleObj.md b/domains/docs/CreateRoleObj.md new file mode 100644 index 00000000..59ac3f4f --- /dev/null +++ b/domains/docs/CreateRoleObj.md @@ -0,0 +1,13 @@ +# CreateRoleObj + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**role_name** | Option<**String**> | Role's name. | [optional] +**optional_actions** | Option<**Vec**> | List of optional actions. | [optional] +**optional_members** | Option<**Vec**> | List of optional members. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/domains/docs/Domain.md b/domains/docs/Domain.md new file mode 100644 index 00000000..d2ec9dcb --- /dev/null +++ b/domains/docs/Domain.md @@ -0,0 +1,20 @@ +# Domain + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | Domain unique identified. | [optional] +**name** | Option<**String**> | Domain name. | [optional] +**tags** | Option<**Vec**> | domain tags. | [optional] +**metadata** | Option<[**serde_json::Value**](.md)> | Arbitrary, object-encoded domain's data. | [optional] +**alias** | Option<**String**> | Domain alias. | [optional] +**status** | Option<**String**> | Domain Status | [optional] +**created_by** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | User ID of the user who created the domain. | [optional] +**created_at** | Option<**String**> | Time when the domain was created. | [optional] +**updated_by** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | User ID of the user who last updated the domain. | [optional] +**updated_at** | Option<**String**> | Time when the domain was last updated. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/domains/docs/DomainReqObj.md b/domains/docs/DomainReqObj.md new file mode 100644 index 00000000..2d089a37 --- /dev/null +++ b/domains/docs/DomainReqObj.md @@ -0,0 +1,14 @@ +# DomainReqObj + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | Domain name. | +**tags** | Option<**Vec**> | domain tags. | [optional] +**metadata** | Option<[**serde_json::Value**](.md)> | Arbitrary, object-encoded domain's data. | [optional] +**alias** | **String** | Domain alias. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/domains/docs/DomainUpdate.md b/domains/docs/DomainUpdate.md new file mode 100644 index 00000000..7feabf52 --- /dev/null +++ b/domains/docs/DomainUpdate.md @@ -0,0 +1,14 @@ +# DomainUpdate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | Option<**String**> | Domain name. | [optional] +**tags** | Option<**Vec**> | domain tags. | [optional] +**metadata** | Option<[**serde_json::Value**](.md)> | Arbitrary, object-encoded domain's data. | [optional] +**alias** | Option<**String**> | Domain alias. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/domains/docs/DomainsApi.md b/domains/docs/DomainsApi.md new file mode 100644 index 00000000..42b7930c --- /dev/null +++ b/domains/docs/DomainsApi.md @@ -0,0 +1,231 @@ +# \DomainsApi + +All URIs are relative to *http://localhost:9003* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**domains_domain_id_disable_post**](DomainsApi.md#domains_domain_id_disable_post) | **POST** /domains/{domainID}/disable | Disable a domain +[**domains_domain_id_enable_post**](DomainsApi.md#domains_domain_id_enable_post) | **POST** /domains/{domainID}/enable | Enables a domain +[**domains_domain_id_freeze_post**](DomainsApi.md#domains_domain_id_freeze_post) | **POST** /domains/{domainID}/freeze | Freeze a domain +[**domains_domain_id_get**](DomainsApi.md#domains_domain_id_get) | **GET** /domains/{domainID} | Retrieves domain information +[**domains_domain_id_patch**](DomainsApi.md#domains_domain_id_patch) | **PATCH** /domains/{domainID} | Updates name, metadata, tags and alias of the domain. +[**domains_get**](DomainsApi.md#domains_get) | **GET** /domains | Retrieves list of domains. +[**domains_post**](DomainsApi.md#domains_post) | **POST** /domains | Adds new domain + + + +## domains_domain_id_disable_post + +> domains_domain_id_disable_post(domain_id) +Disable a domain + +Disable a specific domain that is identified by the domain ID. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identified. | [required] | + +### Return type + + (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## domains_domain_id_enable_post + +> domains_domain_id_enable_post(domain_id) +Enables a domain + +Enables a specific domain that is identified by the domain ID. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identified. | [required] | + +### Return type + + (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## domains_domain_id_freeze_post + +> domains_domain_id_freeze_post(domain_id) +Freeze a domain + +Freeze a specific domain that is identified by the domain ID. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identified. | [required] | + +### Return type + + (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## domains_domain_id_get + +> models::Domain domains_domain_id_get(domain_id) +Retrieves domain information + +Retrieves a specific domain that is identified by the domain ID. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identified. | [required] | + +### Return type + +[**models::Domain**](Domain.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## domains_domain_id_patch + +> models::Domain domains_domain_id_patch(domain_id, domain_update) +Updates name, metadata, tags and alias of the domain. + +Updates name, metadata, tags and alias of the domain. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identified. | [required] | +**domain_update** | [**DomainUpdate**](DomainUpdate.md) | JSON-formated document describing the name, alias, tags, and metadata of the domain to be updated | [required] | + +### Return type + +[**models::Domain**](Domain.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## domains_get + +> models::DomainsPage domains_get(limit, offset, metadata, status, name, permission) +Retrieves list of domains. + +Retrieves list of domains that the user have access. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**limit** | Option<**i32**> | Size of the subset to retrieve. | |[default to 10] +**offset** | Option<**i32**> | Number of items to skip during retrieval. | |[default to 0] +**metadata** | Option<[**std::collections::HashMap**](serde_json::Value.md)> | Metadata filter. Filtering is performed matching the parameter with metadata on top level. Parameter is json. | | +**status** | Option<**String**> | Domain status. | |[default to enabled] +**name** | Option<**String**> | Domain's name. | | +**permission** | Option<**String**> | permission. | | + +### Return type + +[**models::DomainsPage**](DomainsPage.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## domains_post + +> models::Domain domains_post(domain_req_obj) +Adds new domain + +Adds new domain. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_req_obj** | [**DomainReqObj**](DomainReqObj.md) | JSON-formatted document describing the new domain to be registered | [required] | + +### Return type + +[**models::Domain**](Domain.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/domains/docs/DomainsPage.md b/domains/docs/DomainsPage.md new file mode 100644 index 00000000..eb4f79de --- /dev/null +++ b/domains/docs/DomainsPage.md @@ -0,0 +1,14 @@ +# DomainsPage + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**domains** | [**Vec**](Domain.md) | | +**total** | **i32** | Total number of items. | +**offset** | **i32** | Number of items to skip during retrieval. | +**limit** | Option<**i32**> | Maximum number of items to return in one page. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/domains/docs/HealthApi.md b/domains/docs/HealthApi.md new file mode 100644 index 00000000..2114f4dd --- /dev/null +++ b/domains/docs/HealthApi.md @@ -0,0 +1,34 @@ +# \HealthApi + +All URIs are relative to *http://localhost:9003* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**health_get**](HealthApi.md#health_get) | **GET** /health | Retrieves service health check info. + + + +## health_get + +> models::HealthInfo health_get() +Retrieves service health check info. + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**models::HealthInfo**](health_info.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/health+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/domains/docs/HealthInfo.md b/domains/docs/HealthInfo.md new file mode 100644 index 00000000..ee8f5c6b --- /dev/null +++ b/domains/docs/HealthInfo.md @@ -0,0 +1,16 @@ +# HealthInfo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | Option<**String**> | Service status. | [optional] +**version** | Option<**String**> | Service version. | [optional] +**commit** | Option<**String**> | Service commit hash. | [optional] +**description** | Option<**String**> | Service description. | [optional] +**build_time** | Option<**String**> | Service build time. | [optional] +**instance_id** | Option<**String**> | Service instance ID. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/domains/docs/NewRole.md b/domains/docs/NewRole.md new file mode 100644 index 00000000..8d232bc0 --- /dev/null +++ b/domains/docs/NewRole.md @@ -0,0 +1,17 @@ +# NewRole + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**role_id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | Role unique identifier. | [optional] +**role_name** | Option<**String**> | Role's name. | [optional] +**entity_id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | Entity unique identifier. | [optional] +**created_by** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | Role creator unique identifier. | [optional] +**created_at** | Option<**String**> | Time when the channel was created. | [optional] +**updated_by** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | Role updater unique identifier. | [optional] +**updated_at** | Option<**String**> | Time when the channel was created. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/domains/docs/Role.md b/domains/docs/Role.md new file mode 100644 index 00000000..c7a4694f --- /dev/null +++ b/domains/docs/Role.md @@ -0,0 +1,17 @@ +# Role + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**role_id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | Role unique identifier. | [optional] +**role_name** | Option<**String**> | Role's name. | [optional] +**entity_id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | Entity unique identifier. | [optional] +**created_by** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | Role creator unique identifier. | [optional] +**created_at** | Option<**String**> | Time when the channel was created. | [optional] +**updated_by** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | Role updater unique identifier. | [optional] +**updated_at** | Option<**String**> | Time when the channel was created. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/domains/docs/RoleActionsObj.md b/domains/docs/RoleActionsObj.md new file mode 100644 index 00000000..b61a2345 --- /dev/null +++ b/domains/docs/RoleActionsObj.md @@ -0,0 +1,11 @@ +# RoleActionsObj + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**actions** | Option<**Vec**> | List of actions to be added to a role. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/domains/docs/RoleMembersObj.md b/domains/docs/RoleMembersObj.md new file mode 100644 index 00000000..1d9d997a --- /dev/null +++ b/domains/docs/RoleMembersObj.md @@ -0,0 +1,11 @@ +# RoleMembersObj + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**members** | Option<**Vec**> | List of members to be added to a role. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/domains/docs/RolesApi.md b/domains/docs/RolesApi.md new file mode 100644 index 00000000..f733a87b --- /dev/null +++ b/domains/docs/RolesApi.md @@ -0,0 +1,461 @@ +# \RolesApi + +All URIs are relative to *http://localhost:9003* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**add_domain_role_action**](RolesApi.md#add_domain_role_action) | **POST** /domains/{domainID}/roles/{roleName}/actions | Adds a role action for a domain role. +[**add_domain_role_member**](RolesApi.md#add_domain_role_member) | **POST** /domains/{domainID}/roles/{roleName}/members | Adds a member to a domain role. +[**create_domain_role**](RolesApi.md#create_domain_role) | **POST** /domains/{domainID}/roles | Creates a role for a domain +[**delete_all_domain_role_actions**](RolesApi.md#delete_all_domain_role_actions) | **POST** /domains/{domainID}/roles/{roleName}/actions/delete-all | Deletes all role actions for a domain role. +[**delete_all_domain_role_members**](RolesApi.md#delete_all_domain_role_members) | **POST** /domains/{domainID}/roles/{roleName}/members/delete-all | Deletes all members from a domain role. +[**delete_domain_role**](RolesApi.md#delete_domain_role) | **DELETE** /domains/{domainID}/roles/{roleName} | Deletes domain role. +[**delete_domain_role_action**](RolesApi.md#delete_domain_role_action) | **POST** /domains/{domainID}/roles/{roleName}/actions/delete | Deletes role actions for a domain role. +[**delete_domain_role_members**](RolesApi.md#delete_domain_role_members) | **POST** /domains/{domainID}/roles/{roleName}/members/delete | Deletes members from a domain role. +[**get_domain_role**](RolesApi.md#get_domain_role) | **GET** /domains/{domainID}/roles/{roleName} | Retrieves domain role. +[**list_available_actions**](RolesApi.md#list_available_actions) | **GET** /domains/roles/available-actions | Retrieves available actions. +[**list_domain_role_actions**](RolesApi.md#list_domain_role_actions) | **GET** /domains/{domainID}/roles/{roleName}/actions | Lists domain role actions. +[**list_domain_role_members**](RolesApi.md#list_domain_role_members) | **GET** /domains/{domainID}/roles/{roleName}/members | Lists domain role members. +[**list_domain_roles**](RolesApi.md#list_domain_roles) | **GET** /domains/{domainID}/roles | Retrieves domains roles. +[**update_domain_role**](RolesApi.md#update_domain_role) | **PUT** /domains/{domainID}/roles/{roleName} | Updates domain role. + + + +## add_domain_role_action + +> models::RoleActionsObj add_domain_role_action(domain_id, role_name, role_actions_obj) +Adds a role action for a domain role. + +Adds a role action for a specific domain role that is identified by the role name. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identified. | [required] | +**role_name** | **String** | Role's name. | [required] | +**role_actions_obj** | [**RoleActionsObj**](RoleActionsObj.md) | JSON- formatted object decsribing an action to be added to a role. | [required] | + +### Return type + +[**models::RoleActionsObj**](RoleActionsObj.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## add_domain_role_member + +> models::RoleMembersObj add_domain_role_member(domain_id, role_name, role_members_obj) +Adds a member to a domain role. + +Adds a member to a specific domain role that is identified by the role name. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identified. | [required] | +**role_name** | **String** | Role's name. | [required] | +**role_members_obj** | [**RoleMembersObj**](RoleMembersObj.md) | JSON- formatted object decsribing a member to be added to a role. | [required] | + +### Return type + +[**models::RoleMembersObj**](RoleMembersObj.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## create_domain_role + +> models::NewRole create_domain_role(domain_id, create_role_obj) +Creates a role for a domain + +Creates a role for a specific domain that is identified by the domain ID. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identified. | [required] | +**create_role_obj** | [**CreateRoleObj**](CreateRoleObj.md) | JSON- formatted object decsribing a new role to be created. | [required] | + +### Return type + +[**models::NewRole**](NewRole.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## delete_all_domain_role_actions + +> delete_all_domain_role_actions(domain_id, role_name) +Deletes all role actions for a domain role. + +Deletes all role actions for a specific domain role that is identified by the role name. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identified. | [required] | +**role_name** | **String** | Role's name. | [required] | + +### Return type + + (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## delete_all_domain_role_members + +> delete_all_domain_role_members(domain_id, role_name) +Deletes all members from a domain role. + +Deletes all members from a specific domain role that is identified by the role name. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identified. | [required] | +**role_name** | **String** | Role's name. | [required] | + +### Return type + + (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## delete_domain_role + +> delete_domain_role(domain_id, role_name) +Deletes domain role. + +Deletes a specific domain role that is identified by the role name. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identified. | [required] | +**role_name** | **String** | Role's name. | [required] | + +### Return type + + (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## delete_domain_role_action + +> delete_domain_role_action(domain_id, role_name, role_actions_obj) +Deletes role actions for a domain role. + +Deletes a role action for a specific domain role that is identified by the role name. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identified. | [required] | +**role_name** | **String** | Role's name. | [required] | +**role_actions_obj** | [**RoleActionsObj**](RoleActionsObj.md) | JSON- formatted object decsribing an action to be added to a role. | [required] | + +### Return type + + (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## delete_domain_role_members + +> delete_domain_role_members(domain_id, role_name, role_members_obj) +Deletes members from a domain role. + +Deletes a member from a specific domain role that is identified by the role name. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identified. | [required] | +**role_name** | **String** | Role's name. | [required] | +**role_members_obj** | [**RoleMembersObj**](RoleMembersObj.md) | JSON- formatted object decsribing a member to be added to a role. | [required] | + +### Return type + + (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_domain_role + +> models::Role get_domain_role(domain_id, role_name) +Retrieves domain role. + +Retrieves a specific domain role that is identified by the role name. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identified. | [required] | +**role_name** | **String** | Role's name. | [required] | + +### Return type + +[**models::Role**](Role.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_available_actions + +> models::AvailableActionsObj list_available_actions(domain_id) +Retrieves available actions. + +Retrieves a list of available actions. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identified. | [required] | + +### Return type + +[**models::AvailableActionsObj**](AvailableActionsObj.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_domain_role_actions + +> models::RoleActionsObj list_domain_role_actions(domain_id, role_name) +Lists domain role actions. + +Retrieves a list of domain role actions. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identified. | [required] | +**role_name** | **String** | Role's name. | [required] | + +### Return type + +[**models::RoleActionsObj**](RoleActionsObj.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_domain_role_members + +> models::RoleMembersObj list_domain_role_members(domain_id, role_name) +Lists domain role members. + +Retrieves a list of domain role members. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identified. | [required] | +**role_name** | **String** | Role's name. | [required] | + +### Return type + +[**models::RoleMembersObj**](RoleMembersObj.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_domain_roles + +> models::RolesPage list_domain_roles(domain_id, limit, offset) +Retrieves domains roles. + +Retrieves a list of domain roles. Due to performance concerns, data is retrieved in subsets. The API domains must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identified. | [required] | +**limit** | Option<**i32**> | Size of the subset to retrieve. | |[default to 10] +**offset** | Option<**i32**> | Number of items to skip during retrieval. | |[default to 0] + +### Return type + +[**models::RolesPage**](RolesPage.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## update_domain_role + +> models::Role update_domain_role(domain_id, role_name, update_role_obj) +Updates domain role. + +Updates a specific domain role that is identified by the role name. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identified. | [required] | +**role_name** | **String** | Role's name. | [required] | +**update_role_obj** | [**UpdateRoleObj**](UpdateRoleObj.md) | JSON- formatted object decsribing a role to be updated. | [required] | + +### Return type + +[**models::Role**](Role.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/domains/docs/RolesPage.md b/domains/docs/RolesPage.md new file mode 100644 index 00000000..be544da3 --- /dev/null +++ b/domains/docs/RolesPage.md @@ -0,0 +1,14 @@ +# RolesPage + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**roles** | Option<[**Vec**](Role.md)> | List of roles. | [optional] +**total** | Option<**i32**> | Total number of roles. | [optional] +**offset** | Option<**i32**> | Number of items to skip during retrieval. | [optional] +**limit** | Option<**i32**> | Maximum number of items to return in one page. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/domains/docs/UpdateRoleObj.md b/domains/docs/UpdateRoleObj.md new file mode 100644 index 00000000..050c5b88 --- /dev/null +++ b/domains/docs/UpdateRoleObj.md @@ -0,0 +1,11 @@ +# UpdateRoleObj + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | Option<**String**> | Role's name. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/domains/git_push.sh b/domains/git_push.sh new file mode 100644 index 00000000..f53a75d4 --- /dev/null +++ b/domains/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/domains/src/apis/configuration.rs b/domains/src/apis/configuration.rs new file mode 100644 index 00000000..ddbee6af --- /dev/null +++ b/domains/src/apis/configuration.rs @@ -0,0 +1,51 @@ +/* + * Magistrala Domains Service + * + * This is the Domains Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform domains. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The Magistrala repository](https://github.com/absmach/magistrala) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + + + +#[derive(Debug, Clone)] +pub struct Configuration { + pub base_path: String, + pub user_agent: Option, + pub client: reqwest::Client, + pub basic_auth: Option, + pub oauth_access_token: Option, + pub bearer_access_token: Option, + pub api_key: Option, +} + +pub type BasicAuth = (String, Option); + +#[derive(Debug, Clone)] +pub struct ApiKey { + pub prefix: Option, + pub key: String, +} + + +impl Configuration { + pub fn new() -> Configuration { + Configuration::default() + } +} + +impl Default for Configuration { + fn default() -> Self { + Configuration { + base_path: "http://localhost:9003".to_owned(), + user_agent: Some("OpenAPI-Generator/0.15.1/rust".to_owned()), + client: reqwest::Client::new(), + basic_auth: None, + oauth_access_token: None, + bearer_access_token: None, + api_key: None, + } + } +} diff --git a/domains/src/apis/domains_api.rs b/domains/src/apis/domains_api.rs new file mode 100644 index 00000000..66acecdc --- /dev/null +++ b/domains/src/apis/domains_api.rs @@ -0,0 +1,350 @@ +/* + * Magistrala Domains Service + * + * This is the Domains Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform domains. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The Magistrala repository](https://github.com/absmach/magistrala) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`domains_domain_id_disable_post`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DomainsDomainIdDisablePostError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`domains_domain_id_enable_post`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DomainsDomainIdEnablePostError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`domains_domain_id_freeze_post`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DomainsDomainIdFreezePostError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`domains_domain_id_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DomainsDomainIdGetError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`domains_domain_id_patch`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DomainsDomainIdPatchError { + Status400(), + Status401(), + Status403(), + Status404(), + Status415(), + Status500(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`domains_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DomainsGetError { + Status400(), + Status401(), + Status404(), + Status422(), + Status500(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`domains_post`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DomainsPostError { + Status400(), + Status401(), + Status409(), + Status415(), + Status422(), + Status500(), + UnknownValue(serde_json::Value), +} + + +/// Disable a specific domain that is identified by the domain ID. +pub async fn domains_domain_id_disable_post(configuration: &configuration::Configuration, domain_id: &str) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/domains/{domainID}/disable", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Enables a specific domain that is identified by the domain ID. +pub async fn domains_domain_id_enable_post(configuration: &configuration::Configuration, domain_id: &str) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/domains/{domainID}/enable", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Freeze a specific domain that is identified by the domain ID. +pub async fn domains_domain_id_freeze_post(configuration: &configuration::Configuration, domain_id: &str) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/domains/{domainID}/freeze", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Retrieves a specific domain that is identified by the domain ID. +pub async fn domains_domain_id_get(configuration: &configuration::Configuration, domain_id: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/domains/{domainID}", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Updates name, metadata, tags and alias of the domain. +pub async fn domains_domain_id_patch(configuration: &configuration::Configuration, domain_id: &str, domain_update: models::DomainUpdate) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/domains/{domainID}", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&domain_update); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Retrieves list of domains that the user have access. +pub async fn domains_get(configuration: &configuration::Configuration, limit: Option, offset: Option, metadata: Option>, status: Option<&str>, name: Option<&str>, permission: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/domains", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = offset { + local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); + } + if let Some(ref local_var_metadata) = metadata { + // Serialize metadata (HashMap) to JSON string + let metadata_json = serde_json::to_string(local_var_metadata) + .map_err(|e| Error::Serde(e))?; // Map to Serde error instead of SerializationError + + // Add the serialized JSON string to the query parameters + local_var_req_builder = local_var_req_builder.query(&[("metadata", &metadata_json)]); + } + if let Some(ref local_var_str) = status { + local_var_req_builder = local_var_req_builder.query(&[("status", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = name { + local_var_req_builder = local_var_req_builder.query(&[("name", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = permission { + local_var_req_builder = local_var_req_builder.query(&[("permission", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Adds new domain. +pub async fn domains_post(configuration: &configuration::Configuration, domain_req_obj: models::DomainReqObj) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/domains", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&domain_req_obj); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/domains/src/apis/health_api.rs b/domains/src/apis/health_api.rs new file mode 100644 index 00000000..fc380e64 --- /dev/null +++ b/domains/src/apis/health_api.rs @@ -0,0 +1,53 @@ +/* + * Magistrala Domains Service + * + * This is the Domains Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform domains. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The Magistrala repository](https://github.com/absmach/magistrala) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`health_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum HealthGetError { + Status500(), + UnknownValue(serde_json::Value), +} + + +pub async fn health_get(configuration: &configuration::Configuration, ) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/health", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/domains/src/apis/mod.rs b/domains/src/apis/mod.rs new file mode 100644 index 00000000..76b597a8 --- /dev/null +++ b/domains/src/apis/mod.rs @@ -0,0 +1,97 @@ +use std::error; +use std::fmt; + +#[derive(Debug, Clone)] +pub struct ResponseContent { + pub status: reqwest::StatusCode, + pub content: String, + pub entity: Option, +} + +#[derive(Debug)] +pub enum Error { + Reqwest(reqwest::Error), + Serde(serde_json::Error), + Io(std::io::Error), + ResponseError(ResponseContent), +} + +impl fmt::Display for Error { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + let (module, e) = match self { + Error::Reqwest(e) => ("reqwest", e.to_string()), + Error::Serde(e) => ("serde", e.to_string()), + Error::Io(e) => ("IO", e.to_string()), + Error::ResponseError(e) => ("response", format!("status code {}", e.status)), + }; + write!(f, "error in {}: {}", module, e) + } +} + +impl error::Error for Error { + fn source(&self) -> Option<&(dyn error::Error + 'static)> { + Some(match self { + Error::Reqwest(e) => e, + Error::Serde(e) => e, + Error::Io(e) => e, + Error::ResponseError(_) => return None, + }) + } +} + +impl From for Error { + fn from(e: reqwest::Error) -> Self { + Error::Reqwest(e) + } +} + +impl From for Error { + fn from(e: serde_json::Error) -> Self { + Error::Serde(e) + } +} + +impl From for Error { + fn from(e: std::io::Error) -> Self { + Error::Io(e) + } +} + +pub fn urlencode>(s: T) -> String { + ::url::form_urlencoded::byte_serialize(s.as_ref().as_bytes()).collect() +} + +pub fn parse_deep_object(prefix: &str, value: &serde_json::Value) -> Vec<(String, String)> { + if let serde_json::Value::Object(object) = value { + let mut params = vec![]; + + for (key, value) in object { + match value { + serde_json::Value::Object(_) => params.append(&mut parse_deep_object( + &format!("{}[{}]", prefix, key), + value, + )), + serde_json::Value::Array(array) => { + for (i, value) in array.iter().enumerate() { + params.append(&mut parse_deep_object( + &format!("{}[{}][{}]", prefix, key, i), + value, + )); + } + }, + serde_json::Value::String(s) => params.push((format!("{}[{}]", prefix, key), s.clone())), + _ => params.push((format!("{}[{}]", prefix, key), value.to_string())), + } + } + + return params; + } + + unimplemented!("Only objects are supported with style=deepObject") +} + +pub mod domains_api; +pub mod health_api; +pub mod roles_api; + +pub mod configuration; diff --git a/domains/src/apis/roles_api.rs b/domains/src/apis/roles_api.rs new file mode 100644 index 00000000..bf9c4f54 --- /dev/null +++ b/domains/src/apis/roles_api.rs @@ -0,0 +1,646 @@ +/* + * Magistrala Domains Service + * + * This is the Domains Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform domains. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The Magistrala repository](https://github.com/absmach/magistrala) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`add_domain_role_action`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AddDomainRoleActionError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`add_domain_role_member`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AddDomainRoleMemberError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`create_domain_role`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CreateDomainRoleError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`delete_all_domain_role_actions`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DeleteAllDomainRoleActionsError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`delete_all_domain_role_members`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DeleteAllDomainRoleMembersError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`delete_domain_role`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DeleteDomainRoleError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`delete_domain_role_action`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DeleteDomainRoleActionError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`delete_domain_role_members`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DeleteDomainRoleMembersError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_domain_role`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetDomainRoleError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_available_actions`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListAvailableActionsError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_domain_role_actions`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListDomainRoleActionsError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_domain_role_members`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListDomainRoleMembersError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_domain_roles`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListDomainRolesError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`update_domain_role`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UpdateDomainRoleError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(), + UnknownValue(serde_json::Value), +} + + +/// Adds a role action for a specific domain role that is identified by the role name. +pub async fn add_domain_role_action(configuration: &configuration::Configuration, domain_id: &str, role_name: &str, role_actions_obj: models::RoleActionsObj) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/domains/{domainID}/roles/{roleName}/actions", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), roleName=crate::apis::urlencode(role_name)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&role_actions_obj); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Adds a member to a specific domain role that is identified by the role name. +pub async fn add_domain_role_member(configuration: &configuration::Configuration, domain_id: &str, role_name: &str, role_members_obj: models::RoleMembersObj) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/domains/{domainID}/roles/{roleName}/members", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), roleName=crate::apis::urlencode(role_name)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&role_members_obj); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Creates a role for a specific domain that is identified by the domain ID. +pub async fn create_domain_role(configuration: &configuration::Configuration, domain_id: &str, create_role_obj: models::CreateRoleObj) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/domains/{domainID}/roles", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&create_role_obj); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Deletes all role actions for a specific domain role that is identified by the role name. +pub async fn delete_all_domain_role_actions(configuration: &configuration::Configuration, domain_id: &str, role_name: &str) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/domains/{domainID}/roles/{roleName}/actions/delete-all", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), roleName=crate::apis::urlencode(role_name)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Deletes all members from a specific domain role that is identified by the role name. +pub async fn delete_all_domain_role_members(configuration: &configuration::Configuration, domain_id: &str, role_name: &str) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/domains/{domainID}/roles/{roleName}/members/delete-all", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), roleName=crate::apis::urlencode(role_name)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Deletes a specific domain role that is identified by the role name. +pub async fn delete_domain_role(configuration: &configuration::Configuration, domain_id: &str, role_name: &str) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/domains/{domainID}/roles/{roleName}", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), roleName=crate::apis::urlencode(role_name)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Deletes a role action for a specific domain role that is identified by the role name. +pub async fn delete_domain_role_action(configuration: &configuration::Configuration, domain_id: &str, role_name: &str, role_actions_obj: models::RoleActionsObj) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/domains/{domainID}/roles/{roleName}/actions/delete", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), roleName=crate::apis::urlencode(role_name)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&role_actions_obj); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Deletes a member from a specific domain role that is identified by the role name. +pub async fn delete_domain_role_members(configuration: &configuration::Configuration, domain_id: &str, role_name: &str, role_members_obj: models::RoleMembersObj) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/domains/{domainID}/roles/{roleName}/members/delete", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), roleName=crate::apis::urlencode(role_name)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&role_members_obj); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Retrieves a specific domain role that is identified by the role name. +pub async fn get_domain_role(configuration: &configuration::Configuration, domain_id: &str, role_name: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/domains/{domainID}/roles/{roleName}", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), roleName=crate::apis::urlencode(role_name)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Retrieves a list of available actions. +pub async fn list_available_actions(configuration: &configuration::Configuration, domain_id: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/domains/roles/available-actions", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Retrieves a list of domain role actions. +pub async fn list_domain_role_actions(configuration: &configuration::Configuration, domain_id: &str, role_name: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/domains/{domainID}/roles/{roleName}/actions", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), roleName=crate::apis::urlencode(role_name)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Retrieves a list of domain role members. +pub async fn list_domain_role_members(configuration: &configuration::Configuration, domain_id: &str, role_name: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/domains/{domainID}/roles/{roleName}/members", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), roleName=crate::apis::urlencode(role_name)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Retrieves a list of domain roles. Due to performance concerns, data is retrieved in subsets. The API domains must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. +pub async fn list_domain_roles(configuration: &configuration::Configuration, domain_id: &str, limit: Option, offset: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/domains/{domainID}/roles", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = offset { + local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Updates a specific domain role that is identified by the role name. +pub async fn update_domain_role(configuration: &configuration::Configuration, domain_id: &str, role_name: &str, update_role_obj: models::UpdateRoleObj) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/domains/{domainID}/roles/{roleName}", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), roleName=crate::apis::urlencode(role_name)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&update_role_obj); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/domains/src/lib.rs b/domains/src/lib.rs new file mode 100644 index 00000000..e1520628 --- /dev/null +++ b/domains/src/lib.rs @@ -0,0 +1,11 @@ +#![allow(unused_imports)] +#![allow(clippy::too_many_arguments)] + +extern crate serde_repr; +extern crate serde; +extern crate serde_json; +extern crate url; +extern crate reqwest; + +pub mod apis; +pub mod models; diff --git a/domains/src/models/available_actions_obj.rs b/domains/src/models/available_actions_obj.rs new file mode 100644 index 00000000..7eb85120 --- /dev/null +++ b/domains/src/models/available_actions_obj.rs @@ -0,0 +1,28 @@ +/* + * Magistrala Domains Service + * + * This is the Domains Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform domains. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The Magistrala repository](https://github.com/absmach/magistrala) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AvailableActionsObj { + /// List of all available actions. + #[serde(rename = "available_actions", skip_serializing_if = "Option::is_none")] + pub available_actions: Option>, +} + +impl AvailableActionsObj { + pub fn new() -> AvailableActionsObj { + AvailableActionsObj { + available_actions: None, + } + } +} + diff --git a/domains/src/models/create_role_obj.rs b/domains/src/models/create_role_obj.rs new file mode 100644 index 00000000..0d37ed8d --- /dev/null +++ b/domains/src/models/create_role_obj.rs @@ -0,0 +1,36 @@ +/* + * Magistrala Domains Service + * + * This is the Domains Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform domains. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The Magistrala repository](https://github.com/absmach/magistrala) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct CreateRoleObj { + /// Role's name. + #[serde(rename = "role_name", skip_serializing_if = "Option::is_none")] + pub role_name: Option, + /// List of optional actions. + #[serde(rename = "optional_actions", skip_serializing_if = "Option::is_none")] + pub optional_actions: Option>, + /// List of optional members. + #[serde(rename = "optional_members", skip_serializing_if = "Option::is_none")] + pub optional_members: Option>, +} + +impl CreateRoleObj { + pub fn new() -> CreateRoleObj { + CreateRoleObj { + role_name: None, + optional_actions: None, + optional_members: None, + } + } +} + diff --git a/domains/src/models/domain.rs b/domains/src/models/domain.rs new file mode 100644 index 00000000..c2bf39c7 --- /dev/null +++ b/domains/src/models/domain.rs @@ -0,0 +1,64 @@ +/* + * Magistrala Domains Service + * + * This is the Domains Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform domains. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The Magistrala repository](https://github.com/absmach/magistrala) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Domain { + /// Domain unique identified. + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + /// Domain name. + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + /// domain tags. + #[serde(rename = "tags", skip_serializing_if = "Option::is_none")] + pub tags: Option>, + /// Arbitrary, object-encoded domain's data. + #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")] + pub metadata: Option, + /// Domain alias. + #[serde(rename = "alias", skip_serializing_if = "Option::is_none")] + pub alias: Option, + /// Domain Status + #[serde(rename = "status", skip_serializing_if = "Option::is_none")] + pub status: Option, + /// User ID of the user who created the domain. + #[serde(rename = "created_by", skip_serializing_if = "Option::is_none")] + pub created_by: Option, + /// Time when the domain was created. + #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] + pub created_at: Option, + /// User ID of the user who last updated the domain. + #[serde(rename = "updated_by", skip_serializing_if = "Option::is_none")] + pub updated_by: Option, + /// Time when the domain was last updated. + #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")] + pub updated_at: Option, +} + +impl Domain { + pub fn new() -> Domain { + Domain { + id: None, + name: None, + tags: None, + metadata: None, + alias: None, + status: None, + created_by: None, + created_at: None, + updated_by: None, + updated_at: None, + } + } +} + diff --git a/domains/src/models/domain_req_obj.rs b/domains/src/models/domain_req_obj.rs new file mode 100644 index 00000000..829c54d8 --- /dev/null +++ b/domains/src/models/domain_req_obj.rs @@ -0,0 +1,40 @@ +/* + * Magistrala Domains Service + * + * This is the Domains Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform domains. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The Magistrala repository](https://github.com/absmach/magistrala) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct DomainReqObj { + /// Domain name. + #[serde(rename = "name")] + pub name: String, + /// domain tags. + #[serde(rename = "tags", skip_serializing_if = "Option::is_none")] + pub tags: Option>, + /// Arbitrary, object-encoded domain's data. + #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")] + pub metadata: Option, + /// Domain alias. + #[serde(rename = "alias")] + pub alias: String, +} + +impl DomainReqObj { + pub fn new(name: String, alias: String) -> DomainReqObj { + DomainReqObj { + name, + tags: None, + metadata: None, + alias, + } + } +} + diff --git a/domains/src/models/domain_update.rs b/domains/src/models/domain_update.rs new file mode 100644 index 00000000..a384fec0 --- /dev/null +++ b/domains/src/models/domain_update.rs @@ -0,0 +1,40 @@ +/* + * Magistrala Domains Service + * + * This is the Domains Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform domains. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The Magistrala repository](https://github.com/absmach/magistrala) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct DomainUpdate { + /// Domain name. + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + /// domain tags. + #[serde(rename = "tags", skip_serializing_if = "Option::is_none")] + pub tags: Option>, + /// Arbitrary, object-encoded domain's data. + #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")] + pub metadata: Option, + /// Domain alias. + #[serde(rename = "alias", skip_serializing_if = "Option::is_none")] + pub alias: Option, +} + +impl DomainUpdate { + pub fn new() -> DomainUpdate { + DomainUpdate { + name: None, + tags: None, + metadata: None, + alias: None, + } + } +} + diff --git a/domains/src/models/domains_page.rs b/domains/src/models/domains_page.rs new file mode 100644 index 00000000..82284aa6 --- /dev/null +++ b/domains/src/models/domains_page.rs @@ -0,0 +1,39 @@ +/* + * Magistrala Domains Service + * + * This is the Domains Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform domains. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The Magistrala repository](https://github.com/absmach/magistrala) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct DomainsPage { + #[serde(rename = "domains")] + pub domains: Vec, + /// Total number of items. + #[serde(rename = "total")] + pub total: i32, + /// Number of items to skip during retrieval. + #[serde(rename = "offset")] + pub offset: i32, + /// Maximum number of items to return in one page. + #[serde(rename = "limit", skip_serializing_if = "Option::is_none")] + pub limit: Option, +} + +impl DomainsPage { + pub fn new(domains: Vec, total: i32, offset: i32) -> DomainsPage { + DomainsPage { + domains, + total, + offset, + limit: None, + } + } +} + diff --git a/domains/src/models/health_info.rs b/domains/src/models/health_info.rs new file mode 100644 index 00000000..b2e56e44 --- /dev/null +++ b/domains/src/models/health_info.rs @@ -0,0 +1,60 @@ +/* + * Magistrala Domains Service + * + * This is the Domains Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform domains. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The Magistrala repository](https://github.com/absmach/magistrala) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct HealthInfo { + /// Service status. + #[serde(rename = "status", skip_serializing_if = "Option::is_none")] + pub status: Option, + /// Service version. + #[serde(rename = "version", skip_serializing_if = "Option::is_none")] + pub version: Option, + /// Service commit hash. + #[serde(rename = "commit", skip_serializing_if = "Option::is_none")] + pub commit: Option, + /// Service description. + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option, + /// Service build time. + #[serde(rename = "build_time", skip_serializing_if = "Option::is_none")] + pub build_time: Option, + /// Service instance ID. + #[serde(rename = "instance_id", skip_serializing_if = "Option::is_none")] + pub instance_id: Option, +} + +impl HealthInfo { + pub fn new() -> HealthInfo { + HealthInfo { + status: None, + version: None, + commit: None, + description: None, + build_time: None, + instance_id: None, + } + } +} +/// Service status. +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Status { + #[serde(rename = "pass")] + Pass, +} + +impl Default for Status { + fn default() -> Status { + Self::Pass + } +} + diff --git a/domains/src/models/mod.rs b/domains/src/models/mod.rs new file mode 100644 index 00000000..2ce6d60c --- /dev/null +++ b/domains/src/models/mod.rs @@ -0,0 +1,26 @@ +pub mod available_actions_obj; +pub use self::available_actions_obj::AvailableActionsObj; +pub mod create_role_obj; +pub use self::create_role_obj::CreateRoleObj; +pub mod domain; +pub use self::domain::Domain; +pub mod domain_req_obj; +pub use self::domain_req_obj::DomainReqObj; +pub mod domain_update; +pub use self::domain_update::DomainUpdate; +pub mod domains_page; +pub use self::domains_page::DomainsPage; +pub mod health_info; +pub use self::health_info::HealthInfo; +pub mod new_role; +pub use self::new_role::NewRole; +pub mod role; +pub use self::role::Role; +pub mod role_actions_obj; +pub use self::role_actions_obj::RoleActionsObj; +pub mod role_members_obj; +pub use self::role_members_obj::RoleMembersObj; +pub mod roles_page; +pub use self::roles_page::RolesPage; +pub mod update_role_obj; +pub use self::update_role_obj::UpdateRoleObj; diff --git a/domains/src/models/new_role.rs b/domains/src/models/new_role.rs new file mode 100644 index 00000000..f5efb41e --- /dev/null +++ b/domains/src/models/new_role.rs @@ -0,0 +1,52 @@ +/* + * Magistrala Domains Service + * + * This is the Domains Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform domains. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The Magistrala repository](https://github.com/absmach/magistrala) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct NewRole { + /// Role unique identifier. + #[serde(rename = "role_id", skip_serializing_if = "Option::is_none")] + pub role_id: Option, + /// Role's name. + #[serde(rename = "role_name", skip_serializing_if = "Option::is_none")] + pub role_name: Option, + /// Entity unique identifier. + #[serde(rename = "entity_id", skip_serializing_if = "Option::is_none")] + pub entity_id: Option, + /// Role creator unique identifier. + #[serde(rename = "created_by", skip_serializing_if = "Option::is_none")] + pub created_by: Option, + /// Time when the channel was created. + #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] + pub created_at: Option, + /// Role updater unique identifier. + #[serde(rename = "updated_by", skip_serializing_if = "Option::is_none")] + pub updated_by: Option, + /// Time when the channel was created. + #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")] + pub updated_at: Option, +} + +impl NewRole { + pub fn new() -> NewRole { + NewRole { + role_id: None, + role_name: None, + entity_id: None, + created_by: None, + created_at: None, + updated_by: None, + updated_at: None, + } + } +} + diff --git a/domains/src/models/role.rs b/domains/src/models/role.rs new file mode 100644 index 00000000..518b83d5 --- /dev/null +++ b/domains/src/models/role.rs @@ -0,0 +1,52 @@ +/* + * Magistrala Domains Service + * + * This is the Domains Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform domains. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The Magistrala repository](https://github.com/absmach/magistrala) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Role { + /// Role unique identifier. + #[serde(rename = "role_id", skip_serializing_if = "Option::is_none")] + pub role_id: Option, + /// Role's name. + #[serde(rename = "role_name", skip_serializing_if = "Option::is_none")] + pub role_name: Option, + /// Entity unique identifier. + #[serde(rename = "entity_id", skip_serializing_if = "Option::is_none")] + pub entity_id: Option, + /// Role creator unique identifier. + #[serde(rename = "created_by", skip_serializing_if = "Option::is_none")] + pub created_by: Option, + /// Time when the channel was created. + #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] + pub created_at: Option, + /// Role updater unique identifier. + #[serde(rename = "updated_by", skip_serializing_if = "Option::is_none")] + pub updated_by: Option, + /// Time when the channel was created. + #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")] + pub updated_at: Option, +} + +impl Role { + pub fn new() -> Role { + Role { + role_id: None, + role_name: None, + entity_id: None, + created_by: None, + created_at: None, + updated_by: None, + updated_at: None, + } + } +} + diff --git a/domains/src/models/role_actions_obj.rs b/domains/src/models/role_actions_obj.rs new file mode 100644 index 00000000..1f74a3c9 --- /dev/null +++ b/domains/src/models/role_actions_obj.rs @@ -0,0 +1,28 @@ +/* + * Magistrala Domains Service + * + * This is the Domains Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform domains. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The Magistrala repository](https://github.com/absmach/magistrala) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct RoleActionsObj { + /// List of actions to be added to a role. + #[serde(rename = "actions", skip_serializing_if = "Option::is_none")] + pub actions: Option>, +} + +impl RoleActionsObj { + pub fn new() -> RoleActionsObj { + RoleActionsObj { + actions: None, + } + } +} + diff --git a/domains/src/models/role_members_obj.rs b/domains/src/models/role_members_obj.rs new file mode 100644 index 00000000..221130cb --- /dev/null +++ b/domains/src/models/role_members_obj.rs @@ -0,0 +1,28 @@ +/* + * Magistrala Domains Service + * + * This is the Domains Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform domains. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The Magistrala repository](https://github.com/absmach/magistrala) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct RoleMembersObj { + /// List of members to be added to a role. + #[serde(rename = "members", skip_serializing_if = "Option::is_none")] + pub members: Option>, +} + +impl RoleMembersObj { + pub fn new() -> RoleMembersObj { + RoleMembersObj { + members: None, + } + } +} + diff --git a/domains/src/models/roles_page.rs b/domains/src/models/roles_page.rs new file mode 100644 index 00000000..4ef0236a --- /dev/null +++ b/domains/src/models/roles_page.rs @@ -0,0 +1,40 @@ +/* + * Magistrala Domains Service + * + * This is the Domains Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform domains. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The Magistrala repository](https://github.com/absmach/magistrala) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct RolesPage { + /// List of roles. + #[serde(rename = "roles", skip_serializing_if = "Option::is_none")] + pub roles: Option>, + /// Total number of roles. + #[serde(rename = "total", skip_serializing_if = "Option::is_none")] + pub total: Option, + /// Number of items to skip during retrieval. + #[serde(rename = "offset", skip_serializing_if = "Option::is_none")] + pub offset: Option, + /// Maximum number of items to return in one page. + #[serde(rename = "limit", skip_serializing_if = "Option::is_none")] + pub limit: Option, +} + +impl RolesPage { + pub fn new() -> RolesPage { + RolesPage { + roles: None, + total: None, + offset: None, + limit: None, + } + } +} + diff --git a/domains/src/models/update_role_obj.rs b/domains/src/models/update_role_obj.rs new file mode 100644 index 00000000..ff276bd0 --- /dev/null +++ b/domains/src/models/update_role_obj.rs @@ -0,0 +1,28 @@ +/* + * Magistrala Domains Service + * + * This is the Domains Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform domains. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The Magistrala repository](https://github.com/absmach/magistrala) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct UpdateRoleObj { + /// Role's name. + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, +} + +impl UpdateRoleObj { + pub fn new() -> UpdateRoleObj { + UpdateRoleObj { + name: None, + } + } +} + diff --git a/groups/.gitignore b/groups/.gitignore new file mode 100644 index 00000000..6aa10640 --- /dev/null +++ b/groups/.gitignore @@ -0,0 +1,3 @@ +/target/ +**/*.rs.bk +Cargo.lock diff --git a/groups/.openapi-generator-ignore b/groups/.openapi-generator-ignore new file mode 100644 index 00000000..7484ee59 --- /dev/null +++ b/groups/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/groups/.openapi-generator/FILES b/groups/.openapi-generator/FILES new file mode 100644 index 00000000..75683be7 --- /dev/null +++ b/groups/.openapi-generator/FILES @@ -0,0 +1,56 @@ +.gitignore +.openapi-generator-ignore +.travis.yml +Cargo.toml +README.md +docs/AvailableActionsObj.md +docs/ChildrenGroupReqObj.md +docs/CreateRoleObj.md +docs/Error.md +docs/Group.md +docs/GroupReqObj.md +docs/GroupUpdate.md +docs/GroupsApi.md +docs/GroupsHierarchyPage.md +docs/GroupsPage.md +docs/HealthApi.md +docs/HealthRes.md +docs/Members.md +docs/MembersCredentials.md +docs/MembersPage.md +docs/NewRole.md +docs/ParentGroupReqObj.md +docs/Role.md +docs/RoleActionsObj.md +docs/RoleMembersObj.md +docs/RolesApi.md +docs/RolesPage.md +docs/UpdateRoleObj.md +git_push.sh +src/apis/configuration.rs +src/apis/groups_api.rs +src/apis/health_api.rs +src/apis/mod.rs +src/apis/roles_api.rs +src/lib.rs +src/models/available_actions_obj.rs +src/models/children_group_req_obj.rs +src/models/create_role_obj.rs +src/models/error.rs +src/models/group.rs +src/models/group_req_obj.rs +src/models/group_update.rs +src/models/groups_hierarchy_page.rs +src/models/groups_page.rs +src/models/health_res.rs +src/models/members.rs +src/models/members_credentials.rs +src/models/members_page.rs +src/models/mod.rs +src/models/new_role.rs +src/models/parent_group_req_obj.rs +src/models/role.rs +src/models/role_actions_obj.rs +src/models/role_members_obj.rs +src/models/roles_page.rs +src/models/update_role_obj.rs diff --git a/groups/.openapi-generator/VERSION b/groups/.openapi-generator/VERSION new file mode 100644 index 00000000..758bb9c8 --- /dev/null +++ b/groups/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.10.0 diff --git a/groups/.travis.yml b/groups/.travis.yml new file mode 100644 index 00000000..22761ba7 --- /dev/null +++ b/groups/.travis.yml @@ -0,0 +1 @@ +language: rust diff --git a/groups/Cargo.toml b/groups/Cargo.toml new file mode 100644 index 00000000..31f8d475 --- /dev/null +++ b/groups/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "groups-openapi" +version = "0.15.1" +authors = ["info@abstractmachines.fr"] +description = "This is the Groups Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform groups. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) " +license = "Apache 2.0" +edition = "2021" + +[dependencies] +serde = { version = "^1.0", features = ["derive"] } +serde_json = "^1.0" +serde_repr = "^0.1" +url = "^2.5" +uuid = { version = "^1.8", features = ["serde", "v4"] } +reqwest = { version = "^0.12", features = ["json", "multipart"] } diff --git a/groups/README.md b/groups/README.md new file mode 100644 index 00000000..9d86d39c --- /dev/null +++ b/groups/README.md @@ -0,0 +1,96 @@ +# Rust API client for openapi + +This is the Groups Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform groups. You can now help us improve the API whether it's by making changes to the definition itself or to the code. +Some useful links: +- [The SuperMQ repository](https://github.com/absmach/supermq) + + + +## Overview + +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://openapis.org) from a remote server, you can easily generate an API client. + +- API version: 0.15.1 +- Package version: 0.15.1 +- Generator version: 7.10.0 +- Build package: `org.openapitools.codegen.languages.RustClientCodegen` + +## Installation + +Put the package under your project folder in a directory named `openapi` and add the following to `Cargo.toml` under `[dependencies]`: + +``` +openapi = { path = "./openapi" } +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost:9004* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*GroupsApi* | [**add_children_groups**](docs/GroupsApi.md#add_children_groups) | **POST** /{domainID}/groups/{groupID}/children | Add children groups. +*GroupsApi* | [**create_group**](docs/GroupsApi.md#create_group) | **POST** /{domainID}/groups | Creates new group +*GroupsApi* | [**disable_group**](docs/GroupsApi.md#disable_group) | **POST** /{domainID}/groups/{groupID}/disable | Disables a group +*GroupsApi* | [**domain_id_groups_group_id_delete**](docs/GroupsApi.md#domain_id_groups_group_id_delete) | **DELETE** /{domainID}/groups/{groupID} | Delete group for a group with the given id. +*GroupsApi* | [**enable_group**](docs/GroupsApi.md#enable_group) | **POST** /{domainID}/groups/{groupID}/enable | Enables a group +*GroupsApi* | [**get_group**](docs/GroupsApi.md#get_group) | **GET** /{domainID}/groups/{groupID} | Gets group info. +*GroupsApi* | [**list_children_groups**](docs/GroupsApi.md#list_children_groups) | **GET** /{domainID}/groups/{groupID}/children | List children of a certain group +*GroupsApi* | [**list_group_hierarchy**](docs/GroupsApi.md#list_group_hierarchy) | **GET** /{domainID}/groups/{groupID}/hierarchy | Lists groups hierarchy. +*GroupsApi* | [**list_groups**](docs/GroupsApi.md#list_groups) | **GET** /{domainID}/groups | Lists groups. +*GroupsApi* | [**remove_all_children_groups**](docs/GroupsApi.md#remove_all_children_groups) | **DELETE** /{domainID}/groups/{groupID}/children/all | Remove all children groups. +*GroupsApi* | [**remove_children_groups**](docs/GroupsApi.md#remove_children_groups) | **DELETE** /{domainID}/groups/{groupID}/children | Remove children groups. +*GroupsApi* | [**remove_group_parent_group**](docs/GroupsApi.md#remove_group_parent_group) | **DELETE** /{domainID}/groups/{groupID}/parent | Removes a parent group from a group. +*GroupsApi* | [**set_group_parent_group**](docs/GroupsApi.md#set_group_parent_group) | **POST** /{domainID}/groups/{groupID}/parent | Sets a parent group for a group. +*GroupsApi* | [**update_group**](docs/GroupsApi.md#update_group) | **PUT** /{domainID}/groups/{groupID} | Updates group data. +*HealthApi* | [**health**](docs/HealthApi.md#health) | **GET** /health | Retrieves service health check info. +*RolesApi* | [**add_group_role_action**](docs/RolesApi.md#add_group_role_action) | **POST** /{domainID}/groups/{groupID}/roles/{roleName}/actions | Adds a role action for a group role. +*RolesApi* | [**add_group_role_member**](docs/RolesApi.md#add_group_role_member) | **POST** /{domainID}/groups/{groupID}/roles/{roleName}/members | Adds a member to a group role. +*RolesApi* | [**create_group_role**](docs/RolesApi.md#create_group_role) | **POST** /{domainID}/groups/{groupID}/roles | Creates a role for a group +*RolesApi* | [**delete_all_group_role_actions**](docs/RolesApi.md#delete_all_group_role_actions) | **POST** /{domainID}/groups/{groupID}/roles/{roleName}/actions/delete-all | Deletes all role actions for a group role. +*RolesApi* | [**delete_all_group_role_members**](docs/RolesApi.md#delete_all_group_role_members) | **POST** /{domainID}/groups/{groupID}/roles/{roleName}/members/delete-all | Deletes all members from a group role. +*RolesApi* | [**delete_group_role**](docs/RolesApi.md#delete_group_role) | **DELETE** /{domainID}/groups/{groupID}/roles/{roleName} | Deletes group role. +*RolesApi* | [**delete_group_role_action**](docs/RolesApi.md#delete_group_role_action) | **POST** /{domainID}/groups/{groupID}/roles/{roleName}/actions/delete | Deletes role actions for a group role. +*RolesApi* | [**delete_group_role_members**](docs/RolesApi.md#delete_group_role_members) | **POST** /{domainID}/groups/{groupID}/roles/{roleName}/members/delete | Deletes members from a group role. +*RolesApi* | [**get_group_role**](docs/RolesApi.md#get_group_role) | **GET** /{domainID}/groups/{groupID}/roles/{roleName} | Retrieves group role. +*RolesApi* | [**list_available_actions**](docs/RolesApi.md#list_available_actions) | **GET** /{domainID}/groups/roles/available-actions | Retrieves available actions. +*RolesApi* | [**list_group_role_actions**](docs/RolesApi.md#list_group_role_actions) | **GET** /{domainID}/groups/{groupID}/roles/{roleName}/actions | Lists group role actions. +*RolesApi* | [**list_group_role_members**](docs/RolesApi.md#list_group_role_members) | **GET** /{domainID}/groups/{groupID}/roles/{roleName}/members | Lists group role members. +*RolesApi* | [**list_group_roles**](docs/RolesApi.md#list_group_roles) | **GET** /{domainID}/groups/{groupID}/roles | Retrieves groups roles. +*RolesApi* | [**update_group_role**](docs/RolesApi.md#update_group_role) | **PUT** /{domainID}/groups/{groupID}/roles/{roleName} | Updates group role. + + +## Documentation For Models + + - [AvailableActionsObj](docs/AvailableActionsObj.md) + - [ChildrenGroupReqObj](docs/ChildrenGroupReqObj.md) + - [CreateRoleObj](docs/CreateRoleObj.md) + - [Error](docs/Error.md) + - [Group](docs/Group.md) + - [GroupReqObj](docs/GroupReqObj.md) + - [GroupUpdate](docs/GroupUpdate.md) + - [GroupsHierarchyPage](docs/GroupsHierarchyPage.md) + - [GroupsPage](docs/GroupsPage.md) + - [HealthRes](docs/HealthRes.md) + - [Members](docs/Members.md) + - [MembersCredentials](docs/MembersCredentials.md) + - [MembersPage](docs/MembersPage.md) + - [NewRole](docs/NewRole.md) + - [ParentGroupReqObj](docs/ParentGroupReqObj.md) + - [Role](docs/Role.md) + - [RoleActionsObj](docs/RoleActionsObj.md) + - [RoleMembersObj](docs/RoleMembersObj.md) + - [RolesPage](docs/RolesPage.md) + - [UpdateRoleObj](docs/UpdateRoleObj.md) + + +To get access to the crate's generated documentation, use: + +``` +cargo doc --open +``` + +## Author + +info@abstractmachines.fr + diff --git a/groups/docs/AvailableActionsObj.md b/groups/docs/AvailableActionsObj.md new file mode 100644 index 00000000..07f6848c --- /dev/null +++ b/groups/docs/AvailableActionsObj.md @@ -0,0 +1,11 @@ +# AvailableActionsObj + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**available_actions** | Option<**Vec**> | List of all available actions. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/groups/docs/ChildrenGroupReqObj.md b/groups/docs/ChildrenGroupReqObj.md new file mode 100644 index 00000000..eddeee15 --- /dev/null +++ b/groups/docs/ChildrenGroupReqObj.md @@ -0,0 +1,11 @@ +# ChildrenGroupReqObj + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**groups** | [**Vec**](uuid::Uuid.md) | Children group IDs. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/groups/docs/CreateRoleObj.md b/groups/docs/CreateRoleObj.md new file mode 100644 index 00000000..59ac3f4f --- /dev/null +++ b/groups/docs/CreateRoleObj.md @@ -0,0 +1,13 @@ +# CreateRoleObj + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**role_name** | Option<**String**> | Role's name. | [optional] +**optional_actions** | Option<**Vec**> | List of optional actions. | [optional] +**optional_members** | Option<**Vec**> | List of optional members. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/groups/docs/Error.md b/groups/docs/Error.md new file mode 100644 index 00000000..8e78862d --- /dev/null +++ b/groups/docs/Error.md @@ -0,0 +1,11 @@ +# Error + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error** | Option<**String**> | Error message | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/groups/docs/Group.md b/groups/docs/Group.md new file mode 100644 index 00000000..c3e986b2 --- /dev/null +++ b/groups/docs/Group.md @@ -0,0 +1,21 @@ +# Group + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | Unique group identifier generated by the service. | [optional] +**name** | Option<**String**> | Free-form group name. Group name is unique on the given hierarchy level. | [optional] +**domain_id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | ID of the domain to which the group belongs.. | [optional] +**parent_id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | Group parent identifier. | [optional] +**description** | Option<**String**> | Group description, free form text. | [optional] +**metadata** | Option<[**serde_json::Value**](.md)> | Arbitrary, object-encoded groups's data. | [optional] +**path** | Option<**String**> | Hierarchy path, concatenated ids of group ancestors. | [optional] +**level** | Option<**i32**> | Level in hierarchy, distance from the root group. | [optional] +**created_at** | Option<**String**> | Datetime when the group was created. | [optional] +**updated_at** | Option<**String**> | Datetime when the group was created. | [optional] +**status** | Option<**String**> | Group Status | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/groups/docs/GroupReqObj.md b/groups/docs/GroupReqObj.md new file mode 100644 index 00000000..399e4131 --- /dev/null +++ b/groups/docs/GroupReqObj.md @@ -0,0 +1,15 @@ +# GroupReqObj + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | Free-form group name. Group name is unique on the given hierarchy level. | +**description** | Option<**String**> | Group description, free form text. | [optional] +**parent_id** | Option<**String**> | Id of parent group, it must be existing group. | [optional] +**metadata** | Option<[**serde_json::Value**](.md)> | Arbitrary, object-encoded groups's data. | [optional] +**status** | Option<**String**> | Group Status | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/groups/docs/GroupUpdate.md b/groups/docs/GroupUpdate.md new file mode 100644 index 00000000..3f215c7e --- /dev/null +++ b/groups/docs/GroupUpdate.md @@ -0,0 +1,13 @@ +# GroupUpdate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | Free-form group name. Group name is unique on the given hierarchy level. | +**description** | **String** | Group description, free form text. | +**metadata** | [**serde_json::Value**](.md) | Arbitrary, object-encoded groups's data. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/groups/docs/GroupsApi.md b/groups/docs/GroupsApi.md new file mode 100644 index 00000000..94498aef --- /dev/null +++ b/groups/docs/GroupsApi.md @@ -0,0 +1,477 @@ +# \GroupsApi + +All URIs are relative to *http://localhost:9004* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**add_children_groups**](GroupsApi.md#add_children_groups) | **POST** /{domainID}/groups/{groupID}/children | Add children groups. +[**create_group**](GroupsApi.md#create_group) | **POST** /{domainID}/groups | Creates new group +[**disable_group**](GroupsApi.md#disable_group) | **POST** /{domainID}/groups/{groupID}/disable | Disables a group +[**domain_id_groups_group_id_delete**](GroupsApi.md#domain_id_groups_group_id_delete) | **DELETE** /{domainID}/groups/{groupID} | Delete group for a group with the given id. +[**enable_group**](GroupsApi.md#enable_group) | **POST** /{domainID}/groups/{groupID}/enable | Enables a group +[**get_group**](GroupsApi.md#get_group) | **GET** /{domainID}/groups/{groupID} | Gets group info. +[**list_children_groups**](GroupsApi.md#list_children_groups) | **GET** /{domainID}/groups/{groupID}/children | List children of a certain group +[**list_group_hierarchy**](GroupsApi.md#list_group_hierarchy) | **GET** /{domainID}/groups/{groupID}/hierarchy | Lists groups hierarchy. +[**list_groups**](GroupsApi.md#list_groups) | **GET** /{domainID}/groups | Lists groups. +[**remove_all_children_groups**](GroupsApi.md#remove_all_children_groups) | **DELETE** /{domainID}/groups/{groupID}/children/all | Remove all children groups. +[**remove_children_groups**](GroupsApi.md#remove_children_groups) | **DELETE** /{domainID}/groups/{groupID}/children | Remove children groups. +[**remove_group_parent_group**](GroupsApi.md#remove_group_parent_group) | **DELETE** /{domainID}/groups/{groupID}/parent | Removes a parent group from a group. +[**set_group_parent_group**](GroupsApi.md#set_group_parent_group) | **POST** /{domainID}/groups/{groupID}/parent | Sets a parent group for a group. +[**update_group**](GroupsApi.md#update_group) | **PUT** /{domainID}/groups/{groupID} | Updates group data. + + + +## add_children_groups + +> add_children_groups(domain_id, group_id, children_group_req_obj) +Add children groups. + +Adds children groups for a specific group that is identified by the group ID. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**group_id** | **uuid::Uuid** | Unique group identifier. | [required] | +**children_group_req_obj** | [**ChildrenGroupReqObj**](ChildrenGroupReqObj.md) | JSON-formated document describing the children groups to be added to a group. | [required] | + +### Return type + + (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## create_group + +> models::Group create_group(domain_id, group_req_obj) +Creates new group + +Creates new group that can be used for grouping entities. New account will be uniquely identified by its identity. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**group_req_obj** | [**GroupReqObj**](GroupReqObj.md) | JSON-formatted document describing the new group to be registered | [required] | + +### Return type + +[**models::Group**](Group.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## disable_group + +> models::Group disable_group(domain_id, group_id) +Disables a group + +Disables a specific group that is identifier by the group ID. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**group_id** | **uuid::Uuid** | Unique group identifier. | [required] | + +### Return type + +[**models::Group**](Group.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## domain_id_groups_group_id_delete + +> domain_id_groups_group_id_delete(domain_id, group_id) +Delete group for a group with the given id. + +Delete group removes a group with the given id from repo and removes all the policies related to this group. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**group_id** | **uuid::Uuid** | Unique group identifier. | [required] | + +### Return type + + (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## enable_group + +> models::Group enable_group(domain_id, group_id) +Enables a group + +Enables a specific group that is identifier by the group ID. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**group_id** | **uuid::Uuid** | Unique group identifier. | [required] | + +### Return type + +[**models::Group**](Group.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_group + +> models::Group get_group(domain_id, group_id) +Gets group info. + +Gets info on a group specified by id. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**group_id** | **uuid::Uuid** | Unique group identifier. | [required] | + +### Return type + +[**models::Group**](Group.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_children_groups + +> models::GroupsPage list_children_groups(domain_id, group_id, limit, offset, start_level, end_level, tree, metadata, name) +List children of a certain group + +Lists groups up to a max level of hierarchy that can be fetched in one request ( max level = 5). Result can be filtered by metadata. Groups will be returned as JSON array or JSON tree. Due to performance concerns, result is returned in subsets. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**group_id** | **uuid::Uuid** | Unique group identifier. | [required] | +**limit** | Option<**i32**> | Size of the subset to retrieve. | |[default to 10] +**offset** | Option<**i32**> | Number of items to skip during retrieval. | |[default to 0] +**start_level** | Option<**i32**> | Level of hierarchy from which to start retrieving groups from given group id. | | +**end_level** | Option<**i32**> | Level of hierarchy up to which to retrieve groups from given group id. | | +**tree** | Option<**bool**> | Specify type of response, JSON array or tree. | |[default to false] +**metadata** | Option<**String**> | Metadata filter. Filtering is performed matching the parameter with metadata on top level. Parameter is json. | | +**name** | Option<**String**> | Group's name. | | + +### Return type + +[**models::GroupsPage**](GroupsPage.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_group_hierarchy + +> models::GroupsHierarchyPage list_group_hierarchy(domain_id, group_id, level, tree, direction) +Lists groups hierarchy. + +Lists groups heirarchy up to a max level of hierarchy that can be fetched in one request ( max level = 5). Result can be filtered by metadata. Groups will be returned as JSON array or JSON tree. Due to performance concerns, result is returned in subsets. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**group_id** | **uuid::Uuid** | Unique group identifier. | [required] | +**level** | Option<**i32**> | Level of hierarchy up to which to retrieve groups from given group id. | | +**tree** | Option<**bool**> | Specify type of response, JSON array or tree. | |[default to false] +**direction** | Option<**i32**> | Direction of hierarchy traversal. | | + +### Return type + +[**models::GroupsHierarchyPage**](GroupsHierarchyPage.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_groups + +> models::GroupsPage list_groups(domain_id, limit, offset, level, tree, metadata, name, parent_id) +Lists groups. + +Lists groups up to a max level of hierarchy that can be fetched in one request ( max level = 5). Result can be filtered by metadata. Groups will be returned as JSON array or JSON tree. Due to performance concerns, result is returned in subsets. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**limit** | Option<**i32**> | Size of the subset to retrieve. | |[default to 10] +**offset** | Option<**i32**> | Number of items to skip during retrieval. | |[default to 0] +**level** | Option<**i32**> | Level of hierarchy up to which to retrieve groups from given group id. | | +**tree** | Option<**bool**> | Specify type of response, JSON array or tree. | |[default to false] +**metadata** | Option<**String**> | Metadata filter. Filtering is performed matching the parameter with metadata on top level. Parameter is json. | | +**name** | Option<**String**> | Group's name. | | +**parent_id** | Option<**uuid::Uuid**> | Unique parent identifier for a group. | | + +### Return type + +[**models::GroupsPage**](GroupsPage.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## remove_all_children_groups + +> remove_all_children_groups(domain_id, group_id) +Remove all children groups. + +Removes all children groups for a specific group that is identified by the group ID. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**group_id** | **uuid::Uuid** | Unique group identifier. | [required] | + +### Return type + + (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## remove_children_groups + +> remove_children_groups(domain_id, group_id, children_group_req_obj) +Remove children groups. + +Removes children groups for a specific group that is identified by the group ID. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**group_id** | **uuid::Uuid** | Unique group identifier. | [required] | +**children_group_req_obj** | [**ChildrenGroupReqObj**](ChildrenGroupReqObj.md) | JSON-formated document describing the children groups to be added to a group. | [required] | + +### Return type + + (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## remove_group_parent_group + +> remove_group_parent_group(domain_id, group_id, parent_group_req_obj) +Removes a parent group from a group. + +Removes a parent group from a specific group that is identified by the group ID. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**group_id** | **uuid::Uuid** | Unique group identifier. | [required] | +**parent_group_req_obj** | [**ParentGroupReqObj**](ParentGroupReqObj.md) | JSON-formated document describing the parent group to be set to or removed from a group. | [required] | + +### Return type + + (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## set_group_parent_group + +> set_group_parent_group(domain_id, group_id, parent_group_req_obj) +Sets a parent group for a group. + +Sets a parent group for a specific group that is identified by the group ID. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**group_id** | **uuid::Uuid** | Unique group identifier. | [required] | +**parent_group_req_obj** | [**ParentGroupReqObj**](ParentGroupReqObj.md) | JSON-formated document describing the parent group to be set to or removed from a group. | [required] | + +### Return type + + (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## update_group + +> models::Group update_group(domain_id, group_id, group_update) +Updates group data. + +Updates Name, Description or Metadata of a group. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**group_id** | **uuid::Uuid** | Unique group identifier. | [required] | +**group_update** | [**GroupUpdate**](GroupUpdate.md) | JSON-formated document describing the metadata and name of group to be update | [required] | + +### Return type + +[**models::Group**](Group.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/groups/docs/GroupsHierarchyPage.md b/groups/docs/GroupsHierarchyPage.md new file mode 100644 index 00000000..82d89aaa --- /dev/null +++ b/groups/docs/GroupsHierarchyPage.md @@ -0,0 +1,13 @@ +# GroupsHierarchyPage + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**level** | Option<**i32**> | Level of hierarchy. | [optional] +**direction** | Option<**i32**> | Direction of hierarchy traversal. | [optional] +**groups** | Option<[**Vec**](Group.md)> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/groups/docs/GroupsPage.md b/groups/docs/GroupsPage.md new file mode 100644 index 00000000..fff04c3b --- /dev/null +++ b/groups/docs/GroupsPage.md @@ -0,0 +1,14 @@ +# GroupsPage + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**groups** | [**Vec**](Group.md) | | +**total** | **i32** | Total number of items. | +**offset** | **i32** | Number of items to skip during retrieval. | +**limit** | Option<**i32**> | Maximum number of items to return in one page. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/groups/docs/HealthApi.md b/groups/docs/HealthApi.md new file mode 100644 index 00000000..c0b3629d --- /dev/null +++ b/groups/docs/HealthApi.md @@ -0,0 +1,34 @@ +# \HealthApi + +All URIs are relative to *http://localhost:9004* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**health**](HealthApi.md#health) | **GET** /health | Retrieves service health check info. + + + +## health + +> models::HealthRes health() +Retrieves service health check info. + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**models::HealthRes**](HealthRes.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/health+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/groups/docs/HealthRes.md b/groups/docs/HealthRes.md new file mode 100644 index 00000000..319b16fb --- /dev/null +++ b/groups/docs/HealthRes.md @@ -0,0 +1,15 @@ +# HealthRes + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | Option<**String**> | Service status. | [optional] +**version** | Option<**String**> | Service version. | [optional] +**commit** | Option<**String**> | Service commit hash. | [optional] +**description** | Option<**String**> | Service description. | [optional] +**build_time** | Option<**String**> | Service build time. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/groups/docs/Members.md b/groups/docs/Members.md new file mode 100644 index 00000000..a5d7e31b --- /dev/null +++ b/groups/docs/Members.md @@ -0,0 +1,20 @@ +# Members + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | User unique identifier. | [optional] +**first_name** | Option<**String**> | User's first name. | [optional] +**last_name** | Option<**String**> | User's last name. | [optional] +**email** | Option<**String**> | User's email address. | [optional] +**tags** | Option<**Vec**> | User tags. | [optional] +**credentials** | Option<[**models::MembersCredentials**](Members_credentials.md)> | | [optional] +**metadata** | Option<[**serde_json::Value**](.md)> | Arbitrary, object-encoded user's data. | [optional] +**status** | Option<**String**> | User Status | [optional] +**created_at** | Option<**String**> | Time when the group was created. | [optional] +**updated_at** | Option<**String**> | Time when the group was created. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/groups/docs/MembersCredentials.md b/groups/docs/MembersCredentials.md new file mode 100644 index 00000000..e3669de6 --- /dev/null +++ b/groups/docs/MembersCredentials.md @@ -0,0 +1,12 @@ +# MembersCredentials + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**username** | Option<**String**> | User's username. | [optional] +**secret** | Option<**String**> | User secret password. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/groups/docs/MembersPage.md b/groups/docs/MembersPage.md new file mode 100644 index 00000000..66f13666 --- /dev/null +++ b/groups/docs/MembersPage.md @@ -0,0 +1,14 @@ +# MembersPage + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**members** | [**Vec**](Members.md) | | +**total** | **i32** | Total number of items. | +**offset** | Option<**i32**> | Number of items to skip during retrieval. | [optional] +**limit** | Option<**i32**> | Maximum number of items to return in one page. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/groups/docs/NewRole.md b/groups/docs/NewRole.md new file mode 100644 index 00000000..8d232bc0 --- /dev/null +++ b/groups/docs/NewRole.md @@ -0,0 +1,17 @@ +# NewRole + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**role_id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | Role unique identifier. | [optional] +**role_name** | Option<**String**> | Role's name. | [optional] +**entity_id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | Entity unique identifier. | [optional] +**created_by** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | Role creator unique identifier. | [optional] +**created_at** | Option<**String**> | Time when the channel was created. | [optional] +**updated_by** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | Role updater unique identifier. | [optional] +**updated_at** | Option<**String**> | Time when the channel was created. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/groups/docs/ParentGroupReqObj.md b/groups/docs/ParentGroupReqObj.md new file mode 100644 index 00000000..fef42f7a --- /dev/null +++ b/groups/docs/ParentGroupReqObj.md @@ -0,0 +1,11 @@ +# ParentGroupReqObj + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**group_id** | [**uuid::Uuid**](uuid::Uuid.md) | Parent group unique identifier. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/groups/docs/Role.md b/groups/docs/Role.md new file mode 100644 index 00000000..c7a4694f --- /dev/null +++ b/groups/docs/Role.md @@ -0,0 +1,17 @@ +# Role + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**role_id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | Role unique identifier. | [optional] +**role_name** | Option<**String**> | Role's name. | [optional] +**entity_id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | Entity unique identifier. | [optional] +**created_by** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | Role creator unique identifier. | [optional] +**created_at** | Option<**String**> | Time when the channel was created. | [optional] +**updated_by** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | Role updater unique identifier. | [optional] +**updated_at** | Option<**String**> | Time when the channel was created. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/groups/docs/RoleActionsObj.md b/groups/docs/RoleActionsObj.md new file mode 100644 index 00000000..b61a2345 --- /dev/null +++ b/groups/docs/RoleActionsObj.md @@ -0,0 +1,11 @@ +# RoleActionsObj + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**actions** | Option<**Vec**> | List of actions to be added to a role. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/groups/docs/RoleMembersObj.md b/groups/docs/RoleMembersObj.md new file mode 100644 index 00000000..1d9d997a --- /dev/null +++ b/groups/docs/RoleMembersObj.md @@ -0,0 +1,11 @@ +# RoleMembersObj + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**members** | Option<**Vec**> | List of members to be added to a role. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/groups/docs/RolesApi.md b/groups/docs/RolesApi.md new file mode 100644 index 00000000..eed8e188 --- /dev/null +++ b/groups/docs/RolesApi.md @@ -0,0 +1,474 @@ +# \RolesApi + +All URIs are relative to *http://localhost:9004* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**add_group_role_action**](RolesApi.md#add_group_role_action) | **POST** /{domainID}/groups/{groupID}/roles/{roleName}/actions | Adds a role action for a group role. +[**add_group_role_member**](RolesApi.md#add_group_role_member) | **POST** /{domainID}/groups/{groupID}/roles/{roleName}/members | Adds a member to a group role. +[**create_group_role**](RolesApi.md#create_group_role) | **POST** /{domainID}/groups/{groupID}/roles | Creates a role for a group +[**delete_all_group_role_actions**](RolesApi.md#delete_all_group_role_actions) | **POST** /{domainID}/groups/{groupID}/roles/{roleName}/actions/delete-all | Deletes all role actions for a group role. +[**delete_all_group_role_members**](RolesApi.md#delete_all_group_role_members) | **POST** /{domainID}/groups/{groupID}/roles/{roleName}/members/delete-all | Deletes all members from a group role. +[**delete_group_role**](RolesApi.md#delete_group_role) | **DELETE** /{domainID}/groups/{groupID}/roles/{roleName} | Deletes group role. +[**delete_group_role_action**](RolesApi.md#delete_group_role_action) | **POST** /{domainID}/groups/{groupID}/roles/{roleName}/actions/delete | Deletes role actions for a group role. +[**delete_group_role_members**](RolesApi.md#delete_group_role_members) | **POST** /{domainID}/groups/{groupID}/roles/{roleName}/members/delete | Deletes members from a group role. +[**get_group_role**](RolesApi.md#get_group_role) | **GET** /{domainID}/groups/{groupID}/roles/{roleName} | Retrieves group role. +[**list_available_actions**](RolesApi.md#list_available_actions) | **GET** /{domainID}/groups/roles/available-actions | Retrieves available actions. +[**list_group_role_actions**](RolesApi.md#list_group_role_actions) | **GET** /{domainID}/groups/{groupID}/roles/{roleName}/actions | Lists group role actions. +[**list_group_role_members**](RolesApi.md#list_group_role_members) | **GET** /{domainID}/groups/{groupID}/roles/{roleName}/members | Lists group role members. +[**list_group_roles**](RolesApi.md#list_group_roles) | **GET** /{domainID}/groups/{groupID}/roles | Retrieves groups roles. +[**update_group_role**](RolesApi.md#update_group_role) | **PUT** /{domainID}/groups/{groupID}/roles/{roleName} | Updates group role. + + + +## add_group_role_action + +> models::RoleActionsObj add_group_role_action(domain_id, group_id, role_name, role_actions_obj) +Adds a role action for a group role. + +Adds a role action for a specific group role that is identified by the role name. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**group_id** | **uuid::Uuid** | Unique group identifier. | [required] | +**role_name** | **String** | Role's name. | [required] | +**role_actions_obj** | [**RoleActionsObj**](RoleActionsObj.md) | JSON- formatted object decsribing an action to be added to a role. | [required] | + +### Return type + +[**models::RoleActionsObj**](RoleActionsObj.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## add_group_role_member + +> models::RoleMembersObj add_group_role_member(domain_id, group_id, role_name, role_members_obj) +Adds a member to a group role. + +Adds a member to a specific group role that is identified by the role name. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**group_id** | **uuid::Uuid** | Unique group identifier. | [required] | +**role_name** | **String** | Role's name. | [required] | +**role_members_obj** | [**RoleMembersObj**](RoleMembersObj.md) | JSON- formatted object decsribing a member to be added to a role. | [required] | + +### Return type + +[**models::RoleMembersObj**](RoleMembersObj.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## create_group_role + +> models::NewRole create_group_role(domain_id, group_id, create_role_obj) +Creates a role for a group + +Creates a role for a specific group that is identified by the group ID. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**group_id** | **uuid::Uuid** | Unique group identifier. | [required] | +**create_role_obj** | [**CreateRoleObj**](CreateRoleObj.md) | JSON- formatted object decsribing a new role to be created. | [required] | + +### Return type + +[**models::NewRole**](NewRole.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## delete_all_group_role_actions + +> delete_all_group_role_actions(domain_id, group_id, role_name) +Deletes all role actions for a group role. + +Deletes all role actions for a specific group role that is identified by the role name. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**group_id** | **uuid::Uuid** | Unique group identifier. | [required] | +**role_name** | **String** | Role's name. | [required] | + +### Return type + + (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## delete_all_group_role_members + +> delete_all_group_role_members(domain_id, group_id, role_name) +Deletes all members from a group role. + +Deletes all members from a specific group role that is identified by the role name. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**group_id** | **uuid::Uuid** | Unique group identifier. | [required] | +**role_name** | **String** | Role's name. | [required] | + +### Return type + + (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## delete_group_role + +> delete_group_role(domain_id, group_id, role_name) +Deletes group role. + +Deletes a specific group role that is identifier by the role name. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**group_id** | **uuid::Uuid** | Unique group identifier. | [required] | +**role_name** | **String** | Role's name. | [required] | + +### Return type + + (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## delete_group_role_action + +> delete_group_role_action(domain_id, group_id, role_name, role_actions_obj) +Deletes role actions for a group role. + +Deletes a role action for a specific group role that is identified by the role name. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**group_id** | **uuid::Uuid** | Unique group identifier. | [required] | +**role_name** | **String** | Role's name. | [required] | +**role_actions_obj** | [**RoleActionsObj**](RoleActionsObj.md) | JSON- formatted object decsribing an action to be added to a role. | [required] | + +### Return type + + (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## delete_group_role_members + +> delete_group_role_members(domain_id, group_id, role_name, role_members_obj) +Deletes members from a group role. + +Deletes a member from a specific group role that is identified by the role name. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**group_id** | **uuid::Uuid** | Unique group identifier. | [required] | +**role_name** | **String** | Role's name. | [required] | +**role_members_obj** | [**RoleMembersObj**](RoleMembersObj.md) | JSON- formatted object decsribing a member to be added to a role. | [required] | + +### Return type + + (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_group_role + +> models::Role get_group_role(domain_id, group_id, role_name) +Retrieves group role. + +Retrieves a specific group role that is identified by the role name. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**group_id** | **uuid::Uuid** | Unique group identifier. | [required] | +**role_name** | **String** | Role's name. | [required] | + +### Return type + +[**models::Role**](Role.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_available_actions + +> models::AvailableActionsObj list_available_actions(domain_id) +Retrieves available actions. + +Retrieves a list of available actions. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | + +### Return type + +[**models::AvailableActionsObj**](AvailableActionsObj.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_group_role_actions + +> models::RoleActionsObj list_group_role_actions(domain_id, group_id, role_name) +Lists group role actions. + +Retrieves a list of group role actions. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**group_id** | **uuid::Uuid** | Unique group identifier. | [required] | +**role_name** | **String** | Role's name. | [required] | + +### Return type + +[**models::RoleActionsObj**](RoleActionsObj.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_group_role_members + +> models::RoleMembersObj list_group_role_members(domain_id, group_id, role_name) +Lists group role members. + +Retrieves a list of group role members. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**group_id** | **uuid::Uuid** | Unique group identifier. | [required] | +**role_name** | **String** | Role's name. | [required] | + +### Return type + +[**models::RoleMembersObj**](RoleMembersObj.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_group_roles + +> models::RolesPage list_group_roles(domain_id, group_id, limit, offset) +Retrieves groups roles. + +Retrieves a list of group roles. Due to performance concerns, data is retrieved in subsets. The API groups must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**group_id** | **uuid::Uuid** | Unique group identifier. | [required] | +**limit** | Option<**i32**> | Size of the subset to retrieve. | |[default to 10] +**offset** | Option<**i32**> | Number of items to skip during retrieval. | |[default to 0] + +### Return type + +[**models::RolesPage**](RolesPage.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## update_group_role + +> models::Role update_group_role(domain_id, group_id, role_name, update_role_obj) +Updates group role. + +Updates a specific group role that is identified by the role name. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**group_id** | **uuid::Uuid** | Unique group identifier. | [required] | +**role_name** | **String** | Role's name. | [required] | +**update_role_obj** | [**UpdateRoleObj**](UpdateRoleObj.md) | JSON- formatted object decsribing a role to be updated. | [required] | + +### Return type + +[**models::Role**](Role.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/groups/docs/RolesPage.md b/groups/docs/RolesPage.md new file mode 100644 index 00000000..be544da3 --- /dev/null +++ b/groups/docs/RolesPage.md @@ -0,0 +1,14 @@ +# RolesPage + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**roles** | Option<[**Vec**](Role.md)> | List of roles. | [optional] +**total** | Option<**i32**> | Total number of roles. | [optional] +**offset** | Option<**i32**> | Number of items to skip during retrieval. | [optional] +**limit** | Option<**i32**> | Maximum number of items to return in one page. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/groups/docs/UpdateRoleObj.md b/groups/docs/UpdateRoleObj.md new file mode 100644 index 00000000..050c5b88 --- /dev/null +++ b/groups/docs/UpdateRoleObj.md @@ -0,0 +1,11 @@ +# UpdateRoleObj + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | Option<**String**> | Role's name. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/groups/git_push.sh b/groups/git_push.sh new file mode 100644 index 00000000..f53a75d4 --- /dev/null +++ b/groups/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/groups/src/apis/configuration.rs b/groups/src/apis/configuration.rs new file mode 100644 index 00000000..bf3b3cc3 --- /dev/null +++ b/groups/src/apis/configuration.rs @@ -0,0 +1,51 @@ +/* + * SuperMQ Groups Service + * + * This is the Groups Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform groups. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + + + +#[derive(Debug, Clone)] +pub struct Configuration { + pub base_path: String, + pub user_agent: Option, + pub client: reqwest::Client, + pub basic_auth: Option, + pub oauth_access_token: Option, + pub bearer_access_token: Option, + pub api_key: Option, +} + +pub type BasicAuth = (String, Option); + +#[derive(Debug, Clone)] +pub struct ApiKey { + pub prefix: Option, + pub key: String, +} + + +impl Configuration { + pub fn new() -> Configuration { + Configuration::default() + } +} + +impl Default for Configuration { + fn default() -> Self { + Configuration { + base_path: "http://localhost:9004".to_owned(), + user_agent: Some("OpenAPI-Generator/0.15.1/rust".to_owned()), + client: reqwest::Client::new(), + basic_auth: None, + oauth_access_token: None, + bearer_access_token: None, + api_key: None, + } + } +} diff --git a/groups/src/apis/groups_api.rs b/groups/src/apis/groups_api.rs new file mode 100644 index 00000000..83a195f6 --- /dev/null +++ b/groups/src/apis/groups_api.rs @@ -0,0 +1,704 @@ +/* + * SuperMQ Groups Service + * + * This is the Groups Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform groups. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`add_children_groups`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AddChildrenGroupsError { + Status400(), + Status401(), + Status403(), + Status404(), + Status409(), + Status415(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`create_group`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CreateGroupError { + Status400(), + Status401(), + Status403(), + Status404(), + Status409(), + Status415(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`disable_group`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DisableGroupError { + Status400(), + Status401(), + Status403(), + Status404(), + Status409(), + Status415(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`domain_id_groups_group_id_delete`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DomainIdGroupsGroupIdDeleteError { + Status400(), + Status401(), + Status403(), + Status404(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`enable_group`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EnableGroupError { + Status400(), + Status401(), + Status403(), + Status404(), + Status409(), + Status415(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_group`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetGroupError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_children_groups`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListChildrenGroupsError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_group_hierarchy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListGroupHierarchyError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_groups`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListGroupsError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`remove_all_children_groups`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RemoveAllChildrenGroupsError { + Status400(), + Status401(), + Status403(), + Status404(), + Status409(), + Status415(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`remove_children_groups`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RemoveChildrenGroupsError { + Status400(), + Status401(), + Status403(), + Status404(), + Status409(), + Status415(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`remove_group_parent_group`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RemoveGroupParentGroupError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`set_group_parent_group`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SetGroupParentGroupError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`update_group`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UpdateGroupError { + Status400(), + Status401(), + Status403(), + Status404(), + Status409(), + Status415(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + + +/// Adds children groups for a specific group that is identified by the group ID. +pub async fn add_children_groups(configuration: &configuration::Configuration, domain_id: &str, group_id: &str, children_group_req_obj: models::ChildrenGroupReqObj) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}/children", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&children_group_req_obj); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Creates new group that can be used for grouping entities. New account will be uniquely identified by its identity. +pub async fn create_group(configuration: &configuration::Configuration, domain_id: &str, group_req_obj: models::GroupReqObj) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/groups", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&group_req_obj); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Disables a specific group that is identifier by the group ID. +pub async fn disable_group(configuration: &configuration::Configuration, domain_id: &str, group_id: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}/disable", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Delete group removes a group with the given id from repo and removes all the policies related to this group. +pub async fn domain_id_groups_group_id_delete(configuration: &configuration::Configuration, domain_id: &str, group_id: &str) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Enables a specific group that is identifier by the group ID. +pub async fn enable_group(configuration: &configuration::Configuration, domain_id: &str, group_id: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}/enable", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Gets info on a group specified by id. +pub async fn get_group(configuration: &configuration::Configuration, domain_id: &str, group_id: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Lists groups up to a max level of hierarchy that can be fetched in one request ( max level = 5). Result can be filtered by metadata. Groups will be returned as JSON array or JSON tree. Due to performance concerns, result is returned in subsets. +pub async fn list_children_groups(configuration: &configuration::Configuration, domain_id: &str, group_id: &str, limit: Option, offset: Option, start_level: Option, end_level: Option, tree: Option, metadata: Option<&str>, name: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}/children", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = offset { + local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = start_level { + local_var_req_builder = local_var_req_builder.query(&[("start_level", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = end_level { + local_var_req_builder = local_var_req_builder.query(&[("end_level", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = tree { + local_var_req_builder = local_var_req_builder.query(&[("tree", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = metadata { + local_var_req_builder = local_var_req_builder.query(&[("metadata", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = name { + local_var_req_builder = local_var_req_builder.query(&[("name", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Lists groups heirarchy up to a max level of hierarchy that can be fetched in one request ( max level = 5). Result can be filtered by metadata. Groups will be returned as JSON array or JSON tree. Due to performance concerns, result is returned in subsets. +pub async fn list_group_hierarchy(configuration: &configuration::Configuration, domain_id: &str, group_id: &str, level: Option, tree: Option, direction: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}/hierarchy", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = level { + local_var_req_builder = local_var_req_builder.query(&[("level", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = tree { + local_var_req_builder = local_var_req_builder.query(&[("tree", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = direction { + local_var_req_builder = local_var_req_builder.query(&[("direction", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Lists groups up to a max level of hierarchy that can be fetched in one request ( max level = 5). Result can be filtered by metadata. Groups will be returned as JSON array or JSON tree. Due to performance concerns, result is returned in subsets. +pub async fn list_groups(configuration: &configuration::Configuration, domain_id: &str, limit: Option, offset: Option, level: Option, tree: Option, metadata: Option<&str>, name: Option<&str>, parent_id: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/groups", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = offset { + local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = level { + local_var_req_builder = local_var_req_builder.query(&[("level", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = tree { + local_var_req_builder = local_var_req_builder.query(&[("tree", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = metadata { + local_var_req_builder = local_var_req_builder.query(&[("metadata", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = name { + local_var_req_builder = local_var_req_builder.query(&[("name", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = parent_id { + local_var_req_builder = local_var_req_builder.query(&[("parentID", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Removes all children groups for a specific group that is identified by the group ID. +pub async fn remove_all_children_groups(configuration: &configuration::Configuration, domain_id: &str, group_id: &str) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}/children/all", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Removes children groups for a specific group that is identified by the group ID. +pub async fn remove_children_groups(configuration: &configuration::Configuration, domain_id: &str, group_id: &str, children_group_req_obj: models::ChildrenGroupReqObj) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}/children", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&children_group_req_obj); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Removes a parent group from a specific group that is identified by the group ID. +pub async fn remove_group_parent_group(configuration: &configuration::Configuration, domain_id: &str, group_id: &str, parent_group_req_obj: models::ParentGroupReqObj) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}/parent", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&parent_group_req_obj); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Sets a parent group for a specific group that is identified by the group ID. +pub async fn set_group_parent_group(configuration: &configuration::Configuration, domain_id: &str, group_id: &str, parent_group_req_obj: models::ParentGroupReqObj) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}/parent", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&parent_group_req_obj); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Updates Name, Description or Metadata of a group. +pub async fn update_group(configuration: &configuration::Configuration, domain_id: &str, group_id: &str, group_update: models::GroupUpdate) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&group_update); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/groups/src/apis/health_api.rs b/groups/src/apis/health_api.rs new file mode 100644 index 00000000..524487dd --- /dev/null +++ b/groups/src/apis/health_api.rs @@ -0,0 +1,53 @@ +/* + * SuperMQ Groups Service + * + * This is the Groups Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform groups. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`health`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum HealthError { + Status500(models::Error), + UnknownValue(serde_json::Value), +} + + +pub async fn health(configuration: &configuration::Configuration, ) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/health", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/groups/src/apis/mod.rs b/groups/src/apis/mod.rs new file mode 100644 index 00000000..8c98d1f1 --- /dev/null +++ b/groups/src/apis/mod.rs @@ -0,0 +1,97 @@ +use std::error; +use std::fmt; + +#[derive(Debug, Clone)] +pub struct ResponseContent { + pub status: reqwest::StatusCode, + pub content: String, + pub entity: Option, +} + +#[derive(Debug)] +pub enum Error { + Reqwest(reqwest::Error), + Serde(serde_json::Error), + Io(std::io::Error), + ResponseError(ResponseContent), +} + +impl fmt::Display for Error { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + let (module, e) = match self { + Error::Reqwest(e) => ("reqwest", e.to_string()), + Error::Serde(e) => ("serde", e.to_string()), + Error::Io(e) => ("IO", e.to_string()), + Error::ResponseError(e) => ("response", format!("status code {}", e.status)), + }; + write!(f, "error in {}: {}", module, e) + } +} + +impl error::Error for Error { + fn source(&self) -> Option<&(dyn error::Error + 'static)> { + Some(match self { + Error::Reqwest(e) => e, + Error::Serde(e) => e, + Error::Io(e) => e, + Error::ResponseError(_) => return None, + }) + } +} + +impl From for Error { + fn from(e: reqwest::Error) -> Self { + Error::Reqwest(e) + } +} + +impl From for Error { + fn from(e: serde_json::Error) -> Self { + Error::Serde(e) + } +} + +impl From for Error { + fn from(e: std::io::Error) -> Self { + Error::Io(e) + } +} + +pub fn urlencode>(s: T) -> String { + ::url::form_urlencoded::byte_serialize(s.as_ref().as_bytes()).collect() +} + +pub fn parse_deep_object(prefix: &str, value: &serde_json::Value) -> Vec<(String, String)> { + if let serde_json::Value::Object(object) = value { + let mut params = vec![]; + + for (key, value) in object { + match value { + serde_json::Value::Object(_) => params.append(&mut parse_deep_object( + &format!("{}[{}]", prefix, key), + value, + )), + serde_json::Value::Array(array) => { + for (i, value) in array.iter().enumerate() { + params.append(&mut parse_deep_object( + &format!("{}[{}][{}]", prefix, key, i), + value, + )); + } + }, + serde_json::Value::String(s) => params.push((format!("{}[{}]", prefix, key), s.clone())), + _ => params.push((format!("{}[{}]", prefix, key), value.to_string())), + } + } + + return params; + } + + unimplemented!("Only objects are supported with style=deepObject") +} + +pub mod groups_api; +pub mod health_api; +pub mod roles_api; + +pub mod configuration; diff --git a/groups/src/apis/roles_api.rs b/groups/src/apis/roles_api.rs new file mode 100644 index 00000000..6d809c03 --- /dev/null +++ b/groups/src/apis/roles_api.rs @@ -0,0 +1,646 @@ +/* + * SuperMQ Groups Service + * + * This is the Groups Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform groups. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`add_group_role_action`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AddGroupRoleActionError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`add_group_role_member`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AddGroupRoleMemberError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`create_group_role`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CreateGroupRoleError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`delete_all_group_role_actions`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DeleteAllGroupRoleActionsError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`delete_all_group_role_members`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DeleteAllGroupRoleMembersError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`delete_group_role`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DeleteGroupRoleError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`delete_group_role_action`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DeleteGroupRoleActionError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`delete_group_role_members`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DeleteGroupRoleMembersError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_group_role`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetGroupRoleError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_available_actions`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListAvailableActionsError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_group_role_actions`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListGroupRoleActionsError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_group_role_members`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListGroupRoleMembersError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_group_roles`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListGroupRolesError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`update_group_role`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UpdateGroupRoleError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + + +/// Adds a role action for a specific group role that is identified by the role name. +pub async fn add_group_role_action(configuration: &configuration::Configuration, domain_id: &str, group_id: &str, role_name: &str, role_actions_obj: models::RoleActionsObj) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}/roles/{roleName}/actions", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id), roleName=crate::apis::urlencode(role_name)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&role_actions_obj); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Adds a member to a specific group role that is identified by the role name. +pub async fn add_group_role_member(configuration: &configuration::Configuration, domain_id: &str, group_id: &str, role_name: &str, role_members_obj: models::RoleMembersObj) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}/roles/{roleName}/members", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id), roleName=crate::apis::urlencode(role_name)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&role_members_obj); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Creates a role for a specific group that is identified by the group ID. +pub async fn create_group_role(configuration: &configuration::Configuration, domain_id: &str, group_id: &str, create_role_obj: models::CreateRoleObj) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}/roles", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&create_role_obj); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Deletes all role actions for a specific group role that is identified by the role name. +pub async fn delete_all_group_role_actions(configuration: &configuration::Configuration, domain_id: &str, group_id: &str, role_name: &str) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}/roles/{roleName}/actions/delete-all", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id), roleName=crate::apis::urlencode(role_name)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Deletes all members from a specific group role that is identified by the role name. +pub async fn delete_all_group_role_members(configuration: &configuration::Configuration, domain_id: &str, group_id: &str, role_name: &str) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}/roles/{roleName}/members/delete-all", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id), roleName=crate::apis::urlencode(role_name)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Deletes a specific group role that is identifier by the role name. +pub async fn delete_group_role(configuration: &configuration::Configuration, domain_id: &str, group_id: &str, role_name: &str) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}/roles/{roleName}", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id), roleName=crate::apis::urlencode(role_name)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Deletes a role action for a specific group role that is identified by the role name. +pub async fn delete_group_role_action(configuration: &configuration::Configuration, domain_id: &str, group_id: &str, role_name: &str, role_actions_obj: models::RoleActionsObj) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}/roles/{roleName}/actions/delete", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id), roleName=crate::apis::urlencode(role_name)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&role_actions_obj); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Deletes a member from a specific group role that is identified by the role name. +pub async fn delete_group_role_members(configuration: &configuration::Configuration, domain_id: &str, group_id: &str, role_name: &str, role_members_obj: models::RoleMembersObj) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}/roles/{roleName}/members/delete", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id), roleName=crate::apis::urlencode(role_name)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&role_members_obj); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Retrieves a specific group role that is identified by the role name. +pub async fn get_group_role(configuration: &configuration::Configuration, domain_id: &str, group_id: &str, role_name: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}/roles/{roleName}", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id), roleName=crate::apis::urlencode(role_name)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Retrieves a list of available actions. +pub async fn list_available_actions(configuration: &configuration::Configuration, domain_id: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/groups/roles/available-actions", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Retrieves a list of group role actions. +pub async fn list_group_role_actions(configuration: &configuration::Configuration, domain_id: &str, group_id: &str, role_name: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}/roles/{roleName}/actions", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id), roleName=crate::apis::urlencode(role_name)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Retrieves a list of group role members. +pub async fn list_group_role_members(configuration: &configuration::Configuration, domain_id: &str, group_id: &str, role_name: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}/roles/{roleName}/members", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id), roleName=crate::apis::urlencode(role_name)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Retrieves a list of group roles. Due to performance concerns, data is retrieved in subsets. The API groups must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. +pub async fn list_group_roles(configuration: &configuration::Configuration, domain_id: &str, group_id: &str, limit: Option, offset: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}/roles", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = offset { + local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Updates a specific group role that is identified by the role name. +pub async fn update_group_role(configuration: &configuration::Configuration, domain_id: &str, group_id: &str, role_name: &str, update_role_obj: models::UpdateRoleObj) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}/roles/{roleName}", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id), roleName=crate::apis::urlencode(role_name)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&update_role_obj); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/groups/src/lib.rs b/groups/src/lib.rs new file mode 100644 index 00000000..e1520628 --- /dev/null +++ b/groups/src/lib.rs @@ -0,0 +1,11 @@ +#![allow(unused_imports)] +#![allow(clippy::too_many_arguments)] + +extern crate serde_repr; +extern crate serde; +extern crate serde_json; +extern crate url; +extern crate reqwest; + +pub mod apis; +pub mod models; diff --git a/groups/src/models/available_actions_obj.rs b/groups/src/models/available_actions_obj.rs new file mode 100644 index 00000000..c6b9434b --- /dev/null +++ b/groups/src/models/available_actions_obj.rs @@ -0,0 +1,28 @@ +/* + * SuperMQ Groups Service + * + * This is the Groups Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform groups. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AvailableActionsObj { + /// List of all available actions. + #[serde(rename = "available_actions", skip_serializing_if = "Option::is_none")] + pub available_actions: Option>, +} + +impl AvailableActionsObj { + pub fn new() -> AvailableActionsObj { + AvailableActionsObj { + available_actions: None, + } + } +} + diff --git a/groups/src/models/children_group_req_obj.rs b/groups/src/models/children_group_req_obj.rs new file mode 100644 index 00000000..702514c2 --- /dev/null +++ b/groups/src/models/children_group_req_obj.rs @@ -0,0 +1,28 @@ +/* + * SuperMQ Groups Service + * + * This is the Groups Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform groups. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ChildrenGroupReqObj { + /// Children group IDs. + #[serde(rename = "groups")] + pub groups: Vec, +} + +impl ChildrenGroupReqObj { + pub fn new(groups: Vec) -> ChildrenGroupReqObj { + ChildrenGroupReqObj { + groups, + } + } +} + diff --git a/groups/src/models/create_role_obj.rs b/groups/src/models/create_role_obj.rs new file mode 100644 index 00000000..fba68081 --- /dev/null +++ b/groups/src/models/create_role_obj.rs @@ -0,0 +1,36 @@ +/* + * SuperMQ Groups Service + * + * This is the Groups Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform groups. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct CreateRoleObj { + /// Role's name. + #[serde(rename = "role_name", skip_serializing_if = "Option::is_none")] + pub role_name: Option, + /// List of optional actions. + #[serde(rename = "optional_actions", skip_serializing_if = "Option::is_none")] + pub optional_actions: Option>, + /// List of optional members. + #[serde(rename = "optional_members", skip_serializing_if = "Option::is_none")] + pub optional_members: Option>, +} + +impl CreateRoleObj { + pub fn new() -> CreateRoleObj { + CreateRoleObj { + role_name: None, + optional_actions: None, + optional_members: None, + } + } +} + diff --git a/groups/src/models/error.rs b/groups/src/models/error.rs new file mode 100644 index 00000000..827f85d5 --- /dev/null +++ b/groups/src/models/error.rs @@ -0,0 +1,28 @@ +/* + * SuperMQ Groups Service + * + * This is the Groups Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform groups. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Error { + /// Error message + #[serde(rename = "error", skip_serializing_if = "Option::is_none")] + pub error: Option, +} + +impl Error { + pub fn new() -> Error { + Error { + error: None, + } + } +} + diff --git a/groups/src/models/group.rs b/groups/src/models/group.rs new file mode 100644 index 00000000..06e13076 --- /dev/null +++ b/groups/src/models/group.rs @@ -0,0 +1,68 @@ +/* + * SuperMQ Groups Service + * + * This is the Groups Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform groups. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Group { + /// Unique group identifier generated by the service. + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + /// Free-form group name. Group name is unique on the given hierarchy level. + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + /// ID of the domain to which the group belongs.. + #[serde(rename = "domain_id", skip_serializing_if = "Option::is_none")] + pub domain_id: Option, + /// Group parent identifier. + #[serde(rename = "parent_id", skip_serializing_if = "Option::is_none")] + pub parent_id: Option, + /// Group description, free form text. + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option, + /// Arbitrary, object-encoded groups's data. + #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")] + pub metadata: Option, + /// Hierarchy path, concatenated ids of group ancestors. + #[serde(rename = "path", skip_serializing_if = "Option::is_none")] + pub path: Option, + /// Level in hierarchy, distance from the root group. + #[serde(rename = "level", skip_serializing_if = "Option::is_none")] + pub level: Option, + /// Datetime when the group was created. + #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] + pub created_at: Option, + /// Datetime when the group was created. + #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")] + pub updated_at: Option, + /// Group Status + #[serde(rename = "status", skip_serializing_if = "Option::is_none")] + pub status: Option, +} + +impl Group { + pub fn new() -> Group { + Group { + id: None, + name: None, + domain_id: None, + parent_id: None, + description: None, + metadata: None, + path: None, + level: None, + created_at: None, + updated_at: None, + status: None, + } + } +} + diff --git a/groups/src/models/group_req_obj.rs b/groups/src/models/group_req_obj.rs new file mode 100644 index 00000000..19fd825d --- /dev/null +++ b/groups/src/models/group_req_obj.rs @@ -0,0 +1,44 @@ +/* + * SuperMQ Groups Service + * + * This is the Groups Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform groups. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct GroupReqObj { + /// Free-form group name. Group name is unique on the given hierarchy level. + #[serde(rename = "name")] + pub name: String, + /// Group description, free form text. + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option, + /// Id of parent group, it must be existing group. + #[serde(rename = "parent_id", skip_serializing_if = "Option::is_none")] + pub parent_id: Option, + /// Arbitrary, object-encoded groups's data. + #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")] + pub metadata: Option, + /// Group Status + #[serde(rename = "status", skip_serializing_if = "Option::is_none")] + pub status: Option, +} + +impl GroupReqObj { + pub fn new(name: String) -> GroupReqObj { + GroupReqObj { + name, + description: None, + parent_id: None, + metadata: None, + status: None, + } + } +} + diff --git a/groups/src/models/group_update.rs b/groups/src/models/group_update.rs new file mode 100644 index 00000000..5d009c7b --- /dev/null +++ b/groups/src/models/group_update.rs @@ -0,0 +1,36 @@ +/* + * SuperMQ Groups Service + * + * This is the Groups Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform groups. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct GroupUpdate { + /// Free-form group name. Group name is unique on the given hierarchy level. + #[serde(rename = "name")] + pub name: String, + /// Group description, free form text. + #[serde(rename = "description")] + pub description: String, + /// Arbitrary, object-encoded groups's data. + #[serde(rename = "metadata")] + pub metadata: serde_json::Value, +} + +impl GroupUpdate { + pub fn new(name: String, description: String, metadata: serde_json::Value) -> GroupUpdate { + GroupUpdate { + name, + description, + metadata, + } + } +} + diff --git a/groups/src/models/groups_hierarchy_page.rs b/groups/src/models/groups_hierarchy_page.rs new file mode 100644 index 00000000..5906c415 --- /dev/null +++ b/groups/src/models/groups_hierarchy_page.rs @@ -0,0 +1,35 @@ +/* + * SuperMQ Groups Service + * + * This is the Groups Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform groups. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct GroupsHierarchyPage { + /// Level of hierarchy. + #[serde(rename = "level", skip_serializing_if = "Option::is_none")] + pub level: Option, + /// Direction of hierarchy traversal. + #[serde(rename = "direction", skip_serializing_if = "Option::is_none")] + pub direction: Option, + #[serde(rename = "groups", skip_serializing_if = "Option::is_none")] + pub groups: Option>, +} + +impl GroupsHierarchyPage { + pub fn new() -> GroupsHierarchyPage { + GroupsHierarchyPage { + level: None, + direction: None, + groups: None, + } + } +} + diff --git a/groups/src/models/groups_page.rs b/groups/src/models/groups_page.rs new file mode 100644 index 00000000..30be5d9a --- /dev/null +++ b/groups/src/models/groups_page.rs @@ -0,0 +1,39 @@ +/* + * SuperMQ Groups Service + * + * This is the Groups Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform groups. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct GroupsPage { + #[serde(rename = "groups")] + pub groups: Vec, + /// Total number of items. + #[serde(rename = "total")] + pub total: i32, + /// Number of items to skip during retrieval. + #[serde(rename = "offset")] + pub offset: i32, + /// Maximum number of items to return in one page. + #[serde(rename = "limit", skip_serializing_if = "Option::is_none")] + pub limit: Option, +} + +impl GroupsPage { + pub fn new(groups: Vec, total: i32, offset: i32) -> GroupsPage { + GroupsPage { + groups, + total, + offset, + limit: None, + } + } +} + diff --git a/groups/src/models/health_res.rs b/groups/src/models/health_res.rs new file mode 100644 index 00000000..61eb773c --- /dev/null +++ b/groups/src/models/health_res.rs @@ -0,0 +1,56 @@ +/* + * SuperMQ Groups Service + * + * This is the Groups Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform groups. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct HealthRes { + /// Service status. + #[serde(rename = "status", skip_serializing_if = "Option::is_none")] + pub status: Option, + /// Service version. + #[serde(rename = "version", skip_serializing_if = "Option::is_none")] + pub version: Option, + /// Service commit hash. + #[serde(rename = "commit", skip_serializing_if = "Option::is_none")] + pub commit: Option, + /// Service description. + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option, + /// Service build time. + #[serde(rename = "build_time", skip_serializing_if = "Option::is_none")] + pub build_time: Option, +} + +impl HealthRes { + pub fn new() -> HealthRes { + HealthRes { + status: None, + version: None, + commit: None, + description: None, + build_time: None, + } + } +} +/// Service status. +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Status { + #[serde(rename = "pass")] + Pass, +} + +impl Default for Status { + fn default() -> Status { + Self::Pass + } +} + diff --git a/groups/src/models/members.rs b/groups/src/models/members.rs new file mode 100644 index 00000000..e636d4f7 --- /dev/null +++ b/groups/src/models/members.rs @@ -0,0 +1,63 @@ +/* + * SuperMQ Groups Service + * + * This is the Groups Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform groups. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Members { + /// User unique identifier. + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + /// User's first name. + #[serde(rename = "first_name", skip_serializing_if = "Option::is_none")] + pub first_name: Option, + /// User's last name. + #[serde(rename = "last_name", skip_serializing_if = "Option::is_none")] + pub last_name: Option, + /// User's email address. + #[serde(rename = "email", skip_serializing_if = "Option::is_none")] + pub email: Option, + /// User tags. + #[serde(rename = "tags", skip_serializing_if = "Option::is_none")] + pub tags: Option>, + #[serde(rename = "credentials", skip_serializing_if = "Option::is_none")] + pub credentials: Option>, + /// Arbitrary, object-encoded user's data. + #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")] + pub metadata: Option, + /// User Status + #[serde(rename = "status", skip_serializing_if = "Option::is_none")] + pub status: Option, + /// Time when the group was created. + #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] + pub created_at: Option, + /// Time when the group was created. + #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")] + pub updated_at: Option, +} + +impl Members { + pub fn new() -> Members { + Members { + id: None, + first_name: None, + last_name: None, + email: None, + tags: None, + credentials: None, + metadata: None, + status: None, + created_at: None, + updated_at: None, + } + } +} + diff --git a/groups/src/models/members_credentials.rs b/groups/src/models/members_credentials.rs new file mode 100644 index 00000000..dfc2fefd --- /dev/null +++ b/groups/src/models/members_credentials.rs @@ -0,0 +1,32 @@ +/* + * SuperMQ Groups Service + * + * This is the Groups Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform groups. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct MembersCredentials { + /// User's username. + #[serde(rename = "username", skip_serializing_if = "Option::is_none")] + pub username: Option, + /// User secret password. + #[serde(rename = "secret", skip_serializing_if = "Option::is_none")] + pub secret: Option, +} + +impl MembersCredentials { + pub fn new() -> MembersCredentials { + MembersCredentials { + username: None, + secret: None, + } + } +} + diff --git a/groups/src/models/members_page.rs b/groups/src/models/members_page.rs new file mode 100644 index 00000000..5e0d2c99 --- /dev/null +++ b/groups/src/models/members_page.rs @@ -0,0 +1,39 @@ +/* + * SuperMQ Groups Service + * + * This is the Groups Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform groups. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct MembersPage { + #[serde(rename = "members")] + pub members: Vec, + /// Total number of items. + #[serde(rename = "total")] + pub total: i32, + /// Number of items to skip during retrieval. + #[serde(rename = "offset", skip_serializing_if = "Option::is_none")] + pub offset: Option, + /// Maximum number of items to return in one page. + #[serde(rename = "limit", skip_serializing_if = "Option::is_none")] + pub limit: Option, +} + +impl MembersPage { + pub fn new(members: Vec, total: i32) -> MembersPage { + MembersPage { + members, + total, + offset: None, + limit: None, + } + } +} + diff --git a/groups/src/models/mod.rs b/groups/src/models/mod.rs new file mode 100644 index 00000000..698b523a --- /dev/null +++ b/groups/src/models/mod.rs @@ -0,0 +1,40 @@ +pub mod available_actions_obj; +pub use self::available_actions_obj::AvailableActionsObj; +pub mod children_group_req_obj; +pub use self::children_group_req_obj::ChildrenGroupReqObj; +pub mod create_role_obj; +pub use self::create_role_obj::CreateRoleObj; +pub mod error; +pub use self::error::Error; +pub mod group; +pub use self::group::Group; +pub mod group_req_obj; +pub use self::group_req_obj::GroupReqObj; +pub mod group_update; +pub use self::group_update::GroupUpdate; +pub mod groups_hierarchy_page; +pub use self::groups_hierarchy_page::GroupsHierarchyPage; +pub mod groups_page; +pub use self::groups_page::GroupsPage; +pub mod health_res; +pub use self::health_res::HealthRes; +pub mod members; +pub use self::members::Members; +pub mod members_credentials; +pub use self::members_credentials::MembersCredentials; +pub mod members_page; +pub use self::members_page::MembersPage; +pub mod new_role; +pub use self::new_role::NewRole; +pub mod parent_group_req_obj; +pub use self::parent_group_req_obj::ParentGroupReqObj; +pub mod role; +pub use self::role::Role; +pub mod role_actions_obj; +pub use self::role_actions_obj::RoleActionsObj; +pub mod role_members_obj; +pub use self::role_members_obj::RoleMembersObj; +pub mod roles_page; +pub use self::roles_page::RolesPage; +pub mod update_role_obj; +pub use self::update_role_obj::UpdateRoleObj; diff --git a/groups/src/models/new_role.rs b/groups/src/models/new_role.rs new file mode 100644 index 00000000..cb80641a --- /dev/null +++ b/groups/src/models/new_role.rs @@ -0,0 +1,52 @@ +/* + * SuperMQ Groups Service + * + * This is the Groups Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform groups. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct NewRole { + /// Role unique identifier. + #[serde(rename = "role_id", skip_serializing_if = "Option::is_none")] + pub role_id: Option, + /// Role's name. + #[serde(rename = "role_name", skip_serializing_if = "Option::is_none")] + pub role_name: Option, + /// Entity unique identifier. + #[serde(rename = "entity_id", skip_serializing_if = "Option::is_none")] + pub entity_id: Option, + /// Role creator unique identifier. + #[serde(rename = "created_by", skip_serializing_if = "Option::is_none")] + pub created_by: Option, + /// Time when the channel was created. + #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] + pub created_at: Option, + /// Role updater unique identifier. + #[serde(rename = "updated_by", skip_serializing_if = "Option::is_none")] + pub updated_by: Option, + /// Time when the channel was created. + #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")] + pub updated_at: Option, +} + +impl NewRole { + pub fn new() -> NewRole { + NewRole { + role_id: None, + role_name: None, + entity_id: None, + created_by: None, + created_at: None, + updated_by: None, + updated_at: None, + } + } +} + diff --git a/groups/src/models/parent_group_req_obj.rs b/groups/src/models/parent_group_req_obj.rs new file mode 100644 index 00000000..d99b76d5 --- /dev/null +++ b/groups/src/models/parent_group_req_obj.rs @@ -0,0 +1,28 @@ +/* + * SuperMQ Groups Service + * + * This is the Groups Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform groups. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ParentGroupReqObj { + /// Parent group unique identifier. + #[serde(rename = "group_id")] + pub group_id: uuid::Uuid, +} + +impl ParentGroupReqObj { + pub fn new(group_id: uuid::Uuid) -> ParentGroupReqObj { + ParentGroupReqObj { + group_id, + } + } +} + diff --git a/groups/src/models/role.rs b/groups/src/models/role.rs new file mode 100644 index 00000000..ee5a09fd --- /dev/null +++ b/groups/src/models/role.rs @@ -0,0 +1,52 @@ +/* + * SuperMQ Groups Service + * + * This is the Groups Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform groups. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Role { + /// Role unique identifier. + #[serde(rename = "role_id", skip_serializing_if = "Option::is_none")] + pub role_id: Option, + /// Role's name. + #[serde(rename = "role_name", skip_serializing_if = "Option::is_none")] + pub role_name: Option, + /// Entity unique identifier. + #[serde(rename = "entity_id", skip_serializing_if = "Option::is_none")] + pub entity_id: Option, + /// Role creator unique identifier. + #[serde(rename = "created_by", skip_serializing_if = "Option::is_none")] + pub created_by: Option, + /// Time when the channel was created. + #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] + pub created_at: Option, + /// Role updater unique identifier. + #[serde(rename = "updated_by", skip_serializing_if = "Option::is_none")] + pub updated_by: Option, + /// Time when the channel was created. + #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")] + pub updated_at: Option, +} + +impl Role { + pub fn new() -> Role { + Role { + role_id: None, + role_name: None, + entity_id: None, + created_by: None, + created_at: None, + updated_by: None, + updated_at: None, + } + } +} + diff --git a/groups/src/models/role_actions_obj.rs b/groups/src/models/role_actions_obj.rs new file mode 100644 index 00000000..17711484 --- /dev/null +++ b/groups/src/models/role_actions_obj.rs @@ -0,0 +1,28 @@ +/* + * SuperMQ Groups Service + * + * This is the Groups Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform groups. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct RoleActionsObj { + /// List of actions to be added to a role. + #[serde(rename = "actions", skip_serializing_if = "Option::is_none")] + pub actions: Option>, +} + +impl RoleActionsObj { + pub fn new() -> RoleActionsObj { + RoleActionsObj { + actions: None, + } + } +} + diff --git a/groups/src/models/role_members_obj.rs b/groups/src/models/role_members_obj.rs new file mode 100644 index 00000000..8e49e45f --- /dev/null +++ b/groups/src/models/role_members_obj.rs @@ -0,0 +1,28 @@ +/* + * SuperMQ Groups Service + * + * This is the Groups Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform groups. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct RoleMembersObj { + /// List of members to be added to a role. + #[serde(rename = "members", skip_serializing_if = "Option::is_none")] + pub members: Option>, +} + +impl RoleMembersObj { + pub fn new() -> RoleMembersObj { + RoleMembersObj { + members: None, + } + } +} + diff --git a/groups/src/models/roles_page.rs b/groups/src/models/roles_page.rs new file mode 100644 index 00000000..81ac1748 --- /dev/null +++ b/groups/src/models/roles_page.rs @@ -0,0 +1,40 @@ +/* + * SuperMQ Groups Service + * + * This is the Groups Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform groups. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct RolesPage { + /// List of roles. + #[serde(rename = "roles", skip_serializing_if = "Option::is_none")] + pub roles: Option>, + /// Total number of roles. + #[serde(rename = "total", skip_serializing_if = "Option::is_none")] + pub total: Option, + /// Number of items to skip during retrieval. + #[serde(rename = "offset", skip_serializing_if = "Option::is_none")] + pub offset: Option, + /// Maximum number of items to return in one page. + #[serde(rename = "limit", skip_serializing_if = "Option::is_none")] + pub limit: Option, +} + +impl RolesPage { + pub fn new() -> RolesPage { + RolesPage { + roles: None, + total: None, + offset: None, + limit: None, + } + } +} + diff --git a/groups/src/models/update_role_obj.rs b/groups/src/models/update_role_obj.rs new file mode 100644 index 00000000..32d82d30 --- /dev/null +++ b/groups/src/models/update_role_obj.rs @@ -0,0 +1,28 @@ +/* + * SuperMQ Groups Service + * + * This is the Groups Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform groups. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct UpdateRoleObj { + /// Role's name. + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, +} + +impl UpdateRoleObj { + pub fn new() -> UpdateRoleObj { + UpdateRoleObj { + name: None, + } + } +} + diff --git a/http/.gitignore b/http/.gitignore new file mode 100644 index 00000000..6aa10640 --- /dev/null +++ b/http/.gitignore @@ -0,0 +1,3 @@ +/target/ +**/*.rs.bk +Cargo.lock diff --git a/http/.openapi-generator-ignore b/http/.openapi-generator-ignore new file mode 100644 index 00000000..7484ee59 --- /dev/null +++ b/http/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/http/.openapi-generator/FILES b/http/.openapi-generator/FILES new file mode 100644 index 00000000..432ce0c9 --- /dev/null +++ b/http/.openapi-generator/FILES @@ -0,0 +1,18 @@ +.gitignore +.openapi-generator-ignore +.travis.yml +Cargo.toml +README.md +docs/HealthApi.md +docs/HealthInfo.md +docs/MessagesApi.md +docs/SenMlRecord.md +git_push.sh +src/apis/configuration.rs +src/apis/health_api.rs +src/apis/messages_api.rs +src/apis/mod.rs +src/lib.rs +src/models/health_info.rs +src/models/mod.rs +src/models/sen_ml_record.rs diff --git a/http/.openapi-generator/VERSION b/http/.openapi-generator/VERSION new file mode 100644 index 00000000..758bb9c8 --- /dev/null +++ b/http/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.10.0 diff --git a/http/.travis.yml b/http/.travis.yml new file mode 100644 index 00000000..22761ba7 --- /dev/null +++ b/http/.travis.yml @@ -0,0 +1 @@ +language: rust diff --git a/http/Cargo.toml b/http/Cargo.toml new file mode 100644 index 00000000..13931f1b --- /dev/null +++ b/http/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "http-openapi" +version = "0.15.1" +authors = ["info@abstractmachines.fr"] +description = "HTTP API for sending messages through communication channels. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) " +license = "Apache 2.0" +edition = "2021" + +[dependencies] +serde = { version = "^1.0", features = ["derive"] } +serde_json = "^1.0" +serde_repr = "^0.1" +url = "^2.5" +uuid = { version = "^1.8", features = ["serde", "v4"] } +reqwest = { version = "^0.12", features = ["json", "multipart"] } diff --git a/http/README.md b/http/README.md new file mode 100644 index 00000000..83d8a231 --- /dev/null +++ b/http/README.md @@ -0,0 +1,51 @@ +# Rust API client for openapi + +HTTP API for sending messages through communication channels. +Some useful links: +- [The SuperMQ repository](https://github.com/absmach/supermq) + + + +## Overview + +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://openapis.org) from a remote server, you can easily generate an API client. + +- API version: 0.15.1 +- Package version: 0.15.1 +- Generator version: 7.10.0 +- Build package: `org.openapitools.codegen.languages.RustClientCodegen` + +## Installation + +Put the package under your project folder in a directory named `openapi` and add the following to `Cargo.toml` under `[dependencies]`: + +``` +openapi = { path = "./openapi" } +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost:8008* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*HealthApi* | [**health_get**](docs/HealthApi.md#health_get) | **GET** /health | Retrieves service health check info. +*MessagesApi* | [**channels_id_messages_post**](docs/MessagesApi.md#channels_id_messages_post) | **POST** /channels/{id}/messages | Sends message to the communication channel + + +## Documentation For Models + + - [HealthInfo](docs/HealthInfo.md) + - [SenMlRecord](docs/SenMlRecord.md) + + +To get access to the crate's generated documentation, use: + +``` +cargo doc --open +``` + +## Author + +info@abstractmachines.fr + diff --git a/http/docs/HealthApi.md b/http/docs/HealthApi.md new file mode 100644 index 00000000..4fc3953b --- /dev/null +++ b/http/docs/HealthApi.md @@ -0,0 +1,34 @@ +# \HealthApi + +All URIs are relative to *http://localhost:8008* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**health_get**](HealthApi.md#health_get) | **GET** /health | Retrieves service health check info. + + + +## health_get + +> models::HealthInfo health_get() +Retrieves service health check info. + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**models::HealthInfo**](health_info.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/health+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/http/docs/HealthInfo.md b/http/docs/HealthInfo.md new file mode 100644 index 00000000..ee8f5c6b --- /dev/null +++ b/http/docs/HealthInfo.md @@ -0,0 +1,16 @@ +# HealthInfo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | Option<**String**> | Service status. | [optional] +**version** | Option<**String**> | Service version. | [optional] +**commit** | Option<**String**> | Service commit hash. | [optional] +**description** | Option<**String**> | Service description. | [optional] +**build_time** | Option<**String**> | Service build time. | [optional] +**instance_id** | Option<**String**> | Service instance ID. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/http/docs/MessagesApi.md b/http/docs/MessagesApi.md new file mode 100644 index 00000000..a97a7ad8 --- /dev/null +++ b/http/docs/MessagesApi.md @@ -0,0 +1,40 @@ +# \MessagesApi + +All URIs are relative to *http://localhost:8008* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**channels_id_messages_post**](MessagesApi.md#channels_id_messages_post) | **POST** /channels/{id}/messages | Sends message to the communication channel + + + +## channels_id_messages_post + +> channels_id_messages_post(id, sen_ml_record) +Sends message to the communication channel + +Sends message to the communication channel. Messages can be sent as JSON formatted SenML or as blob. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **uuid::Uuid** | Unique channel identifier. | [required] | +**sen_ml_record** | [**Vec**](SenMLRecord.md) | Message to be distributed. Since the platform expects messages to be properly formatted SenML in order to be post-processed, clients are obliged to specify Content-Type header for each published message. Note that all messages that aren't SenML will be accepted and published, but no post-processing will be applied. | [required] | + +### Return type + + (empty response body) + +### Authorization + +[basicAuth](../README.md#basicAuth), [bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/http/docs/SenMlRecord.md b/http/docs/SenMlRecord.md new file mode 100644 index 00000000..fe77b0fd --- /dev/null +++ b/http/docs/SenMlRecord.md @@ -0,0 +1,25 @@ +# SenMlRecord + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bn** | Option<**String**> | Base Name | [optional] +**bt** | Option<**f64**> | Base Time | [optional] +**bu** | Option<**f64**> | Base Unit | [optional] +**bv** | Option<**f64**> | Base Value | [optional] +**bs** | Option<**f64**> | Base Sum | [optional] +**bver** | Option<**f64**> | Version | [optional] +**n** | Option<**String**> | Name | [optional] +**u** | Option<**String**> | Unit | [optional] +**v** | Option<**f64**> | Value | [optional] +**vs** | Option<**String**> | String Value | [optional] +**vb** | Option<**bool**> | Boolean Value | [optional] +**vd** | Option<**String**> | Data Value | [optional] +**s** | Option<**f64**> | Value Sum | [optional] +**t** | Option<**f64**> | Time | [optional] +**ut** | Option<**f64**> | Update Time | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/http/git_push.sh b/http/git_push.sh new file mode 100644 index 00000000..f53a75d4 --- /dev/null +++ b/http/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/http/src/apis/configuration.rs b/http/src/apis/configuration.rs new file mode 100644 index 00000000..f4b11b9b --- /dev/null +++ b/http/src/apis/configuration.rs @@ -0,0 +1,51 @@ +/* + * SuperMQ http adapter + * + * HTTP API for sending messages through communication channels. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + + + +#[derive(Debug, Clone)] +pub struct Configuration { + pub base_path: String, + pub user_agent: Option, + pub client: reqwest::Client, + pub basic_auth: Option, + pub oauth_access_token: Option, + pub bearer_access_token: Option, + pub api_key: Option, +} + +pub type BasicAuth = (String, Option); + +#[derive(Debug, Clone)] +pub struct ApiKey { + pub prefix: Option, + pub key: String, +} + + +impl Configuration { + pub fn new() -> Configuration { + Configuration::default() + } +} + +impl Default for Configuration { + fn default() -> Self { + Configuration { + base_path: "http://localhost:8008".to_owned(), + user_agent: Some("OpenAPI-Generator/0.15.1/rust".to_owned()), + client: reqwest::Client::new(), + basic_auth: None, + oauth_access_token: None, + bearer_access_token: None, + api_key: None, + } + } +} diff --git a/http/src/apis/health_api.rs b/http/src/apis/health_api.rs new file mode 100644 index 00000000..d14c6e59 --- /dev/null +++ b/http/src/apis/health_api.rs @@ -0,0 +1,53 @@ +/* + * SuperMQ http adapter + * + * HTTP API for sending messages through communication channels. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`health_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum HealthGetError { + Status500(), + UnknownValue(serde_json::Value), +} + + +pub async fn health_get(configuration: &configuration::Configuration, ) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/health", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/http/src/apis/messages_api.rs b/http/src/apis/messages_api.rs new file mode 100644 index 00000000..2c251166 --- /dev/null +++ b/http/src/apis/messages_api.rs @@ -0,0 +1,65 @@ +/* + * SuperMQ http adapter + * + * HTTP API for sending messages through communication channels. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`channels_id_messages_post`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ChannelsIdMessagesPostError { + Status400(), + Status401(), + Status404(), + Status415(), + Status500(), + UnknownValue(serde_json::Value), +} + + +/// Sends message to the communication channel. Messages can be sent as JSON formatted SenML or as blob. +pub async fn channels_id_messages_post(configuration: &configuration::Configuration, id: &str, sen_ml_record: Vec) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/channels/{id}/messages", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&sen_ml_record); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/http/src/apis/mod.rs b/http/src/apis/mod.rs new file mode 100644 index 00000000..d04ef61e --- /dev/null +++ b/http/src/apis/mod.rs @@ -0,0 +1,96 @@ +use std::error; +use std::fmt; + +#[derive(Debug, Clone)] +pub struct ResponseContent { + pub status: reqwest::StatusCode, + pub content: String, + pub entity: Option, +} + +#[derive(Debug)] +pub enum Error { + Reqwest(reqwest::Error), + Serde(serde_json::Error), + Io(std::io::Error), + ResponseError(ResponseContent), +} + +impl fmt::Display for Error { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + let (module, e) = match self { + Error::Reqwest(e) => ("reqwest", e.to_string()), + Error::Serde(e) => ("serde", e.to_string()), + Error::Io(e) => ("IO", e.to_string()), + Error::ResponseError(e) => ("response", format!("status code {}", e.status)), + }; + write!(f, "error in {}: {}", module, e) + } +} + +impl error::Error for Error { + fn source(&self) -> Option<&(dyn error::Error + 'static)> { + Some(match self { + Error::Reqwest(e) => e, + Error::Serde(e) => e, + Error::Io(e) => e, + Error::ResponseError(_) => return None, + }) + } +} + +impl From for Error { + fn from(e: reqwest::Error) -> Self { + Error::Reqwest(e) + } +} + +impl From for Error { + fn from(e: serde_json::Error) -> Self { + Error::Serde(e) + } +} + +impl From for Error { + fn from(e: std::io::Error) -> Self { + Error::Io(e) + } +} + +pub fn urlencode>(s: T) -> String { + ::url::form_urlencoded::byte_serialize(s.as_ref().as_bytes()).collect() +} + +pub fn parse_deep_object(prefix: &str, value: &serde_json::Value) -> Vec<(String, String)> { + if let serde_json::Value::Object(object) = value { + let mut params = vec![]; + + for (key, value) in object { + match value { + serde_json::Value::Object(_) => params.append(&mut parse_deep_object( + &format!("{}[{}]", prefix, key), + value, + )), + serde_json::Value::Array(array) => { + for (i, value) in array.iter().enumerate() { + params.append(&mut parse_deep_object( + &format!("{}[{}][{}]", prefix, key, i), + value, + )); + } + }, + serde_json::Value::String(s) => params.push((format!("{}[{}]", prefix, key), s.clone())), + _ => params.push((format!("{}[{}]", prefix, key), value.to_string())), + } + } + + return params; + } + + unimplemented!("Only objects are supported with style=deepObject") +} + +pub mod health_api; +pub mod messages_api; + +pub mod configuration; diff --git a/http/src/lib.rs b/http/src/lib.rs new file mode 100644 index 00000000..e1520628 --- /dev/null +++ b/http/src/lib.rs @@ -0,0 +1,11 @@ +#![allow(unused_imports)] +#![allow(clippy::too_many_arguments)] + +extern crate serde_repr; +extern crate serde; +extern crate serde_json; +extern crate url; +extern crate reqwest; + +pub mod apis; +pub mod models; diff --git a/http/src/models/health_info.rs b/http/src/models/health_info.rs new file mode 100644 index 00000000..209edbe3 --- /dev/null +++ b/http/src/models/health_info.rs @@ -0,0 +1,60 @@ +/* + * SuperMQ http adapter + * + * HTTP API for sending messages through communication channels. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct HealthInfo { + /// Service status. + #[serde(rename = "status", skip_serializing_if = "Option::is_none")] + pub status: Option, + /// Service version. + #[serde(rename = "version", skip_serializing_if = "Option::is_none")] + pub version: Option, + /// Service commit hash. + #[serde(rename = "commit", skip_serializing_if = "Option::is_none")] + pub commit: Option, + /// Service description. + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option, + /// Service build time. + #[serde(rename = "build_time", skip_serializing_if = "Option::is_none")] + pub build_time: Option, + /// Service instance ID. + #[serde(rename = "instance_id", skip_serializing_if = "Option::is_none")] + pub instance_id: Option, +} + +impl HealthInfo { + pub fn new() -> HealthInfo { + HealthInfo { + status: None, + version: None, + commit: None, + description: None, + build_time: None, + instance_id: None, + } + } +} +/// Service status. +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Status { + #[serde(rename = "pass")] + Pass, +} + +impl Default for Status { + fn default() -> Status { + Self::Pass + } +} + diff --git a/http/src/models/mod.rs b/http/src/models/mod.rs new file mode 100644 index 00000000..70cb3691 --- /dev/null +++ b/http/src/models/mod.rs @@ -0,0 +1,4 @@ +pub mod health_info; +pub use self::health_info::HealthInfo; +pub mod sen_ml_record; +pub use self::sen_ml_record::SenMlRecord; diff --git a/http/src/models/sen_ml_record.rs b/http/src/models/sen_ml_record.rs new file mode 100644 index 00000000..db16277f --- /dev/null +++ b/http/src/models/sen_ml_record.rs @@ -0,0 +1,84 @@ +/* + * SuperMQ http adapter + * + * HTTP API for sending messages through communication channels. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct SenMlRecord { + /// Base Name + #[serde(rename = "bn", skip_serializing_if = "Option::is_none")] + pub bn: Option, + /// Base Time + #[serde(rename = "bt", skip_serializing_if = "Option::is_none")] + pub bt: Option, + /// Base Unit + #[serde(rename = "bu", skip_serializing_if = "Option::is_none")] + pub bu: Option, + /// Base Value + #[serde(rename = "bv", skip_serializing_if = "Option::is_none")] + pub bv: Option, + /// Base Sum + #[serde(rename = "bs", skip_serializing_if = "Option::is_none")] + pub bs: Option, + /// Version + #[serde(rename = "bver", skip_serializing_if = "Option::is_none")] + pub bver: Option, + /// Name + #[serde(rename = "n", skip_serializing_if = "Option::is_none")] + pub n: Option, + /// Unit + #[serde(rename = "u", skip_serializing_if = "Option::is_none")] + pub u: Option, + /// Value + #[serde(rename = "v", skip_serializing_if = "Option::is_none")] + pub v: Option, + /// String Value + #[serde(rename = "vs", skip_serializing_if = "Option::is_none")] + pub vs: Option, + /// Boolean Value + #[serde(rename = "vb", skip_serializing_if = "Option::is_none")] + pub vb: Option, + /// Data Value + #[serde(rename = "vd", skip_serializing_if = "Option::is_none")] + pub vd: Option, + /// Value Sum + #[serde(rename = "s", skip_serializing_if = "Option::is_none")] + pub s: Option, + /// Time + #[serde(rename = "t", skip_serializing_if = "Option::is_none")] + pub t: Option, + /// Update Time + #[serde(rename = "ut", skip_serializing_if = "Option::is_none")] + pub ut: Option, +} + +impl SenMlRecord { + pub fn new() -> SenMlRecord { + SenMlRecord { + bn: None, + bt: None, + bu: None, + bv: None, + bs: None, + bver: None, + n: None, + u: None, + v: None, + vs: None, + vb: None, + vd: None, + s: None, + t: None, + ut: None, + } + } +} + diff --git a/invitations/.gitignore b/invitations/.gitignore new file mode 100644 index 00000000..6aa10640 --- /dev/null +++ b/invitations/.gitignore @@ -0,0 +1,3 @@ +/target/ +**/*.rs.bk +Cargo.lock diff --git a/invitations/.openapi-generator-ignore b/invitations/.openapi-generator-ignore new file mode 100644 index 00000000..7484ee59 --- /dev/null +++ b/invitations/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/invitations/.openapi-generator/FILES b/invitations/.openapi-generator/FILES new file mode 100644 index 00000000..d49a94e3 --- /dev/null +++ b/invitations/.openapi-generator/FILES @@ -0,0 +1,26 @@ +.gitignore +.openapi-generator-ignore +.travis.yml +Cargo.toml +README.md +docs/AcceptInvitationRequest.md +docs/Error.md +docs/HealthApi.md +docs/HealthRes.md +docs/Invitation.md +docs/InvitationPage.md +docs/InvitationsApi.md +docs/SendInvitationReqObj.md +git_push.sh +src/apis/configuration.rs +src/apis/health_api.rs +src/apis/invitations_api.rs +src/apis/mod.rs +src/lib.rs +src/models/accept_invitation_request.rs +src/models/error.rs +src/models/health_res.rs +src/models/invitation.rs +src/models/invitation_page.rs +src/models/mod.rs +src/models/send_invitation_req_obj.rs diff --git a/invitations/.openapi-generator/VERSION b/invitations/.openapi-generator/VERSION new file mode 100644 index 00000000..758bb9c8 --- /dev/null +++ b/invitations/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.10.0 diff --git a/invitations/.travis.yml b/invitations/.travis.yml new file mode 100644 index 00000000..22761ba7 --- /dev/null +++ b/invitations/.travis.yml @@ -0,0 +1 @@ +language: rust diff --git a/invitations/Cargo.toml b/invitations/Cargo.toml new file mode 100644 index 00000000..f1b756e9 --- /dev/null +++ b/invitations/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "invitations-openapi" +version = "0.15.1" +authors = ["info@abstractmachines.fr"] +description = "This is the Invitations Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform invitations. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) " +license = "Apache 2.0" +edition = "2021" + +[dependencies] +serde = { version = "^1.0", features = ["derive"] } +serde_json = "^1.0" +serde_repr = "^0.1" +url = "^2.5" +uuid = { version = "^1.8", features = ["serde", "v4"] } +reqwest = { version = "^0.12", features = ["json", "multipart"] } diff --git a/invitations/README.md b/invitations/README.md new file mode 100644 index 00000000..59f28fb1 --- /dev/null +++ b/invitations/README.md @@ -0,0 +1,60 @@ +# Rust API client for openapi + +This is the Invitations Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform invitations. You can now help us improve the API whether it's by making changes to the definition itself or to the code. +Some useful links: +- [The SuperMQ repository](https://github.com/absmach/supermq) + + + +## Overview + +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://openapis.org) from a remote server, you can easily generate an API client. + +- API version: 0.15.1 +- Package version: 0.15.1 +- Generator version: 7.10.0 +- Build package: `org.openapitools.codegen.languages.RustClientCodegen` + +## Installation + +Put the package under your project folder in a directory named `openapi` and add the following to `Cargo.toml` under `[dependencies]`: + +``` +openapi = { path = "./openapi" } +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost:9020* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*HealthApi* | [**health_get**](docs/HealthApi.md#health_get) | **GET** /health | Retrieves service health check info. +*InvitationsApi* | [**accept_invitation**](docs/InvitationsApi.md#accept_invitation) | **POST** /invitations/accept | Accept invitation +*InvitationsApi* | [**delete_invitation**](docs/InvitationsApi.md#delete_invitation) | **DELETE** /invitations/{user_id}/{domain_id} | Deletes a specific invitation +*InvitationsApi* | [**get_invitation**](docs/InvitationsApi.md#get_invitation) | **GET** /invitations/{user_id}/{domain_id} | Retrieves a specific invitation +*InvitationsApi* | [**list_invitations**](docs/InvitationsApi.md#list_invitations) | **GET** /invitations | List invitations +*InvitationsApi* | [**reject_invitation**](docs/InvitationsApi.md#reject_invitation) | **POST** /invitations/reject | Reject invitation +*InvitationsApi* | [**send_invitation**](docs/InvitationsApi.md#send_invitation) | **POST** /invitations | Send invitation + + +## Documentation For Models + + - [AcceptInvitationRequest](docs/AcceptInvitationRequest.md) + - [Error](docs/Error.md) + - [HealthRes](docs/HealthRes.md) + - [Invitation](docs/Invitation.md) + - [InvitationPage](docs/InvitationPage.md) + - [SendInvitationReqObj](docs/SendInvitationReqObj.md) + + +To get access to the crate's generated documentation, use: + +``` +cargo doc --open +``` + +## Author + +info@abstractmachines.fr + diff --git a/invitations/docs/AcceptInvitationRequest.md b/invitations/docs/AcceptInvitationRequest.md new file mode 100644 index 00000000..b7281393 --- /dev/null +++ b/invitations/docs/AcceptInvitationRequest.md @@ -0,0 +1,11 @@ +# AcceptInvitationRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**domain_id** | [**uuid::Uuid**](uuid::Uuid.md) | Domain unique identifier. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/invitations/docs/Error.md b/invitations/docs/Error.md new file mode 100644 index 00000000..8e78862d --- /dev/null +++ b/invitations/docs/Error.md @@ -0,0 +1,11 @@ +# Error + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error** | Option<**String**> | Error message | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/invitations/docs/HealthApi.md b/invitations/docs/HealthApi.md new file mode 100644 index 00000000..0bdb760d --- /dev/null +++ b/invitations/docs/HealthApi.md @@ -0,0 +1,34 @@ +# \HealthApi + +All URIs are relative to *http://localhost:9020* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**health_get**](HealthApi.md#health_get) | **GET** /health | Retrieves service health check info. + + + +## health_get + +> models::HealthRes health_get() +Retrieves service health check info. + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**models::HealthRes**](HealthRes.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/health+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/invitations/docs/HealthRes.md b/invitations/docs/HealthRes.md new file mode 100644 index 00000000..319b16fb --- /dev/null +++ b/invitations/docs/HealthRes.md @@ -0,0 +1,15 @@ +# HealthRes + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | Option<**String**> | Service status. | [optional] +**version** | Option<**String**> | Service version. | [optional] +**commit** | Option<**String**> | Service commit hash. | [optional] +**description** | Option<**String**> | Service description. | [optional] +**build_time** | Option<**String**> | Service build time. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/invitations/docs/Invitation.md b/invitations/docs/Invitation.md new file mode 100644 index 00000000..cc061547 --- /dev/null +++ b/invitations/docs/Invitation.md @@ -0,0 +1,17 @@ +# Invitation + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**invited_by** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | User unique identifier. | [optional] +**user_id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | User unique identifier. | [optional] +**domain_id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | Domain unique identifier. | [optional] +**relation** | Option<**String**> | Relation between user and domain. | [optional] +**created_at** | Option<**String**> | Time when the group was created. | [optional] +**updated_at** | Option<**String**> | Time when the group was created. | [optional] +**confirmed_at** | Option<**String**> | Time when the group was created. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/invitations/docs/InvitationPage.md b/invitations/docs/InvitationPage.md new file mode 100644 index 00000000..39d14548 --- /dev/null +++ b/invitations/docs/InvitationPage.md @@ -0,0 +1,14 @@ +# InvitationPage + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**invitations** | [**Vec**](Invitation.md) | | +**total** | **i32** | Total number of items. | +**offset** | **i32** | Number of items to skip during retrieval. | +**limit** | Option<**i32**> | Maximum number of items to return in one page. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/invitations/docs/InvitationsApi.md b/invitations/docs/InvitationsApi.md new file mode 100644 index 00000000..d8bd316b --- /dev/null +++ b/invitations/docs/InvitationsApi.md @@ -0,0 +1,202 @@ +# \InvitationsApi + +All URIs are relative to *http://localhost:9020* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**accept_invitation**](InvitationsApi.md#accept_invitation) | **POST** /invitations/accept | Accept invitation +[**delete_invitation**](InvitationsApi.md#delete_invitation) | **DELETE** /invitations/{user_id}/{domain_id} | Deletes a specific invitation +[**get_invitation**](InvitationsApi.md#get_invitation) | **GET** /invitations/{user_id}/{domain_id} | Retrieves a specific invitation +[**list_invitations**](InvitationsApi.md#list_invitations) | **GET** /invitations | List invitations +[**reject_invitation**](InvitationsApi.md#reject_invitation) | **POST** /invitations/reject | Reject invitation +[**send_invitation**](InvitationsApi.md#send_invitation) | **POST** /invitations | Send invitation + + + +## accept_invitation + +> accept_invitation(accept_invitation_request) +Accept invitation + +Current logged in user accepts invitation to join domain. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**accept_invitation_request** | [**AcceptInvitationRequest**](AcceptInvitationRequest.md) | JSON-formatted document describing request for accepting invitation | [required] | + +### Return type + + (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## delete_invitation + +> delete_invitation(user_id, domain_id) +Deletes a specific invitation + +Deletes a specific invitation that is identifier by the user ID and domain ID. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**user_id** | **uuid::Uuid** | Unique user identifier. | [required] | +**domain_id** | **uuid::Uuid** | Unique identifier for a domain. | [required] | + +### Return type + + (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_invitation + +> models::Invitation get_invitation(user_id, domain_id) +Retrieves a specific invitation + +Retrieves a specific invitation that is identifier by the user ID and domain ID. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**user_id** | **uuid::Uuid** | Unique user identifier. | [required] | +**domain_id** | **uuid::Uuid** | Unique identifier for a domain. | [required] | + +### Return type + +[**models::Invitation**](Invitation.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_invitations + +> models::InvitationPage list_invitations(user_id, limit, offset, invited_by, domain_id, relation, state) +List invitations + +Retrieves a list of invitations. Due to performance concerns, data is retrieved in subsets. The API must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**user_id** | **uuid::Uuid** | Unique user identifier. | [required] | +**limit** | Option<**i32**> | Size of the subset to retrieve. | |[default to 10] +**offset** | Option<**i32**> | Number of items to skip during retrieval. | |[default to 0] +**invited_by** | Option<**uuid::Uuid**> | Unique identifier for a user that invited the user. | | +**domain_id** | Option<**uuid::Uuid**> | Unique identifier for a domain. | | +**relation** | Option<**String**> | Relation between user and domain. | | +**state** | Option<**String**> | Invitation state. | | + +### Return type + +[**models::InvitationPage**](InvitationPage.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## reject_invitation + +> reject_invitation(accept_invitation_request) +Reject invitation + +Current logged in user rejects invitation to join domain. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**accept_invitation_request** | [**AcceptInvitationRequest**](AcceptInvitationRequest.md) | JSON-formatted document describing request for accepting invitation | [required] | + +### Return type + + (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## send_invitation + +> send_invitation(send_invitation_req_obj) +Send invitation + +Send invitation to user to join domain. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**send_invitation_req_obj** | [**SendInvitationReqObj**](SendInvitationReqObj.md) | JSON-formatted document describing request for sending invitation | [required] | + +### Return type + + (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/invitations/docs/SendInvitationReqObj.md b/invitations/docs/SendInvitationReqObj.md new file mode 100644 index 00000000..d22a9efc --- /dev/null +++ b/invitations/docs/SendInvitationReqObj.md @@ -0,0 +1,14 @@ +# SendInvitationReqObj + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user_id** | [**uuid::Uuid**](uuid::Uuid.md) | User unique identifier. | +**domain_id** | [**uuid::Uuid**](uuid::Uuid.md) | Domain unique identifier. | +**relation** | **String** | Relation between user and domain. | +**resend** | Option<**bool**> | Resend invitation. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/invitations/git_push.sh b/invitations/git_push.sh new file mode 100644 index 00000000..f53a75d4 --- /dev/null +++ b/invitations/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/invitations/src/apis/configuration.rs b/invitations/src/apis/configuration.rs new file mode 100644 index 00000000..5bbc1b35 --- /dev/null +++ b/invitations/src/apis/configuration.rs @@ -0,0 +1,51 @@ +/* + * SuperMQ Invitations Service + * + * This is the Invitations Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform invitations. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + + + +#[derive(Debug, Clone)] +pub struct Configuration { + pub base_path: String, + pub user_agent: Option, + pub client: reqwest::Client, + pub basic_auth: Option, + pub oauth_access_token: Option, + pub bearer_access_token: Option, + pub api_key: Option, +} + +pub type BasicAuth = (String, Option); + +#[derive(Debug, Clone)] +pub struct ApiKey { + pub prefix: Option, + pub key: String, +} + + +impl Configuration { + pub fn new() -> Configuration { + Configuration::default() + } +} + +impl Default for Configuration { + fn default() -> Self { + Configuration { + base_path: "http://localhost:9020".to_owned(), + user_agent: Some("OpenAPI-Generator/0.15.1/rust".to_owned()), + client: reqwest::Client::new(), + basic_auth: None, + oauth_access_token: None, + bearer_access_token: None, + api_key: None, + } + } +} diff --git a/invitations/src/apis/health_api.rs b/invitations/src/apis/health_api.rs new file mode 100644 index 00000000..06e960c2 --- /dev/null +++ b/invitations/src/apis/health_api.rs @@ -0,0 +1,53 @@ +/* + * SuperMQ Invitations Service + * + * This is the Invitations Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform invitations. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`health_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum HealthGetError { + Status500(models::Error), + UnknownValue(serde_json::Value), +} + + +pub async fn health_get(configuration: &configuration::Configuration, ) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/health", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/invitations/src/apis/invitations_api.rs b/invitations/src/apis/invitations_api.rs new file mode 100644 index 00000000..5656c740 --- /dev/null +++ b/invitations/src/apis/invitations_api.rs @@ -0,0 +1,300 @@ +/* + * SuperMQ Invitations Service + * + * This is the Invitations Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform invitations. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`accept_invitation`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AcceptInvitationError { + Status400(), + Status401(), + Status404(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`delete_invitation`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DeleteInvitationError { + Status400(), + Status403(), + Status404(), + Status401(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_invitation`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetInvitationError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_invitations`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListInvitationsError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`reject_invitation`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RejectInvitationError { + Status400(), + Status401(), + Status404(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`send_invitation`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SendInvitationError { + Status400(), + Status401(), + Status403(), + Status404(), + Status409(), + Status415(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + + +/// Current logged in user accepts invitation to join domain. +pub async fn accept_invitation(configuration: &configuration::Configuration, accept_invitation_request: models::AcceptInvitationRequest) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/invitations/accept", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&accept_invitation_request); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Deletes a specific invitation that is identifier by the user ID and domain ID. +pub async fn delete_invitation(configuration: &configuration::Configuration, user_id: &str, domain_id: &str) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/invitations/{user_id}/{domain_id}", local_var_configuration.base_path, user_id=crate::apis::urlencode(user_id), domain_id=crate::apis::urlencode(domain_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Retrieves a specific invitation that is identifier by the user ID and domain ID. +pub async fn get_invitation(configuration: &configuration::Configuration, user_id: &str, domain_id: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/invitations/{user_id}/{domain_id}", local_var_configuration.base_path, user_id=crate::apis::urlencode(user_id), domain_id=crate::apis::urlencode(domain_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Retrieves a list of invitations. Due to performance concerns, data is retrieved in subsets. The API must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. +pub async fn list_invitations(configuration: &configuration::Configuration, user_id: &str, limit: Option, offset: Option, invited_by: Option<&str>, domain_id: Option<&str>, relation: Option<&str>, state: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/invitations", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = offset { + local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); + } + local_var_req_builder = local_var_req_builder.query(&[("user_id", &user_id.to_string())]); + if let Some(ref local_var_str) = invited_by { + local_var_req_builder = local_var_req_builder.query(&[("invited_by", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = domain_id { + local_var_req_builder = local_var_req_builder.query(&[("domain_id", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = relation { + local_var_req_builder = local_var_req_builder.query(&[("relation", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = state { + local_var_req_builder = local_var_req_builder.query(&[("state", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Current logged in user rejects invitation to join domain. +pub async fn reject_invitation(configuration: &configuration::Configuration, accept_invitation_request: models::AcceptInvitationRequest) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/invitations/reject", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&accept_invitation_request); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Send invitation to user to join domain. +pub async fn send_invitation(configuration: &configuration::Configuration, send_invitation_req_obj: models::SendInvitationReqObj) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/invitations", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&send_invitation_req_obj); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/invitations/src/apis/mod.rs b/invitations/src/apis/mod.rs new file mode 100644 index 00000000..9053d793 --- /dev/null +++ b/invitations/src/apis/mod.rs @@ -0,0 +1,96 @@ +use std::error; +use std::fmt; + +#[derive(Debug, Clone)] +pub struct ResponseContent { + pub status: reqwest::StatusCode, + pub content: String, + pub entity: Option, +} + +#[derive(Debug)] +pub enum Error { + Reqwest(reqwest::Error), + Serde(serde_json::Error), + Io(std::io::Error), + ResponseError(ResponseContent), +} + +impl fmt::Display for Error { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + let (module, e) = match self { + Error::Reqwest(e) => ("reqwest", e.to_string()), + Error::Serde(e) => ("serde", e.to_string()), + Error::Io(e) => ("IO", e.to_string()), + Error::ResponseError(e) => ("response", format!("status code {}", e.status)), + }; + write!(f, "error in {}: {}", module, e) + } +} + +impl error::Error for Error { + fn source(&self) -> Option<&(dyn error::Error + 'static)> { + Some(match self { + Error::Reqwest(e) => e, + Error::Serde(e) => e, + Error::Io(e) => e, + Error::ResponseError(_) => return None, + }) + } +} + +impl From for Error { + fn from(e: reqwest::Error) -> Self { + Error::Reqwest(e) + } +} + +impl From for Error { + fn from(e: serde_json::Error) -> Self { + Error::Serde(e) + } +} + +impl From for Error { + fn from(e: std::io::Error) -> Self { + Error::Io(e) + } +} + +pub fn urlencode>(s: T) -> String { + ::url::form_urlencoded::byte_serialize(s.as_ref().as_bytes()).collect() +} + +pub fn parse_deep_object(prefix: &str, value: &serde_json::Value) -> Vec<(String, String)> { + if let serde_json::Value::Object(object) = value { + let mut params = vec![]; + + for (key, value) in object { + match value { + serde_json::Value::Object(_) => params.append(&mut parse_deep_object( + &format!("{}[{}]", prefix, key), + value, + )), + serde_json::Value::Array(array) => { + for (i, value) in array.iter().enumerate() { + params.append(&mut parse_deep_object( + &format!("{}[{}][{}]", prefix, key, i), + value, + )); + } + }, + serde_json::Value::String(s) => params.push((format!("{}[{}]", prefix, key), s.clone())), + _ => params.push((format!("{}[{}]", prefix, key), value.to_string())), + } + } + + return params; + } + + unimplemented!("Only objects are supported with style=deepObject") +} + +pub mod health_api; +pub mod invitations_api; + +pub mod configuration; diff --git a/invitations/src/lib.rs b/invitations/src/lib.rs new file mode 100644 index 00000000..e1520628 --- /dev/null +++ b/invitations/src/lib.rs @@ -0,0 +1,11 @@ +#![allow(unused_imports)] +#![allow(clippy::too_many_arguments)] + +extern crate serde_repr; +extern crate serde; +extern crate serde_json; +extern crate url; +extern crate reqwest; + +pub mod apis; +pub mod models; diff --git a/invitations/src/models/accept_invitation_request.rs b/invitations/src/models/accept_invitation_request.rs new file mode 100644 index 00000000..66f62a0f --- /dev/null +++ b/invitations/src/models/accept_invitation_request.rs @@ -0,0 +1,28 @@ +/* + * SuperMQ Invitations Service + * + * This is the Invitations Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform invitations. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AcceptInvitationRequest { + /// Domain unique identifier. + #[serde(rename = "domain_id")] + pub domain_id: uuid::Uuid, +} + +impl AcceptInvitationRequest { + pub fn new(domain_id: uuid::Uuid) -> AcceptInvitationRequest { + AcceptInvitationRequest { + domain_id, + } + } +} + diff --git a/invitations/src/models/error.rs b/invitations/src/models/error.rs new file mode 100644 index 00000000..05e8c4b2 --- /dev/null +++ b/invitations/src/models/error.rs @@ -0,0 +1,28 @@ +/* + * SuperMQ Invitations Service + * + * This is the Invitations Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform invitations. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Error { + /// Error message + #[serde(rename = "error", skip_serializing_if = "Option::is_none")] + pub error: Option, +} + +impl Error { + pub fn new() -> Error { + Error { + error: None, + } + } +} + diff --git a/invitations/src/models/health_res.rs b/invitations/src/models/health_res.rs new file mode 100644 index 00000000..5313d5fb --- /dev/null +++ b/invitations/src/models/health_res.rs @@ -0,0 +1,56 @@ +/* + * SuperMQ Invitations Service + * + * This is the Invitations Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform invitations. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct HealthRes { + /// Service status. + #[serde(rename = "status", skip_serializing_if = "Option::is_none")] + pub status: Option, + /// Service version. + #[serde(rename = "version", skip_serializing_if = "Option::is_none")] + pub version: Option, + /// Service commit hash. + #[serde(rename = "commit", skip_serializing_if = "Option::is_none")] + pub commit: Option, + /// Service description. + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option, + /// Service build time. + #[serde(rename = "build_time", skip_serializing_if = "Option::is_none")] + pub build_time: Option, +} + +impl HealthRes { + pub fn new() -> HealthRes { + HealthRes { + status: None, + version: None, + commit: None, + description: None, + build_time: None, + } + } +} +/// Service status. +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Status { + #[serde(rename = "pass")] + Pass, +} + +impl Default for Status { + fn default() -> Status { + Self::Pass + } +} + diff --git a/invitations/src/models/invitation.rs b/invitations/src/models/invitation.rs new file mode 100644 index 00000000..5fdbea44 --- /dev/null +++ b/invitations/src/models/invitation.rs @@ -0,0 +1,82 @@ +/* + * SuperMQ Invitations Service + * + * This is the Invitations Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform invitations. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Invitation { + /// User unique identifier. + #[serde(rename = "invited_by", skip_serializing_if = "Option::is_none")] + pub invited_by: Option, + /// User unique identifier. + #[serde(rename = "user_id", skip_serializing_if = "Option::is_none")] + pub user_id: Option, + /// Domain unique identifier. + #[serde(rename = "domain_id", skip_serializing_if = "Option::is_none")] + pub domain_id: Option, + /// Relation between user and domain. + #[serde(rename = "relation", skip_serializing_if = "Option::is_none")] + pub relation: Option, + /// Time when the group was created. + #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] + pub created_at: Option, + /// Time when the group was created. + #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")] + pub updated_at: Option, + /// Time when the group was created. + #[serde(rename = "confirmed_at", skip_serializing_if = "Option::is_none")] + pub confirmed_at: Option, +} + +impl Invitation { + pub fn new() -> Invitation { + Invitation { + invited_by: None, + user_id: None, + domain_id: None, + relation: None, + created_at: None, + updated_at: None, + confirmed_at: None, + } + } +} +/// Relation between user and domain. +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Relation { + #[serde(rename = "administrator")] + Administrator, + #[serde(rename = "editor")] + Editor, + #[serde(rename = "contributor")] + Contributor, + #[serde(rename = "member")] + Member, + #[serde(rename = "guest")] + Guest, + #[serde(rename = "domain")] + Domain, + #[serde(rename = "parent_group")] + ParentGroup, + #[serde(rename = "role_group")] + RoleGroup, + #[serde(rename = "group")] + Group, + #[serde(rename = "platform")] + Platform, +} + +impl Default for Relation { + fn default() -> Relation { + Self::Administrator + } +} + diff --git a/invitations/src/models/invitation_page.rs b/invitations/src/models/invitation_page.rs new file mode 100644 index 00000000..9d94601e --- /dev/null +++ b/invitations/src/models/invitation_page.rs @@ -0,0 +1,39 @@ +/* + * SuperMQ Invitations Service + * + * This is the Invitations Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform invitations. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct InvitationPage { + #[serde(rename = "invitations")] + pub invitations: Vec, + /// Total number of items. + #[serde(rename = "total")] + pub total: i32, + /// Number of items to skip during retrieval. + #[serde(rename = "offset")] + pub offset: i32, + /// Maximum number of items to return in one page. + #[serde(rename = "limit", skip_serializing_if = "Option::is_none")] + pub limit: Option, +} + +impl InvitationPage { + pub fn new(invitations: Vec, total: i32, offset: i32) -> InvitationPage { + InvitationPage { + invitations, + total, + offset, + limit: None, + } + } +} + diff --git a/invitations/src/models/mod.rs b/invitations/src/models/mod.rs new file mode 100644 index 00000000..ef485402 --- /dev/null +++ b/invitations/src/models/mod.rs @@ -0,0 +1,12 @@ +pub mod accept_invitation_request; +pub use self::accept_invitation_request::AcceptInvitationRequest; +pub mod error; +pub use self::error::Error; +pub mod health_res; +pub use self::health_res::HealthRes; +pub mod invitation; +pub use self::invitation::Invitation; +pub mod invitation_page; +pub use self::invitation_page::InvitationPage; +pub mod send_invitation_req_obj; +pub use self::send_invitation_req_obj::SendInvitationReqObj; diff --git a/invitations/src/models/send_invitation_req_obj.rs b/invitations/src/models/send_invitation_req_obj.rs new file mode 100644 index 00000000..63dac198 --- /dev/null +++ b/invitations/src/models/send_invitation_req_obj.rs @@ -0,0 +1,70 @@ +/* + * SuperMQ Invitations Service + * + * This is the Invitations Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform invitations. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct SendInvitationReqObj { + /// User unique identifier. + #[serde(rename = "user_id")] + pub user_id: uuid::Uuid, + /// Domain unique identifier. + #[serde(rename = "domain_id")] + pub domain_id: uuid::Uuid, + /// Relation between user and domain. + #[serde(rename = "relation")] + pub relation: Relation, + /// Resend invitation. + #[serde(rename = "resend", skip_serializing_if = "Option::is_none")] + pub resend: Option, +} + +impl SendInvitationReqObj { + pub fn new(user_id: uuid::Uuid, domain_id: uuid::Uuid, relation: Relation) -> SendInvitationReqObj { + SendInvitationReqObj { + user_id, + domain_id, + relation, + resend: None, + } + } +} +/// Relation between user and domain. +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Relation { + #[serde(rename = "administrator")] + Administrator, + #[serde(rename = "editor")] + Editor, + #[serde(rename = "contributor")] + Contributor, + #[serde(rename = "member")] + Member, + #[serde(rename = "guest")] + Guest, + #[serde(rename = "domain")] + Domain, + #[serde(rename = "parent_group")] + ParentGroup, + #[serde(rename = "role_group")] + RoleGroup, + #[serde(rename = "group")] + Group, + #[serde(rename = "platform")] + Platform, +} + +impl Default for Relation { + fn default() -> Relation { + Self::Administrator + } +} + diff --git a/journal/.gitignore b/journal/.gitignore new file mode 100644 index 00000000..6aa10640 --- /dev/null +++ b/journal/.gitignore @@ -0,0 +1,3 @@ +/target/ +**/*.rs.bk +Cargo.lock diff --git a/journal/.openapi-generator-ignore b/journal/.openapi-generator-ignore new file mode 100644 index 00000000..7484ee59 --- /dev/null +++ b/journal/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/journal/.openapi-generator/FILES b/journal/.openapi-generator/FILES new file mode 100644 index 00000000..636088a4 --- /dev/null +++ b/journal/.openapi-generator/FILES @@ -0,0 +1,22 @@ +.gitignore +.openapi-generator-ignore +.travis.yml +Cargo.toml +README.md +docs/Error.md +docs/HealthApi.md +docs/HealthInfo.md +docs/Journal.md +docs/JournalLogApi.md +docs/JournalPage.md +git_push.sh +src/apis/configuration.rs +src/apis/health_api.rs +src/apis/journal_log_api.rs +src/apis/mod.rs +src/lib.rs +src/models/error.rs +src/models/health_info.rs +src/models/journal.rs +src/models/journal_page.rs +src/models/mod.rs diff --git a/journal/.openapi-generator/VERSION b/journal/.openapi-generator/VERSION new file mode 100644 index 00000000..758bb9c8 --- /dev/null +++ b/journal/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.10.0 diff --git a/journal/.travis.yml b/journal/.travis.yml new file mode 100644 index 00000000..22761ba7 --- /dev/null +++ b/journal/.travis.yml @@ -0,0 +1 @@ +language: rust diff --git a/journal/Cargo.toml b/journal/Cargo.toml new file mode 100644 index 00000000..ebd20cb9 --- /dev/null +++ b/journal/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "journal-openapi" +version = "0.15.1" +authors = ["info@mainflux.com"] +description = "This is the Journal Log Server based on the OpenAPI 3.0 specification. It is the HTTP API for viewing journal log history. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) " +license = "Apache 2.0" +edition = "2021" + +[dependencies] +serde = { version = "^1.0", features = ["derive"] } +serde_json = "^1.0" +serde_repr = "^0.1" +url = "^2.5" +uuid = { version = "^1.8", features = ["serde", "v4"] } +reqwest = { version = "^0.12", features = ["json", "multipart"] } diff --git a/journal/README.md b/journal/README.md new file mode 100644 index 00000000..514303a3 --- /dev/null +++ b/journal/README.md @@ -0,0 +1,54 @@ +# Rust API client for openapi + +This is the Journal Log Server based on the OpenAPI 3.0 specification. It is the HTTP API for viewing journal log history. You can now help us improve the API whether it's by making changes to the definition itself or to the code. +Some useful links: +- [The SuperMQ repository](https://github.com/absmach/supermq) + + + +## Overview + +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://openapis.org) from a remote server, you can easily generate an API client. + +- API version: 0.15.1 +- Package version: 0.15.1 +- Generator version: 7.10.0 +- Build package: `org.openapitools.codegen.languages.RustClientCodegen` + +## Installation + +Put the package under your project folder in a directory named `openapi` and add the following to `Cargo.toml` under `[dependencies]`: + +``` +openapi = { path = "./openapi" } +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost:9021* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*HealthApi* | [**health_get**](docs/HealthApi.md#health_get) | **GET** /health | Retrieves service health check info. +*JournalLogApi* | [**domain_id_journal_entity_type_id_get**](docs/JournalLogApi.md#domain_id_journal_entity_type_id_get) | **GET** /{domainID}/journal/{entityType}/{id} | List entity journal log +*JournalLogApi* | [**journal_user_user_id_get**](docs/JournalLogApi.md#journal_user_user_id_get) | **GET** /journal/user/{userID} | List user journal log + + +## Documentation For Models + + - [Error](docs/Error.md) + - [HealthInfo](docs/HealthInfo.md) + - [Journal](docs/Journal.md) + - [JournalPage](docs/JournalPage.md) + + +To get access to the crate's generated documentation, use: + +``` +cargo doc --open +``` + +## Author + +info@mainflux.com + diff --git a/journal/docs/Error.md b/journal/docs/Error.md new file mode 100644 index 00000000..8e78862d --- /dev/null +++ b/journal/docs/Error.md @@ -0,0 +1,11 @@ +# Error + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error** | Option<**String**> | Error message | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/journal/docs/HealthApi.md b/journal/docs/HealthApi.md new file mode 100644 index 00000000..6d4507a5 --- /dev/null +++ b/journal/docs/HealthApi.md @@ -0,0 +1,34 @@ +# \HealthApi + +All URIs are relative to *http://localhost:9021* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**health_get**](HealthApi.md#health_get) | **GET** /health | Retrieves service health check info. + + + +## health_get + +> models::HealthInfo health_get() +Retrieves service health check info. + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**models::HealthInfo**](health_info.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/health+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/journal/docs/HealthInfo.md b/journal/docs/HealthInfo.md new file mode 100644 index 00000000..ee8f5c6b --- /dev/null +++ b/journal/docs/HealthInfo.md @@ -0,0 +1,16 @@ +# HealthInfo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | Option<**String**> | Service status. | [optional] +**version** | Option<**String**> | Service version. | [optional] +**commit** | Option<**String**> | Service commit hash. | [optional] +**description** | Option<**String**> | Service description. | [optional] +**build_time** | Option<**String**> | Service build time. | [optional] +**instance_id** | Option<**String**> | Service instance ID. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/journal/docs/Journal.md b/journal/docs/Journal.md new file mode 100644 index 00000000..02b6a011 --- /dev/null +++ b/journal/docs/Journal.md @@ -0,0 +1,14 @@ +# Journal + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**operation** | Option<**String**> | Journal operation. | [optional] +**occurred_at** | Option<**String**> | Time when the journal occurred. | [optional] +**attributes** | Option<[**serde_json::Value**](.md)> | Journal attributes. | [optional] +**metadata** | Option<[**serde_json::Value**](.md)> | Journal payload. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/journal/docs/JournalLogApi.md b/journal/docs/JournalLogApi.md new file mode 100644 index 00000000..bcce44e0 --- /dev/null +++ b/journal/docs/JournalLogApi.md @@ -0,0 +1,88 @@ +# \JournalLogApi + +All URIs are relative to *http://localhost:9021* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**domain_id_journal_entity_type_id_get**](JournalLogApi.md#domain_id_journal_entity_type_id_get) | **GET** /{domainID}/journal/{entityType}/{id} | List entity journal log +[**journal_user_user_id_get**](JournalLogApi.md#journal_user_user_id_get) | **GET** /journal/user/{userID} | List user journal log + + + +## domain_id_journal_entity_type_id_get + +> models::JournalPage domain_id_journal_entity_type_id_get(domain_id, entity_type, id, offset, limit, operation, with_attributes, with_metadata, from, to, dir) +List entity journal log + +Retrieves a list of journal. Due to performance concerns, data is retrieved in subsets. The API must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique identifier for a domain. | [required] | +**entity_type** | **String** | Type of entity, e.g. user, group, client, etc.entityType | [required] | +**id** | **uuid::Uuid** | Unique identifier for an entity, e.g. group, channel or thing. Used together with entity_type. | [required] | +**offset** | Option<**i32**> | Number of items to skip during retrieval. | |[default to 0] +**limit** | Option<**i32**> | Size of the subset to retrieve. | |[default to 10] +**operation** | Option<**String**> | Journal operation. | | +**with_attributes** | Option<**bool**> | Include journal attributes. | | +**with_metadata** | Option<**bool**> | Include journal metadata. | | +**from** | Option<**String**> | Start date in unix time. | | +**to** | Option<**String**> | End date in unix time. | | +**dir** | Option<**String**> | Sort direction. | | + +### Return type + +[**models::JournalPage**](JournalPage.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## journal_user_user_id_get + +> models::JournalPage journal_user_user_id_get(user_id, offset, limit, operation, with_attributes, with_metadata, from, to, dir) +List user journal log + +Retrieves a list of journal. Due to performance concerns, data is retrieved in subsets. The API must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**user_id** | **uuid::Uuid** | Unique identifier for a user. | [required] | +**offset** | Option<**i32**> | Number of items to skip during retrieval. | |[default to 0] +**limit** | Option<**i32**> | Size of the subset to retrieve. | |[default to 10] +**operation** | Option<**String**> | Journal operation. | | +**with_attributes** | Option<**bool**> | Include journal attributes. | | +**with_metadata** | Option<**bool**> | Include journal metadata. | | +**from** | Option<**String**> | Start date in unix time. | | +**to** | Option<**String**> | End date in unix time. | | +**dir** | Option<**String**> | Sort direction. | | + +### Return type + +[**models::JournalPage**](JournalPage.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/journal/docs/JournalPage.md b/journal/docs/JournalPage.md new file mode 100644 index 00000000..18597b4b --- /dev/null +++ b/journal/docs/JournalPage.md @@ -0,0 +1,14 @@ +# JournalPage + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**journals** | [**Vec**](Journal.md) | | +**total** | **i32** | Total number of items. | +**offset** | **i32** | Number of items to skip during retrieval. | +**limit** | Option<**i32**> | Maximum number of items to return in one page. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/journal/git_push.sh b/journal/git_push.sh new file mode 100644 index 00000000..f53a75d4 --- /dev/null +++ b/journal/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/journal/src/apis/configuration.rs b/journal/src/apis/configuration.rs new file mode 100644 index 00000000..d4857ba2 --- /dev/null +++ b/journal/src/apis/configuration.rs @@ -0,0 +1,51 @@ +/* + * SuperMQ Journal Log Service + * + * This is the Journal Log Server based on the OpenAPI 3.0 specification. It is the HTTP API for viewing journal log history. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@mainflux.com + * Generated by: https://openapi-generator.tech + */ + + + +#[derive(Debug, Clone)] +pub struct Configuration { + pub base_path: String, + pub user_agent: Option, + pub client: reqwest::Client, + pub basic_auth: Option, + pub oauth_access_token: Option, + pub bearer_access_token: Option, + pub api_key: Option, +} + +pub type BasicAuth = (String, Option); + +#[derive(Debug, Clone)] +pub struct ApiKey { + pub prefix: Option, + pub key: String, +} + + +impl Configuration { + pub fn new() -> Configuration { + Configuration::default() + } +} + +impl Default for Configuration { + fn default() -> Self { + Configuration { + base_path: "http://localhost:9021".to_owned(), + user_agent: Some("OpenAPI-Generator/0.15.1/rust".to_owned()), + client: reqwest::Client::new(), + basic_auth: None, + oauth_access_token: None, + bearer_access_token: None, + api_key: None, + } + } +} diff --git a/journal/src/apis/health_api.rs b/journal/src/apis/health_api.rs new file mode 100644 index 00000000..8ae1db94 --- /dev/null +++ b/journal/src/apis/health_api.rs @@ -0,0 +1,53 @@ +/* + * SuperMQ Journal Log Service + * + * This is the Journal Log Server based on the OpenAPI 3.0 specification. It is the HTTP API for viewing journal log history. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@mainflux.com + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`health_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum HealthGetError { + Status500(models::Error), + UnknownValue(serde_json::Value), +} + + +pub async fn health_get(configuration: &configuration::Configuration, ) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/health", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/journal/src/apis/journal_log_api.rs b/journal/src/apis/journal_log_api.rs new file mode 100644 index 00000000..2922b29f --- /dev/null +++ b/journal/src/apis/journal_log_api.rs @@ -0,0 +1,154 @@ +/* + * SuperMQ Journal Log Service + * + * This is the Journal Log Server based on the OpenAPI 3.0 specification. It is the HTTP API for viewing journal log history. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@mainflux.com + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`domain_id_journal_entity_type_id_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DomainIdJournalEntityTypeIdGetError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`journal_user_user_id_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum JournalUserUserIdGetError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + + +/// Retrieves a list of journal. Due to performance concerns, data is retrieved in subsets. The API must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. +pub async fn domain_id_journal_entity_type_id_get(configuration: &configuration::Configuration, domain_id: &str, entity_type: &str, id: &str, offset: Option, limit: Option, operation: Option<&str>, with_attributes: Option, with_metadata: Option, from: Option<&str>, to: Option<&str>, dir: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/journal/{entityType}/{id}", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), entityType=crate::apis::urlencode(entity_type), id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = offset { + local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = operation { + local_var_req_builder = local_var_req_builder.query(&[("operation", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = with_attributes { + local_var_req_builder = local_var_req_builder.query(&[("with_attributes", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = with_metadata { + local_var_req_builder = local_var_req_builder.query(&[("with_metadata", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = from { + local_var_req_builder = local_var_req_builder.query(&[("from", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = to { + local_var_req_builder = local_var_req_builder.query(&[("to", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = dir { + local_var_req_builder = local_var_req_builder.query(&[("dir", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Retrieves a list of journal. Due to performance concerns, data is retrieved in subsets. The API must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. +pub async fn journal_user_user_id_get(configuration: &configuration::Configuration, user_id: &str, offset: Option, limit: Option, operation: Option<&str>, with_attributes: Option, with_metadata: Option, from: Option<&str>, to: Option<&str>, dir: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/journal/user/{userID}", local_var_configuration.base_path, userID=crate::apis::urlencode(user_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = offset { + local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = operation { + local_var_req_builder = local_var_req_builder.query(&[("operation", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = with_attributes { + local_var_req_builder = local_var_req_builder.query(&[("with_attributes", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = with_metadata { + local_var_req_builder = local_var_req_builder.query(&[("with_metadata", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = from { + local_var_req_builder = local_var_req_builder.query(&[("from", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = to { + local_var_req_builder = local_var_req_builder.query(&[("to", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = dir { + local_var_req_builder = local_var_req_builder.query(&[("dir", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/journal/src/apis/mod.rs b/journal/src/apis/mod.rs new file mode 100644 index 00000000..9210e296 --- /dev/null +++ b/journal/src/apis/mod.rs @@ -0,0 +1,96 @@ +use std::error; +use std::fmt; + +#[derive(Debug, Clone)] +pub struct ResponseContent { + pub status: reqwest::StatusCode, + pub content: String, + pub entity: Option, +} + +#[derive(Debug)] +pub enum Error { + Reqwest(reqwest::Error), + Serde(serde_json::Error), + Io(std::io::Error), + ResponseError(ResponseContent), +} + +impl fmt::Display for Error { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + let (module, e) = match self { + Error::Reqwest(e) => ("reqwest", e.to_string()), + Error::Serde(e) => ("serde", e.to_string()), + Error::Io(e) => ("IO", e.to_string()), + Error::ResponseError(e) => ("response", format!("status code {}", e.status)), + }; + write!(f, "error in {}: {}", module, e) + } +} + +impl error::Error for Error { + fn source(&self) -> Option<&(dyn error::Error + 'static)> { + Some(match self { + Error::Reqwest(e) => e, + Error::Serde(e) => e, + Error::Io(e) => e, + Error::ResponseError(_) => return None, + }) + } +} + +impl From for Error { + fn from(e: reqwest::Error) -> Self { + Error::Reqwest(e) + } +} + +impl From for Error { + fn from(e: serde_json::Error) -> Self { + Error::Serde(e) + } +} + +impl From for Error { + fn from(e: std::io::Error) -> Self { + Error::Io(e) + } +} + +pub fn urlencode>(s: T) -> String { + ::url::form_urlencoded::byte_serialize(s.as_ref().as_bytes()).collect() +} + +pub fn parse_deep_object(prefix: &str, value: &serde_json::Value) -> Vec<(String, String)> { + if let serde_json::Value::Object(object) = value { + let mut params = vec![]; + + for (key, value) in object { + match value { + serde_json::Value::Object(_) => params.append(&mut parse_deep_object( + &format!("{}[{}]", prefix, key), + value, + )), + serde_json::Value::Array(array) => { + for (i, value) in array.iter().enumerate() { + params.append(&mut parse_deep_object( + &format!("{}[{}][{}]", prefix, key, i), + value, + )); + } + }, + serde_json::Value::String(s) => params.push((format!("{}[{}]", prefix, key), s.clone())), + _ => params.push((format!("{}[{}]", prefix, key), value.to_string())), + } + } + + return params; + } + + unimplemented!("Only objects are supported with style=deepObject") +} + +pub mod health_api; +pub mod journal_log_api; + +pub mod configuration; diff --git a/journal/src/lib.rs b/journal/src/lib.rs new file mode 100644 index 00000000..e1520628 --- /dev/null +++ b/journal/src/lib.rs @@ -0,0 +1,11 @@ +#![allow(unused_imports)] +#![allow(clippy::too_many_arguments)] + +extern crate serde_repr; +extern crate serde; +extern crate serde_json; +extern crate url; +extern crate reqwest; + +pub mod apis; +pub mod models; diff --git a/journal/src/models/error.rs b/journal/src/models/error.rs new file mode 100644 index 00000000..5015f517 --- /dev/null +++ b/journal/src/models/error.rs @@ -0,0 +1,28 @@ +/* + * SuperMQ Journal Log Service + * + * This is the Journal Log Server based on the OpenAPI 3.0 specification. It is the HTTP API for viewing journal log history. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@mainflux.com + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Error { + /// Error message + #[serde(rename = "error", skip_serializing_if = "Option::is_none")] + pub error: Option, +} + +impl Error { + pub fn new() -> Error { + Error { + error: None, + } + } +} + diff --git a/journal/src/models/health_info.rs b/journal/src/models/health_info.rs new file mode 100644 index 00000000..2f479314 --- /dev/null +++ b/journal/src/models/health_info.rs @@ -0,0 +1,60 @@ +/* + * SuperMQ Journal Log Service + * + * This is the Journal Log Server based on the OpenAPI 3.0 specification. It is the HTTP API for viewing journal log history. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@mainflux.com + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct HealthInfo { + /// Service status. + #[serde(rename = "status", skip_serializing_if = "Option::is_none")] + pub status: Option, + /// Service version. + #[serde(rename = "version", skip_serializing_if = "Option::is_none")] + pub version: Option, + /// Service commit hash. + #[serde(rename = "commit", skip_serializing_if = "Option::is_none")] + pub commit: Option, + /// Service description. + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option, + /// Service build time. + #[serde(rename = "build_time", skip_serializing_if = "Option::is_none")] + pub build_time: Option, + /// Service instance ID. + #[serde(rename = "instance_id", skip_serializing_if = "Option::is_none")] + pub instance_id: Option, +} + +impl HealthInfo { + pub fn new() -> HealthInfo { + HealthInfo { + status: None, + version: None, + commit: None, + description: None, + build_time: None, + instance_id: None, + } + } +} +/// Service status. +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Status { + #[serde(rename = "pass")] + Pass, +} + +impl Default for Status { + fn default() -> Status { + Self::Pass + } +} + diff --git a/journal/src/models/journal.rs b/journal/src/models/journal.rs new file mode 100644 index 00000000..dccc07c8 --- /dev/null +++ b/journal/src/models/journal.rs @@ -0,0 +1,40 @@ +/* + * SuperMQ Journal Log Service + * + * This is the Journal Log Server based on the OpenAPI 3.0 specification. It is the HTTP API for viewing journal log history. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@mainflux.com + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Journal { + /// Journal operation. + #[serde(rename = "operation", skip_serializing_if = "Option::is_none")] + pub operation: Option, + /// Time when the journal occurred. + #[serde(rename = "occurred_at", skip_serializing_if = "Option::is_none")] + pub occurred_at: Option, + /// Journal attributes. + #[serde(rename = "attributes", skip_serializing_if = "Option::is_none")] + pub attributes: Option, + /// Journal payload. + #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")] + pub metadata: Option, +} + +impl Journal { + pub fn new() -> Journal { + Journal { + operation: None, + occurred_at: None, + attributes: None, + metadata: None, + } + } +} + diff --git a/journal/src/models/journal_page.rs b/journal/src/models/journal_page.rs new file mode 100644 index 00000000..ec1dd2f8 --- /dev/null +++ b/journal/src/models/journal_page.rs @@ -0,0 +1,39 @@ +/* + * SuperMQ Journal Log Service + * + * This is the Journal Log Server based on the OpenAPI 3.0 specification. It is the HTTP API for viewing journal log history. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@mainflux.com + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct JournalPage { + #[serde(rename = "journals")] + pub journals: Vec, + /// Total number of items. + #[serde(rename = "total")] + pub total: i32, + /// Number of items to skip during retrieval. + #[serde(rename = "offset")] + pub offset: i32, + /// Maximum number of items to return in one page. + #[serde(rename = "limit", skip_serializing_if = "Option::is_none")] + pub limit: Option, +} + +impl JournalPage { + pub fn new(journals: Vec, total: i32, offset: i32) -> JournalPage { + JournalPage { + journals, + total, + offset, + limit: None, + } + } +} + diff --git a/journal/src/models/mod.rs b/journal/src/models/mod.rs new file mode 100644 index 00000000..a170978c --- /dev/null +++ b/journal/src/models/mod.rs @@ -0,0 +1,8 @@ +pub mod error; +pub use self::error::Error; +pub mod health_info; +pub use self::health_info::HealthInfo; +pub mod journal; +pub use self::journal::Journal; +pub mod journal_page; +pub use self::journal_page::JournalPage; diff --git a/notifiers/.gitignore b/notifiers/.gitignore new file mode 100644 index 00000000..6aa10640 --- /dev/null +++ b/notifiers/.gitignore @@ -0,0 +1,3 @@ +/target/ +**/*.rs.bk +Cargo.lock diff --git a/notifiers/.openapi-generator-ignore b/notifiers/.openapi-generator-ignore new file mode 100644 index 00000000..7484ee59 --- /dev/null +++ b/notifiers/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/notifiers/.openapi-generator/FILES b/notifiers/.openapi-generator/FILES new file mode 100644 index 00000000..27334be2 --- /dev/null +++ b/notifiers/.openapi-generator/FILES @@ -0,0 +1,22 @@ +.gitignore +.openapi-generator-ignore +.travis.yml +Cargo.toml +README.md +docs/CreateSubscription.md +docs/HealthApi.md +docs/HealthInfo.md +docs/NotifiersApi.md +docs/Page.md +docs/Subscription.md +git_push.sh +src/apis/configuration.rs +src/apis/health_api.rs +src/apis/mod.rs +src/apis/notifiers_api.rs +src/lib.rs +src/models/create_subscription.rs +src/models/health_info.rs +src/models/mod.rs +src/models/page.rs +src/models/subscription.rs diff --git a/notifiers/.openapi-generator/VERSION b/notifiers/.openapi-generator/VERSION new file mode 100644 index 00000000..758bb9c8 --- /dev/null +++ b/notifiers/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.10.0 diff --git a/notifiers/.travis.yml b/notifiers/.travis.yml new file mode 100644 index 00000000..22761ba7 --- /dev/null +++ b/notifiers/.travis.yml @@ -0,0 +1 @@ +language: rust diff --git a/notifiers/Cargo.toml b/notifiers/Cargo.toml new file mode 100644 index 00000000..00508378 --- /dev/null +++ b/notifiers/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "notifiers-openapi" +version = "0.15.1" +authors = ["info@abstractmachines.fr"] +description = "HTTP API for Notifiers service. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) " +license = "Apache 2.0" +edition = "2021" + +[dependencies] +serde = { version = "^1.0", features = ["derive"] } +serde_json = "^1.0" +serde_repr = "^0.1" +url = "^2.5" +uuid = { version = "^1.8", features = ["serde", "v4"] } +reqwest = { version = "^0.12", features = ["json", "multipart"] } diff --git a/notifiers/README.md b/notifiers/README.md new file mode 100644 index 00000000..8eb9650f --- /dev/null +++ b/notifiers/README.md @@ -0,0 +1,56 @@ +# Rust API client for openapi + +HTTP API for Notifiers service. +Some useful links: +- [The SuperMQ repository](https://github.com/absmach/supermq) + + + +## Overview + +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://openapis.org) from a remote server, you can easily generate an API client. + +- API version: 0.15.1 +- Package version: 0.15.1 +- Generator version: 7.10.0 +- Build package: `org.openapitools.codegen.languages.RustClientCodegen` + +## Installation + +Put the package under your project folder in a directory named `openapi` and add the following to `Cargo.toml` under `[dependencies]`: + +``` +openapi = { path = "./openapi" } +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost:9014* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*HealthApi* | [**health_get**](docs/HealthApi.md#health_get) | **GET** /health | Retrieves service health check info. +*NotifiersApi* | [**create_subscription**](docs/NotifiersApi.md#create_subscription) | **POST** /subscriptions | Create subscription +*NotifiersApi* | [**list_subscriptions**](docs/NotifiersApi.md#list_subscriptions) | **GET** /subscriptions | List subscriptions +*NotifiersApi* | [**remove_subscription**](docs/NotifiersApi.md#remove_subscription) | **DELETE** /subscriptions/{id} | Delete subscription with the provided id +*NotifiersApi* | [**view_subscription**](docs/NotifiersApi.md#view_subscription) | **GET** /subscriptions/{id} | Get subscription with the provided id + + +## Documentation For Models + + - [CreateSubscription](docs/CreateSubscription.md) + - [HealthInfo](docs/HealthInfo.md) + - [Page](docs/Page.md) + - [Subscription](docs/Subscription.md) + + +To get access to the crate's generated documentation, use: + +``` +cargo doc --open +``` + +## Author + +info@abstractmachines.fr + diff --git a/notifiers/docs/CreateSubscription.md b/notifiers/docs/CreateSubscription.md new file mode 100644 index 00000000..349da073 --- /dev/null +++ b/notifiers/docs/CreateSubscription.md @@ -0,0 +1,12 @@ +# CreateSubscription + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**topic** | Option<**String**> | Topic to which the user subscribes. | [optional] +**contact** | Option<**String**> | The contact of the user to which the notification will be sent. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/notifiers/docs/HealthApi.md b/notifiers/docs/HealthApi.md new file mode 100644 index 00000000..b4f3cf64 --- /dev/null +++ b/notifiers/docs/HealthApi.md @@ -0,0 +1,34 @@ +# \HealthApi + +All URIs are relative to *http://localhost:9014* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**health_get**](HealthApi.md#health_get) | **GET** /health | Retrieves service health check info. + + + +## health_get + +> models::HealthInfo health_get() +Retrieves service health check info. + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**models::HealthInfo**](health_info.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/health+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/notifiers/docs/HealthInfo.md b/notifiers/docs/HealthInfo.md new file mode 100644 index 00000000..ee8f5c6b --- /dev/null +++ b/notifiers/docs/HealthInfo.md @@ -0,0 +1,16 @@ +# HealthInfo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | Option<**String**> | Service status. | [optional] +**version** | Option<**String**> | Service version. | [optional] +**commit** | Option<**String**> | Service commit hash. | [optional] +**description** | Option<**String**> | Service description. | [optional] +**build_time** | Option<**String**> | Service build time. | [optional] +**instance_id** | Option<**String**> | Service instance ID. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/notifiers/docs/NotifiersApi.md b/notifiers/docs/NotifiersApi.md new file mode 100644 index 00000000..26e5f60e --- /dev/null +++ b/notifiers/docs/NotifiersApi.md @@ -0,0 +1,135 @@ +# \NotifiersApi + +All URIs are relative to *http://localhost:9014* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_subscription**](NotifiersApi.md#create_subscription) | **POST** /subscriptions | Create subscription +[**list_subscriptions**](NotifiersApi.md#list_subscriptions) | **GET** /subscriptions | List subscriptions +[**remove_subscription**](NotifiersApi.md#remove_subscription) | **DELETE** /subscriptions/{id} | Delete subscription with the provided id +[**view_subscription**](NotifiersApi.md#view_subscription) | **GET** /subscriptions/{id} | Get subscription with the provided id + + + +## create_subscription + +> create_subscription(create_subscription) +Create subscription + +Creates a new subscription give a topic and contact. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**create_subscription** | [**CreateSubscription**](CreateSubscription.md) | JSON-formatted document describing the new subscription to be created | [required] | + +### Return type + + (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_subscriptions + +> models::Page list_subscriptions(topic, contact, offset, limit) +List subscriptions + +List subscriptions given list parameters. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**topic** | Option<**String**> | Topic name. | | +**contact** | Option<**String**> | Subscription contact. | | +**offset** | Option<**i32**> | Number of items to skip during retrieval. | |[default to 0] +**limit** | Option<**i32**> | Size of the subset to retrieve. | |[default to 10] + +### Return type + +[**models::Page**](Page.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## remove_subscription + +> remove_subscription(id) +Delete subscription with the provided id + +Removes a subscription with the provided id. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | Unique identifier. | [required] | + +### Return type + + (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## view_subscription + +> models::Subscription view_subscription(id) +Get subscription with the provided id + +Retrieves a subscription with the provided id. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | Unique identifier. | [required] | + +### Return type + +[**models::Subscription**](Subscription.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/notifiers/docs/Page.md b/notifiers/docs/Page.md new file mode 100644 index 00000000..e5ffa53c --- /dev/null +++ b/notifiers/docs/Page.md @@ -0,0 +1,14 @@ +# Page + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**subscriptions** | Option<[**Vec**](Subscription.md)> | | [optional] +**total** | Option<**i32**> | Total number of items. | [optional] +**offset** | Option<**i32**> | Number of items to skip during retrieval. | [optional] +**limit** | Option<**i32**> | Maximum number of items to return in one page. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/notifiers/docs/Subscription.md b/notifiers/docs/Subscription.md new file mode 100644 index 00000000..479fcb68 --- /dev/null +++ b/notifiers/docs/Subscription.md @@ -0,0 +1,14 @@ +# Subscription + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | Option<**String**> | ULID id of the subscription. | [optional] +**owner_id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | An id of the owner who created subscription. | [optional] +**topic** | Option<**String**> | Topic to which the user subscribes. | [optional] +**contact** | Option<**String**> | The contact of the user to which the notification will be sent. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/notifiers/git_push.sh b/notifiers/git_push.sh new file mode 100644 index 00000000..f53a75d4 --- /dev/null +++ b/notifiers/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/notifiers/src/apis/configuration.rs b/notifiers/src/apis/configuration.rs new file mode 100644 index 00000000..c3fde6b3 --- /dev/null +++ b/notifiers/src/apis/configuration.rs @@ -0,0 +1,51 @@ +/* + * SuperMQ Notifiers service + * + * HTTP API for Notifiers service. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + + + +#[derive(Debug, Clone)] +pub struct Configuration { + pub base_path: String, + pub user_agent: Option, + pub client: reqwest::Client, + pub basic_auth: Option, + pub oauth_access_token: Option, + pub bearer_access_token: Option, + pub api_key: Option, +} + +pub type BasicAuth = (String, Option); + +#[derive(Debug, Clone)] +pub struct ApiKey { + pub prefix: Option, + pub key: String, +} + + +impl Configuration { + pub fn new() -> Configuration { + Configuration::default() + } +} + +impl Default for Configuration { + fn default() -> Self { + Configuration { + base_path: "http://localhost:9014".to_owned(), + user_agent: Some("OpenAPI-Generator/0.15.1/rust".to_owned()), + client: reqwest::Client::new(), + basic_auth: None, + oauth_access_token: None, + bearer_access_token: None, + api_key: None, + } + } +} diff --git a/notifiers/src/apis/health_api.rs b/notifiers/src/apis/health_api.rs new file mode 100644 index 00000000..6856123e --- /dev/null +++ b/notifiers/src/apis/health_api.rs @@ -0,0 +1,53 @@ +/* + * SuperMQ Notifiers service + * + * HTTP API for Notifiers service. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`health_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum HealthGetError { + Status500(), + UnknownValue(serde_json::Value), +} + + +pub async fn health_get(configuration: &configuration::Configuration, ) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/health", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/notifiers/src/apis/mod.rs b/notifiers/src/apis/mod.rs new file mode 100644 index 00000000..99ceea9a --- /dev/null +++ b/notifiers/src/apis/mod.rs @@ -0,0 +1,96 @@ +use std::error; +use std::fmt; + +#[derive(Debug, Clone)] +pub struct ResponseContent { + pub status: reqwest::StatusCode, + pub content: String, + pub entity: Option, +} + +#[derive(Debug)] +pub enum Error { + Reqwest(reqwest::Error), + Serde(serde_json::Error), + Io(std::io::Error), + ResponseError(ResponseContent), +} + +impl fmt::Display for Error { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + let (module, e) = match self { + Error::Reqwest(e) => ("reqwest", e.to_string()), + Error::Serde(e) => ("serde", e.to_string()), + Error::Io(e) => ("IO", e.to_string()), + Error::ResponseError(e) => ("response", format!("status code {}", e.status)), + }; + write!(f, "error in {}: {}", module, e) + } +} + +impl error::Error for Error { + fn source(&self) -> Option<&(dyn error::Error + 'static)> { + Some(match self { + Error::Reqwest(e) => e, + Error::Serde(e) => e, + Error::Io(e) => e, + Error::ResponseError(_) => return None, + }) + } +} + +impl From for Error { + fn from(e: reqwest::Error) -> Self { + Error::Reqwest(e) + } +} + +impl From for Error { + fn from(e: serde_json::Error) -> Self { + Error::Serde(e) + } +} + +impl From for Error { + fn from(e: std::io::Error) -> Self { + Error::Io(e) + } +} + +pub fn urlencode>(s: T) -> String { + ::url::form_urlencoded::byte_serialize(s.as_ref().as_bytes()).collect() +} + +pub fn parse_deep_object(prefix: &str, value: &serde_json::Value) -> Vec<(String, String)> { + if let serde_json::Value::Object(object) = value { + let mut params = vec![]; + + for (key, value) in object { + match value { + serde_json::Value::Object(_) => params.append(&mut parse_deep_object( + &format!("{}[{}]", prefix, key), + value, + )), + serde_json::Value::Array(array) => { + for (i, value) in array.iter().enumerate() { + params.append(&mut parse_deep_object( + &format!("{}[{}][{}]", prefix, key, i), + value, + )); + } + }, + serde_json::Value::String(s) => params.push((format!("{}[{}]", prefix, key), s.clone())), + _ => params.push((format!("{}[{}]", prefix, key), value.to_string())), + } + } + + return params; + } + + unimplemented!("Only objects are supported with style=deepObject") +} + +pub mod health_api; +pub mod notifiers_api; + +pub mod configuration; diff --git a/notifiers/src/apis/notifiers_api.rs b/notifiers/src/apis/notifiers_api.rs new file mode 100644 index 00000000..3874414d --- /dev/null +++ b/notifiers/src/apis/notifiers_api.rs @@ -0,0 +1,207 @@ +/* + * SuperMQ Notifiers service + * + * HTTP API for Notifiers service. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`create_subscription`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CreateSubscriptionError { + Status400(), + Status401(), + Status403(), + Status409(), + Status415(), + Status422(), + Status500(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_subscriptions`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListSubscriptionsError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`remove_subscription`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RemoveSubscriptionError { + Status401(), + Status403(), + Status404(), + Status422(), + Status500(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`view_subscription`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ViewSubscriptionError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(), + UnknownValue(serde_json::Value), +} + + +/// Creates a new subscription give a topic and contact. +pub async fn create_subscription(configuration: &configuration::Configuration, create_subscription: models::CreateSubscription) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/subscriptions", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&create_subscription); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// List subscriptions given list parameters. +pub async fn list_subscriptions(configuration: &configuration::Configuration, topic: Option<&str>, contact: Option<&str>, offset: Option, limit: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/subscriptions", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = topic { + local_var_req_builder = local_var_req_builder.query(&[("topic", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = contact { + local_var_req_builder = local_var_req_builder.query(&[("contact", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = offset { + local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Removes a subscription with the provided id. +pub async fn remove_subscription(configuration: &configuration::Configuration, id: &str) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/subscriptions/{id}", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Retrieves a subscription with the provided id. +pub async fn view_subscription(configuration: &configuration::Configuration, id: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/subscriptions/{id}", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/notifiers/src/lib.rs b/notifiers/src/lib.rs new file mode 100644 index 00000000..e1520628 --- /dev/null +++ b/notifiers/src/lib.rs @@ -0,0 +1,11 @@ +#![allow(unused_imports)] +#![allow(clippy::too_many_arguments)] + +extern crate serde_repr; +extern crate serde; +extern crate serde_json; +extern crate url; +extern crate reqwest; + +pub mod apis; +pub mod models; diff --git a/notifiers/src/models/create_subscription.rs b/notifiers/src/models/create_subscription.rs new file mode 100644 index 00000000..6e0c508a --- /dev/null +++ b/notifiers/src/models/create_subscription.rs @@ -0,0 +1,32 @@ +/* + * SuperMQ Notifiers service + * + * HTTP API for Notifiers service. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct CreateSubscription { + /// Topic to which the user subscribes. + #[serde(rename = "topic", skip_serializing_if = "Option::is_none")] + pub topic: Option, + /// The contact of the user to which the notification will be sent. + #[serde(rename = "contact", skip_serializing_if = "Option::is_none")] + pub contact: Option, +} + +impl CreateSubscription { + pub fn new() -> CreateSubscription { + CreateSubscription { + topic: None, + contact: None, + } + } +} + diff --git a/notifiers/src/models/health_info.rs b/notifiers/src/models/health_info.rs new file mode 100644 index 00000000..d852d72e --- /dev/null +++ b/notifiers/src/models/health_info.rs @@ -0,0 +1,60 @@ +/* + * SuperMQ Notifiers service + * + * HTTP API for Notifiers service. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct HealthInfo { + /// Service status. + #[serde(rename = "status", skip_serializing_if = "Option::is_none")] + pub status: Option, + /// Service version. + #[serde(rename = "version", skip_serializing_if = "Option::is_none")] + pub version: Option, + /// Service commit hash. + #[serde(rename = "commit", skip_serializing_if = "Option::is_none")] + pub commit: Option, + /// Service description. + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option, + /// Service build time. + #[serde(rename = "build_time", skip_serializing_if = "Option::is_none")] + pub build_time: Option, + /// Service instance ID. + #[serde(rename = "instance_id", skip_serializing_if = "Option::is_none")] + pub instance_id: Option, +} + +impl HealthInfo { + pub fn new() -> HealthInfo { + HealthInfo { + status: None, + version: None, + commit: None, + description: None, + build_time: None, + instance_id: None, + } + } +} +/// Service status. +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Status { + #[serde(rename = "pass")] + Pass, +} + +impl Default for Status { + fn default() -> Status { + Self::Pass + } +} + diff --git a/notifiers/src/models/mod.rs b/notifiers/src/models/mod.rs new file mode 100644 index 00000000..472ad3e6 --- /dev/null +++ b/notifiers/src/models/mod.rs @@ -0,0 +1,8 @@ +pub mod create_subscription; +pub use self::create_subscription::CreateSubscription; +pub mod health_info; +pub use self::health_info::HealthInfo; +pub mod page; +pub use self::page::Page; +pub mod subscription; +pub use self::subscription::Subscription; diff --git a/notifiers/src/models/page.rs b/notifiers/src/models/page.rs new file mode 100644 index 00000000..b7b60aa3 --- /dev/null +++ b/notifiers/src/models/page.rs @@ -0,0 +1,39 @@ +/* + * SuperMQ Notifiers service + * + * HTTP API for Notifiers service. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Page { + #[serde(rename = "subscriptions", skip_serializing_if = "Option::is_none")] + pub subscriptions: Option>, + /// Total number of items. + #[serde(rename = "total", skip_serializing_if = "Option::is_none")] + pub total: Option, + /// Number of items to skip during retrieval. + #[serde(rename = "offset", skip_serializing_if = "Option::is_none")] + pub offset: Option, + /// Maximum number of items to return in one page. + #[serde(rename = "limit", skip_serializing_if = "Option::is_none")] + pub limit: Option, +} + +impl Page { + pub fn new() -> Page { + Page { + subscriptions: None, + total: None, + offset: None, + limit: None, + } + } +} + diff --git a/notifiers/src/models/subscription.rs b/notifiers/src/models/subscription.rs new file mode 100644 index 00000000..78691574 --- /dev/null +++ b/notifiers/src/models/subscription.rs @@ -0,0 +1,40 @@ +/* + * SuperMQ Notifiers service + * + * HTTP API for Notifiers service. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Subscription { + /// ULID id of the subscription. + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + /// An id of the owner who created subscription. + #[serde(rename = "owner_id", skip_serializing_if = "Option::is_none")] + pub owner_id: Option, + /// Topic to which the user subscribes. + #[serde(rename = "topic", skip_serializing_if = "Option::is_none")] + pub topic: Option, + /// The contact of the user to which the notification will be sent. + #[serde(rename = "contact", skip_serializing_if = "Option::is_none")] + pub contact: Option, +} + +impl Subscription { + pub fn new() -> Subscription { + Subscription { + id: None, + owner_id: None, + topic: None, + contact: None, + } + } +} + diff --git a/openapitools.json b/openapitools.json new file mode 100644 index 00000000..f8d07ce1 --- /dev/null +++ b/openapitools.json @@ -0,0 +1,7 @@ +{ + "$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json", + "spaces": 2, + "generator-cli": { + "version": "7.10.0" + } +} diff --git a/provision/.gitignore b/provision/.gitignore new file mode 100644 index 00000000..6aa10640 --- /dev/null +++ b/provision/.gitignore @@ -0,0 +1,3 @@ +/target/ +**/*.rs.bk +Cargo.lock diff --git a/provision/.openapi-generator-ignore b/provision/.openapi-generator-ignore new file mode 100644 index 00000000..7484ee59 --- /dev/null +++ b/provision/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/provision/.openapi-generator/FILES b/provision/.openapi-generator/FILES new file mode 100644 index 00000000..36a29ce0 --- /dev/null +++ b/provision/.openapi-generator/FILES @@ -0,0 +1,18 @@ +.gitignore +.openapi-generator-ignore +.travis.yml +Cargo.toml +README.md +docs/DomainIdMappingPostRequest.md +docs/HealthApi.md +docs/HealthInfo.md +docs/ProvisionApi.md +git_push.sh +src/apis/configuration.rs +src/apis/health_api.rs +src/apis/mod.rs +src/apis/provision_api.rs +src/lib.rs +src/models/__domain_id__mapping_post_request.rs +src/models/health_info.rs +src/models/mod.rs diff --git a/provision/.openapi-generator/VERSION b/provision/.openapi-generator/VERSION new file mode 100644 index 00000000..758bb9c8 --- /dev/null +++ b/provision/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.10.0 diff --git a/provision/.travis.yml b/provision/.travis.yml new file mode 100644 index 00000000..22761ba7 --- /dev/null +++ b/provision/.travis.yml @@ -0,0 +1 @@ +language: rust diff --git a/provision/Cargo.toml b/provision/Cargo.toml new file mode 100644 index 00000000..be7c4160 --- /dev/null +++ b/provision/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "provision-openapi" +version = "0.15.1" +authors = ["info@abstracmachines.fr"] +description = "HTTP API for Provision service Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) " +license = "Apache 2.0" +edition = "2021" + +[dependencies] +serde = { version = "^1.0", features = ["derive"] } +serde_json = "^1.0" +serde_repr = "^0.1" +url = "^2.5" +uuid = { version = "^1.8", features = ["serde", "v4"] } +reqwest = { version = "^0.12", features = ["json", "multipart"] } diff --git a/provision/README.md b/provision/README.md new file mode 100644 index 00000000..98116e97 --- /dev/null +++ b/provision/README.md @@ -0,0 +1,52 @@ +# Rust API client for openapi + +HTTP API for Provision service +Some useful links: +- [The SuperMQ repository](https://github.com/absmach/supermq) + + + +## Overview + +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://openapis.org) from a remote server, you can easily generate an API client. + +- API version: 0.15.1 +- Package version: 0.15.1 +- Generator version: 7.10.0 +- Build package: `org.openapitools.codegen.languages.RustClientCodegen` + +## Installation + +Put the package under your project folder in a directory named `openapi` and add the following to `Cargo.toml` under `[dependencies]`: + +``` +openapi = { path = "./openapi" } +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost:9016* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*HealthApi* | [**health_get**](docs/HealthApi.md#health_get) | **GET** /health | Retrieves service health check info. +*ProvisionApi* | [**domain_id_mapping_get**](docs/ProvisionApi.md#domain_id_mapping_get) | **GET** /{domainID}/mapping | Gets current mapping. +*ProvisionApi* | [**domain_id_mapping_post**](docs/ProvisionApi.md#domain_id_mapping_post) | **POST** /{domainID}/mapping | Adds new device to proxy + + +## Documentation For Models + + - [DomainIdMappingPostRequest](docs/DomainIdMappingPostRequest.md) + - [HealthInfo](docs/HealthInfo.md) + + +To get access to the crate's generated documentation, use: + +``` +cargo doc --open +``` + +## Author + +info@abstracmachines.fr + diff --git a/provision/docs/DomainIdMappingPostRequest.md b/provision/docs/DomainIdMappingPostRequest.md new file mode 100644 index 00000000..371cfbcf --- /dev/null +++ b/provision/docs/DomainIdMappingPostRequest.md @@ -0,0 +1,13 @@ +# DomainIdMappingPostRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**external_id** | **String** | | +**external_key** | **String** | | +**name** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/provision/docs/HealthApi.md b/provision/docs/HealthApi.md new file mode 100644 index 00000000..7ddea58f --- /dev/null +++ b/provision/docs/HealthApi.md @@ -0,0 +1,34 @@ +# \HealthApi + +All URIs are relative to *http://localhost:9016* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**health_get**](HealthApi.md#health_get) | **GET** /health | Retrieves service health check info. + + + +## health_get + +> models::HealthInfo health_get() +Retrieves service health check info. + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**models::HealthInfo**](health_info.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/health+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/provision/docs/HealthInfo.md b/provision/docs/HealthInfo.md new file mode 100644 index 00000000..ee8f5c6b --- /dev/null +++ b/provision/docs/HealthInfo.md @@ -0,0 +1,16 @@ +# HealthInfo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | Option<**String**> | Service status. | [optional] +**version** | Option<**String**> | Service version. | [optional] +**commit** | Option<**String**> | Service commit hash. | [optional] +**description** | Option<**String**> | Service description. | [optional] +**build_time** | Option<**String**> | Service build time. | [optional] +**instance_id** | Option<**String**> | Service instance ID. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/provision/docs/ProvisionApi.md b/provision/docs/ProvisionApi.md new file mode 100644 index 00000000..542e854a --- /dev/null +++ b/provision/docs/ProvisionApi.md @@ -0,0 +1,71 @@ +# \ProvisionApi + +All URIs are relative to *http://localhost:9016* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**domain_id_mapping_get**](ProvisionApi.md#domain_id_mapping_get) | **GET** /{domainID}/mapping | Gets current mapping. +[**domain_id_mapping_post**](ProvisionApi.md#domain_id_mapping_post) | **POST** /{domainID}/mapping | Adds new device to proxy + + + +## domain_id_mapping_get + +> serde_json::Value domain_id_mapping_get(domain_id) +Gets current mapping. + +Gets current mapping. This can be used in UI so that when bootstrap config is created from UI matches configuration created with provision service. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | + +### Return type + +[**serde_json::Value**](serde_json::Value.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## domain_id_mapping_post + +> domain_id_mapping_post(domain_id, domain_id_mapping_post_request) +Adds new device to proxy + +Adds new device to proxy + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**domain_id_mapping_post_request** | Option<[**DomainIdMappingPostRequest**](DomainIdMappingPostRequest.md)> | MAC address of device or other identifier | | + +### Return type + + (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/provision/git_push.sh b/provision/git_push.sh new file mode 100644 index 00000000..f53a75d4 --- /dev/null +++ b/provision/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/provision/src/apis/configuration.rs b/provision/src/apis/configuration.rs new file mode 100644 index 00000000..58fa91ec --- /dev/null +++ b/provision/src/apis/configuration.rs @@ -0,0 +1,51 @@ +/* + * SuperMQ Provision service + * + * HTTP API for Provision service Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstracmachines.fr + * Generated by: https://openapi-generator.tech + */ + + + +#[derive(Debug, Clone)] +pub struct Configuration { + pub base_path: String, + pub user_agent: Option, + pub client: reqwest::Client, + pub basic_auth: Option, + pub oauth_access_token: Option, + pub bearer_access_token: Option, + pub api_key: Option, +} + +pub type BasicAuth = (String, Option); + +#[derive(Debug, Clone)] +pub struct ApiKey { + pub prefix: Option, + pub key: String, +} + + +impl Configuration { + pub fn new() -> Configuration { + Configuration::default() + } +} + +impl Default for Configuration { + fn default() -> Self { + Configuration { + base_path: "http://localhost:9016".to_owned(), + user_agent: Some("OpenAPI-Generator/0.15.1/rust".to_owned()), + client: reqwest::Client::new(), + basic_auth: None, + oauth_access_token: None, + bearer_access_token: None, + api_key: None, + } + } +} diff --git a/provision/src/apis/health_api.rs b/provision/src/apis/health_api.rs new file mode 100644 index 00000000..856055db --- /dev/null +++ b/provision/src/apis/health_api.rs @@ -0,0 +1,53 @@ +/* + * SuperMQ Provision service + * + * HTTP API for Provision service Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstracmachines.fr + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`health_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum HealthGetError { + Status500(), + UnknownValue(serde_json::Value), +} + + +pub async fn health_get(configuration: &configuration::Configuration, ) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/health", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/provision/src/apis/mod.rs b/provision/src/apis/mod.rs new file mode 100644 index 00000000..aae57a13 --- /dev/null +++ b/provision/src/apis/mod.rs @@ -0,0 +1,96 @@ +use std::error; +use std::fmt; + +#[derive(Debug, Clone)] +pub struct ResponseContent { + pub status: reqwest::StatusCode, + pub content: String, + pub entity: Option, +} + +#[derive(Debug)] +pub enum Error { + Reqwest(reqwest::Error), + Serde(serde_json::Error), + Io(std::io::Error), + ResponseError(ResponseContent), +} + +impl fmt::Display for Error { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + let (module, e) = match self { + Error::Reqwest(e) => ("reqwest", e.to_string()), + Error::Serde(e) => ("serde", e.to_string()), + Error::Io(e) => ("IO", e.to_string()), + Error::ResponseError(e) => ("response", format!("status code {}", e.status)), + }; + write!(f, "error in {}: {}", module, e) + } +} + +impl error::Error for Error { + fn source(&self) -> Option<&(dyn error::Error + 'static)> { + Some(match self { + Error::Reqwest(e) => e, + Error::Serde(e) => e, + Error::Io(e) => e, + Error::ResponseError(_) => return None, + }) + } +} + +impl From for Error { + fn from(e: reqwest::Error) -> Self { + Error::Reqwest(e) + } +} + +impl From for Error { + fn from(e: serde_json::Error) -> Self { + Error::Serde(e) + } +} + +impl From for Error { + fn from(e: std::io::Error) -> Self { + Error::Io(e) + } +} + +pub fn urlencode>(s: T) -> String { + ::url::form_urlencoded::byte_serialize(s.as_ref().as_bytes()).collect() +} + +pub fn parse_deep_object(prefix: &str, value: &serde_json::Value) -> Vec<(String, String)> { + if let serde_json::Value::Object(object) = value { + let mut params = vec![]; + + for (key, value) in object { + match value { + serde_json::Value::Object(_) => params.append(&mut parse_deep_object( + &format!("{}[{}]", prefix, key), + value, + )), + serde_json::Value::Array(array) => { + for (i, value) in array.iter().enumerate() { + params.append(&mut parse_deep_object( + &format!("{}[{}][{}]", prefix, key, i), + value, + )); + } + }, + serde_json::Value::String(s) => params.push((format!("{}[{}]", prefix, key), s.clone())), + _ => params.push((format!("{}[{}]", prefix, key), value.to_string())), + } + } + + return params; + } + + unimplemented!("Only objects are supported with style=deepObject") +} + +pub mod health_api; +pub mod provision_api; + +pub mod configuration; diff --git a/provision/src/apis/provision_api.rs b/provision/src/apis/provision_api.rs new file mode 100644 index 00000000..6b674cc7 --- /dev/null +++ b/provision/src/apis/provision_api.rs @@ -0,0 +1,106 @@ +/* + * SuperMQ Provision service + * + * HTTP API for Provision service Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstracmachines.fr + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`domain_id_mapping_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DomainIdMappingGetError { + Status401(), + Status403(), + Status415(), + Status422(), + Status500(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`domain_id_mapping_post`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DomainIdMappingPostError { + Status400(), + Status401(), + Status403(), + Status415(), + Status422(), + Status500(), + UnknownValue(serde_json::Value), +} + + +/// Gets current mapping. This can be used in UI so that when bootstrap config is created from UI matches configuration created with provision service. +pub async fn domain_id_mapping_get(configuration: &configuration::Configuration, domain_id: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/mapping", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Adds new device to proxy +pub async fn domain_id_mapping_post(configuration: &configuration::Configuration, domain_id: &str, domain_id_mapping_post_request: Option) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/mapping", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&domain_id_mapping_post_request); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/provision/src/lib.rs b/provision/src/lib.rs new file mode 100644 index 00000000..e1520628 --- /dev/null +++ b/provision/src/lib.rs @@ -0,0 +1,11 @@ +#![allow(unused_imports)] +#![allow(clippy::too_many_arguments)] + +extern crate serde_repr; +extern crate serde; +extern crate serde_json; +extern crate url; +extern crate reqwest; + +pub mod apis; +pub mod models; diff --git a/provision/src/models/__domain_id__mapping_post_request.rs b/provision/src/models/__domain_id__mapping_post_request.rs new file mode 100644 index 00000000..65789c11 --- /dev/null +++ b/provision/src/models/__domain_id__mapping_post_request.rs @@ -0,0 +1,33 @@ +/* + * SuperMQ Provision service + * + * HTTP API for Provision service Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstracmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct DomainIdMappingPostRequest { + #[serde(rename = "external_id")] + pub external_id: String, + #[serde(rename = "external_key")] + pub external_key: String, + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, +} + +impl DomainIdMappingPostRequest { + pub fn new(external_id: String, external_key: String) -> DomainIdMappingPostRequest { + DomainIdMappingPostRequest { + external_id, + external_key, + name: None, + } + } +} + diff --git a/provision/src/models/health_info.rs b/provision/src/models/health_info.rs new file mode 100644 index 00000000..5f4696f8 --- /dev/null +++ b/provision/src/models/health_info.rs @@ -0,0 +1,60 @@ +/* + * SuperMQ Provision service + * + * HTTP API for Provision service Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstracmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct HealthInfo { + /// Service status. + #[serde(rename = "status", skip_serializing_if = "Option::is_none")] + pub status: Option, + /// Service version. + #[serde(rename = "version", skip_serializing_if = "Option::is_none")] + pub version: Option, + /// Service commit hash. + #[serde(rename = "commit", skip_serializing_if = "Option::is_none")] + pub commit: Option, + /// Service description. + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option, + /// Service build time. + #[serde(rename = "build_time", skip_serializing_if = "Option::is_none")] + pub build_time: Option, + /// Service instance ID. + #[serde(rename = "instance_id", skip_serializing_if = "Option::is_none")] + pub instance_id: Option, +} + +impl HealthInfo { + pub fn new() -> HealthInfo { + HealthInfo { + status: None, + version: None, + commit: None, + description: None, + build_time: None, + instance_id: None, + } + } +} +/// Service status. +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Status { + #[serde(rename = "pass")] + Pass, +} + +impl Default for Status { + fn default() -> Status { + Self::Pass + } +} + diff --git a/provision/src/models/mod.rs b/provision/src/models/mod.rs new file mode 100644 index 00000000..35ca68ba --- /dev/null +++ b/provision/src/models/mod.rs @@ -0,0 +1,4 @@ +pub mod __domain_id__mapping_post_request; +pub use self::__domain_id__mapping_post_request::DomainIdMappingPostRequest; +pub mod health_info; +pub use self::health_info::HealthInfo; diff --git a/readers/.gitignore b/readers/.gitignore new file mode 100644 index 00000000..6aa10640 --- /dev/null +++ b/readers/.gitignore @@ -0,0 +1,3 @@ +/target/ +**/*.rs.bk +Cargo.lock diff --git a/readers/.openapi-generator-ignore b/readers/.openapi-generator-ignore new file mode 100644 index 00000000..7484ee59 --- /dev/null +++ b/readers/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/readers/.openapi-generator/FILES b/readers/.openapi-generator/FILES new file mode 100644 index 00000000..f7dee6cc --- /dev/null +++ b/readers/.openapi-generator/FILES @@ -0,0 +1,20 @@ +.gitignore +.openapi-generator-ignore +.travis.yml +Cargo.toml +README.md +docs/HealthApi.md +docs/HealthInfo.md +docs/MessagesPage.md +docs/MessagesPageMessagesInner.md +docs/ReadersApi.md +git_push.sh +src/apis/configuration.rs +src/apis/health_api.rs +src/apis/mod.rs +src/apis/readers_api.rs +src/lib.rs +src/models/health_info.rs +src/models/messages_page.rs +src/models/messages_page_messages_inner.rs +src/models/mod.rs diff --git a/readers/.openapi-generator/VERSION b/readers/.openapi-generator/VERSION new file mode 100644 index 00000000..758bb9c8 --- /dev/null +++ b/readers/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.10.0 diff --git a/readers/.travis.yml b/readers/.travis.yml new file mode 100644 index 00000000..22761ba7 --- /dev/null +++ b/readers/.travis.yml @@ -0,0 +1 @@ +language: rust diff --git a/readers/Cargo.toml b/readers/Cargo.toml new file mode 100644 index 00000000..1039a0c7 --- /dev/null +++ b/readers/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "readers-openapi" +version = "0.15.1" +authors = ["info@abstractmachines.fr"] +description = "HTTP API for reading messages. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) " +license = "Apache 2.0" +edition = "2021" + +[dependencies] +serde = { version = "^1.0", features = ["derive"] } +serde_json = "^1.0" +serde_repr = "^0.1" +url = "^2.5" +uuid = { version = "^1.8", features = ["serde", "v4"] } +reqwest = { version = "^0.12", features = ["json", "multipart"] } diff --git a/readers/README.md b/readers/README.md new file mode 100644 index 00000000..f80dd1b8 --- /dev/null +++ b/readers/README.md @@ -0,0 +1,52 @@ +# Rust API client for openapi + +HTTP API for reading messages. +Some useful links: +- [The SuperMQ repository](https://github.com/absmach/supermq) + + + +## Overview + +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://openapis.org) from a remote server, you can easily generate an API client. + +- API version: 0.15.1 +- Package version: 0.15.1 +- Generator version: 7.10.0 +- Build package: `org.openapitools.codegen.languages.RustClientCodegen` + +## Installation + +Put the package under your project folder in a directory named `openapi` and add the following to `Cargo.toml` under `[dependencies]`: + +``` +openapi = { path = "./openapi" } +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost:9003* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*HealthApi* | [**health**](docs/HealthApi.md#health) | **GET** /health | Retrieves service health check info. +*ReadersApi* | [**get_messages**](docs/ReadersApi.md#get_messages) | **GET** /channels/{chanId}/messages | Retrieves messages sent to single channel + + +## Documentation For Models + + - [HealthInfo](docs/HealthInfo.md) + - [MessagesPage](docs/MessagesPage.md) + - [MessagesPageMessagesInner](docs/MessagesPageMessagesInner.md) + + +To get access to the crate's generated documentation, use: + +``` +cargo doc --open +``` + +## Author + +info@abstractmachines.fr + diff --git a/readers/docs/HealthApi.md b/readers/docs/HealthApi.md new file mode 100644 index 00000000..cc4f54de --- /dev/null +++ b/readers/docs/HealthApi.md @@ -0,0 +1,34 @@ +# \HealthApi + +All URIs are relative to *http://localhost:9003* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**health**](HealthApi.md#health) | **GET** /health | Retrieves service health check info. + + + +## health + +> models::HealthInfo health() +Retrieves service health check info. + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**models::HealthInfo**](health_info.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/health+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/readers/docs/HealthInfo.md b/readers/docs/HealthInfo.md new file mode 100644 index 00000000..ee8f5c6b --- /dev/null +++ b/readers/docs/HealthInfo.md @@ -0,0 +1,16 @@ +# HealthInfo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | Option<**String**> | Service status. | [optional] +**version** | Option<**String**> | Service version. | [optional] +**commit** | Option<**String**> | Service commit hash. | [optional] +**description** | Option<**String**> | Service description. | [optional] +**build_time** | Option<**String**> | Service build time. | [optional] +**instance_id** | Option<**String**> | Service instance ID. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/readers/docs/MessagesPage.md b/readers/docs/MessagesPage.md new file mode 100644 index 00000000..fce2bbd8 --- /dev/null +++ b/readers/docs/MessagesPage.md @@ -0,0 +1,14 @@ +# MessagesPage + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**total** | Option<**f64**> | Total number of items that are present on the system. | [optional] +**offset** | Option<**f64**> | Number of items that were skipped during retrieval. | [optional] +**limit** | Option<**f64**> | Size of the subset that was retrieved. | [optional] +**messages** | Option<[**Vec**](MessagesPage_messages_inner.md)> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/readers/docs/MessagesPageMessagesInner.md b/readers/docs/MessagesPageMessagesInner.md new file mode 100644 index 00000000..586ed1f7 --- /dev/null +++ b/readers/docs/MessagesPageMessagesInner.md @@ -0,0 +1,22 @@ +# MessagesPageMessagesInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**channel** | Option<**i32**> | Unique channel id. | [optional] +**publisher** | Option<**i32**> | Unique publisher id. | [optional] +**protocol** | Option<**String**> | Protocol name. | [optional] +**name** | Option<**String**> | Measured parameter name. | [optional] +**unit** | Option<**String**> | Value unit. | [optional] +**value** | Option<**f64**> | Measured value in number. | [optional] +**string_value** | Option<**String**> | Measured value in string format. | [optional] +**bool_value** | Option<**bool**> | Measured value in boolean format. | [optional] +**data_value** | Option<**String**> | Measured value in binary format. | [optional] +**value_sum** | Option<**f64**> | Sum value. | [optional] +**time** | Option<**f64**> | Time of measurement. | [optional] +**update_time** | Option<**f64**> | Time of updating measurement. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/readers/docs/ReadersApi.md b/readers/docs/ReadersApi.md new file mode 100644 index 00000000..a1f7e7f4 --- /dev/null +++ b/readers/docs/ReadersApi.md @@ -0,0 +1,51 @@ +# \ReadersApi + +All URIs are relative to *http://localhost:9003* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_messages**](ReadersApi.md#get_messages) | **GET** /channels/{chanId}/messages | Retrieves messages sent to single channel + + + +## get_messages + +> models::MessagesPage get_messages(chan_id, limit, offset, publisher, name, v, vb, vs, vd, from, to, aggregation, interval) +Retrieves messages sent to single channel + +Retrieves a list of messages sent to specific channel. Due to performance concerns, data is retrieved in subsets. The API readers must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**chan_id** | **uuid::Uuid** | Unique channel identifier. | [required] | +**limit** | Option<**i32**> | Size of the subset to retrieve. | |[default to 10] +**offset** | Option<**i32**> | Number of items to skip during retrieval. | |[default to 0] +**publisher** | Option<**uuid::Uuid**> | Unique client identifier. | | +**name** | Option<**String**> | SenML message name. | | +**v** | Option<**String**> | SenML message value. | | +**vb** | Option<**bool**> | SenML message bool value. | | +**vs** | Option<**String**> | SenML message string value. | | +**vd** | Option<**String**> | SenML message data value. | | +**from** | Option<**f64**> | SenML message time in nanoseconds (integer part represents seconds). | | +**to** | Option<**f64**> | SenML message time in nanoseconds (integer part represents seconds). | | +**aggregation** | Option<**String**> | Aggregation function. | | +**interval** | Option<**String**> | Aggregation interval. | | + +### Return type + +[**models::MessagesPage**](MessagesPage.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth), [clientAuth](../README.md#clientAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/readers/git_push.sh b/readers/git_push.sh new file mode 100644 index 00000000..f53a75d4 --- /dev/null +++ b/readers/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/readers/src/apis/configuration.rs b/readers/src/apis/configuration.rs new file mode 100644 index 00000000..2f4ee109 --- /dev/null +++ b/readers/src/apis/configuration.rs @@ -0,0 +1,51 @@ +/* + * SuperMQ reader service + * + * HTTP API for reading messages. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + + + +#[derive(Debug, Clone)] +pub struct Configuration { + pub base_path: String, + pub user_agent: Option, + pub client: reqwest::Client, + pub basic_auth: Option, + pub oauth_access_token: Option, + pub bearer_access_token: Option, + pub api_key: Option, +} + +pub type BasicAuth = (String, Option); + +#[derive(Debug, Clone)] +pub struct ApiKey { + pub prefix: Option, + pub key: String, +} + + +impl Configuration { + pub fn new() -> Configuration { + Configuration::default() + } +} + +impl Default for Configuration { + fn default() -> Self { + Configuration { + base_path: "http://localhost:9003".to_owned(), + user_agent: Some("OpenAPI-Generator/0.15.1/rust".to_owned()), + client: reqwest::Client::new(), + basic_auth: None, + oauth_access_token: None, + bearer_access_token: None, + api_key: None, + } + } +} diff --git a/readers/src/apis/health_api.rs b/readers/src/apis/health_api.rs new file mode 100644 index 00000000..b087ca74 --- /dev/null +++ b/readers/src/apis/health_api.rs @@ -0,0 +1,53 @@ +/* + * SuperMQ reader service + * + * HTTP API for reading messages. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`health`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum HealthError { + Status500(), + UnknownValue(serde_json::Value), +} + + +pub async fn health(configuration: &configuration::Configuration, ) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/health", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/readers/src/apis/mod.rs b/readers/src/apis/mod.rs new file mode 100644 index 00000000..46a1b23b --- /dev/null +++ b/readers/src/apis/mod.rs @@ -0,0 +1,96 @@ +use std::error; +use std::fmt; + +#[derive(Debug, Clone)] +pub struct ResponseContent { + pub status: reqwest::StatusCode, + pub content: String, + pub entity: Option, +} + +#[derive(Debug)] +pub enum Error { + Reqwest(reqwest::Error), + Serde(serde_json::Error), + Io(std::io::Error), + ResponseError(ResponseContent), +} + +impl fmt::Display for Error { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + let (module, e) = match self { + Error::Reqwest(e) => ("reqwest", e.to_string()), + Error::Serde(e) => ("serde", e.to_string()), + Error::Io(e) => ("IO", e.to_string()), + Error::ResponseError(e) => ("response", format!("status code {}", e.status)), + }; + write!(f, "error in {}: {}", module, e) + } +} + +impl error::Error for Error { + fn source(&self) -> Option<&(dyn error::Error + 'static)> { + Some(match self { + Error::Reqwest(e) => e, + Error::Serde(e) => e, + Error::Io(e) => e, + Error::ResponseError(_) => return None, + }) + } +} + +impl From for Error { + fn from(e: reqwest::Error) -> Self { + Error::Reqwest(e) + } +} + +impl From for Error { + fn from(e: serde_json::Error) -> Self { + Error::Serde(e) + } +} + +impl From for Error { + fn from(e: std::io::Error) -> Self { + Error::Io(e) + } +} + +pub fn urlencode>(s: T) -> String { + ::url::form_urlencoded::byte_serialize(s.as_ref().as_bytes()).collect() +} + +pub fn parse_deep_object(prefix: &str, value: &serde_json::Value) -> Vec<(String, String)> { + if let serde_json::Value::Object(object) = value { + let mut params = vec![]; + + for (key, value) in object { + match value { + serde_json::Value::Object(_) => params.append(&mut parse_deep_object( + &format!("{}[{}]", prefix, key), + value, + )), + serde_json::Value::Array(array) => { + for (i, value) in array.iter().enumerate() { + params.append(&mut parse_deep_object( + &format!("{}[{}][{}]", prefix, key, i), + value, + )); + } + }, + serde_json::Value::String(s) => params.push((format!("{}[{}]", prefix, key), s.clone())), + _ => params.push((format!("{}[{}]", prefix, key), value.to_string())), + } + } + + return params; + } + + unimplemented!("Only objects are supported with style=deepObject") +} + +pub mod health_api; +pub mod readers_api; + +pub mod configuration; diff --git a/readers/src/apis/readers_api.rs b/readers/src/apis/readers_api.rs new file mode 100644 index 00000000..3592c63b --- /dev/null +++ b/readers/src/apis/readers_api.rs @@ -0,0 +1,98 @@ +/* + * SuperMQ reader service + * + * HTTP API for reading messages. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`get_messages`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetMessagesError { + Status400(), + Status401(), + Status500(), + UnknownValue(serde_json::Value), +} + + +/// Retrieves a list of messages sent to specific channel. Due to performance concerns, data is retrieved in subsets. The API readers must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. +pub async fn get_messages(configuration: &configuration::Configuration, chan_id: &str, limit: Option, offset: Option, publisher: Option<&str>, name: Option<&str>, v: Option<&str>, vb: Option, vs: Option<&str>, vd: Option<&str>, from: Option, to: Option, aggregation: Option<&str>, interval: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/channels/{chanId}/messages", local_var_configuration.base_path, chanId=crate::apis::urlencode(chan_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = offset { + local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = publisher { + local_var_req_builder = local_var_req_builder.query(&[("Publisher", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = name { + local_var_req_builder = local_var_req_builder.query(&[("name", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = v { + local_var_req_builder = local_var_req_builder.query(&[("v", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = vb { + local_var_req_builder = local_var_req_builder.query(&[("vb", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = vs { + local_var_req_builder = local_var_req_builder.query(&[("vs", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = vd { + local_var_req_builder = local_var_req_builder.query(&[("vd", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = from { + local_var_req_builder = local_var_req_builder.query(&[("from", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = to { + local_var_req_builder = local_var_req_builder.query(&[("to", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = aggregation { + local_var_req_builder = local_var_req_builder.query(&[("aggregation", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = interval { + local_var_req_builder = local_var_req_builder.query(&[("interval", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/readers/src/lib.rs b/readers/src/lib.rs new file mode 100644 index 00000000..e1520628 --- /dev/null +++ b/readers/src/lib.rs @@ -0,0 +1,11 @@ +#![allow(unused_imports)] +#![allow(clippy::too_many_arguments)] + +extern crate serde_repr; +extern crate serde; +extern crate serde_json; +extern crate url; +extern crate reqwest; + +pub mod apis; +pub mod models; diff --git a/readers/src/models/health_info.rs b/readers/src/models/health_info.rs new file mode 100644 index 00000000..82d29f72 --- /dev/null +++ b/readers/src/models/health_info.rs @@ -0,0 +1,60 @@ +/* + * SuperMQ reader service + * + * HTTP API for reading messages. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct HealthInfo { + /// Service status. + #[serde(rename = "status", skip_serializing_if = "Option::is_none")] + pub status: Option, + /// Service version. + #[serde(rename = "version", skip_serializing_if = "Option::is_none")] + pub version: Option, + /// Service commit hash. + #[serde(rename = "commit", skip_serializing_if = "Option::is_none")] + pub commit: Option, + /// Service description. + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option, + /// Service build time. + #[serde(rename = "build_time", skip_serializing_if = "Option::is_none")] + pub build_time: Option, + /// Service instance ID. + #[serde(rename = "instance_id", skip_serializing_if = "Option::is_none")] + pub instance_id: Option, +} + +impl HealthInfo { + pub fn new() -> HealthInfo { + HealthInfo { + status: None, + version: None, + commit: None, + description: None, + build_time: None, + instance_id: None, + } + } +} +/// Service status. +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Status { + #[serde(rename = "pass")] + Pass, +} + +impl Default for Status { + fn default() -> Status { + Self::Pass + } +} + diff --git a/readers/src/models/messages_page.rs b/readers/src/models/messages_page.rs new file mode 100644 index 00000000..7bad95ee --- /dev/null +++ b/readers/src/models/messages_page.rs @@ -0,0 +1,39 @@ +/* + * SuperMQ reader service + * + * HTTP API for reading messages. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct MessagesPage { + /// Total number of items that are present on the system. + #[serde(rename = "total", skip_serializing_if = "Option::is_none")] + pub total: Option, + /// Number of items that were skipped during retrieval. + #[serde(rename = "offset", skip_serializing_if = "Option::is_none")] + pub offset: Option, + /// Size of the subset that was retrieved. + #[serde(rename = "limit", skip_serializing_if = "Option::is_none")] + pub limit: Option, + #[serde(rename = "messages", skip_serializing_if = "Option::is_none")] + pub messages: Option>, +} + +impl MessagesPage { + pub fn new() -> MessagesPage { + MessagesPage { + total: None, + offset: None, + limit: None, + messages: None, + } + } +} + diff --git a/readers/src/models/messages_page_messages_inner.rs b/readers/src/models/messages_page_messages_inner.rs new file mode 100644 index 00000000..aebad35b --- /dev/null +++ b/readers/src/models/messages_page_messages_inner.rs @@ -0,0 +1,72 @@ +/* + * SuperMQ reader service + * + * HTTP API for reading messages. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct MessagesPageMessagesInner { + /// Unique channel id. + #[serde(rename = "channel", skip_serializing_if = "Option::is_none")] + pub channel: Option, + /// Unique publisher id. + #[serde(rename = "publisher", skip_serializing_if = "Option::is_none")] + pub publisher: Option, + /// Protocol name. + #[serde(rename = "protocol", skip_serializing_if = "Option::is_none")] + pub protocol: Option, + /// Measured parameter name. + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + /// Value unit. + #[serde(rename = "unit", skip_serializing_if = "Option::is_none")] + pub unit: Option, + /// Measured value in number. + #[serde(rename = "value", skip_serializing_if = "Option::is_none")] + pub value: Option, + /// Measured value in string format. + #[serde(rename = "stringValue", skip_serializing_if = "Option::is_none")] + pub string_value: Option, + /// Measured value in boolean format. + #[serde(rename = "boolValue", skip_serializing_if = "Option::is_none")] + pub bool_value: Option, + /// Measured value in binary format. + #[serde(rename = "dataValue", skip_serializing_if = "Option::is_none")] + pub data_value: Option, + /// Sum value. + #[serde(rename = "valueSum", skip_serializing_if = "Option::is_none")] + pub value_sum: Option, + /// Time of measurement. + #[serde(rename = "time", skip_serializing_if = "Option::is_none")] + pub time: Option, + /// Time of updating measurement. + #[serde(rename = "updateTime", skip_serializing_if = "Option::is_none")] + pub update_time: Option, +} + +impl MessagesPageMessagesInner { + pub fn new() -> MessagesPageMessagesInner { + MessagesPageMessagesInner { + channel: None, + publisher: None, + protocol: None, + name: None, + unit: None, + value: None, + string_value: None, + bool_value: None, + data_value: None, + value_sum: None, + time: None, + update_time: None, + } + } +} + diff --git a/readers/src/models/mod.rs b/readers/src/models/mod.rs new file mode 100644 index 00000000..cf7bb986 --- /dev/null +++ b/readers/src/models/mod.rs @@ -0,0 +1,6 @@ +pub mod health_info; +pub use self::health_info::HealthInfo; +pub mod messages_page; +pub use self::messages_page::MessagesPage; +pub mod messages_page_messages_inner; +pub use self::messages_page_messages_inner::MessagesPageMessagesInner; diff --git a/twins/.gitignore b/twins/.gitignore new file mode 100644 index 00000000..6aa10640 --- /dev/null +++ b/twins/.gitignore @@ -0,0 +1,3 @@ +/target/ +**/*.rs.bk +Cargo.lock diff --git a/twins/.openapi-generator-ignore b/twins/.openapi-generator-ignore new file mode 100644 index 00000000..7484ee59 --- /dev/null +++ b/twins/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/twins/.openapi-generator/FILES b/twins/.openapi-generator/FILES new file mode 100644 index 00000000..f92ceb11 --- /dev/null +++ b/twins/.openapi-generator/FILES @@ -0,0 +1,32 @@ +.gitignore +.openapi-generator-ignore +.travis.yml +Cargo.toml +README.md +docs/Attribute.md +docs/Definition.md +docs/HealthApi.md +docs/HealthInfo.md +docs/State.md +docs/StatesApi.md +docs/StatesPage.md +docs/TwinReqObj.md +docs/TwinResObj.md +docs/TwinsApi.md +docs/TwinsPage.md +git_push.sh +src/apis/configuration.rs +src/apis/health_api.rs +src/apis/mod.rs +src/apis/states_api.rs +src/apis/twins_api.rs +src/lib.rs +src/models/attribute.rs +src/models/definition.rs +src/models/health_info.rs +src/models/mod.rs +src/models/state.rs +src/models/states_page.rs +src/models/twin_req_obj.rs +src/models/twin_res_obj.rs +src/models/twins_page.rs diff --git a/twins/.openapi-generator/VERSION b/twins/.openapi-generator/VERSION new file mode 100644 index 00000000..758bb9c8 --- /dev/null +++ b/twins/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.10.0 diff --git a/twins/.travis.yml b/twins/.travis.yml new file mode 100644 index 00000000..22761ba7 --- /dev/null +++ b/twins/.travis.yml @@ -0,0 +1 @@ +language: rust diff --git a/twins/Cargo.toml b/twins/Cargo.toml new file mode 100644 index 00000000..b86fac5e --- /dev/null +++ b/twins/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "twins-openapi" +version = "0.15.1" +authors = ["info@abstractmachines.fr"] +description = "HTTP API for managing digital twins and their states. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) " +license = "Apache 2.0" +edition = "2021" + +[dependencies] +serde = { version = "^1.0", features = ["derive"] } +serde_json = "^1.0" +serde_repr = "^0.1" +url = "^2.5" +uuid = { version = "^1.8", features = ["serde", "v4"] } +reqwest = { version = "^0.12", features = ["json", "multipart"] } diff --git a/twins/README.md b/twins/README.md new file mode 100644 index 00000000..b8a9e749 --- /dev/null +++ b/twins/README.md @@ -0,0 +1,62 @@ +# Rust API client for openapi + +HTTP API for managing digital twins and their states. +Some useful links: +- [The SuperMQ repository](https://github.com/absmach/supermq) + + + +## Overview + +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://openapis.org) from a remote server, you can easily generate an API client. + +- API version: 0.15.1 +- Package version: 0.15.1 +- Generator version: 7.10.0 +- Build package: `org.openapitools.codegen.languages.RustClientCodegen` + +## Installation + +Put the package under your project folder in a directory named `openapi` and add the following to `Cargo.toml` under `[dependencies]`: + +``` +openapi = { path = "./openapi" } +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost:9018* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*HealthApi* | [**health_get**](docs/HealthApi.md#health_get) | **GET** /health | Retrieves service health check info. +*StatesApi* | [**get_states**](docs/StatesApi.md#get_states) | **GET** /states/{twinID} | Retrieves states of twin with id twinID +*TwinsApi* | [**create_twin**](docs/TwinsApi.md#create_twin) | **POST** /twins | Adds new twin +*TwinsApi* | [**get_twin**](docs/TwinsApi.md#get_twin) | **GET** /twins/{twinID} | Retrieves twin info +*TwinsApi* | [**get_twins**](docs/TwinsApi.md#get_twins) | **GET** /twins | Retrieves twins +*TwinsApi* | [**remove_twin**](docs/TwinsApi.md#remove_twin) | **DELETE** /twins/{twinID} | Removes a twin +*TwinsApi* | [**update_twin**](docs/TwinsApi.md#update_twin) | **PUT** /twins/{twinID} | Updates twin info + + +## Documentation For Models + + - [Attribute](docs/Attribute.md) + - [Definition](docs/Definition.md) + - [HealthInfo](docs/HealthInfo.md) + - [State](docs/State.md) + - [StatesPage](docs/StatesPage.md) + - [TwinReqObj](docs/TwinReqObj.md) + - [TwinResObj](docs/TwinResObj.md) + - [TwinsPage](docs/TwinsPage.md) + + +To get access to the crate's generated documentation, use: + +``` +cargo doc --open +``` + +## Author + +info@abstractmachines.fr + diff --git a/twins/docs/Attribute.md b/twins/docs/Attribute.md new file mode 100644 index 00000000..c35530dc --- /dev/null +++ b/twins/docs/Attribute.md @@ -0,0 +1,14 @@ +# Attribute + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | Option<**String**> | Name of the attribute. | [optional] +**channel** | Option<**String**> | SuperMQ channel used by attribute. | [optional] +**subtopic** | Option<**String**> | Subtopic used by attribute. | [optional] +**persist_state** | Option<**bool**> | Trigger state creation based on the attribute. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/twins/docs/Definition.md b/twins/docs/Definition.md new file mode 100644 index 00000000..40c35f7a --- /dev/null +++ b/twins/docs/Definition.md @@ -0,0 +1,12 @@ +# Definition + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**delta** | Option<**f64**> | Minimal time delay before new state creation. | [optional] +**attributes** | Option<[**Vec**](Attribute.md)> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/twins/docs/HealthApi.md b/twins/docs/HealthApi.md new file mode 100644 index 00000000..868cd47f --- /dev/null +++ b/twins/docs/HealthApi.md @@ -0,0 +1,34 @@ +# \HealthApi + +All URIs are relative to *http://localhost:9018* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**health_get**](HealthApi.md#health_get) | **GET** /health | Retrieves service health check info. + + + +## health_get + +> models::HealthInfo health_get() +Retrieves service health check info. + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**models::HealthInfo**](health_info.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/health+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/twins/docs/HealthInfo.md b/twins/docs/HealthInfo.md new file mode 100644 index 00000000..ee8f5c6b --- /dev/null +++ b/twins/docs/HealthInfo.md @@ -0,0 +1,16 @@ +# HealthInfo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | Option<**String**> | Service status. | [optional] +**version** | Option<**String**> | Service version. | [optional] +**commit** | Option<**String**> | Service commit hash. | [optional] +**description** | Option<**String**> | Service description. | [optional] +**build_time** | Option<**String**> | Service build time. | [optional] +**instance_id** | Option<**String**> | Service instance ID. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/twins/docs/State.md b/twins/docs/State.md new file mode 100644 index 00000000..793c5338 --- /dev/null +++ b/twins/docs/State.md @@ -0,0 +1,14 @@ +# State + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**twin_id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | ID of twin state belongs to. | [optional] +**id** | Option<**f64**> | State position in a time row of states. | [optional] +**created** | Option<[**String**](string.md)> | State creation date. | [optional] +**payload** | Option<[**serde_json::Value**](.md)> | Object-encoded states's payload. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/twins/docs/StatesApi.md b/twins/docs/StatesApi.md new file mode 100644 index 00000000..d6c3c5ff --- /dev/null +++ b/twins/docs/StatesApi.md @@ -0,0 +1,41 @@ +# \StatesApi + +All URIs are relative to *http://localhost:9018* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_states**](StatesApi.md#get_states) | **GET** /states/{twinID} | Retrieves states of twin with id twinID + + + +## get_states + +> models::StatesPage get_states(twin_id, limit, offset) +Retrieves states of twin with id twinID + +Retrieves a list of states. Due to performance concerns, data is retrieved in subsets. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**twin_id** | **uuid::Uuid** | Unique twin identifier. | [required] | +**limit** | Option<**i32**> | Size of the subset to retrieve. | |[default to 10] +**offset** | Option<**i32**> | Number of items to skip during retrieval. | |[default to 0] + +### Return type + +[**models::StatesPage**](StatesPage.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/twins/docs/StatesPage.md b/twins/docs/StatesPage.md new file mode 100644 index 00000000..56fa62b2 --- /dev/null +++ b/twins/docs/StatesPage.md @@ -0,0 +1,14 @@ +# StatesPage + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**states** | [**Vec**](State.md) | | +**total** | Option<**i32**> | Total number of items. | [optional] +**offset** | Option<**i32**> | Number of items to skip during retrieval. | [optional] +**limit** | Option<**i32**> | Maximum number of items to return in one page. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/twins/docs/TwinReqObj.md b/twins/docs/TwinReqObj.md new file mode 100644 index 00000000..02557e28 --- /dev/null +++ b/twins/docs/TwinReqObj.md @@ -0,0 +1,13 @@ +# TwinReqObj + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | Option<**String**> | Free-form twin name. | [optional] +**metadata** | Option<[**serde_json::Value**](.md)> | Arbitrary, object-encoded twin's data. | [optional] +**definition** | Option<[**models::Definition**](Definition.md)> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/twins/docs/TwinResObj.md b/twins/docs/TwinResObj.md new file mode 100644 index 00000000..492818c1 --- /dev/null +++ b/twins/docs/TwinResObj.md @@ -0,0 +1,18 @@ +# TwinResObj + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**owner** | Option<**String**> | Email address of SuperMQ user that owns twin. | [optional] +**id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | Unique twin identifier generated by the service. | [optional] +**name** | Option<**String**> | Free-form twin name. | [optional] +**revision** | Option<**f64**> | Oridnal revision number of twin. | [optional] +**created** | Option<[**String**](string.md)> | Twin creation date and time. | [optional] +**updated** | Option<[**String**](string.md)> | Twin update date and time. | [optional] +**definitions** | Option<[**Vec**](Definition.md)> | | [optional] +**metadata** | Option<[**serde_json::Value**](.md)> | Arbitrary, object-encoded twin's data. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/twins/docs/TwinsApi.md b/twins/docs/TwinsApi.md new file mode 100644 index 00000000..5e2f5061 --- /dev/null +++ b/twins/docs/TwinsApi.md @@ -0,0 +1,165 @@ +# \TwinsApi + +All URIs are relative to *http://localhost:9018* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_twin**](TwinsApi.md#create_twin) | **POST** /twins | Adds new twin +[**get_twin**](TwinsApi.md#get_twin) | **GET** /twins/{twinID} | Retrieves twin info +[**get_twins**](TwinsApi.md#get_twins) | **GET** /twins | Retrieves twins +[**remove_twin**](TwinsApi.md#remove_twin) | **DELETE** /twins/{twinID} | Removes a twin +[**update_twin**](TwinsApi.md#update_twin) | **PUT** /twins/{twinID} | Updates twin info + + + +## create_twin + +> create_twin(twin_req_obj) +Adds new twin + +Adds new twin to the list of twins owned by user identified using the provided access token. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**twin_req_obj** | [**TwinReqObj**](TwinReqObj.md) | JSON-formatted document describing the twin to create or update. | [required] | + +### Return type + + (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_twin + +> models::TwinResObj get_twin(twin_id) +Retrieves twin info + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**twin_id** | **uuid::Uuid** | Unique twin identifier. | [required] | + +### Return type + +[**models::TwinResObj**](TwinResObj.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_twins + +> models::TwinsPage get_twins(limit, offset, name, metadata) +Retrieves twins + +Retrieves a list of twins. Due to performance concerns, data is retrieved in subsets. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**limit** | Option<**i32**> | Size of the subset to retrieve. | |[default to 10] +**offset** | Option<**i32**> | Number of items to skip during retrieval. | |[default to 0] +**name** | Option<**String**> | Twin name | | +**metadata** | Option<**String**> | Metadata filter. Filtering is performed matching the parameter with metadata on top level. Parameter is json. | | + +### Return type + +[**models::TwinsPage**](TwinsPage.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## remove_twin + +> remove_twin(twin_id) +Removes a twin + +Removes a twin. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**twin_id** | **uuid::Uuid** | Unique twin identifier. | [required] | + +### Return type + + (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## update_twin + +> update_twin(twin_id, twin_req_obj) +Updates twin info + +Update is performed by replacing the current resource data with values provided in a request payload. Note that the twin's ID cannot be changed. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**twin_id** | **uuid::Uuid** | Unique twin identifier. | [required] | +**twin_req_obj** | [**TwinReqObj**](TwinReqObj.md) | JSON-formatted document describing the twin to create or update. | [required] | + +### Return type + + (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/twins/docs/TwinsPage.md b/twins/docs/TwinsPage.md new file mode 100644 index 00000000..e2bd97ef --- /dev/null +++ b/twins/docs/TwinsPage.md @@ -0,0 +1,14 @@ +# TwinsPage + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**twins** | [**Vec**](TwinResObj.md) | | +**total** | Option<**i32**> | Total number of items. | [optional] +**offset** | Option<**i32**> | Number of items to skip during retrieval. | [optional] +**limit** | Option<**i32**> | Maximum number of items to return in one page. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/twins/git_push.sh b/twins/git_push.sh new file mode 100644 index 00000000..f53a75d4 --- /dev/null +++ b/twins/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/twins/src/apis/configuration.rs b/twins/src/apis/configuration.rs new file mode 100644 index 00000000..a5e9f8d2 --- /dev/null +++ b/twins/src/apis/configuration.rs @@ -0,0 +1,51 @@ +/* + * SuperMQ twins service + * + * HTTP API for managing digital twins and their states. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + + + +#[derive(Debug, Clone)] +pub struct Configuration { + pub base_path: String, + pub user_agent: Option, + pub client: reqwest::Client, + pub basic_auth: Option, + pub oauth_access_token: Option, + pub bearer_access_token: Option, + pub api_key: Option, +} + +pub type BasicAuth = (String, Option); + +#[derive(Debug, Clone)] +pub struct ApiKey { + pub prefix: Option, + pub key: String, +} + + +impl Configuration { + pub fn new() -> Configuration { + Configuration::default() + } +} + +impl Default for Configuration { + fn default() -> Self { + Configuration { + base_path: "http://localhost:9018".to_owned(), + user_agent: Some("OpenAPI-Generator/0.15.1/rust".to_owned()), + client: reqwest::Client::new(), + basic_auth: None, + oauth_access_token: None, + bearer_access_token: None, + api_key: None, + } + } +} diff --git a/twins/src/apis/health_api.rs b/twins/src/apis/health_api.rs new file mode 100644 index 00000000..de3632db --- /dev/null +++ b/twins/src/apis/health_api.rs @@ -0,0 +1,53 @@ +/* + * SuperMQ twins service + * + * HTTP API for managing digital twins and their states. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`health_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum HealthGetError { + Status500(), + UnknownValue(serde_json::Value), +} + + +pub async fn health_get(configuration: &configuration::Configuration, ) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/health", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/twins/src/apis/mod.rs b/twins/src/apis/mod.rs new file mode 100644 index 00000000..a6b9209b --- /dev/null +++ b/twins/src/apis/mod.rs @@ -0,0 +1,97 @@ +use std::error; +use std::fmt; + +#[derive(Debug, Clone)] +pub struct ResponseContent { + pub status: reqwest::StatusCode, + pub content: String, + pub entity: Option, +} + +#[derive(Debug)] +pub enum Error { + Reqwest(reqwest::Error), + Serde(serde_json::Error), + Io(std::io::Error), + ResponseError(ResponseContent), +} + +impl fmt::Display for Error { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + let (module, e) = match self { + Error::Reqwest(e) => ("reqwest", e.to_string()), + Error::Serde(e) => ("serde", e.to_string()), + Error::Io(e) => ("IO", e.to_string()), + Error::ResponseError(e) => ("response", format!("status code {}", e.status)), + }; + write!(f, "error in {}: {}", module, e) + } +} + +impl error::Error for Error { + fn source(&self) -> Option<&(dyn error::Error + 'static)> { + Some(match self { + Error::Reqwest(e) => e, + Error::Serde(e) => e, + Error::Io(e) => e, + Error::ResponseError(_) => return None, + }) + } +} + +impl From for Error { + fn from(e: reqwest::Error) -> Self { + Error::Reqwest(e) + } +} + +impl From for Error { + fn from(e: serde_json::Error) -> Self { + Error::Serde(e) + } +} + +impl From for Error { + fn from(e: std::io::Error) -> Self { + Error::Io(e) + } +} + +pub fn urlencode>(s: T) -> String { + ::url::form_urlencoded::byte_serialize(s.as_ref().as_bytes()).collect() +} + +pub fn parse_deep_object(prefix: &str, value: &serde_json::Value) -> Vec<(String, String)> { + if let serde_json::Value::Object(object) = value { + let mut params = vec![]; + + for (key, value) in object { + match value { + serde_json::Value::Object(_) => params.append(&mut parse_deep_object( + &format!("{}[{}]", prefix, key), + value, + )), + serde_json::Value::Array(array) => { + for (i, value) in array.iter().enumerate() { + params.append(&mut parse_deep_object( + &format!("{}[{}][{}]", prefix, key, i), + value, + )); + } + }, + serde_json::Value::String(s) => params.push((format!("{}[{}]", prefix, key), s.clone())), + _ => params.push((format!("{}[{}]", prefix, key), value.to_string())), + } + } + + return params; + } + + unimplemented!("Only objects are supported with style=deepObject") +} + +pub mod health_api; +pub mod states_api; +pub mod twins_api; + +pub mod configuration; diff --git a/twins/src/apis/states_api.rs b/twins/src/apis/states_api.rs new file mode 100644 index 00000000..23460789 --- /dev/null +++ b/twins/src/apis/states_api.rs @@ -0,0 +1,67 @@ +/* + * SuperMQ twins service + * + * HTTP API for managing digital twins and their states. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`get_states`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetStatesError { + Status400(), + Status401(), + Status404(), + Status422(), + Status500(), + UnknownValue(serde_json::Value), +} + + +/// Retrieves a list of states. Due to performance concerns, data is retrieved in subsets. +pub async fn get_states(configuration: &configuration::Configuration, twin_id: &str, limit: Option, offset: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/states/{twinID}", local_var_configuration.base_path, twinID=crate::apis::urlencode(twin_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = offset { + local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/twins/src/apis/twins_api.rs b/twins/src/apis/twins_api.rs new file mode 100644 index 00000000..35e58de2 --- /dev/null +++ b/twins/src/apis/twins_api.rs @@ -0,0 +1,247 @@ +/* + * SuperMQ twins service + * + * HTTP API for managing digital twins and their states. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`create_twin`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CreateTwinError { + Status400(), + Status401(), + Status415(), + Status422(), + Status500(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_twin`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetTwinError { + Status400(), + Status401(), + Status404(), + Status422(), + Status500(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_twins`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetTwinsError { + Status400(), + Status401(), + Status422(), + Status500(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`remove_twin`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RemoveTwinError { + Status400(), + Status401(), + Status404(), + Status415(), + Status422(), + Status500(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`update_twin`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UpdateTwinError { + Status400(), + Status401(), + Status404(), + Status415(), + Status422(), + Status500(), + UnknownValue(serde_json::Value), +} + + +/// Adds new twin to the list of twins owned by user identified using the provided access token. +pub async fn create_twin(configuration: &configuration::Configuration, twin_req_obj: models::TwinReqObj) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/twins", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&twin_req_obj); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn get_twin(configuration: &configuration::Configuration, twin_id: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/twins/{twinID}", local_var_configuration.base_path, twinID=crate::apis::urlencode(twin_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Retrieves a list of twins. Due to performance concerns, data is retrieved in subsets. +pub async fn get_twins(configuration: &configuration::Configuration, limit: Option, offset: Option, name: Option<&str>, metadata: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/twins", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = offset { + local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = name { + local_var_req_builder = local_var_req_builder.query(&[("name", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = metadata { + local_var_req_builder = local_var_req_builder.query(&[("metadata", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Removes a twin. +pub async fn remove_twin(configuration: &configuration::Configuration, twin_id: &str) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/twins/{twinID}", local_var_configuration.base_path, twinID=crate::apis::urlencode(twin_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Update is performed by replacing the current resource data with values provided in a request payload. Note that the twin's ID cannot be changed. +pub async fn update_twin(configuration: &configuration::Configuration, twin_id: &str, twin_req_obj: models::TwinReqObj) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/twins/{twinID}", local_var_configuration.base_path, twinID=crate::apis::urlencode(twin_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&twin_req_obj); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/twins/src/lib.rs b/twins/src/lib.rs new file mode 100644 index 00000000..e1520628 --- /dev/null +++ b/twins/src/lib.rs @@ -0,0 +1,11 @@ +#![allow(unused_imports)] +#![allow(clippy::too_many_arguments)] + +extern crate serde_repr; +extern crate serde; +extern crate serde_json; +extern crate url; +extern crate reqwest; + +pub mod apis; +pub mod models; diff --git a/twins/src/models/attribute.rs b/twins/src/models/attribute.rs new file mode 100644 index 00000000..ab840986 --- /dev/null +++ b/twins/src/models/attribute.rs @@ -0,0 +1,40 @@ +/* + * SuperMQ twins service + * + * HTTP API for managing digital twins and their states. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Attribute { + /// Name of the attribute. + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + /// SuperMQ channel used by attribute. + #[serde(rename = "channel", skip_serializing_if = "Option::is_none")] + pub channel: Option, + /// Subtopic used by attribute. + #[serde(rename = "subtopic", skip_serializing_if = "Option::is_none")] + pub subtopic: Option, + /// Trigger state creation based on the attribute. + #[serde(rename = "persist_state", skip_serializing_if = "Option::is_none")] + pub persist_state: Option, +} + +impl Attribute { + pub fn new() -> Attribute { + Attribute { + name: None, + channel: None, + subtopic: None, + persist_state: None, + } + } +} + diff --git a/twins/src/models/definition.rs b/twins/src/models/definition.rs new file mode 100644 index 00000000..543d2465 --- /dev/null +++ b/twins/src/models/definition.rs @@ -0,0 +1,31 @@ +/* + * SuperMQ twins service + * + * HTTP API for managing digital twins and their states. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Definition { + /// Minimal time delay before new state creation. + #[serde(rename = "delta", skip_serializing_if = "Option::is_none")] + pub delta: Option, + #[serde(rename = "attributes", skip_serializing_if = "Option::is_none")] + pub attributes: Option>, +} + +impl Definition { + pub fn new() -> Definition { + Definition { + delta: None, + attributes: None, + } + } +} + diff --git a/twins/src/models/health_info.rs b/twins/src/models/health_info.rs new file mode 100644 index 00000000..eaa19be0 --- /dev/null +++ b/twins/src/models/health_info.rs @@ -0,0 +1,60 @@ +/* + * SuperMQ twins service + * + * HTTP API for managing digital twins and their states. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct HealthInfo { + /// Service status. + #[serde(rename = "status", skip_serializing_if = "Option::is_none")] + pub status: Option, + /// Service version. + #[serde(rename = "version", skip_serializing_if = "Option::is_none")] + pub version: Option, + /// Service commit hash. + #[serde(rename = "commit", skip_serializing_if = "Option::is_none")] + pub commit: Option, + /// Service description. + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option, + /// Service build time. + #[serde(rename = "build_time", skip_serializing_if = "Option::is_none")] + pub build_time: Option, + /// Service instance ID. + #[serde(rename = "instance_id", skip_serializing_if = "Option::is_none")] + pub instance_id: Option, +} + +impl HealthInfo { + pub fn new() -> HealthInfo { + HealthInfo { + status: None, + version: None, + commit: None, + description: None, + build_time: None, + instance_id: None, + } + } +} +/// Service status. +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Status { + #[serde(rename = "pass")] + Pass, +} + +impl Default for Status { + fn default() -> Status { + Self::Pass + } +} + diff --git a/twins/src/models/mod.rs b/twins/src/models/mod.rs new file mode 100644 index 00000000..93754329 --- /dev/null +++ b/twins/src/models/mod.rs @@ -0,0 +1,16 @@ +pub mod attribute; +pub use self::attribute::Attribute; +pub mod definition; +pub use self::definition::Definition; +pub mod health_info; +pub use self::health_info::HealthInfo; +pub mod state; +pub use self::state::State; +pub mod states_page; +pub use self::states_page::StatesPage; +pub mod twin_req_obj; +pub use self::twin_req_obj::TwinReqObj; +pub mod twin_res_obj; +pub use self::twin_res_obj::TwinResObj; +pub mod twins_page; +pub use self::twins_page::TwinsPage; diff --git a/twins/src/models/state.rs b/twins/src/models/state.rs new file mode 100644 index 00000000..7a13c515 --- /dev/null +++ b/twins/src/models/state.rs @@ -0,0 +1,40 @@ +/* + * SuperMQ twins service + * + * HTTP API for managing digital twins and their states. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct State { + /// ID of twin state belongs to. + #[serde(rename = "twin_id", skip_serializing_if = "Option::is_none")] + pub twin_id: Option, + /// State position in a time row of states. + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + /// State creation date. + #[serde(rename = "created", skip_serializing_if = "Option::is_none")] + pub created: Option, + /// Object-encoded states's payload. + #[serde(rename = "payload", skip_serializing_if = "Option::is_none")] + pub payload: Option, +} + +impl State { + pub fn new() -> State { + State { + twin_id: None, + id: None, + created: None, + payload: None, + } + } +} + diff --git a/twins/src/models/states_page.rs b/twins/src/models/states_page.rs new file mode 100644 index 00000000..80856b52 --- /dev/null +++ b/twins/src/models/states_page.rs @@ -0,0 +1,39 @@ +/* + * SuperMQ twins service + * + * HTTP API for managing digital twins and their states. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct StatesPage { + #[serde(rename = "states")] + pub states: Vec, + /// Total number of items. + #[serde(rename = "total", skip_serializing_if = "Option::is_none")] + pub total: Option, + /// Number of items to skip during retrieval. + #[serde(rename = "offset", skip_serializing_if = "Option::is_none")] + pub offset: Option, + /// Maximum number of items to return in one page. + #[serde(rename = "limit", skip_serializing_if = "Option::is_none")] + pub limit: Option, +} + +impl StatesPage { + pub fn new(states: Vec) -> StatesPage { + StatesPage { + states, + total: None, + offset: None, + limit: None, + } + } +} + diff --git a/twins/src/models/twin_req_obj.rs b/twins/src/models/twin_req_obj.rs new file mode 100644 index 00000000..7fa03a68 --- /dev/null +++ b/twins/src/models/twin_req_obj.rs @@ -0,0 +1,35 @@ +/* + * SuperMQ twins service + * + * HTTP API for managing digital twins and their states. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct TwinReqObj { + /// Free-form twin name. + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + /// Arbitrary, object-encoded twin's data. + #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")] + pub metadata: Option, + #[serde(rename = "definition", skip_serializing_if = "Option::is_none")] + pub definition: Option>, +} + +impl TwinReqObj { + pub fn new() -> TwinReqObj { + TwinReqObj { + name: None, + metadata: None, + definition: None, + } + } +} + diff --git a/twins/src/models/twin_res_obj.rs b/twins/src/models/twin_res_obj.rs new file mode 100644 index 00000000..ebff5042 --- /dev/null +++ b/twins/src/models/twin_res_obj.rs @@ -0,0 +1,55 @@ +/* + * SuperMQ twins service + * + * HTTP API for managing digital twins and their states. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct TwinResObj { + /// Email address of SuperMQ user that owns twin. + #[serde(rename = "owner", skip_serializing_if = "Option::is_none")] + pub owner: Option, + /// Unique twin identifier generated by the service. + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + /// Free-form twin name. + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + /// Oridnal revision number of twin. + #[serde(rename = "revision", skip_serializing_if = "Option::is_none")] + pub revision: Option, + /// Twin creation date and time. + #[serde(rename = "created", skip_serializing_if = "Option::is_none")] + pub created: Option, + /// Twin update date and time. + #[serde(rename = "updated", skip_serializing_if = "Option::is_none")] + pub updated: Option, + #[serde(rename = "definitions", skip_serializing_if = "Option::is_none")] + pub definitions: Option>, + /// Arbitrary, object-encoded twin's data. + #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")] + pub metadata: Option, +} + +impl TwinResObj { + pub fn new() -> TwinResObj { + TwinResObj { + owner: None, + id: None, + name: None, + revision: None, + created: None, + updated: None, + definitions: None, + metadata: None, + } + } +} + diff --git a/twins/src/models/twins_page.rs b/twins/src/models/twins_page.rs new file mode 100644 index 00000000..655c63b1 --- /dev/null +++ b/twins/src/models/twins_page.rs @@ -0,0 +1,39 @@ +/* + * SuperMQ twins service + * + * HTTP API for managing digital twins and their states. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct TwinsPage { + #[serde(rename = "twins")] + pub twins: Vec, + /// Total number of items. + #[serde(rename = "total", skip_serializing_if = "Option::is_none")] + pub total: Option, + /// Number of items to skip during retrieval. + #[serde(rename = "offset", skip_serializing_if = "Option::is_none")] + pub offset: Option, + /// Maximum number of items to return in one page. + #[serde(rename = "limit", skip_serializing_if = "Option::is_none")] + pub limit: Option, +} + +impl TwinsPage { + pub fn new(twins: Vec) -> TwinsPage { + TwinsPage { + twins, + total: None, + offset: None, + limit: None, + } + } +} + diff --git a/users/.gitignore b/users/.gitignore new file mode 100644 index 00000000..6aa10640 --- /dev/null +++ b/users/.gitignore @@ -0,0 +1,3 @@ +/target/ +**/*.rs.bk +Cargo.lock diff --git a/users/.openapi-generator-ignore b/users/.openapi-generator-ignore new file mode 100644 index 00000000..7484ee59 --- /dev/null +++ b/users/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/users/.openapi-generator/FILES b/users/.openapi-generator/FILES new file mode 100644 index 00000000..794a5604 --- /dev/null +++ b/users/.openapi-generator/FILES @@ -0,0 +1,60 @@ +.gitignore +.openapi-generator-ignore +.travis.yml +Cargo.toml +README.md +docs/AssignReqObj.md +docs/AssignUserReqObj.md +docs/Email.md +docs/Error.md +docs/HealthApi.md +docs/HealthRes.md +docs/IssueToken.md +docs/IssueToken200Response.md +docs/Members.md +docs/MembersCredentials.md +docs/MembersPage.md +docs/RequestPasswordResetRequest.md +docs/ResetPasswordRequest.md +docs/User.md +docs/UserCredentials.md +docs/UserProfilePicture.md +docs/UserReqObj.md +docs/UserReqObjCredentials.md +docs/UserRole.md +docs/UserSecret.md +docs/UserTags.md +docs/UserUpdate.md +docs/Username.md +docs/UsersApi.md +docs/UsersPage.md +git_push.sh +src/apis/configuration.rs +src/apis/health_api.rs +src/apis/mod.rs +src/apis/users_api.rs +src/lib.rs +src/models/assign_req_obj.rs +src/models/assign_user_req_obj.rs +src/models/email.rs +src/models/error.rs +src/models/health_res.rs +src/models/issue_token.rs +src/models/issue_token_200_response.rs +src/models/members.rs +src/models/members_credentials.rs +src/models/members_page.rs +src/models/mod.rs +src/models/request_password_reset_request.rs +src/models/reset_password_request.rs +src/models/user.rs +src/models/user_credentials.rs +src/models/user_profile_picture.rs +src/models/user_req_obj.rs +src/models/user_req_obj_credentials.rs +src/models/user_role.rs +src/models/user_secret.rs +src/models/user_tags.rs +src/models/user_update.rs +src/models/username.rs +src/models/users_page.rs diff --git a/users/.openapi-generator/VERSION b/users/.openapi-generator/VERSION new file mode 100644 index 00000000..758bb9c8 --- /dev/null +++ b/users/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.10.0 diff --git a/users/.travis.yml b/users/.travis.yml new file mode 100644 index 00000000..22761ba7 --- /dev/null +++ b/users/.travis.yml @@ -0,0 +1 @@ +language: rust diff --git a/users/Cargo.toml b/users/Cargo.toml new file mode 100644 index 00000000..125611d8 --- /dev/null +++ b/users/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "users-openapi" +version = "0.15.1" +authors = ["info@abstractmachines.fr"] +description = "This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) " +license = "Apache 2.0" +edition = "2021" + +[dependencies] +serde = { version = "^1.0", features = ["derive"] } +serde_json = "^1.0" +serde_repr = "^0.1" +url = "^2.5" +uuid = { version = "^1.8", features = ["serde", "v4"] } +reqwest = { version = "^0.12", features = ["json", "multipart"] } +tokio = { version = "1", features = ["full"] } \ No newline at end of file diff --git a/users/README.md b/users/README.md new file mode 100644 index 00000000..b1e6a814 --- /dev/null +++ b/users/README.md @@ -0,0 +1,94 @@ +# Rust API client for openapi + +This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. +Some useful links: +- [The SuperMQ repository](https://github.com/absmach/supermq) + + + +## Overview + +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://openapis.org) from a remote server, you can easily generate an API client. + +- API version: 0.15.1 +- Package version: 0.15.1 +- Generator version: 7.10.0 +- Build package: `org.openapitools.codegen.languages.RustClientCodegen` + +## Installation + +Put the package under your project folder in a directory named `openapi` and add the following to `Cargo.toml` under `[dependencies]`: + +``` +openapi = { path = "./openapi" } +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost:9002* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*HealthApi* | [**health**](docs/HealthApi.md#health) | **GET** /health | Retrieves service health check info. +*UsersApi* | [**create_user**](docs/UsersApi.md#create_user) | **POST** /users | Registers user account +*UsersApi* | [**disable_user**](docs/UsersApi.md#disable_user) | **POST** /users/{userID}/disable | Disables a user +*UsersApi* | [**domain_id_users_get**](docs/UsersApi.md#domain_id_users_get) | **GET** /{domainID}/users | List users assigned to domain +*UsersApi* | [**enable_user**](docs/UsersApi.md#enable_user) | **POST** /users/{userID}/enable | Enables a user +*UsersApi* | [**get_profile**](docs/UsersApi.md#get_profile) | **GET** /users/profile | Gets info on currently logged in user. +*UsersApi* | [**get_user**](docs/UsersApi.md#get_user) | **GET** /users/{userID} | Retrieves a user +*UsersApi* | [**issue_token**](docs/UsersApi.md#issue_token) | **POST** /users/tokens/issue | Issue Token +*UsersApi* | [**list_users**](docs/UsersApi.md#list_users) | **GET** /users | List users +*UsersApi* | [**list_users_in_channel**](docs/UsersApi.md#list_users_in_channel) | **GET** /{domainID}/channels/{channelID}/users | List users in a channel +*UsersApi* | [**list_users_in_client**](docs/UsersApi.md#list_users_in_client) | **GET** /{domainID}/clients/{clientID}/users | List users associated with a client +*UsersApi* | [**list_users_in_group**](docs/UsersApi.md#list_users_in_group) | **GET** /{domainID}/groups/{groupID}/users | List users in a group +*UsersApi* | [**refresh_token**](docs/UsersApi.md#refresh_token) | **POST** /users/tokens/refresh | Refresh Token +*UsersApi* | [**request_password_reset**](docs/UsersApi.md#request_password_reset) | **POST** /password/reset-request | User password reset request +*UsersApi* | [**reset_password**](docs/UsersApi.md#reset_password) | **PUT** /password/reset | User password reset endpoint +*UsersApi* | [**search_users**](docs/UsersApi.md#search_users) | **GET** /users/search | Search users +*UsersApi* | [**update_email**](docs/UsersApi.md#update_email) | **PATCH** /users/{userID}/email | Updates email of the user. +*UsersApi* | [**update_profile_picture**](docs/UsersApi.md#update_profile_picture) | **PATCH** /users/{userID}/picture | Updates the user's profile picture. +*UsersApi* | [**update_role**](docs/UsersApi.md#update_role) | **PATCH** /users/{userID}/role | Updates the user's role. +*UsersApi* | [**update_secret**](docs/UsersApi.md#update_secret) | **PATCH** /users/secret | Updates secret of currently logged in user. +*UsersApi* | [**update_tags**](docs/UsersApi.md#update_tags) | **PATCH** /users/{userID}/tags | Updates tags of the user. +*UsersApi* | [**update_user**](docs/UsersApi.md#update_user) | **PATCH** /users/{userID} | Updates first, last name and metadata of the user. +*UsersApi* | [**update_username**](docs/UsersApi.md#update_username) | **PATCH** /users/{userID}/username | Updates user's username. +*UsersApi* | [**users_user_id_delete**](docs/UsersApi.md#users_user_id_delete) | **DELETE** /users/{userID} | Delete a user + + +## Documentation For Models + + - [AssignReqObj](docs/AssignReqObj.md) + - [AssignUserReqObj](docs/AssignUserReqObj.md) + - [Email](docs/Email.md) + - [Error](docs/Error.md) + - [HealthRes](docs/HealthRes.md) + - [IssueToken](docs/IssueToken.md) + - [IssueToken200Response](docs/IssueToken200Response.md) + - [Members](docs/Members.md) + - [MembersCredentials](docs/MembersCredentials.md) + - [MembersPage](docs/MembersPage.md) + - [RequestPasswordResetRequest](docs/RequestPasswordResetRequest.md) + - [ResetPasswordRequest](docs/ResetPasswordRequest.md) + - [User](docs/User.md) + - [UserCredentials](docs/UserCredentials.md) + - [UserProfilePicture](docs/UserProfilePicture.md) + - [UserReqObj](docs/UserReqObj.md) + - [UserReqObjCredentials](docs/UserReqObjCredentials.md) + - [UserRole](docs/UserRole.md) + - [UserSecret](docs/UserSecret.md) + - [UserTags](docs/UserTags.md) + - [UserUpdate](docs/UserUpdate.md) + - [Username](docs/Username.md) + - [UsersPage](docs/UsersPage.md) + + +To get access to the crate's generated documentation, use: + +``` +cargo doc --open +``` + +## Author + +info@abstractmachines.fr + diff --git a/users/docs/AssignReqObj.md b/users/docs/AssignReqObj.md new file mode 100644 index 00000000..895b525e --- /dev/null +++ b/users/docs/AssignReqObj.md @@ -0,0 +1,13 @@ +# AssignReqObj + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**members** | **Vec** | Members IDs | +**relation** | **String** | Permission relations. | +**member_kind** | **String** | Member kind. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/users/docs/AssignUserReqObj.md b/users/docs/AssignUserReqObj.md new file mode 100644 index 00000000..9262413e --- /dev/null +++ b/users/docs/AssignUserReqObj.md @@ -0,0 +1,12 @@ +# AssignUserReqObj + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user_ids** | **Vec** | User IDs | +**relation** | **String** | Permission relations. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/users/docs/Email.md b/users/docs/Email.md new file mode 100644 index 00000000..1abc6702 --- /dev/null +++ b/users/docs/Email.md @@ -0,0 +1,11 @@ +# Email + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**email** | **String** | User email address. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/users/docs/Error.md b/users/docs/Error.md new file mode 100644 index 00000000..8e78862d --- /dev/null +++ b/users/docs/Error.md @@ -0,0 +1,11 @@ +# Error + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error** | Option<**String**> | Error message | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/users/docs/HealthApi.md b/users/docs/HealthApi.md new file mode 100644 index 00000000..99159d8a --- /dev/null +++ b/users/docs/HealthApi.md @@ -0,0 +1,34 @@ +# \HealthApi + +All URIs are relative to *http://localhost:9002* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**health**](HealthApi.md#health) | **GET** /health | Retrieves service health check info. + + + +## health + +> models::HealthRes health() +Retrieves service health check info. + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**models::HealthRes**](HealthRes.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/health+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/users/docs/HealthRes.md b/users/docs/HealthRes.md new file mode 100644 index 00000000..319b16fb --- /dev/null +++ b/users/docs/HealthRes.md @@ -0,0 +1,15 @@ +# HealthRes + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | Option<**String**> | Service status. | [optional] +**version** | Option<**String**> | Service version. | [optional] +**commit** | Option<**String**> | Service commit hash. | [optional] +**description** | Option<**String**> | Service description. | [optional] +**build_time** | Option<**String**> | Service build time. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/users/docs/IssueToken.md b/users/docs/IssueToken.md new file mode 100644 index 00000000..cdc0841c --- /dev/null +++ b/users/docs/IssueToken.md @@ -0,0 +1,12 @@ +# IssueToken + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**identity** | **String** | User identity - email address. | +**secret** | **String** | User secret password. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/users/docs/IssueToken200Response.md b/users/docs/IssueToken200Response.md new file mode 100644 index 00000000..831b2680 --- /dev/null +++ b/users/docs/IssueToken200Response.md @@ -0,0 +1,13 @@ +# IssueToken200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**access_token** | Option<**String**> | User access token. | [optional] +**refresh_token** | Option<**String**> | User refresh token. | [optional] +**access_type** | Option<**String**> | User access token type. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/users/docs/Members.md b/users/docs/Members.md new file mode 100644 index 00000000..a5d7e31b --- /dev/null +++ b/users/docs/Members.md @@ -0,0 +1,20 @@ +# Members + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | User unique identifier. | [optional] +**first_name** | Option<**String**> | User's first name. | [optional] +**last_name** | Option<**String**> | User's last name. | [optional] +**email** | Option<**String**> | User's email address. | [optional] +**tags** | Option<**Vec**> | User tags. | [optional] +**credentials** | Option<[**models::MembersCredentials**](Members_credentials.md)> | | [optional] +**metadata** | Option<[**serde_json::Value**](.md)> | Arbitrary, object-encoded user's data. | [optional] +**status** | Option<**String**> | User Status | [optional] +**created_at** | Option<**String**> | Time when the group was created. | [optional] +**updated_at** | Option<**String**> | Time when the group was created. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/users/docs/MembersCredentials.md b/users/docs/MembersCredentials.md new file mode 100644 index 00000000..e3669de6 --- /dev/null +++ b/users/docs/MembersCredentials.md @@ -0,0 +1,12 @@ +# MembersCredentials + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**username** | Option<**String**> | User's username. | [optional] +**secret** | Option<**String**> | User secret password. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/users/docs/MembersPage.md b/users/docs/MembersPage.md new file mode 100644 index 00000000..66f13666 --- /dev/null +++ b/users/docs/MembersPage.md @@ -0,0 +1,14 @@ +# MembersPage + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**members** | [**Vec**](Members.md) | | +**total** | **i32** | Total number of items. | +**offset** | Option<**i32**> | Number of items to skip during retrieval. | [optional] +**limit** | Option<**i32**> | Maximum number of items to return in one page. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/users/docs/RequestPasswordResetRequest.md b/users/docs/RequestPasswordResetRequest.md new file mode 100644 index 00000000..bc5a0c83 --- /dev/null +++ b/users/docs/RequestPasswordResetRequest.md @@ -0,0 +1,12 @@ +# RequestPasswordResetRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**email** | Option<**String**> | User email. | [optional] +**host** | Option<**String**> | Email host. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/users/docs/ResetPasswordRequest.md b/users/docs/ResetPasswordRequest.md new file mode 100644 index 00000000..976524fb --- /dev/null +++ b/users/docs/ResetPasswordRequest.md @@ -0,0 +1,13 @@ +# ResetPasswordRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**password** | Option<**String**> | New password. | [optional] +**confirm_password** | Option<**String**> | New confirmation password. | [optional] +**token** | Option<**String**> | Reset token generated and sent in email. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/users/docs/User.md b/users/docs/User.md new file mode 100644 index 00000000..58b9da37 --- /dev/null +++ b/users/docs/User.md @@ -0,0 +1,21 @@ +# User + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | User unique identifier. | [optional] +**first_name** | Option<**String**> | User's first name. | [optional] +**last_name** | Option<**String**> | User's last name. | [optional] +**tags** | Option<**Vec**> | User tags. | [optional] +**email** | Option<**String**> | User email for example email address. | [optional] +**credentials** | Option<[**models::UserCredentials**](User_credentials.md)> | | [optional] +**metadata** | Option<[**serde_json::Value**](.md)> | Arbitrary, object-encoded user's data. | [optional] +**profile_picture** | Option<**String**> | User's profile picture URL that is represented as a string. | [optional] +**status** | Option<**String**> | User Status | [optional] +**created_at** | Option<**String**> | Time when the group was created. | [optional] +**updated_at** | Option<**String**> | Time when the group was created. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/users/docs/UserCredentials.md b/users/docs/UserCredentials.md new file mode 100644 index 00000000..036c8628 --- /dev/null +++ b/users/docs/UserCredentials.md @@ -0,0 +1,11 @@ +# UserCredentials + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**username** | Option<**String**> | User's username for example john_doe for Mr John Doe. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/users/docs/UserProfilePicture.md b/users/docs/UserProfilePicture.md new file mode 100644 index 00000000..099e08c4 --- /dev/null +++ b/users/docs/UserProfilePicture.md @@ -0,0 +1,11 @@ +# UserProfilePicture + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**profile_picture** | **String** | User's profile picture URL that is represented as a string. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/users/docs/UserReqObj.md b/users/docs/UserReqObj.md new file mode 100644 index 00000000..0232c189 --- /dev/null +++ b/users/docs/UserReqObj.md @@ -0,0 +1,18 @@ +# UserReqObj + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**first_name** | Option<**String**> | User's first name. | [optional] +**last_name** | Option<**String**> | User's last name. | [optional] +**email** | Option<**String**> | User's email address will be used as its unique identifier. | [optional] +**tags** | Option<**Vec**> | User tags. | [optional] +**credentials** | [**models::UserReqObjCredentials**](UserReqObj_credentials.md) | | +**metadata** | Option<[**serde_json::Value**](.md)> | Arbitrary, object-encoded user's data. | [optional] +**profile_picture** | Option<**String**> | User's profile picture URL that is represented as a string. | [optional] +**status** | Option<**String**> | User Status | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/users/docs/UserReqObjCredentials.md b/users/docs/UserReqObjCredentials.md new file mode 100644 index 00000000..d8cfcdcb --- /dev/null +++ b/users/docs/UserReqObjCredentials.md @@ -0,0 +1,12 @@ +# UserReqObjCredentials + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**username** | Option<**String**> | User's username for example 'admin' will be used as its unique identifier. | [optional] +**secret** | Option<**String**> | Free-form account secret used for acquiring auth token(s). | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/users/docs/UserRole.md b/users/docs/UserRole.md new file mode 100644 index 00000000..7aabe1e1 --- /dev/null +++ b/users/docs/UserRole.md @@ -0,0 +1,11 @@ +# UserRole + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**role** | **String** | User role example. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/users/docs/UserSecret.md b/users/docs/UserSecret.md new file mode 100644 index 00000000..830c8115 --- /dev/null +++ b/users/docs/UserSecret.md @@ -0,0 +1,12 @@ +# UserSecret + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**old_secret** | **String** | Old user secret password. | +**new_secret** | **String** | New user secret password. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/users/docs/UserTags.md b/users/docs/UserTags.md new file mode 100644 index 00000000..dfabd374 --- /dev/null +++ b/users/docs/UserTags.md @@ -0,0 +1,11 @@ +# UserTags + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tags** | Option<**Vec**> | User tags. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/users/docs/UserUpdate.md b/users/docs/UserUpdate.md new file mode 100644 index 00000000..7bdef9fc --- /dev/null +++ b/users/docs/UserUpdate.md @@ -0,0 +1,13 @@ +# UserUpdate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**first_name** | **String** | User's first name. | +**last_name** | **String** | User's last name. | +**metadata** | [**serde_json::Value**](.md) | Arbitrary, object-encoded user's data. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/users/docs/Username.md b/users/docs/Username.md new file mode 100644 index 00000000..8efa755f --- /dev/null +++ b/users/docs/Username.md @@ -0,0 +1,11 @@ +# Username + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**username** | **String** | User's username for example 'admin' will be used as its unique identifier. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/users/docs/UsersApi.md b/users/docs/UsersApi.md new file mode 100644 index 00000000..6295826d --- /dev/null +++ b/users/docs/UsersApi.md @@ -0,0 +1,764 @@ +# \UsersApi + +All URIs are relative to *http://localhost:9002* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_user**](UsersApi.md#create_user) | **POST** /users | Registers user account +[**disable_user**](UsersApi.md#disable_user) | **POST** /users/{userID}/disable | Disables a user +[**domain_id_users_get**](UsersApi.md#domain_id_users_get) | **GET** /{domainID}/users | List users assigned to domain +[**enable_user**](UsersApi.md#enable_user) | **POST** /users/{userID}/enable | Enables a user +[**get_profile**](UsersApi.md#get_profile) | **GET** /users/profile | Gets info on currently logged in user. +[**get_user**](UsersApi.md#get_user) | **GET** /users/{userID} | Retrieves a user +[**issue_token**](UsersApi.md#issue_token) | **POST** /users/tokens/issue | Issue Token +[**list_users**](UsersApi.md#list_users) | **GET** /users | List users +[**list_users_in_channel**](UsersApi.md#list_users_in_channel) | **GET** /{domainID}/channels/{channelID}/users | List users in a channel +[**list_users_in_client**](UsersApi.md#list_users_in_client) | **GET** /{domainID}/clients/{clientID}/users | List users associated with a client +[**list_users_in_group**](UsersApi.md#list_users_in_group) | **GET** /{domainID}/groups/{groupID}/users | List users in a group +[**refresh_token**](UsersApi.md#refresh_token) | **POST** /users/tokens/refresh | Refresh Token +[**request_password_reset**](UsersApi.md#request_password_reset) | **POST** /password/reset-request | User password reset request +[**reset_password**](UsersApi.md#reset_password) | **PUT** /password/reset | User password reset endpoint +[**search_users**](UsersApi.md#search_users) | **GET** /users/search | Search users +[**update_email**](UsersApi.md#update_email) | **PATCH** /users/{userID}/email | Updates email of the user. +[**update_profile_picture**](UsersApi.md#update_profile_picture) | **PATCH** /users/{userID}/picture | Updates the user's profile picture. +[**update_role**](UsersApi.md#update_role) | **PATCH** /users/{userID}/role | Updates the user's role. +[**update_secret**](UsersApi.md#update_secret) | **PATCH** /users/secret | Updates secret of currently logged in user. +[**update_tags**](UsersApi.md#update_tags) | **PATCH** /users/{userID}/tags | Updates tags of the user. +[**update_user**](UsersApi.md#update_user) | **PATCH** /users/{userID} | Updates first, last name and metadata of the user. +[**update_username**](UsersApi.md#update_username) | **PATCH** /users/{userID}/username | Updates user's username. +[**users_user_id_delete**](UsersApi.md#users_user_id_delete) | **DELETE** /users/{userID} | Delete a user + + + +## create_user + +> models::User create_user(user_req_obj) +Registers user account + +Registers new user account given email and password. New account will be uniquely identified by its email address. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**user_req_obj** | [**UserReqObj**](UserReqObj.md) | JSON-formatted document describing the new user to be registered | [required] | + +### Return type + +[**models::User**](User.md) + +### Authorization + +[refreshAuth](../README.md#refreshAuth), [bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## disable_user + +> models::User disable_user(user_id) +Disables a user + +Disables a specific user that is identifier by the user ID. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**user_id** | **uuid::Uuid** | Unique user identifier. | [required] | + +### Return type + +[**models::User**](User.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## domain_id_users_get + +> models::UsersPage domain_id_users_get(domain_id, limit, offset, metadata, status) +List users assigned to domain + +List users assigned to domain that is identified by the domain ID. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**limit** | Option<**i32**> | Size of the subset to retrieve. | |[default to 10] +**offset** | Option<**i32**> | Number of items to skip during retrieval. | |[default to 0] +**metadata** | Option<**String**> | Metadata filter. Filtering is performed matching the parameter with metadata on top level. Parameter is json. | | +**status** | Option<**String**> | User account status. | |[default to enabled] + +### Return type + +[**models::UsersPage**](UsersPage.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## enable_user + +> models::User enable_user(user_id) +Enables a user + +Enables a specific user that is identifier by the user ID. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**user_id** | **uuid::Uuid** | Unique user identifier. | [required] | + +### Return type + +[**models::User**](User.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_profile + +> models::User get_profile() +Gets info on currently logged in user. + +Gets info on currently logged in user. Info is obtained using authorization token + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**models::User**](User.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_user + +> models::User get_user(user_id) +Retrieves a user + +Retrieves a specific user that is identifier by the user ID. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**user_id** | **uuid::Uuid** | Unique user identifier. | [required] | + +### Return type + +[**models::User**](User.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## issue_token + +> models::IssueToken200Response issue_token(issue_token) +Issue Token + +Issue Access and Refresh Token used for authenticating into the system. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**issue_token** | [**IssueToken**](IssueToken.md) | Login credentials. | [required] | + +### Return type + +[**models::IssueToken200Response**](issueToken_200_response.md) + +### Authorization + +[refreshAuth](../README.md#refreshAuth), [bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_users + +> models::UsersPage list_users(limit, offset, metadata, status, first_name, last_name, username, email, tags) +List users + +Retrieves a list of users. Due to performance concerns, data is retrieved in subsets. The API must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**limit** | Option<**i32**> | Size of the subset to retrieve. | |[default to 10] +**offset** | Option<**i32**> | Number of items to skip during retrieval. | |[default to 0] +**metadata** | Option<**String**> | Metadata filter. Filtering is performed matching the parameter with metadata on top level. Parameter is json. | | +**status** | Option<**String**> | User account status. | |[default to enabled] +**first_name** | Option<**String**> | User's first name. | | +**last_name** | Option<**String**> | User's last name. | | +**username** | Option<**String**> | User's username. | | +**email** | Option<**String**> | User's email address. | | +**tags** | Option<[**Vec**](String.md)> | User tags. | | + +### Return type + +[**models::UsersPage**](UsersPage.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_users_in_channel + +> models::MembersPage list_users_in_channel(domain_id, channel_id, limit, offset, level, tree, metadata, name, parent_id) +List users in a channel + +Retrieves a list of users in a channel. Due to performance concerns, data is retrieved in subsets. The API must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**channel_id** | **uuid::Uuid** | Unique channel identifier. | [required] | +**limit** | Option<**i32**> | Size of the subset to retrieve. | |[default to 10] +**offset** | Option<**i32**> | Number of items to skip during retrieval. | |[default to 0] +**level** | Option<**i32**> | Level of hierarchy up to which to retrieve groups from given group id. | | +**tree** | Option<**bool**> | Specify type of response, JSON array or tree. | |[default to false] +**metadata** | Option<**String**> | Metadata filter. Filtering is performed matching the parameter with metadata on top level. Parameter is json. | | +**name** | Option<**String**> | Channel's name. | | +**parent_id** | Option<**uuid::Uuid**> | Unique parent identifier for a group. | | + +### Return type + +[**models::MembersPage**](MembersPage.md) + +### Authorization + +[refreshAuth](../README.md#refreshAuth), [bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_users_in_client + +> models::MembersPage list_users_in_client(domain_id, client_id, limit, offset, level, tree, metadata, name, parent_id) +List users associated with a client + +Retrieves a list of users associated with a client. Due to performance concerns, data is retrieved in subsets. The API must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**client_id** | **uuid::Uuid** | Unique client identifier. | [required] | +**limit** | Option<**i32**> | Size of the subset to retrieve. | |[default to 10] +**offset** | Option<**i32**> | Number of items to skip during retrieval. | |[default to 0] +**level** | Option<**i32**> | Level of hierarchy up to which to retrieve groups from given group id. | | +**tree** | Option<**bool**> | Specify type of response, JSON array or tree. | |[default to false] +**metadata** | Option<**String**> | Metadata filter. Filtering is performed matching the parameter with metadata on top level. Parameter is json. | | +**name** | Option<**String**> | Channel's name. | | +**parent_id** | Option<**uuid::Uuid**> | Unique parent identifier for a group. | | + +### Return type + +[**models::MembersPage**](MembersPage.md) + +### Authorization + +[refreshAuth](../README.md#refreshAuth), [bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_users_in_group + +> models::MembersPage list_users_in_group(domain_id, group_id, limit, offset, level, tree, metadata, name, parent_id) +List users in a group + +Retrieves a list of users in a group. Due to performance concerns, data is retrieved in subsets. The API must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | +**group_id** | **uuid::Uuid** | Unique group identifier. | [required] | +**limit** | Option<**i32**> | Size of the subset to retrieve. | |[default to 10] +**offset** | Option<**i32**> | Number of items to skip during retrieval. | |[default to 0] +**level** | Option<**i32**> | Level of hierarchy up to which to retrieve groups from given group id. | | +**tree** | Option<**bool**> | Specify type of response, JSON array or tree. | |[default to false] +**metadata** | Option<**String**> | Metadata filter. Filtering is performed matching the parameter with metadata on top level. Parameter is json. | | +**name** | Option<**String**> | Group's name. | | +**parent_id** | Option<**uuid::Uuid**> | Unique parent identifier for a group. | | + +### Return type + +[**models::MembersPage**](MembersPage.md) + +### Authorization + +[refreshAuth](../README.md#refreshAuth), [bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## refresh_token + +> models::IssueToken200Response refresh_token() +Refresh Token + +Refreshes Access and Refresh Token used for authenticating into the system. + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**models::IssueToken200Response**](issueToken_200_response.md) + +### Authorization + +[refreshAuth](../README.md#refreshAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## request_password_reset + +> request_password_reset(referer, request_password_reset_request) +User password reset request + +Generates a reset token and sends and email with link for resetting password. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**referer** | **String** | Host being sent by browser. | [required] | +**request_password_reset_request** | [**RequestPasswordResetRequest**](RequestPasswordResetRequest.md) | Initiate password request procedure. | [required] | + +### Return type + + (empty response body) + +### Authorization + +[refreshAuth](../README.md#refreshAuth), [bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## reset_password + +> reset_password(reset_password_request) +User password reset endpoint + +When user gets reset token, after he submitted email to `/password/reset-request`, posting a new password along to this endpoint will change password. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**reset_password_request** | Option<[**ResetPasswordRequest**](ResetPasswordRequest.md)> | Password reset request data, new password and token that is appended on password reset link received in email. | | + +### Return type + + (empty response body) + +### Authorization + +[refreshAuth](../README.md#refreshAuth), [bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## search_users + +> models::UsersPage search_users(user_id, limit, offset, username, first_name, last_name, email) +Search users + +Search users by name and identity. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**user_id** | **uuid::Uuid** | Unique user identifier. | [required] | +**limit** | Option<**i32**> | Size of the subset to retrieve. | |[default to 10] +**offset** | Option<**i32**> | Number of items to skip during retrieval. | |[default to 0] +**username** | Option<**String**> | User's username. | | +**first_name** | Option<**String**> | User's first name. | | +**last_name** | Option<**String**> | User's last name. | | +**email** | Option<**String**> | User's email address. | | + +### Return type + +[**models::UsersPage**](UsersPage.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## update_email + +> models::User update_email(user_id, email) +Updates email of the user. + +Updates email of the user with provided ID. Email is updated using authorization token and the new received email. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**user_id** | **uuid::Uuid** | Unique user identifier. | [required] | +**email** | [**Email**](Email.md) | Email change data. User can change its email. | [required] | + +### Return type + +[**models::User**](User.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## update_profile_picture + +> models::User update_profile_picture(user_id, user_profile_picture) +Updates the user's profile picture. + +Updates the user's profile picture with provided ID. Profile picture is updated using authorization token and the new received picture. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**user_id** | **uuid::Uuid** | Unique user identifier. | [required] | +**user_profile_picture** | [**UserProfilePicture**](UserProfilePicture.md) | JSON-formated document describing the profile picture of user to be update | [required] | + +### Return type + +[**models::User**](User.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## update_role + +> models::User update_role(user_id, user_role) +Updates the user's role. + +Updates role for the user with provided ID. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**user_id** | **uuid::Uuid** | Unique user identifier. | [required] | +**user_role** | [**UserRole**](UserRole.md) | JSON-formated document describing the role of the user to be updated | [required] | + +### Return type + +[**models::User**](User.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## update_secret + +> models::User update_secret(user_secret) +Updates secret of currently logged in user. + +Updates secret of currently logged in user. Secret is updated using authorization token and the new received info. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**user_secret** | [**UserSecret**](UserSecret.md) | Secret change data. User can change its secret. | [required] | + +### Return type + +[**models::User**](User.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## update_tags + +> models::User update_tags(user_id, user_tags) +Updates tags of the user. + +Updates tags of the user with provided ID. Tags is updated using authorization token and the new tags received in request. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**user_id** | **uuid::Uuid** | Unique user identifier. | [required] | +**user_tags** | [**UserTags**](UserTags.md) | JSON-formated document describing the tags of user to be update | [required] | + +### Return type + +[**models::User**](User.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## update_user + +> models::User update_user(user_id, user_update) +Updates first, last name and metadata of the user. + +Updates name and metadata of the user with provided ID. Name and metadata is updated using authorization token and the new received info. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**user_id** | **uuid::Uuid** | Unique user identifier. | [required] | +**user_update** | [**UserUpdate**](UserUpdate.md) | JSON-formated document describing the metadata and name of user to be update | [required] | + +### Return type + +[**models::User**](User.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## update_username + +> models::User update_username(user_id, username) +Updates user's username. + +Updates username of the user with provided ID. Username is updated using authorization token and the new received username. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**user_id** | **uuid::Uuid** | Unique user identifier. | [required] | +**username** | [**Username**](Username.md) | JSON-formated document describing the username of the user to be updated | [required] | + +### Return type + +[**models::User**](User.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## users_user_id_delete + +> users_user_id_delete(user_id) +Delete a user + +Delete a specific user that is identifier by the user ID. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**user_id** | **uuid::Uuid** | Unique user identifier. | [required] | + +### Return type + + (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/users/docs/UsersPage.md b/users/docs/UsersPage.md new file mode 100644 index 00000000..d46bd1a5 --- /dev/null +++ b/users/docs/UsersPage.md @@ -0,0 +1,14 @@ +# UsersPage + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**users** | [**Vec**](User.md) | | +**total** | **i32** | Total number of items. | +**offset** | **i32** | Number of items to skip during retrieval. | +**limit** | Option<**i32**> | Maximum number of items to return in one page. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/users/git_push.sh b/users/git_push.sh new file mode 100644 index 00000000..f53a75d4 --- /dev/null +++ b/users/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/users/src/apis/configuration.rs b/users/src/apis/configuration.rs new file mode 100644 index 00000000..085dd13e --- /dev/null +++ b/users/src/apis/configuration.rs @@ -0,0 +1,51 @@ +/* + * SuperMQ Users Service + * + * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + + + +#[derive(Debug, Clone)] +pub struct Configuration { + pub base_path: String, + pub user_agent: Option, + pub client: reqwest::Client, + pub basic_auth: Option, + pub oauth_access_token: Option, + pub bearer_access_token: Option, + pub api_key: Option, +} + +pub type BasicAuth = (String, Option); + +#[derive(Debug, Clone)] +pub struct ApiKey { + pub prefix: Option, + pub key: String, +} + + +impl Configuration { + pub fn new() -> Configuration { + Configuration::default() + } +} + +impl Default for Configuration { + fn default() -> Self { + Configuration { + base_path: "http://localhost:9002".to_owned(), + user_agent: Some("OpenAPI-Generator/0.15.1/rust".to_owned()), + client: reqwest::Client::new(), + basic_auth: None, + oauth_access_token: None, + bearer_access_token: None, + api_key: None, + } + } +} diff --git a/users/src/apis/health_api.rs b/users/src/apis/health_api.rs new file mode 100644 index 00000000..28feea5c --- /dev/null +++ b/users/src/apis/health_api.rs @@ -0,0 +1,53 @@ +/* + * SuperMQ Users Service + * + * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`health`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum HealthError { + Status500(models::Error), + UnknownValue(serde_json::Value), +} + + +pub async fn health(configuration: &configuration::Configuration, ) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/health", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/users/src/apis/mod.rs b/users/src/apis/mod.rs new file mode 100644 index 00000000..82659460 --- /dev/null +++ b/users/src/apis/mod.rs @@ -0,0 +1,96 @@ +use std::error; +use std::fmt; + +#[derive(Debug, Clone)] +pub struct ResponseContent { + pub status: reqwest::StatusCode, + pub content: String, + pub entity: Option, +} + +#[derive(Debug)] +pub enum Error { + Reqwest(reqwest::Error), + Serde(serde_json::Error), + Io(std::io::Error), + ResponseError(ResponseContent), +} + +impl fmt::Display for Error { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + let (module, e) = match self { + Error::Reqwest(e) => ("reqwest", e.to_string()), + Error::Serde(e) => ("serde", e.to_string()), + Error::Io(e) => ("IO", e.to_string()), + Error::ResponseError(e) => ("response", format!("status code {}", e.status)), + }; + write!(f, "error in {}: {}", module, e) + } +} + +impl error::Error for Error { + fn source(&self) -> Option<&(dyn error::Error + 'static)> { + Some(match self { + Error::Reqwest(e) => e, + Error::Serde(e) => e, + Error::Io(e) => e, + Error::ResponseError(_) => return None, + }) + } +} + +impl From for Error { + fn from(e: reqwest::Error) -> Self { + Error::Reqwest(e) + } +} + +impl From for Error { + fn from(e: serde_json::Error) -> Self { + Error::Serde(e) + } +} + +impl From for Error { + fn from(e: std::io::Error) -> Self { + Error::Io(e) + } +} + +pub fn urlencode>(s: T) -> String { + ::url::form_urlencoded::byte_serialize(s.as_ref().as_bytes()).collect() +} + +pub fn parse_deep_object(prefix: &str, value: &serde_json::Value) -> Vec<(String, String)> { + if let serde_json::Value::Object(object) = value { + let mut params = vec![]; + + for (key, value) in object { + match value { + serde_json::Value::Object(_) => params.append(&mut parse_deep_object( + &format!("{}[{}]", prefix, key), + value, + )), + serde_json::Value::Array(array) => { + for (i, value) in array.iter().enumerate() { + params.append(&mut parse_deep_object( + &format!("{}[{}][{}]", prefix, key, i), + value, + )); + } + }, + serde_json::Value::String(s) => params.push((format!("{}[{}]", prefix, key), s.clone())), + _ => params.push((format!("{}[{}]", prefix, key), value.to_string())), + } + } + + return params; + } + + unimplemented!("Only objects are supported with style=deepObject") +} + +pub mod health_api; +pub mod users_api; + +pub mod configuration; diff --git a/users/src/apis/users_api.rs b/users/src/apis/users_api.rs new file mode 100644 index 00000000..803ddaa7 --- /dev/null +++ b/users/src/apis/users_api.rs @@ -0,0 +1,1195 @@ +/* + * SuperMQ Users Service + * + * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`create_user`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CreateUserError { + Status400(), + Status401(), + Status403(), + Status409(), + Status415(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`disable_user`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DisableUserError { + Status400(), + Status401(), + Status403(), + Status404(), + Status409(), + Status415(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`domain_id_users_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DomainIdUsersGetError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`enable_user`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EnableUserError { + Status400(), + Status401(), + Status403(), + Status404(), + Status409(), + Status415(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_profile`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetProfileError { + Status400(), + Status401(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_user`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetUserError { + Status400(), + Status401(), + Status404(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`issue_token`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum IssueTokenError { + Status400(), + Status401(), + Status404(), + Status415(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_users`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListUsersError { + Status400(), + Status401(), + Status404(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_users_in_channel`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListUsersInChannelError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_users_in_client`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListUsersInClientError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_users_in_group`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListUsersInGroupError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`refresh_token`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RefreshTokenError { + Status400(), + Status401(), + Status404(), + Status415(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`request_password_reset`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RequestPasswordResetError { + Status400(), + Status404(), + Status415(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`reset_password`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ResetPasswordError { + Status400(), + Status401(), + Status404(), + Status415(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`search_users`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SearchUsersError { + Status400(), + Status401(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`update_email`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UpdateEmailError { + Status400(), + Status403(), + Status404(), + Status401(), + Status409(), + Status415(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`update_profile_picture`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UpdateProfilePictureError { + Status400(), + Status403(), + Status404(), + Status401(), + Status415(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`update_role`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UpdateRoleError { + Status400(), + Status403(), + Status404(), + Status401(), + Status415(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`update_secret`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UpdateSecretError { + Status400(), + Status401(), + Status404(), + Status415(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`update_tags`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UpdateTagsError { + Status400(), + Status403(), + Status404(), + Status401(), + Status415(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`update_user`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UpdateUserError { + Status400(), + Status403(), + Status404(), + Status401(), + Status409(), + Status415(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`update_username`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UpdateUsernameError { + Status400(), + Status403(), + Status404(), + Status401(), + Status409(), + Status415(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`users_user_id_delete`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UsersUserIdDeleteError { + Status400(), + Status401(), + Status404(), + Status405(), + Status422(), + Status500(models::Error), + UnknownValue(serde_json::Value), +} + + +/// Registers new user account given email and password. New account will be uniquely identified by its email address. +pub async fn create_user(configuration: &configuration::Configuration, user_req_obj: models::UserReqObj) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/users", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&user_req_obj); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Disables a specific user that is identifier by the user ID. +pub async fn disable_user(configuration: &configuration::Configuration, user_id: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/users/{userID}/disable", local_var_configuration.base_path, userID=crate::apis::urlencode(user_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// List users assigned to domain that is identified by the domain ID. +pub async fn domain_id_users_get(configuration: &configuration::Configuration, domain_id: &str, limit: Option, offset: Option, metadata: Option<&str>, status: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/users", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = offset { + local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = metadata { + local_var_req_builder = local_var_req_builder.query(&[("metadata", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = status { + local_var_req_builder = local_var_req_builder.query(&[("status", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Enables a specific user that is identifier by the user ID. +pub async fn enable_user(configuration: &configuration::Configuration, user_id: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/users/{userID}/enable", local_var_configuration.base_path, userID=crate::apis::urlencode(user_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Gets info on currently logged in user. Info is obtained using authorization token +pub async fn get_profile(configuration: &configuration::Configuration, ) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/users/profile", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Retrieves a specific user that is identifier by the user ID. +pub async fn get_user(configuration: &configuration::Configuration, user_id: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/users/{userID}", local_var_configuration.base_path, userID=crate::apis::urlencode(user_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Issue Access and Refresh Token used for authenticating into the system. +pub async fn issue_token(configuration: &configuration::Configuration, issue_token: models::IssueToken) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/users/tokens/issue", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&issue_token); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Retrieves a list of users. Due to performance concerns, data is retrieved in subsets. The API must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. +pub async fn list_users(configuration: &configuration::Configuration, limit: Option, offset: Option, metadata: Option<&str>, status: Option<&str>, first_name: Option<&str>, last_name: Option<&str>, username: Option<&str>, email: Option<&str>, tags: Option>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/users", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = offset { + local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = metadata { + local_var_req_builder = local_var_req_builder.query(&[("metadata", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = status { + local_var_req_builder = local_var_req_builder.query(&[("status", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = first_name { + local_var_req_builder = local_var_req_builder.query(&[("first_name", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = last_name { + local_var_req_builder = local_var_req_builder.query(&[("last_name", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = username { + local_var_req_builder = local_var_req_builder.query(&[("username", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = email { + local_var_req_builder = local_var_req_builder.query(&[("email", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = tags { + local_var_req_builder = match "multi" { + "multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("tags".to_owned(), p.to_string())).collect::>()), + _ => local_var_req_builder.query(&[("tags", &local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), + }; + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Retrieves a list of users in a channel. Due to performance concerns, data is retrieved in subsets. The API must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. +pub async fn list_users_in_channel(configuration: &configuration::Configuration, domain_id: &str, channel_id: &str, limit: Option, offset: Option, level: Option, tree: Option, metadata: Option<&str>, name: Option<&str>, parent_id: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/channels/{channelID}/users", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), channelID=crate::apis::urlencode(channel_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = offset { + local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = level { + local_var_req_builder = local_var_req_builder.query(&[("level", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = tree { + local_var_req_builder = local_var_req_builder.query(&[("tree", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = metadata { + local_var_req_builder = local_var_req_builder.query(&[("metadata", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = name { + local_var_req_builder = local_var_req_builder.query(&[("name", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = parent_id { + local_var_req_builder = local_var_req_builder.query(&[("parentID", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Retrieves a list of users associated with a client. Due to performance concerns, data is retrieved in subsets. The API must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. +pub async fn list_users_in_client(configuration: &configuration::Configuration, domain_id: &str, client_id: &str, limit: Option, offset: Option, level: Option, tree: Option, metadata: Option<&str>, name: Option<&str>, parent_id: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/clients/{clientID}/users", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), clientID=crate::apis::urlencode(client_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = offset { + local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = level { + local_var_req_builder = local_var_req_builder.query(&[("level", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = tree { + local_var_req_builder = local_var_req_builder.query(&[("tree", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = metadata { + local_var_req_builder = local_var_req_builder.query(&[("metadata", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = name { + local_var_req_builder = local_var_req_builder.query(&[("name", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = parent_id { + local_var_req_builder = local_var_req_builder.query(&[("parentID", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Retrieves a list of users in a group. Due to performance concerns, data is retrieved in subsets. The API must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. +pub async fn list_users_in_group(configuration: &configuration::Configuration, domain_id: &str, group_id: &str, limit: Option, offset: Option, level: Option, tree: Option, metadata: Option<&str>, name: Option<&str>, parent_id: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}/users", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = offset { + local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = level { + local_var_req_builder = local_var_req_builder.query(&[("level", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = tree { + local_var_req_builder = local_var_req_builder.query(&[("tree", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = metadata { + local_var_req_builder = local_var_req_builder.query(&[("metadata", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = name { + local_var_req_builder = local_var_req_builder.query(&[("name", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = parent_id { + local_var_req_builder = local_var_req_builder.query(&[("parentID", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Refreshes Access and Refresh Token used for authenticating into the system. +pub async fn refresh_token(configuration: &configuration::Configuration, ) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/users/tokens/refresh", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Generates a reset token and sends and email with link for resetting password. +pub async fn request_password_reset(configuration: &configuration::Configuration, referer: &str, request_password_reset_request: models::RequestPasswordResetRequest) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/password/reset-request", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + local_var_req_builder = local_var_req_builder.header("Referer", referer.to_string()); + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&request_password_reset_request); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// When user gets reset token, after he submitted email to `/password/reset-request`, posting a new password along to this endpoint will change password. +pub async fn reset_password(configuration: &configuration::Configuration, reset_password_request: Option) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/password/reset", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&reset_password_request); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Search users by name and identity. +pub async fn search_users(configuration: &configuration::Configuration, user_id: &str, limit: Option, offset: Option, username: Option<&str>, first_name: Option<&str>, last_name: Option<&str>, email: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/users/search", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("userID", &user_id.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = offset { + local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = username { + local_var_req_builder = local_var_req_builder.query(&[("username", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = first_name { + local_var_req_builder = local_var_req_builder.query(&[("first_name", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = last_name { + local_var_req_builder = local_var_req_builder.query(&[("last_name", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = email { + local_var_req_builder = local_var_req_builder.query(&[("email", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Updates email of the user with provided ID. Email is updated using authorization token and the new received email. +pub async fn update_email(configuration: &configuration::Configuration, user_id: &str, email: models::Email) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/users/{userID}/email", local_var_configuration.base_path, userID=crate::apis::urlencode(user_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&email); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Updates the user's profile picture with provided ID. Profile picture is updated using authorization token and the new received picture. +pub async fn update_profile_picture(configuration: &configuration::Configuration, user_id: &str, user_profile_picture: models::UserProfilePicture) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/users/{userID}/picture", local_var_configuration.base_path, userID=crate::apis::urlencode(user_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&user_profile_picture); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Updates role for the user with provided ID. +pub async fn update_role(configuration: &configuration::Configuration, user_id: &str, user_role: models::UserRole) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/users/{userID}/role", local_var_configuration.base_path, userID=crate::apis::urlencode(user_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&user_role); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Updates secret of currently logged in user. Secret is updated using authorization token and the new received info. +pub async fn update_secret(configuration: &configuration::Configuration, user_secret: models::UserSecret) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/users/secret", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&user_secret); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Updates tags of the user with provided ID. Tags is updated using authorization token and the new tags received in request. +pub async fn update_tags(configuration: &configuration::Configuration, user_id: &str, user_tags: models::UserTags) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/users/{userID}/tags", local_var_configuration.base_path, userID=crate::apis::urlencode(user_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&user_tags); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Updates name and metadata of the user with provided ID. Name and metadata is updated using authorization token and the new received info. +pub async fn update_user(configuration: &configuration::Configuration, user_id: &str, user_update: models::UserUpdate) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/users/{userID}", local_var_configuration.base_path, userID=crate::apis::urlencode(user_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&user_update); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Updates username of the user with provided ID. Username is updated using authorization token and the new received username. +pub async fn update_username(configuration: &configuration::Configuration, user_id: &str, username: models::Username) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/users/{userID}/username", local_var_configuration.base_path, userID=crate::apis::urlencode(user_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&username); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Delete a specific user that is identifier by the user ID. +pub async fn users_user_id_delete(configuration: &configuration::Configuration, user_id: &str) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/users/{userID}", local_var_configuration.base_path, userID=crate::apis::urlencode(user_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/users/src/lib.rs b/users/src/lib.rs new file mode 100644 index 00000000..e1520628 --- /dev/null +++ b/users/src/lib.rs @@ -0,0 +1,11 @@ +#![allow(unused_imports)] +#![allow(clippy::too_many_arguments)] + +extern crate serde_repr; +extern crate serde; +extern crate serde_json; +extern crate url; +extern crate reqwest; + +pub mod apis; +pub mod models; diff --git a/users/src/main.rs b/users/src/main.rs new file mode 100644 index 00000000..5b71c368 --- /dev/null +++ b/users/src/main.rs @@ -0,0 +1,104 @@ +mod models; +use models::user_req_obj_credentials::UserReqObjCredentials; +use models::UserReqObj; // Replace with the actual paths to your models + +mod apis; +use crate::apis::users_api::*; +use apis::configuration::Configuration; +use models::issue_token::IssueToken; +use serde_json::json; + +// Replace with the actual path to your configuration + +#[tokio::main] +async fn main() { + // Construct the configuration with the actual API base URL and authorization token + let mut config = Configuration::new(); + config.base_path = "http://localhost:9002".to_string(); + config.bearer_access_token = Some("eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3MzQ0MjU2MTUsImlhdCI6M\ + TczNDQyMjAxNSwiaXNzIjoic3VwZXJtcS5hdXRoIiwidHlwZSI6MCwidXNlciI6IjRlMjZiMzM4LTg0OGEtNGM1Yi04OWFlLWUyY\ + WUxODhmNDhiMyJ9.cLYQUPrab8URh_FdtSyE15ZrnwJCUBEtwfAwn4CDjIGuVqVRVwoBr1xV8FfuqDxyfpPr-86zQJUP1b4Vqv8T9g".to_string()); + + // Create the credentials, wrapping each field inside Some + let credentials = Box::new(UserReqObjCredentials { + username: Some("adminDorc".to_string()), // Wrap in Some() + secret: Some("password".to_string()), // Wrap in Some() + }); + + let metadata = Some(json!({ + "domain": "example.com", + })); + let cloned_credentials = credentials.clone(); + + // Create the user request object + let user_req_obj = UserReqObj { + first_name: Some("Njeri".to_string()), + last_name: Some("Doe".to_string()), + email: Some("Njeri@example.com".to_string()), + tags: Some(vec!["tag1".to_string(), "tag2".to_string()]), + credentials: credentials, // Boxed credentials + metadata: metadata, + profile_picture: Some("https://example.com/profile.jpg".to_string()), + status: Some("enabled".to_string()), + }; + let token_request = IssueToken::new( + cloned_credentials.username.as_ref().unwrap_or(&"".to_string()).clone(), + cloned_credentials.secret.as_ref().unwrap_or(&"".to_string()).clone(), + ); + + // // Call the `create_user` function + match create_user(&config, user_req_obj).await { + Ok(user) => { + // Success: The user has been created, and `user` contains the response data + println!("User created successfully: {:?}", user); + } + Err(err) => { + // Handle the error (e.g., logging, retrying, etc.) + eprintln!("Error creating user: {:?}", err); + } + } + + // //Obtain token + // match issue_token(&config, token_request).await { + // Ok(user) => { + // // Success: The user has been created, and `user` contains the response data + // println!("Token generated successfully: {:?}", user); + // } + // Err(err) => { + // // Handle the error (e.g., logging, retrying, etc.) + // eprintln!("Error generating token: {:?}", err); + // } + // } + + //Get user + // let user_response: User = match get_profile(&config).await { + // Ok(user) => { + // // Success: The user has been created, and `user` contains the response data + // return user; + // } + // Err(err) => { + // // Handle the error (e.g., logging, retrying, etc.) + // eprintln!("Error obtaining: {:?}", err); + // } + // } + + + // if let Some(id) = user_response.id { + // println!("User ID: {}", id); + // } else { + // println!("User ID is None"); + // } + + // match get_user(&config,).await { + // Ok(user) => { + // // Success: The user has been created, and `user` contains the response data + // println!("Obtained user successfully: {:?}", user); + // } + // Err(err) => { + // // Handle the error (e.g., logging, retrying, etc.) + // eprintln!("Error obtaining: {:?}", err); + // } + // } + +} + diff --git a/users/src/models/assign_req_obj.rs b/users/src/models/assign_req_obj.rs new file mode 100644 index 00000000..518bcf58 --- /dev/null +++ b/users/src/models/assign_req_obj.rs @@ -0,0 +1,36 @@ +/* + * SuperMQ Users Service + * + * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AssignReqObj { + /// Members IDs + #[serde(rename = "members")] + pub members: Vec, + /// Permission relations. + #[serde(rename = "relation")] + pub relation: String, + /// Member kind. + #[serde(rename = "member_kind")] + pub member_kind: String, +} + +impl AssignReqObj { + pub fn new(members: Vec, relation: String, member_kind: String) -> AssignReqObj { + AssignReqObj { + members, + relation, + member_kind, + } + } +} + diff --git a/users/src/models/assign_user_req_obj.rs b/users/src/models/assign_user_req_obj.rs new file mode 100644 index 00000000..35a6e0f9 --- /dev/null +++ b/users/src/models/assign_user_req_obj.rs @@ -0,0 +1,32 @@ +/* + * SuperMQ Users Service + * + * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AssignUserReqObj { + /// User IDs + #[serde(rename = "user_ids")] + pub user_ids: Vec, + /// Permission relations. + #[serde(rename = "relation")] + pub relation: String, +} + +impl AssignUserReqObj { + pub fn new(user_ids: Vec, relation: String) -> AssignUserReqObj { + AssignUserReqObj { + user_ids, + relation, + } + } +} + diff --git a/users/src/models/email.rs b/users/src/models/email.rs new file mode 100644 index 00000000..4ded60df --- /dev/null +++ b/users/src/models/email.rs @@ -0,0 +1,28 @@ +/* + * SuperMQ Users Service + * + * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Email { + /// User email address. + #[serde(rename = "email")] + pub email: String, +} + +impl Email { + pub fn new(email: String) -> Email { + Email { + email, + } + } +} + diff --git a/users/src/models/error.rs b/users/src/models/error.rs new file mode 100644 index 00000000..7e4d1974 --- /dev/null +++ b/users/src/models/error.rs @@ -0,0 +1,28 @@ +/* + * SuperMQ Users Service + * + * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Error { + /// Error message + #[serde(rename = "error", skip_serializing_if = "Option::is_none")] + pub error: Option, +} + +impl Error { + pub fn new() -> Error { + Error { + error: None, + } + } +} + diff --git a/users/src/models/health_res.rs b/users/src/models/health_res.rs new file mode 100644 index 00000000..f2b66d58 --- /dev/null +++ b/users/src/models/health_res.rs @@ -0,0 +1,56 @@ +/* + * SuperMQ Users Service + * + * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct HealthRes { + /// Service status. + #[serde(rename = "status", skip_serializing_if = "Option::is_none")] + pub status: Option, + /// Service version. + #[serde(rename = "version", skip_serializing_if = "Option::is_none")] + pub version: Option, + /// Service commit hash. + #[serde(rename = "commit", skip_serializing_if = "Option::is_none")] + pub commit: Option, + /// Service description. + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option, + /// Service build time. + #[serde(rename = "build_time", skip_serializing_if = "Option::is_none")] + pub build_time: Option, +} + +impl HealthRes { + pub fn new() -> HealthRes { + HealthRes { + status: None, + version: None, + commit: None, + description: None, + build_time: None, + } + } +} +/// Service status. +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Status { + #[serde(rename = "pass")] + Pass, +} + +impl Default for Status { + fn default() -> Status { + Self::Pass + } +} + diff --git a/users/src/models/issue_token.rs b/users/src/models/issue_token.rs new file mode 100644 index 00000000..84d56cbb --- /dev/null +++ b/users/src/models/issue_token.rs @@ -0,0 +1,32 @@ +/* + * SuperMQ Users Service + * + * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct IssueToken { + /// User identity - email address. + #[serde(rename = "identity")] + pub identity: String, + /// User secret password. + #[serde(rename = "secret")] + pub secret: String, +} + +impl IssueToken { + pub fn new(identity: String, secret: String) -> IssueToken { + IssueToken { + identity, + secret, + } + } +} + diff --git a/users/src/models/issue_token_200_response.rs b/users/src/models/issue_token_200_response.rs new file mode 100644 index 00000000..b4a08f8c --- /dev/null +++ b/users/src/models/issue_token_200_response.rs @@ -0,0 +1,36 @@ +/* + * SuperMQ Users Service + * + * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct IssueToken200Response { + /// User access token. + #[serde(rename = "access_token", skip_serializing_if = "Option::is_none")] + pub access_token: Option, + /// User refresh token. + #[serde(rename = "refresh_token", skip_serializing_if = "Option::is_none")] + pub refresh_token: Option, + /// User access token type. + #[serde(rename = "access_type", skip_serializing_if = "Option::is_none")] + pub access_type: Option, +} + +impl IssueToken200Response { + pub fn new() -> IssueToken200Response { + IssueToken200Response { + access_token: None, + refresh_token: None, + access_type: None, + } + } +} + diff --git a/users/src/models/members.rs b/users/src/models/members.rs new file mode 100644 index 00000000..3ee8d225 --- /dev/null +++ b/users/src/models/members.rs @@ -0,0 +1,63 @@ +/* + * SuperMQ Users Service + * + * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Members { + /// User unique identifier. + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + /// User's first name. + #[serde(rename = "first_name", skip_serializing_if = "Option::is_none")] + pub first_name: Option, + /// User's last name. + #[serde(rename = "last_name", skip_serializing_if = "Option::is_none")] + pub last_name: Option, + /// User's email address. + #[serde(rename = "email", skip_serializing_if = "Option::is_none")] + pub email: Option, + /// User tags. + #[serde(rename = "tags", skip_serializing_if = "Option::is_none")] + pub tags: Option>, + #[serde(rename = "credentials", skip_serializing_if = "Option::is_none")] + pub credentials: Option>, + /// Arbitrary, object-encoded user's data. + #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")] + pub metadata: Option, + /// User Status + #[serde(rename = "status", skip_serializing_if = "Option::is_none")] + pub status: Option, + /// Time when the group was created. + #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] + pub created_at: Option, + /// Time when the group was created. + #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")] + pub updated_at: Option, +} + +impl Members { + pub fn new() -> Members { + Members { + id: None, + first_name: None, + last_name: None, + email: None, + tags: None, + credentials: None, + metadata: None, + status: None, + created_at: None, + updated_at: None, + } + } +} + diff --git a/users/src/models/members_credentials.rs b/users/src/models/members_credentials.rs new file mode 100644 index 00000000..7c83d001 --- /dev/null +++ b/users/src/models/members_credentials.rs @@ -0,0 +1,32 @@ +/* + * SuperMQ Users Service + * + * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct MembersCredentials { + /// User's username. + #[serde(rename = "username", skip_serializing_if = "Option::is_none")] + pub username: Option, + /// User secret password. + #[serde(rename = "secret", skip_serializing_if = "Option::is_none")] + pub secret: Option, +} + +impl MembersCredentials { + pub fn new() -> MembersCredentials { + MembersCredentials { + username: None, + secret: None, + } + } +} + diff --git a/users/src/models/members_page.rs b/users/src/models/members_page.rs new file mode 100644 index 00000000..3510d5cc --- /dev/null +++ b/users/src/models/members_page.rs @@ -0,0 +1,39 @@ +/* + * SuperMQ Users Service + * + * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct MembersPage { + #[serde(rename = "members")] + pub members: Vec, + /// Total number of items. + #[serde(rename = "total")] + pub total: i32, + /// Number of items to skip during retrieval. + #[serde(rename = "offset", skip_serializing_if = "Option::is_none")] + pub offset: Option, + /// Maximum number of items to return in one page. + #[serde(rename = "limit", skip_serializing_if = "Option::is_none")] + pub limit: Option, +} + +impl MembersPage { + pub fn new(members: Vec, total: i32) -> MembersPage { + MembersPage { + members, + total, + offset: None, + limit: None, + } + } +} + diff --git a/users/src/models/mod.rs b/users/src/models/mod.rs new file mode 100644 index 00000000..72818cea --- /dev/null +++ b/users/src/models/mod.rs @@ -0,0 +1,46 @@ +pub mod assign_req_obj; +pub use self::assign_req_obj::AssignReqObj; +pub mod assign_user_req_obj; +pub use self::assign_user_req_obj::AssignUserReqObj; +pub mod email; +pub use self::email::Email; +pub mod error; +pub use self::error::Error; +pub mod health_res; +pub use self::health_res::HealthRes; +pub mod issue_token; +pub use self::issue_token::IssueToken; +pub mod issue_token_200_response; +pub use self::issue_token_200_response::IssueToken200Response; +pub mod members; +pub use self::members::Members; +pub mod members_credentials; +pub use self::members_credentials::MembersCredentials; +pub mod members_page; +pub use self::members_page::MembersPage; +pub mod request_password_reset_request; +pub use self::request_password_reset_request::RequestPasswordResetRequest; +pub mod reset_password_request; +pub use self::reset_password_request::ResetPasswordRequest; +pub mod user; +pub use self::user::User; +pub mod user_credentials; +pub use self::user_credentials::UserCredentials; +pub mod user_profile_picture; +pub use self::user_profile_picture::UserProfilePicture; +pub mod user_req_obj; +pub use self::user_req_obj::UserReqObj; +pub mod user_req_obj_credentials; +pub use self::user_req_obj_credentials::UserReqObjCredentials; +pub mod user_role; +pub use self::user_role::UserRole; +pub mod user_secret; +pub use self::user_secret::UserSecret; +pub mod user_tags; +pub use self::user_tags::UserTags; +pub mod user_update; +pub use self::user_update::UserUpdate; +pub mod username; +pub use self::username::Username; +pub mod users_page; +pub use self::users_page::UsersPage; diff --git a/users/src/models/request_password_reset_request.rs b/users/src/models/request_password_reset_request.rs new file mode 100644 index 00000000..91466631 --- /dev/null +++ b/users/src/models/request_password_reset_request.rs @@ -0,0 +1,32 @@ +/* + * SuperMQ Users Service + * + * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct RequestPasswordResetRequest { + /// User email. + #[serde(rename = "email", skip_serializing_if = "Option::is_none")] + pub email: Option, + /// Email host. + #[serde(rename = "host", skip_serializing_if = "Option::is_none")] + pub host: Option, +} + +impl RequestPasswordResetRequest { + pub fn new() -> RequestPasswordResetRequest { + RequestPasswordResetRequest { + email: None, + host: None, + } + } +} + diff --git a/users/src/models/reset_password_request.rs b/users/src/models/reset_password_request.rs new file mode 100644 index 00000000..2386cb80 --- /dev/null +++ b/users/src/models/reset_password_request.rs @@ -0,0 +1,36 @@ +/* + * SuperMQ Users Service + * + * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ResetPasswordRequest { + /// New password. + #[serde(rename = "password", skip_serializing_if = "Option::is_none")] + pub password: Option, + /// New confirmation password. + #[serde(rename = "confirm_password", skip_serializing_if = "Option::is_none")] + pub confirm_password: Option, + /// Reset token generated and sent in email. + #[serde(rename = "token", skip_serializing_if = "Option::is_none")] + pub token: Option, +} + +impl ResetPasswordRequest { + pub fn new() -> ResetPasswordRequest { + ResetPasswordRequest { + password: None, + confirm_password: None, + token: None, + } + } +} + diff --git a/users/src/models/user.rs b/users/src/models/user.rs new file mode 100644 index 00000000..dcc4f726 --- /dev/null +++ b/users/src/models/user.rs @@ -0,0 +1,67 @@ +/* + * SuperMQ Users Service + * + * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct User { + /// User unique identifier. + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + /// User's first name. + #[serde(rename = "first_name", skip_serializing_if = "Option::is_none")] + pub first_name: Option, + /// User's last name. + #[serde(rename = "last_name", skip_serializing_if = "Option::is_none")] + pub last_name: Option, + /// User tags. + #[serde(rename = "tags", skip_serializing_if = "Option::is_none")] + pub tags: Option>, + /// User email for example email address. + #[serde(rename = "email", skip_serializing_if = "Option::is_none")] + pub email: Option, + #[serde(rename = "credentials", skip_serializing_if = "Option::is_none")] + pub credentials: Option>, + /// Arbitrary, object-encoded user's data. + #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")] + pub metadata: Option, + /// User's profile picture URL that is represented as a string. + #[serde(rename = "profile_picture", skip_serializing_if = "Option::is_none")] + pub profile_picture: Option, + /// User Status + #[serde(rename = "status", skip_serializing_if = "Option::is_none")] + pub status: Option, + /// Time when the group was created. + #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] + pub created_at: Option, + /// Time when the group was created. + #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")] + pub updated_at: Option, +} + +impl User { + pub fn new() -> User { + User { + id: None, + first_name: None, + last_name: None, + tags: None, + email: None, + credentials: None, + metadata: None, + profile_picture: None, + status: None, + created_at: None, + updated_at: None, + } + } +} + diff --git a/users/src/models/user_credentials.rs b/users/src/models/user_credentials.rs new file mode 100644 index 00000000..750d2cef --- /dev/null +++ b/users/src/models/user_credentials.rs @@ -0,0 +1,28 @@ +/* + * SuperMQ Users Service + * + * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct UserCredentials { + /// User's username for example john_doe for Mr John Doe. + #[serde(rename = "username", skip_serializing_if = "Option::is_none")] + pub username: Option, +} + +impl UserCredentials { + pub fn new() -> UserCredentials { + UserCredentials { + username: None, + } + } +} + diff --git a/users/src/models/user_profile_picture.rs b/users/src/models/user_profile_picture.rs new file mode 100644 index 00000000..adaf1ab1 --- /dev/null +++ b/users/src/models/user_profile_picture.rs @@ -0,0 +1,28 @@ +/* + * SuperMQ Users Service + * + * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct UserProfilePicture { + /// User's profile picture URL that is represented as a string. + #[serde(rename = "profile_picture")] + pub profile_picture: String, +} + +impl UserProfilePicture { + pub fn new(profile_picture: String) -> UserProfilePicture { + UserProfilePicture { + profile_picture, + } + } +} + diff --git a/users/src/models/user_req_obj.rs b/users/src/models/user_req_obj.rs new file mode 100644 index 00000000..7aed1e61 --- /dev/null +++ b/users/src/models/user_req_obj.rs @@ -0,0 +1,55 @@ +/* + * SuperMQ Users Service + * + * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct UserReqObj { + /// User's first name. + #[serde(rename = "first_name", skip_serializing_if = "Option::is_none")] + pub first_name: Option, + /// User's last name. + #[serde(rename = "last_name", skip_serializing_if = "Option::is_none")] + pub last_name: Option, + /// User's email address will be used as its unique identifier. + #[serde(rename = "email", skip_serializing_if = "Option::is_none")] + pub email: Option, + /// User tags. + #[serde(rename = "tags", skip_serializing_if = "Option::is_none")] + pub tags: Option>, + #[serde(rename = "credentials")] + pub credentials: Box, + /// Arbitrary, object-encoded user's data. + #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")] + pub metadata: Option, + /// User's profile picture URL that is represented as a string. + #[serde(rename = "profile_picture", skip_serializing_if = "Option::is_none")] + pub profile_picture: Option, + /// User Status + #[serde(rename = "status", skip_serializing_if = "Option::is_none")] + pub status: Option, +} + +impl UserReqObj { + pub fn new(credentials: models::UserReqObjCredentials) -> UserReqObj { + UserReqObj { + first_name: None, + last_name: None, + email: None, + tags: None, + credentials: Box::new(credentials), + metadata: None, + profile_picture: None, + status: None, + } + } +} + diff --git a/users/src/models/user_req_obj_credentials.rs b/users/src/models/user_req_obj_credentials.rs new file mode 100644 index 00000000..3d38d35d --- /dev/null +++ b/users/src/models/user_req_obj_credentials.rs @@ -0,0 +1,32 @@ +/* + * SuperMQ Users Service + * + * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct UserReqObjCredentials { + /// User's username for example 'admin' will be used as its unique identifier. + #[serde(rename = "username", skip_serializing_if = "Option::is_none")] + pub username: Option, + /// Free-form account secret used for acquiring auth token(s). + #[serde(rename = "secret", skip_serializing_if = "Option::is_none")] + pub secret: Option, +} + +impl UserReqObjCredentials { + pub fn new() -> UserReqObjCredentials { + UserReqObjCredentials { + username: None, + secret: None, + } + } +} + diff --git a/users/src/models/user_role.rs b/users/src/models/user_role.rs new file mode 100644 index 00000000..10e44ee5 --- /dev/null +++ b/users/src/models/user_role.rs @@ -0,0 +1,42 @@ +/* + * SuperMQ Users Service + * + * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct UserRole { + /// User role example. + #[serde(rename = "role")] + pub role: Role, +} + +impl UserRole { + pub fn new(role: Role) -> UserRole { + UserRole { + role, + } + } +} +/// User role example. +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Role { + #[serde(rename = "admin")] + Admin, + #[serde(rename = "user")] + User, +} + +impl Default for Role { + fn default() -> Role { + Self::Admin + } +} + diff --git a/users/src/models/user_secret.rs b/users/src/models/user_secret.rs new file mode 100644 index 00000000..48674015 --- /dev/null +++ b/users/src/models/user_secret.rs @@ -0,0 +1,32 @@ +/* + * SuperMQ Users Service + * + * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct UserSecret { + /// Old user secret password. + #[serde(rename = "old_secret")] + pub old_secret: String, + /// New user secret password. + #[serde(rename = "new_secret")] + pub new_secret: String, +} + +impl UserSecret { + pub fn new(old_secret: String, new_secret: String) -> UserSecret { + UserSecret { + old_secret, + new_secret, + } + } +} + diff --git a/users/src/models/user_tags.rs b/users/src/models/user_tags.rs new file mode 100644 index 00000000..a63f95c5 --- /dev/null +++ b/users/src/models/user_tags.rs @@ -0,0 +1,28 @@ +/* + * SuperMQ Users Service + * + * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct UserTags { + /// User tags. + #[serde(rename = "tags", skip_serializing_if = "Option::is_none")] + pub tags: Option>, +} + +impl UserTags { + pub fn new() -> UserTags { + UserTags { + tags: None, + } + } +} + diff --git a/users/src/models/user_update.rs b/users/src/models/user_update.rs new file mode 100644 index 00000000..08922708 --- /dev/null +++ b/users/src/models/user_update.rs @@ -0,0 +1,36 @@ +/* + * SuperMQ Users Service + * + * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct UserUpdate { + /// User's first name. + #[serde(rename = "first_name")] + pub first_name: String, + /// User's last name. + #[serde(rename = "last_name")] + pub last_name: String, + /// Arbitrary, object-encoded user's data. + #[serde(rename = "metadata")] + pub metadata: serde_json::Value, +} + +impl UserUpdate { + pub fn new(first_name: String, last_name: String, metadata: serde_json::Value) -> UserUpdate { + UserUpdate { + first_name, + last_name, + metadata, + } + } +} + diff --git a/users/src/models/username.rs b/users/src/models/username.rs new file mode 100644 index 00000000..2d34d638 --- /dev/null +++ b/users/src/models/username.rs @@ -0,0 +1,28 @@ +/* + * SuperMQ Users Service + * + * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Username { + /// User's username for example 'admin' will be used as its unique identifier. + #[serde(rename = "username")] + pub username: String, +} + +impl Username { + pub fn new(username: String) -> Username { + Username { + username, + } + } +} + diff --git a/users/src/models/users_page.rs b/users/src/models/users_page.rs new file mode 100644 index 00000000..4181bd17 --- /dev/null +++ b/users/src/models/users_page.rs @@ -0,0 +1,39 @@ +/* + * SuperMQ Users Service + * + * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct UsersPage { + #[serde(rename = "users")] + pub users: Vec, + /// Total number of items. + #[serde(rename = "total")] + pub total: i32, + /// Number of items to skip during retrieval. + #[serde(rename = "offset")] + pub offset: i32, + /// Maximum number of items to return in one page. + #[serde(rename = "limit", skip_serializing_if = "Option::is_none")] + pub limit: Option, +} + +impl UsersPage { + pub fn new(users: Vec, total: i32, offset: i32) -> UsersPage { + UsersPage { + users, + total, + offset, + limit: None, + } + } +} + From ed56a090693b9680f0210b10bdf153cfd74567d7 Mon Sep 17 00:00:00 2001 From: Dorcas Litunya Date: Fri, 20 Dec 2024 17:54:52 +0300 Subject: [PATCH 03/10] Add a folder to initialize the SDK and show usecase --- Cargo.lock | 390 +++--- Cargo.toml | 2 +- auth/Cargo.toml | 2 +- bootstrap/Cargo.toml | 2 +- certs/Cargo.toml | 2 +- channels/Cargo.toml | 2 +- clients/Cargo.toml | 2 +- domains/Cargo.toml | 2 +- {pkg/sdk/rust => examples}/Cargo.toml | 24 +- {pkg/sdk/rust => examples}/src/lib.rs | 2 - {users => examples}/src/main.rs | 188 ++- groups/Cargo.toml | 2 +- http/Cargo.toml | 2 +- invitations/Cargo.toml | 2 +- journal/Cargo.toml | 2 +- notifiers/Cargo.toml | 2 +- pkg/sdk/rust/.gitignore | 3 - pkg/sdk/rust/.openapi-generator-ignore | 23 - pkg/sdk/rust/.openapi-generator/FILES | 72 -- pkg/sdk/rust/.openapi-generator/VERSION | 1 - pkg/sdk/rust/.travis.yml | 1 - pkg/sdk/rust/README.md | 110 -- pkg/sdk/rust/docs/AssignReqObj.md | 13 - pkg/sdk/rust/docs/AssignUserReqObj.md | 12 - pkg/sdk/rust/docs/DomainsApi.md | 43 - pkg/sdk/rust/docs/Email.md | 11 - pkg/sdk/rust/docs/Error.md | 11 - pkg/sdk/rust/docs/Group.md | 21 - pkg/sdk/rust/docs/GroupReqObj.md | 15 - pkg/sdk/rust/docs/GroupUpdate.md | 13 - pkg/sdk/rust/docs/GroupsApi.md | 457 ------- pkg/sdk/rust/docs/GroupsPage.md | 14 - pkg/sdk/rust/docs/HealthApi.md | 34 - pkg/sdk/rust/docs/HealthRes.md | 15 - pkg/sdk/rust/docs/IssueToken.md | 12 - pkg/sdk/rust/docs/IssueToken200Response.md | 13 - pkg/sdk/rust/docs/Members.md | 20 - pkg/sdk/rust/docs/MembersCredentials.md | 12 - pkg/sdk/rust/docs/MembersPage.md | 14 - .../rust/docs/RequestPasswordResetRequest.md | 12 - pkg/sdk/rust/docs/ResetPasswordRequest.md | 13 - pkg/sdk/rust/docs/User.md | 21 - pkg/sdk/rust/docs/UserCredentials.md | 11 - pkg/sdk/rust/docs/UserProfilePicture.md | 11 - pkg/sdk/rust/docs/UserReqObj.md | 18 - pkg/sdk/rust/docs/UserReqObjCredentials.md | 12 - pkg/sdk/rust/docs/UserRole.md | 11 - pkg/sdk/rust/docs/UserSecret.md | 12 - pkg/sdk/rust/docs/UserTags.md | 11 - pkg/sdk/rust/docs/UserUpdate.md | 13 - pkg/sdk/rust/docs/Username.md | 11 - pkg/sdk/rust/docs/UsersApi.md | 690 ----------- pkg/sdk/rust/docs/UsersPage.md | 14 - pkg/sdk/rust/git_push.sh | 57 - pkg/sdk/rust/src/apis/configuration.rs | 51 - pkg/sdk/rust/src/apis/domains_api.rs | 74 -- pkg/sdk/rust/src/apis/groups_api.rs | 702 ----------- pkg/sdk/rust/src/apis/health_api.rs | 53 - pkg/sdk/rust/src/apis/mod.rs | 99 -- pkg/sdk/rust/src/apis/users_api.rs | 1067 ----------------- pkg/sdk/rust/src/main.rs | 53 - pkg/sdk/rust/src/models/assign_req_obj.rs | 36 - .../rust/src/models/assign_user_req_obj.rs | 32 - pkg/sdk/rust/src/models/email.rs | 28 - pkg/sdk/rust/src/models/error.rs | 28 - pkg/sdk/rust/src/models/group.rs | 68 -- pkg/sdk/rust/src/models/group_req_obj.rs | 44 - pkg/sdk/rust/src/models/group_update.rs | 36 - pkg/sdk/rust/src/models/groups_page.rs | 39 - pkg/sdk/rust/src/models/health_res.rs | 56 - pkg/sdk/rust/src/models/issue_token.rs | 32 - .../src/models/issue_token_200_response.rs | 36 - pkg/sdk/rust/src/models/members.rs | 63 - .../rust/src/models/members_credentials.rs | 32 - pkg/sdk/rust/src/models/members_page.rs | 39 - pkg/sdk/rust/src/models/mod.rs | 54 - .../models/request_password_reset_request.rs | 32 - .../rust/src/models/reset_password_request.rs | 36 - pkg/sdk/rust/src/models/user.rs | 67 -- pkg/sdk/rust/src/models/user_credentials.rs | 28 - .../rust/src/models/user_profile_picture.rs | 28 - pkg/sdk/rust/src/models/user_req_obj.rs | 55 - .../src/models/user_req_obj_credentials.rs | 32 - pkg/sdk/rust/src/models/user_role.rs | 42 - pkg/sdk/rust/src/models/user_secret.rs | 32 - pkg/sdk/rust/src/models/user_tags.rs | 28 - pkg/sdk/rust/src/models/user_update.rs | 36 - pkg/sdk/rust/src/models/username.rs | 28 - pkg/sdk/rust/src/models/users_page.rs | 39 - provision/Cargo.toml | 2 +- readers/Cargo.toml | 2 +- twins/Cargo.toml | 2 +- users/Cargo.toml | 2 +- 93 files changed, 331 insertions(+), 5367 deletions(-) rename {pkg/sdk/rust => examples}/Cargo.toml (52%) rename {pkg/sdk/rust => examples}/src/lib.rs (85%) rename {users => examples}/src/main.rs (67%) delete mode 100644 pkg/sdk/rust/.gitignore delete mode 100644 pkg/sdk/rust/.openapi-generator-ignore delete mode 100644 pkg/sdk/rust/.openapi-generator/FILES delete mode 100644 pkg/sdk/rust/.openapi-generator/VERSION delete mode 100644 pkg/sdk/rust/.travis.yml delete mode 100644 pkg/sdk/rust/README.md delete mode 100644 pkg/sdk/rust/docs/AssignReqObj.md delete mode 100644 pkg/sdk/rust/docs/AssignUserReqObj.md delete mode 100644 pkg/sdk/rust/docs/DomainsApi.md delete mode 100644 pkg/sdk/rust/docs/Email.md delete mode 100644 pkg/sdk/rust/docs/Error.md delete mode 100644 pkg/sdk/rust/docs/Group.md delete mode 100644 pkg/sdk/rust/docs/GroupReqObj.md delete mode 100644 pkg/sdk/rust/docs/GroupUpdate.md delete mode 100644 pkg/sdk/rust/docs/GroupsApi.md delete mode 100644 pkg/sdk/rust/docs/GroupsPage.md delete mode 100644 pkg/sdk/rust/docs/HealthApi.md delete mode 100644 pkg/sdk/rust/docs/HealthRes.md delete mode 100644 pkg/sdk/rust/docs/IssueToken.md delete mode 100644 pkg/sdk/rust/docs/IssueToken200Response.md delete mode 100644 pkg/sdk/rust/docs/Members.md delete mode 100644 pkg/sdk/rust/docs/MembersCredentials.md delete mode 100644 pkg/sdk/rust/docs/MembersPage.md delete mode 100644 pkg/sdk/rust/docs/RequestPasswordResetRequest.md delete mode 100644 pkg/sdk/rust/docs/ResetPasswordRequest.md delete mode 100644 pkg/sdk/rust/docs/User.md delete mode 100644 pkg/sdk/rust/docs/UserCredentials.md delete mode 100644 pkg/sdk/rust/docs/UserProfilePicture.md delete mode 100644 pkg/sdk/rust/docs/UserReqObj.md delete mode 100644 pkg/sdk/rust/docs/UserReqObjCredentials.md delete mode 100644 pkg/sdk/rust/docs/UserRole.md delete mode 100644 pkg/sdk/rust/docs/UserSecret.md delete mode 100644 pkg/sdk/rust/docs/UserTags.md delete mode 100644 pkg/sdk/rust/docs/UserUpdate.md delete mode 100644 pkg/sdk/rust/docs/Username.md delete mode 100644 pkg/sdk/rust/docs/UsersApi.md delete mode 100644 pkg/sdk/rust/docs/UsersPage.md delete mode 100644 pkg/sdk/rust/git_push.sh delete mode 100644 pkg/sdk/rust/src/apis/configuration.rs delete mode 100644 pkg/sdk/rust/src/apis/domains_api.rs delete mode 100644 pkg/sdk/rust/src/apis/groups_api.rs delete mode 100644 pkg/sdk/rust/src/apis/health_api.rs delete mode 100644 pkg/sdk/rust/src/apis/mod.rs delete mode 100644 pkg/sdk/rust/src/apis/users_api.rs delete mode 100644 pkg/sdk/rust/src/main.rs delete mode 100644 pkg/sdk/rust/src/models/assign_req_obj.rs delete mode 100644 pkg/sdk/rust/src/models/assign_user_req_obj.rs delete mode 100644 pkg/sdk/rust/src/models/email.rs delete mode 100644 pkg/sdk/rust/src/models/error.rs delete mode 100644 pkg/sdk/rust/src/models/group.rs delete mode 100644 pkg/sdk/rust/src/models/group_req_obj.rs delete mode 100644 pkg/sdk/rust/src/models/group_update.rs delete mode 100644 pkg/sdk/rust/src/models/groups_page.rs delete mode 100644 pkg/sdk/rust/src/models/health_res.rs delete mode 100644 pkg/sdk/rust/src/models/issue_token.rs delete mode 100644 pkg/sdk/rust/src/models/issue_token_200_response.rs delete mode 100644 pkg/sdk/rust/src/models/members.rs delete mode 100644 pkg/sdk/rust/src/models/members_credentials.rs delete mode 100644 pkg/sdk/rust/src/models/members_page.rs delete mode 100644 pkg/sdk/rust/src/models/mod.rs delete mode 100644 pkg/sdk/rust/src/models/request_password_reset_request.rs delete mode 100644 pkg/sdk/rust/src/models/reset_password_request.rs delete mode 100644 pkg/sdk/rust/src/models/user.rs delete mode 100644 pkg/sdk/rust/src/models/user_credentials.rs delete mode 100644 pkg/sdk/rust/src/models/user_profile_picture.rs delete mode 100644 pkg/sdk/rust/src/models/user_req_obj.rs delete mode 100644 pkg/sdk/rust/src/models/user_req_obj_credentials.rs delete mode 100644 pkg/sdk/rust/src/models/user_role.rs delete mode 100644 pkg/sdk/rust/src/models/user_secret.rs delete mode 100644 pkg/sdk/rust/src/models/user_tags.rs delete mode 100644 pkg/sdk/rust/src/models/user_update.rs delete mode 100644 pkg/sdk/rust/src/models/username.rs delete mode 100644 pkg/sdk/rust/src/models/users_page.rs diff --git a/Cargo.lock b/Cargo.lock index b65ca449..4e68c221 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3,28 +3,31 @@ version = 4 [[package]] -name = "addr2line" -version = "0.24.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" +name = "Auth" +version = "0.15.1" dependencies = [ - "gimli", + "reqwest", + "serde", + "serde_json", + "serde_repr", + "url", + "uuid", ] [[package]] -name = "adler2" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" - -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" +name = "Bootstrap" +version = "0.15.1" +dependencies = [ + "reqwest", + "serde", + "serde_json", + "serde_repr", + "url", + "uuid", +] [[package]] -name = "auth-openapi" +name = "Certs" version = "0.15.1" dependencies = [ "reqwest", @@ -36,40 +39,55 @@ dependencies = [ ] [[package]] -name = "autocfg" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" +name = "Channels" +version = "0.15.1" +dependencies = [ + "reqwest", + "serde", + "serde_json", + "serde_repr", + "url", + "uuid", +] [[package]] -name = "backtrace" -version = "0.3.74" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" +name = "Clients" +version = "0.15.1" dependencies = [ - "addr2line", - "cfg-if", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", - "windows-targets", + "reqwest", + "serde", + "serde_json", + "serde_repr", + "url", + "uuid", ] [[package]] -name = "base64" -version = "0.22.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" +name = "Domains" +version = "0.15.1" +dependencies = [ + "reqwest", + "serde", + "serde_json", + "serde_repr", + "url", + "uuid", +] [[package]] -name = "bitflags" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +name = "Groups" +version = "0.15.1" +dependencies = [ + "reqwest", + "serde", + "serde_json", + "serde_repr", + "url", + "uuid", +] [[package]] -name = "bootstrap-openapi" +name = "Http" version = "0.15.1" dependencies = [ "reqwest", @@ -81,28 +99,43 @@ dependencies = [ ] [[package]] -name = "bumpalo" -version = "3.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" +name = "Invitations" +version = "0.15.1" +dependencies = [ + "reqwest", + "serde", + "serde_json", + "serde_repr", + "url", + "uuid", +] [[package]] -name = "bytes" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "325918d6fe32f23b19878fe4b34794ae41fc19ddbe53b10571a4874d44ffd39b" +name = "Journal" +version = "0.15.1" +dependencies = [ + "reqwest", + "serde", + "serde_json", + "serde_repr", + "url", + "uuid", +] [[package]] -name = "cc" -version = "1.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9157bbaa6b165880c27a4293a474c91cdcf265cc68cc829bf10be0964a391caf" +name = "Notifiers" +version = "0.15.1" dependencies = [ - "shlex", + "reqwest", + "serde", + "serde_json", + "serde_repr", + "url", + "uuid", ] [[package]] -name = "certs-openapi" +name = "Provision" version = "0.15.1" dependencies = [ "reqwest", @@ -114,13 +147,19 @@ dependencies = [ ] [[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +name = "Readers" +version = "0.15.1" +dependencies = [ + "reqwest", + "serde", + "serde_json", + "serde_repr", + "url", + "uuid", +] [[package]] -name = "channels-openapi" +name = "Twins" version = "0.15.1" dependencies = [ "reqwest", @@ -132,17 +171,99 @@ dependencies = [ ] [[package]] -name = "clients-openapi" +name = "Users" version = "0.15.1" dependencies = [ "reqwest", "serde", "serde_json", "serde_repr", + "tokio", "url", "uuid", ] +[[package]] +name = "addr2line" +version = "0.24.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" + +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + +[[package]] +name = "autocfg" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" + +[[package]] +name = "backtrace" +version = "0.3.74" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" +dependencies = [ + "addr2line", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", + "windows-targets", +] + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "bitflags" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" + +[[package]] +name = "bumpalo" +version = "3.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" + +[[package]] +name = "bytes" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "325918d6fe32f23b19878fe4b34794ae41fc19ddbe53b10571a4874d44ffd39b" + +[[package]] +name = "cc" +version = "1.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9157bbaa6b165880c27a4293a474c91cdcf265cc68cc829bf10be0964a391caf" +dependencies = [ + "shlex", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + [[package]] name = "core-foundation" version = "0.9.4" @@ -170,18 +291,6 @@ dependencies = [ "syn", ] -[[package]] -name = "domains-openapi" -version = "0.15.1" -dependencies = [ - "reqwest", - "serde", - "serde_json", - "serde_repr", - "url", - "uuid", -] - [[package]] name = "encoding_rs" version = "0.8.35" @@ -207,6 +316,34 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "examples-openapi" +version = "0.15.1" +dependencies = [ + "Auth", + "Bootstrap", + "Certs", + "Channels", + "Clients", + "Domains", + "Groups", + "Http", + "Invitations", + "Journal", + "Notifiers", + "Provision", + "Readers", + "Twins", + "Users", + "reqwest", + "serde", + "serde_json", + "serde_repr", + "tokio", + "url", + "uuid", +] + [[package]] name = "fastrand" version = "2.3.0" @@ -299,18 +436,6 @@ version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" -[[package]] -name = "groups-openapi" -version = "0.15.1" -dependencies = [ - "reqwest", - "serde", - "serde_json", - "serde_repr", - "url", - "uuid", -] - [[package]] name = "h2" version = "0.4.7" @@ -370,18 +495,6 @@ dependencies = [ "pin-project-lite", ] -[[package]] -name = "http-openapi" -version = "0.15.1" -dependencies = [ - "reqwest", - "serde", - "serde_json", - "serde_repr", - "url", - "uuid", -] - [[package]] name = "httparse" version = "1.9.5" @@ -609,18 +722,6 @@ dependencies = [ "hashbrown", ] -[[package]] -name = "invitations-openapi" -version = "0.15.1" -dependencies = [ - "reqwest", - "serde", - "serde_json", - "serde_repr", - "url", - "uuid", -] - [[package]] name = "ipnet" version = "2.10.1" @@ -633,18 +734,6 @@ version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" -[[package]] -name = "journal-openapi" -version = "0.15.1" -dependencies = [ - "reqwest", - "serde", - "serde_json", - "serde_repr", - "url", - "uuid", -] - [[package]] name = "js-sys" version = "0.3.76" @@ -748,18 +837,6 @@ dependencies = [ "tempfile", ] -[[package]] -name = "notifiers-openapi" -version = "0.15.1" -dependencies = [ - "reqwest", - "serde", - "serde_json", - "serde_repr", - "url", - "uuid", -] - [[package]] name = "object" version = "0.36.5" @@ -875,18 +952,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "provision-openapi" -version = "0.15.1" -dependencies = [ - "reqwest", - "serde", - "serde_json", - "serde_repr", - "url", - "uuid", -] - [[package]] name = "quote" version = "1.0.37" @@ -896,18 +961,6 @@ dependencies = [ "proc-macro2", ] -[[package]] -name = "readers-openapi" -version = "0.15.1" -dependencies = [ - "reqwest", - "serde", - "serde_json", - "serde_repr", - "url", - "uuid", -] - [[package]] name = "redox_syscall" version = "0.5.8" @@ -1359,18 +1412,6 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" -[[package]] -name = "twins-openapi" -version = "0.15.1" -dependencies = [ - "reqwest", - "serde", - "serde_json", - "serde_repr", - "url", - "uuid", -] - [[package]] name = "unicase" version = "2.8.0" @@ -1400,19 +1441,6 @@ dependencies = [ "percent-encoding", ] -[[package]] -name = "users-openapi" -version = "0.15.1" -dependencies = [ - "reqwest", - "serde", - "serde_json", - "serde_repr", - "tokio", - "url", - "uuid", -] - [[package]] name = "utf16_iter" version = "1.0.5" diff --git a/Cargo.toml b/Cargo.toml index 036ac3b0..23b6fd52 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,6 +6,7 @@ members = [ "channels", "clients", "domains", + "examples", "groups", "http", "invitations", @@ -18,4 +19,3 @@ members = [ ] -tokio = { version = "1", features = ["full"] } \ No newline at end of file diff --git a/auth/Cargo.toml b/auth/Cargo.toml index f1490cca..2f51b962 100644 --- a/auth/Cargo.toml +++ b/auth/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "auth-openapi" +name = "Auth" version = "0.15.1" authors = ["info@abstractmachines.fr"] description = "This is the Auth Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) " diff --git a/bootstrap/Cargo.toml b/bootstrap/Cargo.toml index 7870931d..79276bbc 100644 --- a/bootstrap/Cargo.toml +++ b/bootstrap/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "bootstrap-openapi" +name = "Bootstrap" version = "0.15.1" authors = ["info@abstractmachines.fr"] description = "HTTP API for managing platform clients configuration. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) " diff --git a/certs/Cargo.toml b/certs/Cargo.toml index 5cbb502b..eeb05171 100644 --- a/certs/Cargo.toml +++ b/certs/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "certs-openapi" +name = "Certs" version = "0.15.1" authors = ["info@abstractmachines.fr"] description = "HTTP API for Certs service Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) " diff --git a/channels/Cargo.toml b/channels/Cargo.toml index 3a990402..ba1d0258 100644 --- a/channels/Cargo.toml +++ b/channels/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "channels-openapi" +name = "Channels" version = "0.15.1" authors = ["info@abstractmachines.fr"] description = "This is the Channels Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform channels. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) " diff --git a/clients/Cargo.toml b/clients/Cargo.toml index ce79cfc6..b89a9142 100644 --- a/clients/Cargo.toml +++ b/clients/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "clients-openapi" +name = "Clients" version = "0.15.1" authors = ["info@abstractmachines.fr"] description = "This is the Clients Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform clients. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) " diff --git a/domains/Cargo.toml b/domains/Cargo.toml index 52c07121..3a0af67f 100644 --- a/domains/Cargo.toml +++ b/domains/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "domains-openapi" +name = "Domains" version = "0.15.1" authors = ["info@abstractmachines.fr"] description = "This is the Domains Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform domains. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The Magistrala repository](https://github.com/absmach/magistrala) " diff --git a/pkg/sdk/rust/Cargo.toml b/examples/Cargo.toml similarity index 52% rename from pkg/sdk/rust/Cargo.toml rename to examples/Cargo.toml index 90e0174b..9c6a9fb4 100644 --- a/pkg/sdk/rust/Cargo.toml +++ b/examples/Cargo.toml @@ -1,11 +1,14 @@ [package] -name = "openapi" -version = "0.14.0" +name = "examples-openapi" +version = "0.15.1" authors = ["info@abstractmachines.fr"] description = "This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) " license = "Apache 2.0" edition = "2021" +# Set the default binary to `examples-openapi` +default-run = "examples-openapi" + [dependencies] serde = { version = "^1.0", features = ["derive"] } serde_json = "^1.0" @@ -14,3 +17,20 @@ url = "^2.5" uuid = { version = "^1.8", features = ["serde", "v4"] } reqwest = { version = "^0.12", features = ["json", "multipart"] } tokio = { version = "1", features = ["full"] } +Auth = { path = "../auth" } +Bootstrap = { path = "../bootstrap" } +Certs = { path = "../certs" } +Channels = { path = "../channels" } +Clients = { path = "../clients" } +Domains = { path = "../domains" } +Groups = { path = "../groups" } +Http = { path = "../http" } +Invitations = { path = "../invitations" } +Journal = { path = "../journal" } +Notifiers = { path = "../notifiers" } +Provision = { path = "../provision" } +Readers = { path = "../readers" } +Twins = { path = "../twins" } +Users = { path = "../users" } + + diff --git a/pkg/sdk/rust/src/lib.rs b/examples/src/lib.rs similarity index 85% rename from pkg/sdk/rust/src/lib.rs rename to examples/src/lib.rs index e1520628..ca58e3af 100644 --- a/pkg/sdk/rust/src/lib.rs +++ b/examples/src/lib.rs @@ -7,5 +7,3 @@ extern crate serde_json; extern crate url; extern crate reqwest; -pub mod apis; -pub mod models; diff --git a/users/src/main.rs b/examples/src/main.rs similarity index 67% rename from users/src/main.rs rename to examples/src/main.rs index 5b71c368..def9bbf0 100644 --- a/users/src/main.rs +++ b/examples/src/main.rs @@ -1,104 +1,84 @@ -mod models; -use models::user_req_obj_credentials::UserReqObjCredentials; -use models::UserReqObj; // Replace with the actual paths to your models - -mod apis; -use crate::apis::users_api::*; -use apis::configuration::Configuration; -use models::issue_token::IssueToken; -use serde_json::json; - -// Replace with the actual path to your configuration - -#[tokio::main] -async fn main() { - // Construct the configuration with the actual API base URL and authorization token - let mut config = Configuration::new(); - config.base_path = "http://localhost:9002".to_string(); - config.bearer_access_token = Some("eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3MzQ0MjU2MTUsImlhdCI6M\ - TczNDQyMjAxNSwiaXNzIjoic3VwZXJtcS5hdXRoIiwidHlwZSI6MCwidXNlciI6IjRlMjZiMzM4LTg0OGEtNGM1Yi04OWFlLWUyY\ - WUxODhmNDhiMyJ9.cLYQUPrab8URh_FdtSyE15ZrnwJCUBEtwfAwn4CDjIGuVqVRVwoBr1xV8FfuqDxyfpPr-86zQJUP1b4Vqv8T9g".to_string()); - - // Create the credentials, wrapping each field inside Some - let credentials = Box::new(UserReqObjCredentials { - username: Some("adminDorc".to_string()), // Wrap in Some() - secret: Some("password".to_string()), // Wrap in Some() - }); - - let metadata = Some(json!({ - "domain": "example.com", - })); - let cloned_credentials = credentials.clone(); - - // Create the user request object - let user_req_obj = UserReqObj { - first_name: Some("Njeri".to_string()), - last_name: Some("Doe".to_string()), - email: Some("Njeri@example.com".to_string()), - tags: Some(vec!["tag1".to_string(), "tag2".to_string()]), - credentials: credentials, // Boxed credentials - metadata: metadata, - profile_picture: Some("https://example.com/profile.jpg".to_string()), - status: Some("enabled".to_string()), - }; - let token_request = IssueToken::new( - cloned_credentials.username.as_ref().unwrap_or(&"".to_string()).clone(), - cloned_credentials.secret.as_ref().unwrap_or(&"".to_string()).clone(), - ); - - // // Call the `create_user` function - match create_user(&config, user_req_obj).await { - Ok(user) => { - // Success: The user has been created, and `user` contains the response data - println!("User created successfully: {:?}", user); - } - Err(err) => { - // Handle the error (e.g., logging, retrying, etc.) - eprintln!("Error creating user: {:?}", err); - } - } - - // //Obtain token - // match issue_token(&config, token_request).await { - // Ok(user) => { - // // Success: The user has been created, and `user` contains the response data - // println!("Token generated successfully: {:?}", user); - // } - // Err(err) => { - // // Handle the error (e.g., logging, retrying, etc.) - // eprintln!("Error generating token: {:?}", err); - // } - // } - - //Get user - // let user_response: User = match get_profile(&config).await { - // Ok(user) => { - // // Success: The user has been created, and `user` contains the response data - // return user; - // } - // Err(err) => { - // // Handle the error (e.g., logging, retrying, etc.) - // eprintln!("Error obtaining: {:?}", err); - // } - // } - - - // if let Some(id) = user_response.id { - // println!("User ID: {}", id); - // } else { - // println!("User ID is None"); - // } - - // match get_user(&config,).await { - // Ok(user) => { - // // Success: The user has been created, and `user` contains the response data - // println!("Obtained user successfully: {:?}", user); - // } - // Err(err) => { - // // Handle the error (e.g., logging, retrying, etc.) - // eprintln!("Error obtaining: {:?}", err); - // } - // } - -} - +/* This is a sample document to show how to implement the SDK. */ + +use Users::models::*; + +use Users::apis::*; +use serde_json::json; + +use crate::configuration::Configuration; +use crate::users_api::*; + +// Replace with the actual path to your configuration + +#[tokio::main] +async fn main() { + // Construct the configuration with the actual API base URL and authorization token + let mut config = Configuration::new(); + config.base_path = "http://localhost:9002".to_string(); + config.bearer_access_token = Some("Put your bearer token here".to_string()); + + // Create the credentials, wrapping each field inside Some + let credentials = Box::new(UserReqObjCredentials { + username: Some("admin".to_string()), // Wrap in Some() + secret: Some("password".to_string()), // Wrap in Some() + }); + + let metadata = Some(json!({ + "domain": "example.com", + })); + let cloned_credentials = credentials.clone(); + + // Create the user request object + let user_req_obj = UserReqObj { + first_name: Some("Njeri".to_string()), + last_name: Some("Doe".to_string()), + email: Some("Njeri@example.com".to_string()), + tags: Some(vec!["tag1".to_string(), "tag2".to_string()]), + credentials: credentials, // Boxed credentials + metadata: metadata, + profile_picture: Some("https://example.com/profile.jpg".to_string()), + status: Some("enabled".to_string()), + }; + let token_request = IssueToken::new( + cloned_credentials.username.as_ref().unwrap_or(&"".to_string()).clone(), + cloned_credentials.secret.as_ref().unwrap_or(&"".to_string()).clone(), + ); + + // Call the `create_user` function + match create_user(&config, user_req_obj).await { + Ok(user) => { + // Success: The user has been created, and `user` contains the response data + println!("User created successfully: {:?}", user); + } + Err(err) => { + // Handle the error (e.g., logging, retrying, etc.) + eprintln!("Error creating user: {:?}", err); + } + } + + // //Obtain token + // match issue_token(&config, token_request).await { + // Ok(user) => { + // // Success: The user has been created, and `user` contains the response data + // println!("Token generated successfully: {:?}", user); + // } + // Err(err) => { + // // Handle the error (e.g., logging, retrying, etc.) + // eprintln!("Error generating token: {:?}", err); + // } + // } + + //Get user + // let user_response: User = match get_profile(&config).await { + // Ok(user) => { + // // Success: The user has been created, and `user` contains the response data + // return user; + // } + // Err(err) => { + // // Handle the error (e.g., logging, retrying, etc.) + // eprintln!("Error obtaining: {:?}", err); + // } + // } + +} + diff --git a/groups/Cargo.toml b/groups/Cargo.toml index 31f8d475..b8ce0118 100644 --- a/groups/Cargo.toml +++ b/groups/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "groups-openapi" +name = "Groups" version = "0.15.1" authors = ["info@abstractmachines.fr"] description = "This is the Groups Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform groups. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) " diff --git a/http/Cargo.toml b/http/Cargo.toml index 13931f1b..6fd7659d 100644 --- a/http/Cargo.toml +++ b/http/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "http-openapi" +name = "Http" version = "0.15.1" authors = ["info@abstractmachines.fr"] description = "HTTP API for sending messages through communication channels. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) " diff --git a/invitations/Cargo.toml b/invitations/Cargo.toml index f1b756e9..c509b8ec 100644 --- a/invitations/Cargo.toml +++ b/invitations/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "invitations-openapi" +name = "Invitations" version = "0.15.1" authors = ["info@abstractmachines.fr"] description = "This is the Invitations Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform invitations. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) " diff --git a/journal/Cargo.toml b/journal/Cargo.toml index ebd20cb9..203ec72c 100644 --- a/journal/Cargo.toml +++ b/journal/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "journal-openapi" +name = "Journal" version = "0.15.1" authors = ["info@mainflux.com"] description = "This is the Journal Log Server based on the OpenAPI 3.0 specification. It is the HTTP API for viewing journal log history. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) " diff --git a/notifiers/Cargo.toml b/notifiers/Cargo.toml index 00508378..fbe2af48 100644 --- a/notifiers/Cargo.toml +++ b/notifiers/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "notifiers-openapi" +name = "Notifiers" version = "0.15.1" authors = ["info@abstractmachines.fr"] description = "HTTP API for Notifiers service. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) " diff --git a/pkg/sdk/rust/.gitignore b/pkg/sdk/rust/.gitignore deleted file mode 100644 index 6aa10640..00000000 --- a/pkg/sdk/rust/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/target/ -**/*.rs.bk -Cargo.lock diff --git a/pkg/sdk/rust/.openapi-generator-ignore b/pkg/sdk/rust/.openapi-generator-ignore deleted file mode 100644 index 7484ee59..00000000 --- a/pkg/sdk/rust/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/pkg/sdk/rust/.openapi-generator/FILES b/pkg/sdk/rust/.openapi-generator/FILES deleted file mode 100644 index 186dd944..00000000 --- a/pkg/sdk/rust/.openapi-generator/FILES +++ /dev/null @@ -1,72 +0,0 @@ -.gitignore -.openapi-generator-ignore -.travis.yml -Cargo.toml -README.md -docs/AssignReqObj.md -docs/AssignUserReqObj.md -docs/DomainsApi.md -docs/Email.md -docs/Error.md -docs/Group.md -docs/GroupReqObj.md -docs/GroupUpdate.md -docs/GroupsApi.md -docs/GroupsPage.md -docs/HealthApi.md -docs/HealthRes.md -docs/IssueToken.md -docs/IssueToken200Response.md -docs/Members.md -docs/MembersCredentials.md -docs/MembersPage.md -docs/RequestPasswordResetRequest.md -docs/ResetPasswordRequest.md -docs/User.md -docs/UserCredentials.md -docs/UserProfilePicture.md -docs/UserReqObj.md -docs/UserReqObjCredentials.md -docs/UserRole.md -docs/UserSecret.md -docs/UserTags.md -docs/UserUpdate.md -docs/Username.md -docs/UsersApi.md -docs/UsersPage.md -git_push.sh -src/apis/configuration.rs -src/apis/domains_api.rs -src/apis/groups_api.rs -src/apis/health_api.rs -src/apis/mod.rs -src/apis/users_api.rs -src/lib.rs -src/models/assign_req_obj.rs -src/models/assign_user_req_obj.rs -src/models/email.rs -src/models/error.rs -src/models/group.rs -src/models/group_req_obj.rs -src/models/group_update.rs -src/models/groups_page.rs -src/models/health_res.rs -src/models/issue_token.rs -src/models/issue_token_200_response.rs -src/models/members.rs -src/models/members_credentials.rs -src/models/members_page.rs -src/models/mod.rs -src/models/request_password_reset_request.rs -src/models/reset_password_request.rs -src/models/user.rs -src/models/user_credentials.rs -src/models/user_profile_picture.rs -src/models/user_req_obj.rs -src/models/user_req_obj_credentials.rs -src/models/user_role.rs -src/models/user_secret.rs -src/models/user_tags.rs -src/models/user_update.rs -src/models/username.rs -src/models/users_page.rs diff --git a/pkg/sdk/rust/.openapi-generator/VERSION b/pkg/sdk/rust/.openapi-generator/VERSION deleted file mode 100644 index 758bb9c8..00000000 --- a/pkg/sdk/rust/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -7.10.0 diff --git a/pkg/sdk/rust/.travis.yml b/pkg/sdk/rust/.travis.yml deleted file mode 100644 index 22761ba7..00000000 --- a/pkg/sdk/rust/.travis.yml +++ /dev/null @@ -1 +0,0 @@ -language: rust diff --git a/pkg/sdk/rust/README.md b/pkg/sdk/rust/README.md deleted file mode 100644 index 4fb31b9c..00000000 --- a/pkg/sdk/rust/README.md +++ /dev/null @@ -1,110 +0,0 @@ -# Rust API client for openapi - -This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. -Some useful links: -- [The SuperMQ repository](https://github.com/absmach/supermq) - - - -## Overview - -This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://openapis.org) from a remote server, you can easily generate an API client. - -- API version: 0.14.0 -- Package version: 0.14.0 -- Generator version: 7.10.0 -- Build package: `org.openapitools.codegen.languages.RustClientCodegen` - -## Installation - -Put the package under your project folder in a directory named `openapi` and add the following to `Cargo.toml` under `[dependencies]`: - -``` -openapi = { path = "./openapi" } -``` - -## Documentation for API Endpoints - -All URIs are relative to *http://localhost:9002* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*DomainsApi* | [**domain_id_users_get**](docs/DomainsApi.md#domain_id_users_get) | **GET** /{domainID}/users | List users assigned to domain -*GroupsApi* | [**assign_user**](docs/GroupsApi.md#assign_user) | **POST** /{domainID}/groups/{groupID}/users/assign | Assigns a user to a group -*GroupsApi* | [**create_group**](docs/GroupsApi.md#create_group) | **POST** /{domainID}/groups | Creates new group -*GroupsApi* | [**disable_group**](docs/GroupsApi.md#disable_group) | **POST** /{domainID}/groups/{groupID}/disable | Disables a group -*GroupsApi* | [**domain_id_groups_group_id_delete**](docs/GroupsApi.md#domain_id_groups_group_id_delete) | **DELETE** /{domainID}/groups/{groupID} | Delete group for a group with the given id. -*GroupsApi* | [**enable_group**](docs/GroupsApi.md#enable_group) | **POST** /{domainID}/groups/{groupID}/enable | Enables a group -*GroupsApi* | [**get_group**](docs/GroupsApi.md#get_group) | **GET** /{domainID}/groups/{groupID} | Gets group info. -*GroupsApi* | [**list_children**](docs/GroupsApi.md#list_children) | **GET** /{domainID}/groups/{groupID}/children | List children of a certain group -*GroupsApi* | [**list_groups**](docs/GroupsApi.md#list_groups) | **GET** /{domainID}/groups | Lists groups. -*GroupsApi* | [**list_groups_by_user**](docs/GroupsApi.md#list_groups_by_user) | **GET** /{domainID}/users/{memberID}/groups | Get group associated with the member -*GroupsApi* | [**list_groups_in_channel**](docs/GroupsApi.md#list_groups_in_channel) | **GET** /{domainID}/channels/{memberID}/groups | Get group associated with the member -*GroupsApi* | [**list_parents**](docs/GroupsApi.md#list_parents) | **GET** /{domainID}/groups/{groupID}/parents | List parents of a certain group -*GroupsApi* | [**unassign_user**](docs/GroupsApi.md#unassign_user) | **POST** /{domainID}/groups/{groupID}/users/unassign | Unassigns a user to a group -*GroupsApi* | [**update_group**](docs/GroupsApi.md#update_group) | **PUT** /{domainID}/groups/{groupID} | Updates group data. -*HealthApi* | [**health**](docs/HealthApi.md#health) | **GET** /health | Retrieves service health check info. -*UsersApi* | [**create_user**](docs/UsersApi.md#create_user) | **POST** /users | Registers user account -*UsersApi* | [**disable_user**](docs/UsersApi.md#disable_user) | **POST** /users/{userID}/disable | Disables a user -*UsersApi* | [**enable_user**](docs/UsersApi.md#enable_user) | **POST** /users/{userID}/enable | Enables a user -*UsersApi* | [**get_profile**](docs/UsersApi.md#get_profile) | **GET** /users/profile | Gets info on currently logged in user. -*UsersApi* | [**get_user**](docs/UsersApi.md#get_user) | **GET** /users/{userID} | Retrieves a user -*UsersApi* | [**issue_token**](docs/UsersApi.md#issue_token) | **POST** /users/tokens/issue | Issue Token -*UsersApi* | [**list_users**](docs/UsersApi.md#list_users) | **GET** /users | List users -*UsersApi* | [**list_users_in_channel**](docs/UsersApi.md#list_users_in_channel) | **GET** /{domainID}/channels/{channelID}/users | List users in a channel -*UsersApi* | [**list_users_in_group**](docs/UsersApi.md#list_users_in_group) | **GET** /{domainID}/groups/{groupID}/users | List users in a group -*UsersApi* | [**refresh_token**](docs/UsersApi.md#refresh_token) | **POST** /users/tokens/refresh | Refresh Token -*UsersApi* | [**request_password_reset**](docs/UsersApi.md#request_password_reset) | **POST** /password/reset-request | User password reset request -*UsersApi* | [**reset_password**](docs/UsersApi.md#reset_password) | **PUT** /password/reset | User password reset endpoint -*UsersApi* | [**search_users**](docs/UsersApi.md#search_users) | **GET** /users/search | Search users -*UsersApi* | [**update_email**](docs/UsersApi.md#update_email) | **PATCH** /users/{userID}/email | Updates email of the user. -*UsersApi* | [**update_profile_picture**](docs/UsersApi.md#update_profile_picture) | **PATCH** /users/{userID}/picture | Updates the user's profile picture. -*UsersApi* | [**update_role**](docs/UsersApi.md#update_role) | **PATCH** /users/{userID}/role | Updates the user's role. -*UsersApi* | [**update_secret**](docs/UsersApi.md#update_secret) | **PATCH** /users/secret | Updates secret of currently logged in user. -*UsersApi* | [**update_tags**](docs/UsersApi.md#update_tags) | **PATCH** /users/{userID}/tags | Updates tags of the user. -*UsersApi* | [**update_user**](docs/UsersApi.md#update_user) | **PATCH** /users/{userID} | Updates first, last name and metadata of the user. -*UsersApi* | [**update_username**](docs/UsersApi.md#update_username) | **PATCH** /users/{userID}/username | Updates user's username. -*UsersApi* | [**users_user_id_delete**](docs/UsersApi.md#users_user_id_delete) | **DELETE** /users/{userID} | Delete a user - - -## Documentation For Models - - - [AssignReqObj](docs/AssignReqObj.md) - - [AssignUserReqObj](docs/AssignUserReqObj.md) - - [Email](docs/Email.md) - - [Error](docs/Error.md) - - [Group](docs/Group.md) - - [GroupReqObj](docs/GroupReqObj.md) - - [GroupUpdate](docs/GroupUpdate.md) - - [GroupsPage](docs/GroupsPage.md) - - [HealthRes](docs/HealthRes.md) - - [IssueToken](docs/IssueToken.md) - - [IssueToken200Response](docs/IssueToken200Response.md) - - [Members](docs/Members.md) - - [MembersCredentials](docs/MembersCredentials.md) - - [MembersPage](docs/MembersPage.md) - - [RequestPasswordResetRequest](docs/RequestPasswordResetRequest.md) - - [ResetPasswordRequest](docs/ResetPasswordRequest.md) - - [User](docs/User.md) - - [UserCredentials](docs/UserCredentials.md) - - [UserProfilePicture](docs/UserProfilePicture.md) - - [UserReqObj](docs/UserReqObj.md) - - [UserReqObjCredentials](docs/UserReqObjCredentials.md) - - [UserRole](docs/UserRole.md) - - [UserSecret](docs/UserSecret.md) - - [UserTags](docs/UserTags.md) - - [UserUpdate](docs/UserUpdate.md) - - [Username](docs/Username.md) - - [UsersPage](docs/UsersPage.md) - - -To get access to the crate's generated documentation, use: - -``` -cargo doc --open -``` - -## Author - -info@abstractmachines.fr - diff --git a/pkg/sdk/rust/docs/AssignReqObj.md b/pkg/sdk/rust/docs/AssignReqObj.md deleted file mode 100644 index 895b525e..00000000 --- a/pkg/sdk/rust/docs/AssignReqObj.md +++ /dev/null @@ -1,13 +0,0 @@ -# AssignReqObj - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**members** | **Vec** | Members IDs | -**relation** | **String** | Permission relations. | -**member_kind** | **String** | Member kind. | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/pkg/sdk/rust/docs/AssignUserReqObj.md b/pkg/sdk/rust/docs/AssignUserReqObj.md deleted file mode 100644 index 9262413e..00000000 --- a/pkg/sdk/rust/docs/AssignUserReqObj.md +++ /dev/null @@ -1,12 +0,0 @@ -# AssignUserReqObj - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**user_ids** | **Vec** | User IDs | -**relation** | **String** | Permission relations. | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/pkg/sdk/rust/docs/DomainsApi.md b/pkg/sdk/rust/docs/DomainsApi.md deleted file mode 100644 index 3791d439..00000000 --- a/pkg/sdk/rust/docs/DomainsApi.md +++ /dev/null @@ -1,43 +0,0 @@ -# \DomainsApi - -All URIs are relative to *http://localhost:9002* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**domain_id_users_get**](DomainsApi.md#domain_id_users_get) | **GET** /{domainID}/users | List users assigned to domain - - - -## domain_id_users_get - -> models::UsersPage domain_id_users_get(domain_id, limit, offset, metadata, status) -List users assigned to domain - -List users assigned to domain that is identified by the domain ID. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**limit** | Option<**i32**> | Size of the subset to retrieve. | |[default to 10] -**offset** | Option<**i32**> | Number of items to skip during retrieval. | |[default to 0] -**metadata** | Option<**String**> | Metadata filter. Filtering is performed matching the parameter with metadata on top level. Parameter is json. | | -**status** | Option<**String**> | User account status. | |[default to enabled] - -### Return type - -[**models::UsersPage**](UsersPage.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/pkg/sdk/rust/docs/Email.md b/pkg/sdk/rust/docs/Email.md deleted file mode 100644 index 1abc6702..00000000 --- a/pkg/sdk/rust/docs/Email.md +++ /dev/null @@ -1,11 +0,0 @@ -# Email - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**email** | **String** | User email address. | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/pkg/sdk/rust/docs/Error.md b/pkg/sdk/rust/docs/Error.md deleted file mode 100644 index 8e78862d..00000000 --- a/pkg/sdk/rust/docs/Error.md +++ /dev/null @@ -1,11 +0,0 @@ -# Error - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**error** | Option<**String**> | Error message | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/pkg/sdk/rust/docs/Group.md b/pkg/sdk/rust/docs/Group.md deleted file mode 100644 index c3e986b2..00000000 --- a/pkg/sdk/rust/docs/Group.md +++ /dev/null @@ -1,21 +0,0 @@ -# Group - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | Unique group identifier generated by the service. | [optional] -**name** | Option<**String**> | Free-form group name. Group name is unique on the given hierarchy level. | [optional] -**domain_id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | ID of the domain to which the group belongs.. | [optional] -**parent_id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | Group parent identifier. | [optional] -**description** | Option<**String**> | Group description, free form text. | [optional] -**metadata** | Option<[**serde_json::Value**](.md)> | Arbitrary, object-encoded groups's data. | [optional] -**path** | Option<**String**> | Hierarchy path, concatenated ids of group ancestors. | [optional] -**level** | Option<**i32**> | Level in hierarchy, distance from the root group. | [optional] -**created_at** | Option<**String**> | Datetime when the group was created. | [optional] -**updated_at** | Option<**String**> | Datetime when the group was created. | [optional] -**status** | Option<**String**> | Group Status | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/pkg/sdk/rust/docs/GroupReqObj.md b/pkg/sdk/rust/docs/GroupReqObj.md deleted file mode 100644 index 399e4131..00000000 --- a/pkg/sdk/rust/docs/GroupReqObj.md +++ /dev/null @@ -1,15 +0,0 @@ -# GroupReqObj - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | Free-form group name. Group name is unique on the given hierarchy level. | -**description** | Option<**String**> | Group description, free form text. | [optional] -**parent_id** | Option<**String**> | Id of parent group, it must be existing group. | [optional] -**metadata** | Option<[**serde_json::Value**](.md)> | Arbitrary, object-encoded groups's data. | [optional] -**status** | Option<**String**> | Group Status | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/pkg/sdk/rust/docs/GroupUpdate.md b/pkg/sdk/rust/docs/GroupUpdate.md deleted file mode 100644 index 3f215c7e..00000000 --- a/pkg/sdk/rust/docs/GroupUpdate.md +++ /dev/null @@ -1,13 +0,0 @@ -# GroupUpdate - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | Free-form group name. Group name is unique on the given hierarchy level. | -**description** | **String** | Group description, free form text. | -**metadata** | [**serde_json::Value**](.md) | Arbitrary, object-encoded groups's data. | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/pkg/sdk/rust/docs/GroupsApi.md b/pkg/sdk/rust/docs/GroupsApi.md deleted file mode 100644 index 5edf468e..00000000 --- a/pkg/sdk/rust/docs/GroupsApi.md +++ /dev/null @@ -1,457 +0,0 @@ -# \GroupsApi - -All URIs are relative to *http://localhost:9002* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**assign_user**](GroupsApi.md#assign_user) | **POST** /{domainID}/groups/{groupID}/users/assign | Assigns a user to a group -[**create_group**](GroupsApi.md#create_group) | **POST** /{domainID}/groups | Creates new group -[**disable_group**](GroupsApi.md#disable_group) | **POST** /{domainID}/groups/{groupID}/disable | Disables a group -[**domain_id_groups_group_id_delete**](GroupsApi.md#domain_id_groups_group_id_delete) | **DELETE** /{domainID}/groups/{groupID} | Delete group for a group with the given id. -[**enable_group**](GroupsApi.md#enable_group) | **POST** /{domainID}/groups/{groupID}/enable | Enables a group -[**get_group**](GroupsApi.md#get_group) | **GET** /{domainID}/groups/{groupID} | Gets group info. -[**list_children**](GroupsApi.md#list_children) | **GET** /{domainID}/groups/{groupID}/children | List children of a certain group -[**list_groups**](GroupsApi.md#list_groups) | **GET** /{domainID}/groups | Lists groups. -[**list_groups_by_user**](GroupsApi.md#list_groups_by_user) | **GET** /{domainID}/users/{memberID}/groups | Get group associated with the member -[**list_groups_in_channel**](GroupsApi.md#list_groups_in_channel) | **GET** /{domainID}/channels/{memberID}/groups | Get group associated with the member -[**list_parents**](GroupsApi.md#list_parents) | **GET** /{domainID}/groups/{groupID}/parents | List parents of a certain group -[**unassign_user**](GroupsApi.md#unassign_user) | **POST** /{domainID}/groups/{groupID}/users/unassign | Unassigns a user to a group -[**update_group**](GroupsApi.md#update_group) | **PUT** /{domainID}/groups/{groupID} | Updates group data. - - - -## assign_user - -> assign_user(domain_id, group_id, assign_user_req_obj) -Assigns a user to a group - -Assigns a specific user to a group that is identifier by the group ID. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**group_id** | **uuid::Uuid** | Unique group identifier. | [required] | -**assign_user_req_obj** | [**AssignUserReqObj**](AssignUserReqObj.md) | JSON-formated document describing the policy related to assigning users to a group | [required] | - -### Return type - - (empty response body) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## create_group - -> models::Group create_group(domain_id, group_req_obj) -Creates new group - -Creates new group that can be used for grouping entities. New account will be uniquely identified by its identity. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**group_req_obj** | [**GroupReqObj**](GroupReqObj.md) | JSON-formatted document describing the new group to be registered | [required] | - -### Return type - -[**models::Group**](Group.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## disable_group - -> models::Group disable_group(domain_id, group_id) -Disables a group - -Disables a specific group that is identifier by the group ID. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**group_id** | **uuid::Uuid** | Unique group identifier. | [required] | - -### Return type - -[**models::Group**](Group.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## domain_id_groups_group_id_delete - -> domain_id_groups_group_id_delete(domain_id, group_id) -Delete group for a group with the given id. - -Delete group removes a group with the given id from repo and removes all the policies related to this group. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**group_id** | **uuid::Uuid** | Unique group identifier. | [required] | - -### Return type - - (empty response body) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## enable_group - -> models::Group enable_group(domain_id, group_id) -Enables a group - -Enables a specific group that is identifier by the group ID. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**group_id** | **uuid::Uuid** | Unique group identifier. | [required] | - -### Return type - -[**models::Group**](Group.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## get_group - -> models::Group get_group(domain_id, group_id) -Gets group info. - -Gets info on a group specified by id. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**group_id** | **uuid::Uuid** | Unique group identifier. | [required] | - -### Return type - -[**models::Group**](Group.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## list_children - -> models::GroupsPage list_children(domain_id, group_id, limit, offset, level, tree, metadata, name, parent_id) -List children of a certain group - -Lists groups up to a max level of hierarchy that can be fetched in one request ( max level = 5). Result can be filtered by metadata. Groups will be returned as JSON array or JSON tree. Due to performance concerns, result is returned in subsets. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**group_id** | **uuid::Uuid** | Unique group identifier. | [required] | -**limit** | Option<**i32**> | Size of the subset to retrieve. | |[default to 10] -**offset** | Option<**i32**> | Number of items to skip during retrieval. | |[default to 0] -**level** | Option<**i32**> | Level of hierarchy up to which to retrieve groups from given group id. | | -**tree** | Option<**bool**> | Specify type of response, JSON array or tree. | |[default to false] -**metadata** | Option<**String**> | Metadata filter. Filtering is performed matching the parameter with metadata on top level. Parameter is json. | | -**name** | Option<**String**> | Group's name. | | -**parent_id** | Option<**uuid::Uuid**> | Unique parent identifier for a group. | | - -### Return type - -[**models::GroupsPage**](GroupsPage.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## list_groups - -> models::GroupsPage list_groups(domain_id, limit, offset, level, tree, metadata, name, parent_id) -Lists groups. - -Lists groups up to a max level of hierarchy that can be fetched in one request ( max level = 5). Result can be filtered by metadata. Groups will be returned as JSON array or JSON tree. Due to performance concerns, result is returned in subsets. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**limit** | Option<**i32**> | Size of the subset to retrieve. | |[default to 10] -**offset** | Option<**i32**> | Number of items to skip during retrieval. | |[default to 0] -**level** | Option<**i32**> | Level of hierarchy up to which to retrieve groups from given group id. | | -**tree** | Option<**bool**> | Specify type of response, JSON array or tree. | |[default to false] -**metadata** | Option<**String**> | Metadata filter. Filtering is performed matching the parameter with metadata on top level. Parameter is json. | | -**name** | Option<**String**> | Group's name. | | -**parent_id** | Option<**uuid::Uuid**> | Unique parent identifier for a group. | | - -### Return type - -[**models::GroupsPage**](GroupsPage.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## list_groups_by_user - -> models::GroupsPage list_groups_by_user(domain_id, member_id, limit, offset, metadata, status, tags) -Get group associated with the member - -Gets groups associated with the user member specified by id. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**member_id** | **uuid::Uuid** | Unique member identifier. | [required] | -**limit** | Option<**i32**> | Size of the subset to retrieve. | |[default to 10] -**offset** | Option<**i32**> | Number of items to skip during retrieval. | |[default to 0] -**metadata** | Option<**String**> | Metadata filter. Filtering is performed matching the parameter with metadata on top level. Parameter is json. | | -**status** | Option<**String**> | User account status. | |[default to enabled] -**tags** | Option<[**Vec**](String.md)> | User tags. | | - -### Return type - -[**models::GroupsPage**](GroupsPage.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## list_groups_in_channel - -> models::GroupsPage list_groups_in_channel(domain_id, member_id, limit, offset, metadata, status, tags) -Get group associated with the member - -Gets groups associated with the channel member specified by id. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**member_id** | **uuid::Uuid** | Unique member identifier. | [required] | -**limit** | Option<**i32**> | Size of the subset to retrieve. | |[default to 10] -**offset** | Option<**i32**> | Number of items to skip during retrieval. | |[default to 0] -**metadata** | Option<**String**> | Metadata filter. Filtering is performed matching the parameter with metadata on top level. Parameter is json. | | -**status** | Option<**String**> | User account status. | |[default to enabled] -**tags** | Option<[**Vec**](String.md)> | User tags. | | - -### Return type - -[**models::GroupsPage**](GroupsPage.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## list_parents - -> models::GroupsPage list_parents(domain_id, group_id, limit, offset, level, tree, metadata, name, parent_id) -List parents of a certain group - -Lists groups up to a max level of hierarchy that can be fetched in one request ( max level = 5). Result can be filtered by metadata. Groups will be returned as JSON array or JSON tree. Due to performance concerns, result is returned in subsets. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**group_id** | **uuid::Uuid** | Unique group identifier. | [required] | -**limit** | Option<**i32**> | Size of the subset to retrieve. | |[default to 10] -**offset** | Option<**i32**> | Number of items to skip during retrieval. | |[default to 0] -**level** | Option<**i32**> | Level of hierarchy up to which to retrieve groups from given group id. | | -**tree** | Option<**bool**> | Specify type of response, JSON array or tree. | |[default to false] -**metadata** | Option<**String**> | Metadata filter. Filtering is performed matching the parameter with metadata on top level. Parameter is json. | | -**name** | Option<**String**> | Group's name. | | -**parent_id** | Option<**uuid::Uuid**> | Unique parent identifier for a group. | | - -### Return type - -[**models::GroupsPage**](GroupsPage.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## unassign_user - -> unassign_user(domain_id, group_id, assign_user_req_obj) -Unassigns a user to a group - -Unassigns a specific user to a group that is identifier by the group ID. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**group_id** | **uuid::Uuid** | Unique group identifier. | [required] | -**assign_user_req_obj** | [**AssignUserReqObj**](AssignUserReqObj.md) | JSON-formated document describing the policy related to assigning users to a group | [required] | - -### Return type - - (empty response body) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## update_group - -> models::Group update_group(domain_id, group_id, group_update) -Updates group data. - -Updates Name, Description or Metadata of a group. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**group_id** | **uuid::Uuid** | Unique group identifier. | [required] | -**group_update** | [**GroupUpdate**](GroupUpdate.md) | JSON-formated document describing the metadata and name of group to be update | [required] | - -### Return type - -[**models::Group**](Group.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/pkg/sdk/rust/docs/GroupsPage.md b/pkg/sdk/rust/docs/GroupsPage.md deleted file mode 100644 index fff04c3b..00000000 --- a/pkg/sdk/rust/docs/GroupsPage.md +++ /dev/null @@ -1,14 +0,0 @@ -# GroupsPage - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**groups** | [**Vec**](Group.md) | | -**total** | **i32** | Total number of items. | -**offset** | **i32** | Number of items to skip during retrieval. | -**limit** | Option<**i32**> | Maximum number of items to return in one page. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/pkg/sdk/rust/docs/HealthApi.md b/pkg/sdk/rust/docs/HealthApi.md deleted file mode 100644 index 99159d8a..00000000 --- a/pkg/sdk/rust/docs/HealthApi.md +++ /dev/null @@ -1,34 +0,0 @@ -# \HealthApi - -All URIs are relative to *http://localhost:9002* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**health**](HealthApi.md#health) | **GET** /health | Retrieves service health check info. - - - -## health - -> models::HealthRes health() -Retrieves service health check info. - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -[**models::HealthRes**](HealthRes.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/health+json, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/pkg/sdk/rust/docs/HealthRes.md b/pkg/sdk/rust/docs/HealthRes.md deleted file mode 100644 index 319b16fb..00000000 --- a/pkg/sdk/rust/docs/HealthRes.md +++ /dev/null @@ -1,15 +0,0 @@ -# HealthRes - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | Option<**String**> | Service status. | [optional] -**version** | Option<**String**> | Service version. | [optional] -**commit** | Option<**String**> | Service commit hash. | [optional] -**description** | Option<**String**> | Service description. | [optional] -**build_time** | Option<**String**> | Service build time. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/pkg/sdk/rust/docs/IssueToken.md b/pkg/sdk/rust/docs/IssueToken.md deleted file mode 100644 index cdc0841c..00000000 --- a/pkg/sdk/rust/docs/IssueToken.md +++ /dev/null @@ -1,12 +0,0 @@ -# IssueToken - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**identity** | **String** | User identity - email address. | -**secret** | **String** | User secret password. | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/pkg/sdk/rust/docs/IssueToken200Response.md b/pkg/sdk/rust/docs/IssueToken200Response.md deleted file mode 100644 index 831b2680..00000000 --- a/pkg/sdk/rust/docs/IssueToken200Response.md +++ /dev/null @@ -1,13 +0,0 @@ -# IssueToken200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**access_token** | Option<**String**> | User access token. | [optional] -**refresh_token** | Option<**String**> | User refresh token. | [optional] -**access_type** | Option<**String**> | User access token type. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/pkg/sdk/rust/docs/Members.md b/pkg/sdk/rust/docs/Members.md deleted file mode 100644 index a5d7e31b..00000000 --- a/pkg/sdk/rust/docs/Members.md +++ /dev/null @@ -1,20 +0,0 @@ -# Members - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | User unique identifier. | [optional] -**first_name** | Option<**String**> | User's first name. | [optional] -**last_name** | Option<**String**> | User's last name. | [optional] -**email** | Option<**String**> | User's email address. | [optional] -**tags** | Option<**Vec**> | User tags. | [optional] -**credentials** | Option<[**models::MembersCredentials**](Members_credentials.md)> | | [optional] -**metadata** | Option<[**serde_json::Value**](.md)> | Arbitrary, object-encoded user's data. | [optional] -**status** | Option<**String**> | User Status | [optional] -**created_at** | Option<**String**> | Time when the group was created. | [optional] -**updated_at** | Option<**String**> | Time when the group was created. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/pkg/sdk/rust/docs/MembersCredentials.md b/pkg/sdk/rust/docs/MembersCredentials.md deleted file mode 100644 index e3669de6..00000000 --- a/pkg/sdk/rust/docs/MembersCredentials.md +++ /dev/null @@ -1,12 +0,0 @@ -# MembersCredentials - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**username** | Option<**String**> | User's username. | [optional] -**secret** | Option<**String**> | User secret password. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/pkg/sdk/rust/docs/MembersPage.md b/pkg/sdk/rust/docs/MembersPage.md deleted file mode 100644 index 66f13666..00000000 --- a/pkg/sdk/rust/docs/MembersPage.md +++ /dev/null @@ -1,14 +0,0 @@ -# MembersPage - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**members** | [**Vec**](Members.md) | | -**total** | **i32** | Total number of items. | -**offset** | Option<**i32**> | Number of items to skip during retrieval. | [optional] -**limit** | Option<**i32**> | Maximum number of items to return in one page. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/pkg/sdk/rust/docs/RequestPasswordResetRequest.md b/pkg/sdk/rust/docs/RequestPasswordResetRequest.md deleted file mode 100644 index bc5a0c83..00000000 --- a/pkg/sdk/rust/docs/RequestPasswordResetRequest.md +++ /dev/null @@ -1,12 +0,0 @@ -# RequestPasswordResetRequest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**email** | Option<**String**> | User email. | [optional] -**host** | Option<**String**> | Email host. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/pkg/sdk/rust/docs/ResetPasswordRequest.md b/pkg/sdk/rust/docs/ResetPasswordRequest.md deleted file mode 100644 index 976524fb..00000000 --- a/pkg/sdk/rust/docs/ResetPasswordRequest.md +++ /dev/null @@ -1,13 +0,0 @@ -# ResetPasswordRequest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**password** | Option<**String**> | New password. | [optional] -**confirm_password** | Option<**String**> | New confirmation password. | [optional] -**token** | Option<**String**> | Reset token generated and sent in email. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/pkg/sdk/rust/docs/User.md b/pkg/sdk/rust/docs/User.md deleted file mode 100644 index 58b9da37..00000000 --- a/pkg/sdk/rust/docs/User.md +++ /dev/null @@ -1,21 +0,0 @@ -# User - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | User unique identifier. | [optional] -**first_name** | Option<**String**> | User's first name. | [optional] -**last_name** | Option<**String**> | User's last name. | [optional] -**tags** | Option<**Vec**> | User tags. | [optional] -**email** | Option<**String**> | User email for example email address. | [optional] -**credentials** | Option<[**models::UserCredentials**](User_credentials.md)> | | [optional] -**metadata** | Option<[**serde_json::Value**](.md)> | Arbitrary, object-encoded user's data. | [optional] -**profile_picture** | Option<**String**> | User's profile picture URL that is represented as a string. | [optional] -**status** | Option<**String**> | User Status | [optional] -**created_at** | Option<**String**> | Time when the group was created. | [optional] -**updated_at** | Option<**String**> | Time when the group was created. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/pkg/sdk/rust/docs/UserCredentials.md b/pkg/sdk/rust/docs/UserCredentials.md deleted file mode 100644 index 036c8628..00000000 --- a/pkg/sdk/rust/docs/UserCredentials.md +++ /dev/null @@ -1,11 +0,0 @@ -# UserCredentials - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**username** | Option<**String**> | User's username for example john_doe for Mr John Doe. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/pkg/sdk/rust/docs/UserProfilePicture.md b/pkg/sdk/rust/docs/UserProfilePicture.md deleted file mode 100644 index 099e08c4..00000000 --- a/pkg/sdk/rust/docs/UserProfilePicture.md +++ /dev/null @@ -1,11 +0,0 @@ -# UserProfilePicture - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**profile_picture** | **String** | User's profile picture URL that is represented as a string. | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/pkg/sdk/rust/docs/UserReqObj.md b/pkg/sdk/rust/docs/UserReqObj.md deleted file mode 100644 index 0232c189..00000000 --- a/pkg/sdk/rust/docs/UserReqObj.md +++ /dev/null @@ -1,18 +0,0 @@ -# UserReqObj - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**first_name** | Option<**String**> | User's first name. | [optional] -**last_name** | Option<**String**> | User's last name. | [optional] -**email** | Option<**String**> | User's email address will be used as its unique identifier. | [optional] -**tags** | Option<**Vec**> | User tags. | [optional] -**credentials** | [**models::UserReqObjCredentials**](UserReqObj_credentials.md) | | -**metadata** | Option<[**serde_json::Value**](.md)> | Arbitrary, object-encoded user's data. | [optional] -**profile_picture** | Option<**String**> | User's profile picture URL that is represented as a string. | [optional] -**status** | Option<**String**> | User Status | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/pkg/sdk/rust/docs/UserReqObjCredentials.md b/pkg/sdk/rust/docs/UserReqObjCredentials.md deleted file mode 100644 index d8cfcdcb..00000000 --- a/pkg/sdk/rust/docs/UserReqObjCredentials.md +++ /dev/null @@ -1,12 +0,0 @@ -# UserReqObjCredentials - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**username** | Option<**String**> | User's username for example 'admin' will be used as its unique identifier. | [optional] -**secret** | Option<**String**> | Free-form account secret used for acquiring auth token(s). | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/pkg/sdk/rust/docs/UserRole.md b/pkg/sdk/rust/docs/UserRole.md deleted file mode 100644 index 7aabe1e1..00000000 --- a/pkg/sdk/rust/docs/UserRole.md +++ /dev/null @@ -1,11 +0,0 @@ -# UserRole - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**role** | **String** | User role example. | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/pkg/sdk/rust/docs/UserSecret.md b/pkg/sdk/rust/docs/UserSecret.md deleted file mode 100644 index 830c8115..00000000 --- a/pkg/sdk/rust/docs/UserSecret.md +++ /dev/null @@ -1,12 +0,0 @@ -# UserSecret - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**old_secret** | **String** | Old user secret password. | -**new_secret** | **String** | New user secret password. | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/pkg/sdk/rust/docs/UserTags.md b/pkg/sdk/rust/docs/UserTags.md deleted file mode 100644 index dfabd374..00000000 --- a/pkg/sdk/rust/docs/UserTags.md +++ /dev/null @@ -1,11 +0,0 @@ -# UserTags - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**tags** | Option<**Vec**> | User tags. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/pkg/sdk/rust/docs/UserUpdate.md b/pkg/sdk/rust/docs/UserUpdate.md deleted file mode 100644 index 7bdef9fc..00000000 --- a/pkg/sdk/rust/docs/UserUpdate.md +++ /dev/null @@ -1,13 +0,0 @@ -# UserUpdate - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**first_name** | **String** | User's first name. | -**last_name** | **String** | User's last name. | -**metadata** | [**serde_json::Value**](.md) | Arbitrary, object-encoded user's data. | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/pkg/sdk/rust/docs/Username.md b/pkg/sdk/rust/docs/Username.md deleted file mode 100644 index 8efa755f..00000000 --- a/pkg/sdk/rust/docs/Username.md +++ /dev/null @@ -1,11 +0,0 @@ -# Username - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**username** | **String** | User's username for example 'admin' will be used as its unique identifier. | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/pkg/sdk/rust/docs/UsersApi.md b/pkg/sdk/rust/docs/UsersApi.md deleted file mode 100644 index 817d3305..00000000 --- a/pkg/sdk/rust/docs/UsersApi.md +++ /dev/null @@ -1,690 +0,0 @@ -# \UsersApi - -All URIs are relative to *http://localhost:9002* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**create_user**](UsersApi.md#create_user) | **POST** /users | Registers user account -[**disable_user**](UsersApi.md#disable_user) | **POST** /users/{userID}/disable | Disables a user -[**enable_user**](UsersApi.md#enable_user) | **POST** /users/{userID}/enable | Enables a user -[**get_profile**](UsersApi.md#get_profile) | **GET** /users/profile | Gets info on currently logged in user. -[**get_user**](UsersApi.md#get_user) | **GET** /users/{userID} | Retrieves a user -[**issue_token**](UsersApi.md#issue_token) | **POST** /users/tokens/issue | Issue Token -[**list_users**](UsersApi.md#list_users) | **GET** /users | List users -[**list_users_in_channel**](UsersApi.md#list_users_in_channel) | **GET** /{domainID}/channels/{channelID}/users | List users in a channel -[**list_users_in_group**](UsersApi.md#list_users_in_group) | **GET** /{domainID}/groups/{groupID}/users | List users in a group -[**refresh_token**](UsersApi.md#refresh_token) | **POST** /users/tokens/refresh | Refresh Token -[**request_password_reset**](UsersApi.md#request_password_reset) | **POST** /password/reset-request | User password reset request -[**reset_password**](UsersApi.md#reset_password) | **PUT** /password/reset | User password reset endpoint -[**search_users**](UsersApi.md#search_users) | **GET** /users/search | Search users -[**update_email**](UsersApi.md#update_email) | **PATCH** /users/{userID}/email | Updates email of the user. -[**update_profile_picture**](UsersApi.md#update_profile_picture) | **PATCH** /users/{userID}/picture | Updates the user's profile picture. -[**update_role**](UsersApi.md#update_role) | **PATCH** /users/{userID}/role | Updates the user's role. -[**update_secret**](UsersApi.md#update_secret) | **PATCH** /users/secret | Updates secret of currently logged in user. -[**update_tags**](UsersApi.md#update_tags) | **PATCH** /users/{userID}/tags | Updates tags of the user. -[**update_user**](UsersApi.md#update_user) | **PATCH** /users/{userID} | Updates first, last name and metadata of the user. -[**update_username**](UsersApi.md#update_username) | **PATCH** /users/{userID}/username | Updates user's username. -[**users_user_id_delete**](UsersApi.md#users_user_id_delete) | **DELETE** /users/{userID} | Delete a user - - - -## create_user - -> models::User create_user(user_req_obj) -Registers user account - -Registers new user account given email and password. New account will be uniquely identified by its email address. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**user_req_obj** | [**UserReqObj**](UserReqObj.md) | JSON-formatted document describing the new user to be registered | [required] | - -### Return type - -[**models::User**](User.md) - -### Authorization - -[refreshAuth](../README.md#refreshAuth), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## disable_user - -> models::User disable_user(user_id) -Disables a user - -Disables a specific user that is identifier by the user ID. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**user_id** | **uuid::Uuid** | Unique user identifier. | [required] | - -### Return type - -[**models::User**](User.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## enable_user - -> models::User enable_user(user_id) -Enables a user - -Enables a specific user that is identifier by the user ID. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**user_id** | **uuid::Uuid** | Unique user identifier. | [required] | - -### Return type - -[**models::User**](User.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## get_profile - -> models::User get_profile() -Gets info on currently logged in user. - -Gets info on currently logged in user. Info is obtained using authorization token - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -[**models::User**](User.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## get_user - -> models::User get_user(user_id) -Retrieves a user - -Retrieves a specific user that is identifier by the user ID. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**user_id** | **uuid::Uuid** | Unique user identifier. | [required] | - -### Return type - -[**models::User**](User.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## issue_token - -> models::IssueToken200Response issue_token(issue_token) -Issue Token - -Issue Access and Refresh Token used for authenticating into the system. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**issue_token** | [**IssueToken**](IssueToken.md) | Login credentials. | [required] | - -### Return type - -[**models::IssueToken200Response**](issueToken_200_response.md) - -### Authorization - -[refreshAuth](../README.md#refreshAuth), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## list_users - -> models::UsersPage list_users(limit, offset, metadata, status, first_name, last_name, username, email, tags) -List users - -Retrieves a list of users. Due to performance concerns, data is retrieved in subsets. The API must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**limit** | Option<**i32**> | Size of the subset to retrieve. | |[default to 10] -**offset** | Option<**i32**> | Number of items to skip during retrieval. | |[default to 0] -**metadata** | Option<**String**> | Metadata filter. Filtering is performed matching the parameter with metadata on top level. Parameter is json. | | -**status** | Option<**String**> | User account status. | |[default to enabled] -**first_name** | Option<**String**> | User's first name. | | -**last_name** | Option<**String**> | User's last name. | | -**username** | Option<**String**> | User's username. | | -**email** | Option<**String**> | User's email address. | | -**tags** | Option<[**Vec**](String.md)> | User tags. | | - -### Return type - -[**models::UsersPage**](UsersPage.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## list_users_in_channel - -> models::MembersPage list_users_in_channel(domain_id, channel_id, limit, offset, level, tree, metadata, name, parent_id) -List users in a channel - -Retrieves a list of users in a channel. Due to performance concerns, data is retrieved in subsets. The API must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**channel_id** | **uuid::Uuid** | Unique channel identifier. | [required] | -**limit** | Option<**i32**> | Size of the subset to retrieve. | |[default to 10] -**offset** | Option<**i32**> | Number of items to skip during retrieval. | |[default to 0] -**level** | Option<**i32**> | Level of hierarchy up to which to retrieve groups from given group id. | | -**tree** | Option<**bool**> | Specify type of response, JSON array or tree. | |[default to false] -**metadata** | Option<**String**> | Metadata filter. Filtering is performed matching the parameter with metadata on top level. Parameter is json. | | -**name** | Option<**String**> | Channel's name. | | -**parent_id** | Option<**uuid::Uuid**> | Unique parent identifier for a group. | | - -### Return type - -[**models::MembersPage**](MembersPage.md) - -### Authorization - -[refreshAuth](../README.md#refreshAuth), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## list_users_in_group - -> models::MembersPage list_users_in_group(domain_id, group_id, limit, offset, level, tree, metadata, name, parent_id) -List users in a group - -Retrieves a list of users in a group. Due to performance concerns, data is retrieved in subsets. The API must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**group_id** | **uuid::Uuid** | Unique group identifier. | [required] | -**limit** | Option<**i32**> | Size of the subset to retrieve. | |[default to 10] -**offset** | Option<**i32**> | Number of items to skip during retrieval. | |[default to 0] -**level** | Option<**i32**> | Level of hierarchy up to which to retrieve groups from given group id. | | -**tree** | Option<**bool**> | Specify type of response, JSON array or tree. | |[default to false] -**metadata** | Option<**String**> | Metadata filter. Filtering is performed matching the parameter with metadata on top level. Parameter is json. | | -**name** | Option<**String**> | Group's name. | | -**parent_id** | Option<**uuid::Uuid**> | Unique parent identifier for a group. | | - -### Return type - -[**models::MembersPage**](MembersPage.md) - -### Authorization - -[refreshAuth](../README.md#refreshAuth), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## refresh_token - -> models::IssueToken200Response refresh_token() -Refresh Token - -Refreshes Access and Refresh Token used for authenticating into the system. - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -[**models::IssueToken200Response**](issueToken_200_response.md) - -### Authorization - -[refreshAuth](../README.md#refreshAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## request_password_reset - -> request_password_reset(referer, request_password_reset_request) -User password reset request - -Generates a reset token and sends and email with link for resetting password. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**referer** | **String** | Host being sent by browser. | [required] | -**request_password_reset_request** | [**RequestPasswordResetRequest**](RequestPasswordResetRequest.md) | Initiate password request procedure. | [required] | - -### Return type - - (empty response body) - -### Authorization - -[refreshAuth](../README.md#refreshAuth), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## reset_password - -> reset_password(reset_password_request) -User password reset endpoint - -When user gets reset token, after he submitted email to `/password/reset-request`, posting a new password along to this endpoint will change password. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**reset_password_request** | Option<[**ResetPasswordRequest**](ResetPasswordRequest.md)> | Password reset request data, new password and token that is appended on password reset link received in email. | | - -### Return type - - (empty response body) - -### Authorization - -[refreshAuth](../README.md#refreshAuth), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## search_users - -> models::UsersPage search_users(user_id, limit, offset, username, first_name, last_name, email) -Search users - -Search users by name and identity. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**user_id** | **uuid::Uuid** | Unique user identifier. | [required] | -**limit** | Option<**i32**> | Size of the subset to retrieve. | |[default to 10] -**offset** | Option<**i32**> | Number of items to skip during retrieval. | |[default to 0] -**username** | Option<**String**> | User's username. | | -**first_name** | Option<**String**> | User's first name. | | -**last_name** | Option<**String**> | User's last name. | | -**email** | Option<**String**> | User's email address. | | - -### Return type - -[**models::UsersPage**](UsersPage.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## update_email - -> models::User update_email(user_id, email) -Updates email of the user. - -Updates email of the user with provided ID. Email is updated using authorization token and the new received email. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**user_id** | **uuid::Uuid** | Unique user identifier. | [required] | -**email** | [**Email**](Email.md) | Email change data. User can change its email. | [required] | - -### Return type - -[**models::User**](User.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## update_profile_picture - -> models::User update_profile_picture(user_id, user_profile_picture) -Updates the user's profile picture. - -Updates the user's profile picture with provided ID. Profile picture is updated using authorization token and the new received picture. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**user_id** | **uuid::Uuid** | Unique user identifier. | [required] | -**user_profile_picture** | [**UserProfilePicture**](UserProfilePicture.md) | JSON-formated document describing the profile picture of user to be update | [required] | - -### Return type - -[**models::User**](User.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## update_role - -> models::User update_role(user_id, user_role) -Updates the user's role. - -Updates role for the user with provided ID. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**user_id** | **uuid::Uuid** | Unique user identifier. | [required] | -**user_role** | [**UserRole**](UserRole.md) | JSON-formated document describing the role of the user to be updated | [required] | - -### Return type - -[**models::User**](User.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## update_secret - -> models::User update_secret(user_secret) -Updates secret of currently logged in user. - -Updates secret of currently logged in user. Secret is updated using authorization token and the new received info. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**user_secret** | [**UserSecret**](UserSecret.md) | Secret change data. User can change its secret. | [required] | - -### Return type - -[**models::User**](User.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## update_tags - -> models::User update_tags(user_id, user_tags) -Updates tags of the user. - -Updates tags of the user with provided ID. Tags is updated using authorization token and the new tags received in request. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**user_id** | **uuid::Uuid** | Unique user identifier. | [required] | -**user_tags** | [**UserTags**](UserTags.md) | JSON-formated document describing the tags of user to be update | [required] | - -### Return type - -[**models::User**](User.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## update_user - -> models::User update_user(user_id, user_update) -Updates first, last name and metadata of the user. - -Updates name and metadata of the user with provided ID. Name and metadata is updated using authorization token and the new received info. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**user_id** | **uuid::Uuid** | Unique user identifier. | [required] | -**user_update** | [**UserUpdate**](UserUpdate.md) | JSON-formated document describing the metadata and name of user to be update | [required] | - -### Return type - -[**models::User**](User.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## update_username - -> models::User update_username(user_id, username) -Updates user's username. - -Updates username of the user with provided ID. Username is updated using authorization token and the new received username. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**user_id** | **uuid::Uuid** | Unique user identifier. | [required] | -**username** | [**Username**](Username.md) | JSON-formated document describing the username of the user to be updated | [required] | - -### Return type - -[**models::User**](User.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## users_user_id_delete - -> users_user_id_delete(user_id) -Delete a user - -Delete a specific user that is identifier by the user ID. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**user_id** | **uuid::Uuid** | Unique user identifier. | [required] | - -### Return type - - (empty response body) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/pkg/sdk/rust/docs/UsersPage.md b/pkg/sdk/rust/docs/UsersPage.md deleted file mode 100644 index d46bd1a5..00000000 --- a/pkg/sdk/rust/docs/UsersPage.md +++ /dev/null @@ -1,14 +0,0 @@ -# UsersPage - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**users** | [**Vec**](User.md) | | -**total** | **i32** | Total number of items. | -**offset** | **i32** | Number of items to skip during retrieval. | -**limit** | Option<**i32**> | Maximum number of items to return in one page. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/pkg/sdk/rust/git_push.sh b/pkg/sdk/rust/git_push.sh deleted file mode 100644 index f53a75d4..00000000 --- a/pkg/sdk/rust/git_push.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 -git_host=$4 - -if [ "$git_host" = "" ]; then - git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" -fi - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' diff --git a/pkg/sdk/rust/src/apis/configuration.rs b/pkg/sdk/rust/src/apis/configuration.rs deleted file mode 100644 index 013c81a5..00000000 --- a/pkg/sdk/rust/src/apis/configuration.rs +++ /dev/null @@ -1,51 +0,0 @@ -/* - * SuperMQ Users Service - * - * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.14.0 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - - - -#[derive(Debug, Clone)] -pub struct Configuration { - pub base_path: String, - pub user_agent: Option, - pub client: reqwest::Client, - pub basic_auth: Option, - pub oauth_access_token: Option, - pub bearer_access_token: Option, - pub api_key: Option, -} - -pub type BasicAuth = (String, Option); - -#[derive(Debug, Clone)] -pub struct ApiKey { - pub prefix: Option, - pub key: String, -} - - -impl Configuration { - pub fn new() -> Configuration { - Configuration::default() - } -} - -impl Default for Configuration { - fn default() -> Self { - Configuration { - base_path: "http://localhost:9002".to_owned(), - user_agent: Some("OpenAPI-Generator/0.14.0/rust".to_owned()), - client: reqwest::Client::new(), - basic_auth: None, - oauth_access_token: None, - bearer_access_token: None, - api_key: None, - } - } -} diff --git a/pkg/sdk/rust/src/apis/domains_api.rs b/pkg/sdk/rust/src/apis/domains_api.rs deleted file mode 100644 index 75fe0072..00000000 --- a/pkg/sdk/rust/src/apis/domains_api.rs +++ /dev/null @@ -1,74 +0,0 @@ -/* - * SuperMQ Users Service - * - * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.14.0 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - - -use reqwest; -use serde::{Deserialize, Serialize}; -use crate::{apis::ResponseContent, models}; -use super::{Error, configuration}; - - -/// struct for typed errors of method [`domain_id_users_get`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum DomainIdUsersGetError { - Status400(), - Status401(), - Status403(), - Status404(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - - -/// List users assigned to domain that is identified by the domain ID. -pub async fn domain_id_users_get(configuration: &configuration::Configuration, domain_id: &str, limit: Option, offset: Option, metadata: Option<&str>, status: Option<&str>) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/{domainID}/users", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); - - if let Some(ref local_var_str) = limit { - local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); - } - if let Some(ref local_var_str) = offset { - local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); - } - if let Some(ref local_var_str) = metadata { - local_var_req_builder = local_var_req_builder.query(&[("metadata", &local_var_str.to_string())]); - } - if let Some(ref local_var_str) = status { - local_var_req_builder = local_var_req_builder.query(&[("status", &local_var_str.to_string())]); - } - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - diff --git a/pkg/sdk/rust/src/apis/groups_api.rs b/pkg/sdk/rust/src/apis/groups_api.rs deleted file mode 100644 index 15c9f58d..00000000 --- a/pkg/sdk/rust/src/apis/groups_api.rs +++ /dev/null @@ -1,702 +0,0 @@ -/* - * SuperMQ Users Service - * - * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.14.0 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - - -use reqwest; -use serde::{Deserialize, Serialize}; -use crate::{apis::ResponseContent, models}; -use super::{Error, configuration}; - - -/// struct for typed errors of method [`assign_user`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AssignUserError { - Status400(), - Status401(), - Status403(), - Status404(), - Status415(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`create_group`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CreateGroupError { - Status400(), - Status401(), - Status403(), - Status404(), - Status409(), - Status415(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`disable_group`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum DisableGroupError { - Status400(), - Status401(), - Status403(), - Status404(), - Status409(), - Status415(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`domain_id_groups_group_id_delete`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum DomainIdGroupsGroupIdDeleteError { - Status400(), - Status401(), - Status403(), - Status404(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`enable_group`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EnableGroupError { - Status400(), - Status401(), - Status403(), - Status404(), - Status409(), - Status415(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`get_group`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum GetGroupError { - Status400(), - Status401(), - Status403(), - Status404(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`list_children`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ListChildrenError { - Status400(), - Status401(), - Status403(), - Status404(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`list_groups`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ListGroupsError { - Status400(), - Status401(), - Status403(), - Status404(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`list_groups_by_user`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ListGroupsByUserError { - Status400(), - Status401(), - Status403(), - Status404(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`list_groups_in_channel`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ListGroupsInChannelError { - Status400(), - Status401(), - Status403(), - Status404(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`list_parents`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ListParentsError { - Status400(), - Status401(), - Status403(), - Status404(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`unassign_user`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UnassignUserError { - Status400(), - Status401(), - Status403(), - Status404(), - Status415(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`update_group`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UpdateGroupError { - Status400(), - Status401(), - Status403(), - Status404(), - Status409(), - Status415(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - - -/// Assigns a specific user to a group that is identifier by the group ID. -pub async fn assign_user(configuration: &configuration::Configuration, domain_id: &str, group_id: &str, assign_user_req_obj: models::AssignUserReqObj) -> Result<(), Error> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}/users/assign", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - local_var_req_builder = local_var_req_builder.json(&assign_user_req_obj); - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - Ok(()) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Creates new group that can be used for grouping entities. New account will be uniquely identified by its identity. -pub async fn create_group(configuration: &configuration::Configuration, domain_id: &str, group_req_obj: models::GroupReqObj) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/{domainID}/groups", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - local_var_req_builder = local_var_req_builder.json(&group_req_obj); - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Disables a specific group that is identifier by the group ID. -pub async fn disable_group(configuration: &configuration::Configuration, domain_id: &str, group_id: &str) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}/disable", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Delete group removes a group with the given id from repo and removes all the policies related to this group. -pub async fn domain_id_groups_group_id_delete(configuration: &configuration::Configuration, domain_id: &str, group_id: &str) -> Result<(), Error> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - Ok(()) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Enables a specific group that is identifier by the group ID. -pub async fn enable_group(configuration: &configuration::Configuration, domain_id: &str, group_id: &str) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}/enable", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Gets info on a group specified by id. -pub async fn get_group(configuration: &configuration::Configuration, domain_id: &str, group_id: &str) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Lists groups up to a max level of hierarchy that can be fetched in one request ( max level = 5). Result can be filtered by metadata. Groups will be returned as JSON array or JSON tree. Due to performance concerns, result is returned in subsets. -pub async fn list_children(configuration: &configuration::Configuration, domain_id: &str, group_id: &str, limit: Option, offset: Option, level: Option, tree: Option, metadata: Option<&str>, name: Option<&str>, parent_id: Option<&str>) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}/children", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); - - if let Some(ref local_var_str) = limit { - local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); - } - if let Some(ref local_var_str) = offset { - local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); - } - if let Some(ref local_var_str) = level { - local_var_req_builder = local_var_req_builder.query(&[("level", &local_var_str.to_string())]); - } - if let Some(ref local_var_str) = tree { - local_var_req_builder = local_var_req_builder.query(&[("tree", &local_var_str.to_string())]); - } - if let Some(ref local_var_str) = metadata { - local_var_req_builder = local_var_req_builder.query(&[("metadata", &local_var_str.to_string())]); - } - if let Some(ref local_var_str) = name { - local_var_req_builder = local_var_req_builder.query(&[("name", &local_var_str.to_string())]); - } - if let Some(ref local_var_str) = parent_id { - local_var_req_builder = local_var_req_builder.query(&[("parentID", &local_var_str.to_string())]); - } - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Lists groups up to a max level of hierarchy that can be fetched in one request ( max level = 5). Result can be filtered by metadata. Groups will be returned as JSON array or JSON tree. Due to performance concerns, result is returned in subsets. -pub async fn list_groups(configuration: &configuration::Configuration, domain_id: &str, limit: Option, offset: Option, level: Option, tree: Option, metadata: Option<&str>, name: Option<&str>, parent_id: Option<&str>) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/{domainID}/groups", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); - - if let Some(ref local_var_str) = limit { - local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); - } - if let Some(ref local_var_str) = offset { - local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); - } - if let Some(ref local_var_str) = level { - local_var_req_builder = local_var_req_builder.query(&[("level", &local_var_str.to_string())]); - } - if let Some(ref local_var_str) = tree { - local_var_req_builder = local_var_req_builder.query(&[("tree", &local_var_str.to_string())]); - } - if let Some(ref local_var_str) = metadata { - local_var_req_builder = local_var_req_builder.query(&[("metadata", &local_var_str.to_string())]); - } - if let Some(ref local_var_str) = name { - local_var_req_builder = local_var_req_builder.query(&[("name", &local_var_str.to_string())]); - } - if let Some(ref local_var_str) = parent_id { - local_var_req_builder = local_var_req_builder.query(&[("parentID", &local_var_str.to_string())]); - } - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Gets groups associated with the user member specified by id. -pub async fn list_groups_by_user(configuration: &configuration::Configuration, domain_id: &str, member_id: &str, limit: Option, offset: Option, metadata: Option<&str>, status: Option<&str>, tags: Option>) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/{domainID}/users/{memberID}/groups", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), memberID=crate::apis::urlencode(member_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); - - if let Some(ref local_var_str) = limit { - local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); - } - if let Some(ref local_var_str) = offset { - local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); - } - if let Some(ref local_var_str) = metadata { - local_var_req_builder = local_var_req_builder.query(&[("metadata", &local_var_str.to_string())]); - } - if let Some(ref local_var_str) = status { - local_var_req_builder = local_var_req_builder.query(&[("status", &local_var_str.to_string())]); - } - if let Some(ref local_var_str) = tags { - local_var_req_builder = match "multi" { - "multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("tags".to_owned(), p.to_string())).collect::>()), - _ => local_var_req_builder.query(&[("tags", &local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), - }; - } - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Gets groups associated with the channel member specified by id. -pub async fn list_groups_in_channel(configuration: &configuration::Configuration, domain_id: &str, member_id: &str, limit: Option, offset: Option, metadata: Option<&str>, status: Option<&str>, tags: Option>) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/{domainID}/channels/{memberID}/groups", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), memberID=crate::apis::urlencode(member_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); - - if let Some(ref local_var_str) = limit { - local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); - } - if let Some(ref local_var_str) = offset { - local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); - } - if let Some(ref local_var_str) = metadata { - local_var_req_builder = local_var_req_builder.query(&[("metadata", &local_var_str.to_string())]); - } - if let Some(ref local_var_str) = status { - local_var_req_builder = local_var_req_builder.query(&[("status", &local_var_str.to_string())]); - } - if let Some(ref local_var_str) = tags { - local_var_req_builder = match "multi" { - "multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("tags".to_owned(), p.to_string())).collect::>()), - _ => local_var_req_builder.query(&[("tags", &local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), - }; - } - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Lists groups up to a max level of hierarchy that can be fetched in one request ( max level = 5). Result can be filtered by metadata. Groups will be returned as JSON array or JSON tree. Due to performance concerns, result is returned in subsets. -pub async fn list_parents(configuration: &configuration::Configuration, domain_id: &str, group_id: &str, limit: Option, offset: Option, level: Option, tree: Option, metadata: Option<&str>, name: Option<&str>, parent_id: Option<&str>) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}/parents", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); - - if let Some(ref local_var_str) = limit { - local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); - } - if let Some(ref local_var_str) = offset { - local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); - } - if let Some(ref local_var_str) = level { - local_var_req_builder = local_var_req_builder.query(&[("level", &local_var_str.to_string())]); - } - if let Some(ref local_var_str) = tree { - local_var_req_builder = local_var_req_builder.query(&[("tree", &local_var_str.to_string())]); - } - if let Some(ref local_var_str) = metadata { - local_var_req_builder = local_var_req_builder.query(&[("metadata", &local_var_str.to_string())]); - } - if let Some(ref local_var_str) = name { - local_var_req_builder = local_var_req_builder.query(&[("name", &local_var_str.to_string())]); - } - if let Some(ref local_var_str) = parent_id { - local_var_req_builder = local_var_req_builder.query(&[("parentID", &local_var_str.to_string())]); - } - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Unassigns a specific user to a group that is identifier by the group ID. -pub async fn unassign_user(configuration: &configuration::Configuration, domain_id: &str, group_id: &str, assign_user_req_obj: models::AssignUserReqObj) -> Result<(), Error> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}/users/unassign", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - local_var_req_builder = local_var_req_builder.json(&assign_user_req_obj); - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - Ok(()) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Updates Name, Description or Metadata of a group. -pub async fn update_group(configuration: &configuration::Configuration, domain_id: &str, group_id: &str, group_update: models::GroupUpdate) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - local_var_req_builder = local_var_req_builder.json(&group_update); - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - diff --git a/pkg/sdk/rust/src/apis/health_api.rs b/pkg/sdk/rust/src/apis/health_api.rs deleted file mode 100644 index 971f546f..00000000 --- a/pkg/sdk/rust/src/apis/health_api.rs +++ /dev/null @@ -1,53 +0,0 @@ -/* - * SuperMQ Users Service - * - * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.14.0 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - - -use reqwest; -use serde::{Deserialize, Serialize}; -use crate::{apis::ResponseContent, models}; -use super::{Error, configuration}; - - -/// struct for typed errors of method [`health`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum HealthError { - Status500(models::Error), - UnknownValue(serde_json::Value), -} - - -pub async fn health(configuration: &configuration::Configuration, ) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/health", local_var_configuration.base_path); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - diff --git a/pkg/sdk/rust/src/apis/mod.rs b/pkg/sdk/rust/src/apis/mod.rs deleted file mode 100644 index 6b956321..00000000 --- a/pkg/sdk/rust/src/apis/mod.rs +++ /dev/null @@ -1,99 +0,0 @@ -use std::error; -use std::fmt; - -#[derive(Debug, Clone)] -pub struct ResponseContent { - pub status: reqwest::StatusCode, - pub content: String, - pub entity: Option, -} - -#[derive(Debug)] -pub enum Error { - Reqwest(reqwest::Error), - Serde(serde_json::Error), - Io(std::io::Error), - ResponseError(ResponseContent), -} - -impl fmt::Display for Error { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - let (module, e) = match self { - Error::Reqwest(e) => ("reqwest", e.to_string()), - Error::Serde(e) => ("serde", e.to_string()), - Error::Io(e) => ("IO", e.to_string()), - Error::ResponseError(e) => ("response", format!("status code {}", e.status)), - }; - write!(f, "error in {}: {}", module, e) - } -} - -impl error::Error for Error { - fn source(&self) -> Option<&(dyn error::Error + 'static)> { - Some(match self { - Error::Reqwest(e) => e, - Error::Serde(e) => e, - Error::Io(e) => e, - Error::ResponseError(_) => return None, - }) - } -} - -impl From for Error { - fn from(e: reqwest::Error) -> Self { - Error::Reqwest(e) - } -} - -impl From for Error { - fn from(e: serde_json::Error) -> Self { - Error::Serde(e) - } -} - -impl From for Error { - fn from(e: std::io::Error) -> Self { - Error::Io(e) - } -} - -pub fn urlencode>(s: T) -> String { - ::url::form_urlencoded::byte_serialize(s.as_ref().as_bytes()).collect() -} - -pub fn parse_deep_object(prefix: &str, value: &serde_json::Value) -> Vec<(String, String)> { - if let serde_json::Value::Object(object) = value { - let mut params = vec![]; - - for (key, value) in object { - match value { - serde_json::Value::Object(_) => params.append(&mut parse_deep_object( - &format!("{}[{}]", prefix, key), - value, - )), - serde_json::Value::Array(array) => { - for (i, value) in array.iter().enumerate() { - params.append(&mut parse_deep_object( - &format!("{}[{}][{}]", prefix, key, i), - value, - )); - } - }, - serde_json::Value::String(s) => params.push((format!("{}[{}]", prefix, key), s.clone())), - _ => params.push((format!("{}[{}]", prefix, key), value.to_string())), - } - } - - return params; - } - - unimplemented!("Only objects are supported with style=deepObject") -} - -pub mod domains_api; -pub mod groups_api; -pub mod health_api; -pub mod users_api; - -pub mod configuration; -pub use self::configuration::Configuration; diff --git a/pkg/sdk/rust/src/apis/users_api.rs b/pkg/sdk/rust/src/apis/users_api.rs deleted file mode 100644 index 43a1e4d3..00000000 --- a/pkg/sdk/rust/src/apis/users_api.rs +++ /dev/null @@ -1,1067 +0,0 @@ -/* - * SuperMQ Users Service - * - * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.14.0 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - - -use reqwest; -use serde::{Deserialize, Serialize}; -use crate::{apis::ResponseContent, models}; -use super::{Error, configuration}; - - -/// struct for typed errors of method [`create_user`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CreateUserError { - Status400(), - Status401(), - Status403(), - Status409(), - Status415(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`disable_user`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum DisableUserError { - Status400(), - Status401(), - Status403(), - Status404(), - Status409(), - Status415(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`enable_user`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EnableUserError { - Status400(), - Status401(), - Status403(), - Status404(), - Status409(), - Status415(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`get_profile`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum GetProfileError { - Status400(), - Status401(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`get_user`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum GetUserError { - Status400(), - Status401(), - Status404(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`issue_token`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum IssueTokenError { - Status400(), - Status401(), - Status404(), - Status415(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`list_users`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ListUsersError { - Status400(), - Status401(), - Status404(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`list_users_in_channel`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ListUsersInChannelError { - Status400(), - Status401(), - Status403(), - Status404(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`list_users_in_group`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ListUsersInGroupError { - Status400(), - Status401(), - Status403(), - Status404(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`refresh_token`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RefreshTokenError { - Status400(), - Status401(), - Status404(), - Status415(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`request_password_reset`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RequestPasswordResetError { - Status400(), - Status404(), - Status415(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`reset_password`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ResetPasswordError { - Status400(), - Status401(), - Status404(), - Status415(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`search_users`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SearchUsersError { - Status400(), - Status401(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`update_email`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UpdateEmailError { - Status400(), - Status403(), - Status404(), - Status401(), - Status409(), - Status415(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`update_profile_picture`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UpdateProfilePictureError { - Status400(), - Status403(), - Status404(), - Status401(), - Status415(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`update_role`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UpdateRoleError { - Status400(), - Status403(), - Status404(), - Status401(), - Status415(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`update_secret`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UpdateSecretError { - Status400(), - Status401(), - Status404(), - Status415(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`update_tags`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UpdateTagsError { - Status400(), - Status403(), - Status404(), - Status401(), - Status415(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`update_user`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UpdateUserError { - Status400(), - Status403(), - Status404(), - Status401(), - Status409(), - Status415(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`update_username`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UpdateUsernameError { - Status400(), - Status403(), - Status404(), - Status401(), - Status409(), - Status415(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`users_user_id_delete`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UsersUserIdDeleteError { - Status400(), - Status401(), - Status404(), - Status405(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - - -/// Registers new user account given email and password. New account will be uniquely identified by its email address. -pub async fn create_user(configuration: &configuration::Configuration, user_req_obj: models::UserReqObj) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/users", local_var_configuration.base_path); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - local_var_req_builder = local_var_req_builder.json(&user_req_obj); - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Disables a specific user that is identifier by the user ID. -pub async fn disable_user(configuration: &configuration::Configuration, user_id: &str) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/users/{userID}/disable", local_var_configuration.base_path, userID=crate::apis::urlencode(user_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Enables a specific user that is identifier by the user ID. -pub async fn enable_user(configuration: &configuration::Configuration, user_id: &str) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/users/{userID}/enable", local_var_configuration.base_path, userID=crate::apis::urlencode(user_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Gets info on currently logged in user. Info is obtained using authorization token -pub async fn get_profile(configuration: &configuration::Configuration, ) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/users/profile", local_var_configuration.base_path); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Retrieves a specific user that is identifier by the user ID. -pub async fn get_user(configuration: &configuration::Configuration, user_id: &str) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/users/{userID}", local_var_configuration.base_path, userID=crate::apis::urlencode(user_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Issue Access and Refresh Token used for authenticating into the system. -pub async fn issue_token(configuration: &configuration::Configuration, issue_token: models::IssueToken) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/users/tokens/issue", local_var_configuration.base_path); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - local_var_req_builder = local_var_req_builder.json(&issue_token); - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Retrieves a list of users. Due to performance concerns, data is retrieved in subsets. The API must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. -pub async fn list_users(configuration: &configuration::Configuration, limit: Option, offset: Option, metadata: Option<&str>, status: Option<&str>, first_name: Option<&str>, last_name: Option<&str>, username: Option<&str>, email: Option<&str>, tags: Option>) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/users", local_var_configuration.base_path); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); - - if let Some(ref local_var_str) = limit { - local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); - } - if let Some(ref local_var_str) = offset { - local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); - } - if let Some(ref local_var_str) = metadata { - local_var_req_builder = local_var_req_builder.query(&[("metadata", &local_var_str.to_string())]); - } - if let Some(ref local_var_str) = status { - local_var_req_builder = local_var_req_builder.query(&[("status", &local_var_str.to_string())]); - } - if let Some(ref local_var_str) = first_name { - local_var_req_builder = local_var_req_builder.query(&[("first_name", &local_var_str.to_string())]); - } - if let Some(ref local_var_str) = last_name { - local_var_req_builder = local_var_req_builder.query(&[("last_name", &local_var_str.to_string())]); - } - if let Some(ref local_var_str) = username { - local_var_req_builder = local_var_req_builder.query(&[("username", &local_var_str.to_string())]); - } - if let Some(ref local_var_str) = email { - local_var_req_builder = local_var_req_builder.query(&[("email", &local_var_str.to_string())]); - } - if let Some(ref local_var_str) = tags { - local_var_req_builder = match "multi" { - "multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("tags".to_owned(), p.to_string())).collect::>()), - _ => local_var_req_builder.query(&[("tags", &local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), - }; - } - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Retrieves a list of users in a channel. Due to performance concerns, data is retrieved in subsets. The API must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. -pub async fn list_users_in_channel(configuration: &configuration::Configuration, domain_id: &str, channel_id: &str, limit: Option, offset: Option, level: Option, tree: Option, metadata: Option<&str>, name: Option<&str>, parent_id: Option<&str>) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/{domainID}/channels/{channelID}/users", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), channelID=crate::apis::urlencode(channel_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); - - if let Some(ref local_var_str) = limit { - local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); - } - if let Some(ref local_var_str) = offset { - local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); - } - if let Some(ref local_var_str) = level { - local_var_req_builder = local_var_req_builder.query(&[("level", &local_var_str.to_string())]); - } - if let Some(ref local_var_str) = tree { - local_var_req_builder = local_var_req_builder.query(&[("tree", &local_var_str.to_string())]); - } - if let Some(ref local_var_str) = metadata { - local_var_req_builder = local_var_req_builder.query(&[("metadata", &local_var_str.to_string())]); - } - if let Some(ref local_var_str) = name { - local_var_req_builder = local_var_req_builder.query(&[("name", &local_var_str.to_string())]); - } - if let Some(ref local_var_str) = parent_id { - local_var_req_builder = local_var_req_builder.query(&[("parentID", &local_var_str.to_string())]); - } - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Retrieves a list of users in a group. Due to performance concerns, data is retrieved in subsets. The API must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. -pub async fn list_users_in_group(configuration: &configuration::Configuration, domain_id: &str, group_id: &str, limit: Option, offset: Option, level: Option, tree: Option, metadata: Option<&str>, name: Option<&str>, parent_id: Option<&str>) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}/users", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); - - if let Some(ref local_var_str) = limit { - local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); - } - if let Some(ref local_var_str) = offset { - local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); - } - if let Some(ref local_var_str) = level { - local_var_req_builder = local_var_req_builder.query(&[("level", &local_var_str.to_string())]); - } - if let Some(ref local_var_str) = tree { - local_var_req_builder = local_var_req_builder.query(&[("tree", &local_var_str.to_string())]); - } - if let Some(ref local_var_str) = metadata { - local_var_req_builder = local_var_req_builder.query(&[("metadata", &local_var_str.to_string())]); - } - if let Some(ref local_var_str) = name { - local_var_req_builder = local_var_req_builder.query(&[("name", &local_var_str.to_string())]); - } - if let Some(ref local_var_str) = parent_id { - local_var_req_builder = local_var_req_builder.query(&[("parentID", &local_var_str.to_string())]); - } - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Refreshes Access and Refresh Token used for authenticating into the system. -pub async fn refresh_token(configuration: &configuration::Configuration, ) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/users/tokens/refresh", local_var_configuration.base_path); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Generates a reset token and sends and email with link for resetting password. -pub async fn request_password_reset(configuration: &configuration::Configuration, referer: &str, request_password_reset_request: models::RequestPasswordResetRequest) -> Result<(), Error> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/password/reset-request", local_var_configuration.base_path); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - local_var_req_builder = local_var_req_builder.header("Referer", referer.to_string()); - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - local_var_req_builder = local_var_req_builder.json(&request_password_reset_request); - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - Ok(()) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// When user gets reset token, after he submitted email to `/password/reset-request`, posting a new password along to this endpoint will change password. -pub async fn reset_password(configuration: &configuration::Configuration, reset_password_request: Option) -> Result<(), Error> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/password/reset", local_var_configuration.base_path); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - local_var_req_builder = local_var_req_builder.json(&reset_password_request); - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - Ok(()) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -// /// Search users by name and identity. -// pub async fn search_users(configuration: &configuration::Configuration, user_id: &str, limit: Option, offset: Option, username: Option<&str>, first_name: Option<&str>, last_name: Option<&str>, email: Option<&str>) -> Result> { -// let local_var_configuration = configuration; - -// let local_var_client = &local_var_configuration.client; - -// let local_var_uri_str = format!("{}/users/search", local_var_configuration.base_path, userID=crate::apis::urlencode(user_id)); -// let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); - -// if let Some(ref local_var_str) = limit { -// local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); -// } -// if let Some(ref local_var_str) = offset { -// local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); -// } -// if let Some(ref local_var_str) = username { -// local_var_req_builder = local_var_req_builder.query(&[("username", &local_var_str.to_string())]); -// } -// if let Some(ref local_var_str) = first_name { -// local_var_req_builder = local_var_req_builder.query(&[("first_name", &local_var_str.to_string())]); -// } -// if let Some(ref local_var_str) = last_name { -// local_var_req_builder = local_var_req_builder.query(&[("last_name", &local_var_str.to_string())]); -// } -// if let Some(ref local_var_str) = email { -// local_var_req_builder = local_var_req_builder.query(&[("email", &local_var_str.to_string())]); -// } -// if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { -// local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); -// } -// if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { -// local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); -// }; - -// let local_var_req = local_var_req_builder.build()?; -// let local_var_resp = local_var_client.execute(local_var_req).await?; - -// let local_var_status = local_var_resp.status(); -// let local_var_content = local_var_resp.text().await?; - -// if !local_var_status.is_client_error() && !local_var_status.is_server_error() { -// serde_json::from_str(&local_var_content).map_err(Error::from) -// } else { -// let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); -// let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; -// Err(Error::ResponseError(local_var_error)) -// } -// } - -/// Updates email of the user with provided ID. Email is updated using authorization token and the new received email. -pub async fn update_email(configuration: &configuration::Configuration, user_id: &str, email: models::Email) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/users/{userID}/email", local_var_configuration.base_path, userID=crate::apis::urlencode(user_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - local_var_req_builder = local_var_req_builder.json(&email); - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Updates the user's profile picture with provided ID. Profile picture is updated using authorization token and the new received picture. -pub async fn update_profile_picture(configuration: &configuration::Configuration, user_id: &str, user_profile_picture: models::UserProfilePicture) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/users/{userID}/picture", local_var_configuration.base_path, userID=crate::apis::urlencode(user_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - local_var_req_builder = local_var_req_builder.json(&user_profile_picture); - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Updates role for the user with provided ID. -pub async fn update_role(configuration: &configuration::Configuration, user_id: &str, user_role: models::UserRole) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/users/{userID}/role", local_var_configuration.base_path, userID=crate::apis::urlencode(user_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - local_var_req_builder = local_var_req_builder.json(&user_role); - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Updates secret of currently logged in user. Secret is updated using authorization token and the new received info. -pub async fn update_secret(configuration: &configuration::Configuration, user_secret: models::UserSecret) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/users/secret", local_var_configuration.base_path); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - local_var_req_builder = local_var_req_builder.json(&user_secret); - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Updates tags of the user with provided ID. Tags is updated using authorization token and the new tags received in request. -pub async fn update_tags(configuration: &configuration::Configuration, user_id: &str, user_tags: models::UserTags) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/users/{userID}/tags", local_var_configuration.base_path, userID=crate::apis::urlencode(user_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - local_var_req_builder = local_var_req_builder.json(&user_tags); - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Updates name and metadata of the user with provided ID. Name and metadata is updated using authorization token and the new received info. -pub async fn update_user(configuration: &configuration::Configuration, user_id: &str, user_update: models::UserUpdate) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/users/{userID}", local_var_configuration.base_path, userID=crate::apis::urlencode(user_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - local_var_req_builder = local_var_req_builder.json(&user_update); - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Updates username of the user with provided ID. Username is updated using authorization token and the new received username. -pub async fn update_username(configuration: &configuration::Configuration, user_id: &str, username: models::Username) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/users/{userID}/username", local_var_configuration.base_path, userID=crate::apis::urlencode(user_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - local_var_req_builder = local_var_req_builder.json(&username); - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Delete a specific user that is identifier by the user ID. -pub async fn users_user_id_delete(configuration: &configuration::Configuration, user_id: &str) -> Result<(), Error> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/users/{userID}", local_var_configuration.base_path, userID=crate::apis::urlencode(user_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - Ok(()) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - diff --git a/pkg/sdk/rust/src/main.rs b/pkg/sdk/rust/src/main.rs deleted file mode 100644 index 46b9a245..00000000 --- a/pkg/sdk/rust/src/main.rs +++ /dev/null @@ -1,53 +0,0 @@ -mod models; -use models::UserReqObj;// Replace with the actual paths to your models -use models::user_req_obj_credentials::UserReqObjCredentials; - -mod apis; -use apis::configuration::Configuration; - use crate::apis::users_api::create_user; -use serde_json::json; - -// Replace with the actual path to your configuration - - - -#[tokio::main] -async fn main() { - // Construct the configuration with the actual API base URL and authorization token - let mut config = Configuration::new(); - config.base_path = "http://localhost:9002".to_string(); - - // Create the credentials, wrapping each field inside Some - let credentials = Box::new(UserReqObjCredentials { - username: Some("admin".to_string()), // Wrap in Some() - secret: Some("password".to_string()), // Wrap in Some() - }); - let metadata = Some(json!({ - "domain": "example.com",})); - - // Create the user request object - let user_req_obj = UserReqObj { - first_name: Some("John".to_string()), - last_name: Some("Doe".to_string()), - email: Some("johnde@example.com".to_string()), - tags: Some(vec!["tag1".to_string(), "tag2".to_string()]), - credentials: credentials, // Boxed credentials - metadata: metadata, - profile_picture: Some("https://example.com/profile.jpg".to_string()), - status: Some("enabled".to_string()), - -}; - - - // Call the `create_user` function - match create_user(&config, user_req_obj).await { - Ok(user) => { - // Success: The user has been created, and `user` contains the response data - println!("User created successfully: {:?}", user); - } - Err(err) => { - // Handle the error (e.g., logging, retrying, etc.) - eprintln!("Error creating user: {:?}", err); - } - } -} \ No newline at end of file diff --git a/pkg/sdk/rust/src/models/assign_req_obj.rs b/pkg/sdk/rust/src/models/assign_req_obj.rs deleted file mode 100644 index 50f462a1..00000000 --- a/pkg/sdk/rust/src/models/assign_req_obj.rs +++ /dev/null @@ -1,36 +0,0 @@ -/* - * SuperMQ Users Service - * - * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.14.0 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct AssignReqObj { - /// Members IDs - #[serde(rename = "members")] - pub members: Vec, - /// Permission relations. - #[serde(rename = "relation")] - pub relation: String, - /// Member kind. - #[serde(rename = "member_kind")] - pub member_kind: String, -} - -impl AssignReqObj { - pub fn new(members: Vec, relation: String, member_kind: String) -> AssignReqObj { - AssignReqObj { - members, - relation, - member_kind, - } - } -} - diff --git a/pkg/sdk/rust/src/models/assign_user_req_obj.rs b/pkg/sdk/rust/src/models/assign_user_req_obj.rs deleted file mode 100644 index 10d13261..00000000 --- a/pkg/sdk/rust/src/models/assign_user_req_obj.rs +++ /dev/null @@ -1,32 +0,0 @@ -/* - * SuperMQ Users Service - * - * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.14.0 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct AssignUserReqObj { - /// User IDs - #[serde(rename = "user_ids")] - pub user_ids: Vec, - /// Permission relations. - #[serde(rename = "relation")] - pub relation: String, -} - -impl AssignUserReqObj { - pub fn new(user_ids: Vec, relation: String) -> AssignUserReqObj { - AssignUserReqObj { - user_ids, - relation, - } - } -} - diff --git a/pkg/sdk/rust/src/models/email.rs b/pkg/sdk/rust/src/models/email.rs deleted file mode 100644 index fbeda7d8..00000000 --- a/pkg/sdk/rust/src/models/email.rs +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SuperMQ Users Service - * - * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.14.0 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct Email { - /// User email address. - #[serde(rename = "email")] - pub email: String, -} - -impl Email { - pub fn new(email: String) -> Email { - Email { - email, - } - } -} - diff --git a/pkg/sdk/rust/src/models/error.rs b/pkg/sdk/rust/src/models/error.rs deleted file mode 100644 index e808b985..00000000 --- a/pkg/sdk/rust/src/models/error.rs +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SuperMQ Users Service - * - * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.14.0 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct Error { - /// Error message - #[serde(rename = "error", skip_serializing_if = "Option::is_none")] - pub error: Option, -} - -impl Error { - pub fn new() -> Error { - Error { - error: None, - } - } -} - diff --git a/pkg/sdk/rust/src/models/group.rs b/pkg/sdk/rust/src/models/group.rs deleted file mode 100644 index 71978617..00000000 --- a/pkg/sdk/rust/src/models/group.rs +++ /dev/null @@ -1,68 +0,0 @@ -/* - * SuperMQ Users Service - * - * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.14.0 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct Group { - /// Unique group identifier generated by the service. - #[serde(rename = "id", skip_serializing_if = "Option::is_none")] - pub id: Option, - /// Free-form group name. Group name is unique on the given hierarchy level. - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - /// ID of the domain to which the group belongs.. - #[serde(rename = "domain_id", skip_serializing_if = "Option::is_none")] - pub domain_id: Option, - /// Group parent identifier. - #[serde(rename = "parent_id", skip_serializing_if = "Option::is_none")] - pub parent_id: Option, - /// Group description, free form text. - #[serde(rename = "description", skip_serializing_if = "Option::is_none")] - pub description: Option, - /// Arbitrary, object-encoded groups's data. - #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")] - pub metadata: Option, - /// Hierarchy path, concatenated ids of group ancestors. - #[serde(rename = "path", skip_serializing_if = "Option::is_none")] - pub path: Option, - /// Level in hierarchy, distance from the root group. - #[serde(rename = "level", skip_serializing_if = "Option::is_none")] - pub level: Option, - /// Datetime when the group was created. - #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] - pub created_at: Option, - /// Datetime when the group was created. - #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")] - pub updated_at: Option, - /// Group Status - #[serde(rename = "status", skip_serializing_if = "Option::is_none")] - pub status: Option, -} - -impl Group { - pub fn new() -> Group { - Group { - id: None, - name: None, - domain_id: None, - parent_id: None, - description: None, - metadata: None, - path: None, - level: None, - created_at: None, - updated_at: None, - status: None, - } - } -} - diff --git a/pkg/sdk/rust/src/models/group_req_obj.rs b/pkg/sdk/rust/src/models/group_req_obj.rs deleted file mode 100644 index a0bada9a..00000000 --- a/pkg/sdk/rust/src/models/group_req_obj.rs +++ /dev/null @@ -1,44 +0,0 @@ -/* - * SuperMQ Users Service - * - * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.14.0 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct GroupReqObj { - /// Free-form group name. Group name is unique on the given hierarchy level. - #[serde(rename = "name")] - pub name: String, - /// Group description, free form text. - #[serde(rename = "description", skip_serializing_if = "Option::is_none")] - pub description: Option, - /// Id of parent group, it must be existing group. - #[serde(rename = "parent_id", skip_serializing_if = "Option::is_none")] - pub parent_id: Option, - /// Arbitrary, object-encoded groups's data. - #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")] - pub metadata: Option, - /// Group Status - #[serde(rename = "status", skip_serializing_if = "Option::is_none")] - pub status: Option, -} - -impl GroupReqObj { - pub fn new(name: String) -> GroupReqObj { - GroupReqObj { - name, - description: None, - parent_id: None, - metadata: None, - status: None, - } - } -} - diff --git a/pkg/sdk/rust/src/models/group_update.rs b/pkg/sdk/rust/src/models/group_update.rs deleted file mode 100644 index 9fd709f2..00000000 --- a/pkg/sdk/rust/src/models/group_update.rs +++ /dev/null @@ -1,36 +0,0 @@ -/* - * SuperMQ Users Service - * - * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.14.0 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct GroupUpdate { - /// Free-form group name. Group name is unique on the given hierarchy level. - #[serde(rename = "name")] - pub name: String, - /// Group description, free form text. - #[serde(rename = "description")] - pub description: String, - /// Arbitrary, object-encoded groups's data. - #[serde(rename = "metadata")] - pub metadata: serde_json::Value, -} - -impl GroupUpdate { - pub fn new(name: String, description: String, metadata: serde_json::Value) -> GroupUpdate { - GroupUpdate { - name, - description, - metadata, - } - } -} - diff --git a/pkg/sdk/rust/src/models/groups_page.rs b/pkg/sdk/rust/src/models/groups_page.rs deleted file mode 100644 index 62c70541..00000000 --- a/pkg/sdk/rust/src/models/groups_page.rs +++ /dev/null @@ -1,39 +0,0 @@ -/* - * SuperMQ Users Service - * - * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.14.0 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct GroupsPage { - #[serde(rename = "groups")] - pub groups: Vec, - /// Total number of items. - #[serde(rename = "total")] - pub total: i32, - /// Number of items to skip during retrieval. - #[serde(rename = "offset")] - pub offset: i32, - /// Maximum number of items to return in one page. - #[serde(rename = "limit", skip_serializing_if = "Option::is_none")] - pub limit: Option, -} - -impl GroupsPage { - pub fn new(groups: Vec, total: i32, offset: i32) -> GroupsPage { - GroupsPage { - groups, - total, - offset, - limit: None, - } - } -} - diff --git a/pkg/sdk/rust/src/models/health_res.rs b/pkg/sdk/rust/src/models/health_res.rs deleted file mode 100644 index 107e483a..00000000 --- a/pkg/sdk/rust/src/models/health_res.rs +++ /dev/null @@ -1,56 +0,0 @@ -/* - * SuperMQ Users Service - * - * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.14.0 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct HealthRes { - /// Service status. - #[serde(rename = "status", skip_serializing_if = "Option::is_none")] - pub status: Option, - /// Service version. - #[serde(rename = "version", skip_serializing_if = "Option::is_none")] - pub version: Option, - /// Service commit hash. - #[serde(rename = "commit", skip_serializing_if = "Option::is_none")] - pub commit: Option, - /// Service description. - #[serde(rename = "description", skip_serializing_if = "Option::is_none")] - pub description: Option, - /// Service build time. - #[serde(rename = "build_time", skip_serializing_if = "Option::is_none")] - pub build_time: Option, -} - -impl HealthRes { - pub fn new() -> HealthRes { - HealthRes { - status: None, - version: None, - commit: None, - description: None, - build_time: None, - } - } -} -/// Service status. -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum Status { - #[serde(rename = "pass")] - Pass, -} - -impl Default for Status { - fn default() -> Status { - Self::Pass - } -} - diff --git a/pkg/sdk/rust/src/models/issue_token.rs b/pkg/sdk/rust/src/models/issue_token.rs deleted file mode 100644 index ed2453bd..00000000 --- a/pkg/sdk/rust/src/models/issue_token.rs +++ /dev/null @@ -1,32 +0,0 @@ -/* - * SuperMQ Users Service - * - * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.14.0 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct IssueToken { - /// User identity - email address. - #[serde(rename = "identity")] - pub identity: String, - /// User secret password. - #[serde(rename = "secret")] - pub secret: String, -} - -impl IssueToken { - pub fn new(identity: String, secret: String) -> IssueToken { - IssueToken { - identity, - secret, - } - } -} - diff --git a/pkg/sdk/rust/src/models/issue_token_200_response.rs b/pkg/sdk/rust/src/models/issue_token_200_response.rs deleted file mode 100644 index 6629a1b9..00000000 --- a/pkg/sdk/rust/src/models/issue_token_200_response.rs +++ /dev/null @@ -1,36 +0,0 @@ -/* - * SuperMQ Users Service - * - * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.14.0 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct IssueToken200Response { - /// User access token. - #[serde(rename = "access_token", skip_serializing_if = "Option::is_none")] - pub access_token: Option, - /// User refresh token. - #[serde(rename = "refresh_token", skip_serializing_if = "Option::is_none")] - pub refresh_token: Option, - /// User access token type. - #[serde(rename = "access_type", skip_serializing_if = "Option::is_none")] - pub access_type: Option, -} - -impl IssueToken200Response { - pub fn new() -> IssueToken200Response { - IssueToken200Response { - access_token: None, - refresh_token: None, - access_type: None, - } - } -} - diff --git a/pkg/sdk/rust/src/models/members.rs b/pkg/sdk/rust/src/models/members.rs deleted file mode 100644 index fe9639b2..00000000 --- a/pkg/sdk/rust/src/models/members.rs +++ /dev/null @@ -1,63 +0,0 @@ -/* - * SuperMQ Users Service - * - * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.14.0 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct Members { - /// User unique identifier. - #[serde(rename = "id", skip_serializing_if = "Option::is_none")] - pub id: Option, - /// User's first name. - #[serde(rename = "first_name", skip_serializing_if = "Option::is_none")] - pub first_name: Option, - /// User's last name. - #[serde(rename = "last_name", skip_serializing_if = "Option::is_none")] - pub last_name: Option, - /// User's email address. - #[serde(rename = "email", skip_serializing_if = "Option::is_none")] - pub email: Option, - /// User tags. - #[serde(rename = "tags", skip_serializing_if = "Option::is_none")] - pub tags: Option>, - #[serde(rename = "credentials", skip_serializing_if = "Option::is_none")] - pub credentials: Option>, - /// Arbitrary, object-encoded user's data. - #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")] - pub metadata: Option, - /// User Status - #[serde(rename = "status", skip_serializing_if = "Option::is_none")] - pub status: Option, - /// Time when the group was created. - #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] - pub created_at: Option, - /// Time when the group was created. - #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")] - pub updated_at: Option, -} - -impl Members { - pub fn new() -> Members { - Members { - id: None, - first_name: None, - last_name: None, - email: None, - tags: None, - credentials: None, - metadata: None, - status: None, - created_at: None, - updated_at: None, - } - } -} - diff --git a/pkg/sdk/rust/src/models/members_credentials.rs b/pkg/sdk/rust/src/models/members_credentials.rs deleted file mode 100644 index ffb9c498..00000000 --- a/pkg/sdk/rust/src/models/members_credentials.rs +++ /dev/null @@ -1,32 +0,0 @@ -/* - * SuperMQ Users Service - * - * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.14.0 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct MembersCredentials { - /// User's username. - #[serde(rename = "username", skip_serializing_if = "Option::is_none")] - pub username: Option, - /// User secret password. - #[serde(rename = "secret", skip_serializing_if = "Option::is_none")] - pub secret: Option, -} - -impl MembersCredentials { - pub fn new() -> MembersCredentials { - MembersCredentials { - username: None, - secret: None, - } - } -} - diff --git a/pkg/sdk/rust/src/models/members_page.rs b/pkg/sdk/rust/src/models/members_page.rs deleted file mode 100644 index 928e4bc6..00000000 --- a/pkg/sdk/rust/src/models/members_page.rs +++ /dev/null @@ -1,39 +0,0 @@ -/* - * SuperMQ Users Service - * - * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.14.0 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct MembersPage { - #[serde(rename = "members")] - pub members: Vec, - /// Total number of items. - #[serde(rename = "total")] - pub total: i32, - /// Number of items to skip during retrieval. - #[serde(rename = "offset", skip_serializing_if = "Option::is_none")] - pub offset: Option, - /// Maximum number of items to return in one page. - #[serde(rename = "limit", skip_serializing_if = "Option::is_none")] - pub limit: Option, -} - -impl MembersPage { - pub fn new(members: Vec, total: i32) -> MembersPage { - MembersPage { - members, - total, - offset: None, - limit: None, - } - } -} - diff --git a/pkg/sdk/rust/src/models/mod.rs b/pkg/sdk/rust/src/models/mod.rs deleted file mode 100644 index a93319d3..00000000 --- a/pkg/sdk/rust/src/models/mod.rs +++ /dev/null @@ -1,54 +0,0 @@ -pub mod assign_req_obj; -pub use self::assign_req_obj::AssignReqObj; -pub mod assign_user_req_obj; -pub use self::assign_user_req_obj::AssignUserReqObj; -pub mod email; -pub use self::email::Email; -pub mod error; -pub use self::error::Error; -pub mod group; -pub use self::group::Group; -pub mod group_req_obj; -pub use self::group_req_obj::GroupReqObj; -pub mod group_update; -pub use self::group_update::GroupUpdate; -pub mod groups_page; -pub use self::groups_page::GroupsPage; -pub mod health_res; -pub use self::health_res::HealthRes; -pub mod issue_token; -pub use self::issue_token::IssueToken; -pub mod issue_token_200_response; -pub use self::issue_token_200_response::IssueToken200Response; -pub mod members; -pub use self::members::Members; -pub mod members_credentials; -pub use self::members_credentials::MembersCredentials; -pub mod members_page; -pub use self::members_page::MembersPage; -pub mod request_password_reset_request; -pub use self::request_password_reset_request::RequestPasswordResetRequest; -pub mod reset_password_request; -pub use self::reset_password_request::ResetPasswordRequest; -pub mod user; -pub use self::user::User; -pub mod user_credentials; -pub use self::user_credentials::UserCredentials; -pub mod user_profile_picture; -pub use self::user_profile_picture::UserProfilePicture; -pub mod user_req_obj; -pub use self::user_req_obj::UserReqObj; -pub mod user_req_obj_credentials; -pub use self::user_req_obj_credentials::UserReqObjCredentials; -pub mod user_role; -pub use self::user_role::UserRole; -pub mod user_secret; -pub use self::user_secret::UserSecret; -pub mod user_tags; -pub use self::user_tags::UserTags; -pub mod user_update; -pub use self::user_update::UserUpdate; -pub mod username; -pub use self::username::Username; -pub mod users_page; -pub use self::users_page::UsersPage; diff --git a/pkg/sdk/rust/src/models/request_password_reset_request.rs b/pkg/sdk/rust/src/models/request_password_reset_request.rs deleted file mode 100644 index b4cd7599..00000000 --- a/pkg/sdk/rust/src/models/request_password_reset_request.rs +++ /dev/null @@ -1,32 +0,0 @@ -/* - * SuperMQ Users Service - * - * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.14.0 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct RequestPasswordResetRequest { - /// User email. - #[serde(rename = "email", skip_serializing_if = "Option::is_none")] - pub email: Option, - /// Email host. - #[serde(rename = "host", skip_serializing_if = "Option::is_none")] - pub host: Option, -} - -impl RequestPasswordResetRequest { - pub fn new() -> RequestPasswordResetRequest { - RequestPasswordResetRequest { - email: None, - host: None, - } - } -} - diff --git a/pkg/sdk/rust/src/models/reset_password_request.rs b/pkg/sdk/rust/src/models/reset_password_request.rs deleted file mode 100644 index 64a1c7d1..00000000 --- a/pkg/sdk/rust/src/models/reset_password_request.rs +++ /dev/null @@ -1,36 +0,0 @@ -/* - * SuperMQ Users Service - * - * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.14.0 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ResetPasswordRequest { - /// New password. - #[serde(rename = "password", skip_serializing_if = "Option::is_none")] - pub password: Option, - /// New confirmation password. - #[serde(rename = "confirm_password", skip_serializing_if = "Option::is_none")] - pub confirm_password: Option, - /// Reset token generated and sent in email. - #[serde(rename = "token", skip_serializing_if = "Option::is_none")] - pub token: Option, -} - -impl ResetPasswordRequest { - pub fn new() -> ResetPasswordRequest { - ResetPasswordRequest { - password: None, - confirm_password: None, - token: None, - } - } -} - diff --git a/pkg/sdk/rust/src/models/user.rs b/pkg/sdk/rust/src/models/user.rs deleted file mode 100644 index d3f75c87..00000000 --- a/pkg/sdk/rust/src/models/user.rs +++ /dev/null @@ -1,67 +0,0 @@ -/* - * SuperMQ Users Service - * - * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.14.0 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct User { - /// User unique identifier. - #[serde(rename = "id", skip_serializing_if = "Option::is_none")] - pub id: Option, - /// User's first name. - #[serde(rename = "first_name", skip_serializing_if = "Option::is_none")] - pub first_name: Option, - /// User's last name. - #[serde(rename = "last_name", skip_serializing_if = "Option::is_none")] - pub last_name: Option, - /// User tags. - #[serde(rename = "tags", skip_serializing_if = "Option::is_none")] - pub tags: Option>, - /// User email for example email address. - #[serde(rename = "email", skip_serializing_if = "Option::is_none")] - pub email: Option, - #[serde(rename = "credentials", skip_serializing_if = "Option::is_none")] - pub credentials: Option>, - /// Arbitrary, object-encoded user's data. - #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")] - pub metadata: Option, - /// User's profile picture URL that is represented as a string. - #[serde(rename = "profile_picture", skip_serializing_if = "Option::is_none")] - pub profile_picture: Option, - /// User Status - #[serde(rename = "status", skip_serializing_if = "Option::is_none")] - pub status: Option, - /// Time when the group was created. - #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] - pub created_at: Option, - /// Time when the group was created. - #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")] - pub updated_at: Option, -} - -impl User { - pub fn new() -> User { - User { - id: None, - first_name: None, - last_name: None, - tags: None, - email: None, - credentials: None, - metadata: None, - profile_picture: None, - status: None, - created_at: None, - updated_at: None, - } - } -} - diff --git a/pkg/sdk/rust/src/models/user_credentials.rs b/pkg/sdk/rust/src/models/user_credentials.rs deleted file mode 100644 index 37cad0cb..00000000 --- a/pkg/sdk/rust/src/models/user_credentials.rs +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SuperMQ Users Service - * - * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.14.0 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct UserCredentials { - /// User's username for example john_doe for Mr John Doe. - #[serde(rename = "username", skip_serializing_if = "Option::is_none")] - pub username: Option, -} - -impl UserCredentials { - pub fn new() -> UserCredentials { - UserCredentials { - username: None, - } - } -} - diff --git a/pkg/sdk/rust/src/models/user_profile_picture.rs b/pkg/sdk/rust/src/models/user_profile_picture.rs deleted file mode 100644 index 349dc634..00000000 --- a/pkg/sdk/rust/src/models/user_profile_picture.rs +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SuperMQ Users Service - * - * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.14.0 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct UserProfilePicture { - /// User's profile picture URL that is represented as a string. - #[serde(rename = "profile_picture")] - pub profile_picture: String, -} - -impl UserProfilePicture { - pub fn new(profile_picture: String) -> UserProfilePicture { - UserProfilePicture { - profile_picture, - } - } -} - diff --git a/pkg/sdk/rust/src/models/user_req_obj.rs b/pkg/sdk/rust/src/models/user_req_obj.rs deleted file mode 100644 index 569e9862..00000000 --- a/pkg/sdk/rust/src/models/user_req_obj.rs +++ /dev/null @@ -1,55 +0,0 @@ -/* - * SuperMQ Users Service - * - * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.14.0 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct UserReqObj { - /// User's first name. - #[serde(rename = "first_name", skip_serializing_if = "Option::is_none")] - pub first_name: Option, - /// User's last name. - #[serde(rename = "last_name", skip_serializing_if = "Option::is_none")] - pub last_name: Option, - /// User's email address will be used as its unique identifier. - #[serde(rename = "email", skip_serializing_if = "Option::is_none")] - pub email: Option, - /// User tags. - #[serde(rename = "tags", skip_serializing_if = "Option::is_none")] - pub tags: Option>, - #[serde(rename = "credentials")] - pub credentials: Box, - /// Arbitrary, object-encoded user's data. - #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")] - pub metadata: Option, - /// User's profile picture URL that is represented as a string. - #[serde(rename = "profile_picture", skip_serializing_if = "Option::is_none")] - pub profile_picture: Option, - /// User Status - #[serde(rename = "status", skip_serializing_if = "Option::is_none")] - pub status: Option, -} - -impl UserReqObj { - pub fn new(credentials: models::UserReqObjCredentials) -> UserReqObj { - UserReqObj { - first_name: None, - last_name: None, - email: None, - tags: None, - credentials: Box::new(credentials), - metadata: None, - profile_picture: None, - status: None, - } - } -} - diff --git a/pkg/sdk/rust/src/models/user_req_obj_credentials.rs b/pkg/sdk/rust/src/models/user_req_obj_credentials.rs deleted file mode 100644 index 4bc0d3aa..00000000 --- a/pkg/sdk/rust/src/models/user_req_obj_credentials.rs +++ /dev/null @@ -1,32 +0,0 @@ -/* - * SuperMQ Users Service - * - * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.14.0 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct UserReqObjCredentials { - /// User's username for example 'admin' will be used as its unique identifier. - #[serde(rename = "username", skip_serializing_if = "Option::is_none")] - pub username: Option, - /// Free-form account secret used for acquiring auth token(s). - #[serde(rename = "secret", skip_serializing_if = "Option::is_none")] - pub secret: Option, -} - -impl UserReqObjCredentials { - pub fn new() -> UserReqObjCredentials { - UserReqObjCredentials { - username: None, - secret: None, - } - } -} - diff --git a/pkg/sdk/rust/src/models/user_role.rs b/pkg/sdk/rust/src/models/user_role.rs deleted file mode 100644 index a45182ec..00000000 --- a/pkg/sdk/rust/src/models/user_role.rs +++ /dev/null @@ -1,42 +0,0 @@ -/* - * SuperMQ Users Service - * - * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.14.0 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct UserRole { - /// User role example. - #[serde(rename = "role")] - pub role: Role, -} - -impl UserRole { - pub fn new(role: Role) -> UserRole { - UserRole { - role, - } - } -} -/// User role example. -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum Role { - #[serde(rename = "admin")] - Admin, - #[serde(rename = "user")] - User, -} - -impl Default for Role { - fn default() -> Role { - Self::Admin - } -} - diff --git a/pkg/sdk/rust/src/models/user_secret.rs b/pkg/sdk/rust/src/models/user_secret.rs deleted file mode 100644 index 302e0ebf..00000000 --- a/pkg/sdk/rust/src/models/user_secret.rs +++ /dev/null @@ -1,32 +0,0 @@ -/* - * SuperMQ Users Service - * - * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.14.0 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct UserSecret { - /// Old user secret password. - #[serde(rename = "old_secret")] - pub old_secret: String, - /// New user secret password. - #[serde(rename = "new_secret")] - pub new_secret: String, -} - -impl UserSecret { - pub fn new(old_secret: String, new_secret: String) -> UserSecret { - UserSecret { - old_secret, - new_secret, - } - } -} - diff --git a/pkg/sdk/rust/src/models/user_tags.rs b/pkg/sdk/rust/src/models/user_tags.rs deleted file mode 100644 index 924c37cc..00000000 --- a/pkg/sdk/rust/src/models/user_tags.rs +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SuperMQ Users Service - * - * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.14.0 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct UserTags { - /// User tags. - #[serde(rename = "tags", skip_serializing_if = "Option::is_none")] - pub tags: Option>, -} - -impl UserTags { - pub fn new() -> UserTags { - UserTags { - tags: None, - } - } -} - diff --git a/pkg/sdk/rust/src/models/user_update.rs b/pkg/sdk/rust/src/models/user_update.rs deleted file mode 100644 index 3d4d69cb..00000000 --- a/pkg/sdk/rust/src/models/user_update.rs +++ /dev/null @@ -1,36 +0,0 @@ -/* - * SuperMQ Users Service - * - * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.14.0 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct UserUpdate { - /// User's first name. - #[serde(rename = "first_name")] - pub first_name: String, - /// User's last name. - #[serde(rename = "last_name")] - pub last_name: String, - /// Arbitrary, object-encoded user's data. - #[serde(rename = "metadata")] - pub metadata: serde_json::Value, -} - -impl UserUpdate { - pub fn new(first_name: String, last_name: String, metadata: serde_json::Value) -> UserUpdate { - UserUpdate { - first_name, - last_name, - metadata, - } - } -} - diff --git a/pkg/sdk/rust/src/models/username.rs b/pkg/sdk/rust/src/models/username.rs deleted file mode 100644 index 8092289d..00000000 --- a/pkg/sdk/rust/src/models/username.rs +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SuperMQ Users Service - * - * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.14.0 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct Username { - /// User's username for example 'admin' will be used as its unique identifier. - #[serde(rename = "username")] - pub username: String, -} - -impl Username { - pub fn new(username: String) -> Username { - Username { - username, - } - } -} - diff --git a/pkg/sdk/rust/src/models/users_page.rs b/pkg/sdk/rust/src/models/users_page.rs deleted file mode 100644 index 1f63e6a2..00000000 --- a/pkg/sdk/rust/src/models/users_page.rs +++ /dev/null @@ -1,39 +0,0 @@ -/* - * SuperMQ Users Service - * - * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.14.0 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct UsersPage { - #[serde(rename = "users")] - pub users: Vec, - /// Total number of items. - #[serde(rename = "total")] - pub total: i32, - /// Number of items to skip during retrieval. - #[serde(rename = "offset")] - pub offset: i32, - /// Maximum number of items to return in one page. - #[serde(rename = "limit", skip_serializing_if = "Option::is_none")] - pub limit: Option, -} - -impl UsersPage { - pub fn new(users: Vec, total: i32, offset: i32) -> UsersPage { - UsersPage { - users, - total, - offset, - limit: None, - } - } -} - diff --git a/provision/Cargo.toml b/provision/Cargo.toml index be7c4160..5417f635 100644 --- a/provision/Cargo.toml +++ b/provision/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "provision-openapi" +name = "Provision" version = "0.15.1" authors = ["info@abstracmachines.fr"] description = "HTTP API for Provision service Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) " diff --git a/readers/Cargo.toml b/readers/Cargo.toml index 1039a0c7..d16f9f4a 100644 --- a/readers/Cargo.toml +++ b/readers/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "readers-openapi" +name = "Readers" version = "0.15.1" authors = ["info@abstractmachines.fr"] description = "HTTP API for reading messages. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) " diff --git a/twins/Cargo.toml b/twins/Cargo.toml index b86fac5e..0b9c8c8b 100644 --- a/twins/Cargo.toml +++ b/twins/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "twins-openapi" +name = "Twins" version = "0.15.1" authors = ["info@abstractmachines.fr"] description = "HTTP API for managing digital twins and their states. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) " diff --git a/users/Cargo.toml b/users/Cargo.toml index 125611d8..6eddeba7 100644 --- a/users/Cargo.toml +++ b/users/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "users-openapi" +name = "Users" version = "0.15.1" authors = ["info@abstractmachines.fr"] description = "This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) " From 02b28b8ce25b69b8d5b6703d7cdb874b6ee1da06 Mon Sep 17 00:00:00 2001 From: Dorcas Litunya Date: Sun, 12 Jan 2025 16:53:33 +0300 Subject: [PATCH 04/10] Add appropriate README for models and api --- Models.md | 4518 +++++++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 198 ++- 2 files changed, 4714 insertions(+), 2 deletions(-) create mode 100644 Models.md diff --git a/Models.md b/Models.md new file mode 100644 index 00000000..427fdff8 --- /dev/null +++ b/Models.md @@ -0,0 +1,4518 @@ +# AvailableActionsObj +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**available\_actions**|Option<**Vec**>|List of all available actions.|[optional]| + + +# BootstrapConfig +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**client\_id**|[**uuid::Uuid**](uuid::Uuid.md)|Corresponding SuperMQ Client ID.|| +|**client\_key**|[**uuid::Uuid**](uuid::Uuid.md)|Corresponding SuperMQ Client key.|| +|**channels**|**Vec**||| +|**content**|**String**|Free-form custom configuration.|| +|**client\_cert**|Option<**String**>|Client certificate.|[optional]| + + +# Cert +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**client\_id**|Option<[**uuid::Uuid**](uuid::Uuid.md)>|Corresponding SuperMQ Client ID.|[optional]| +|**client\_cert**|Option<**String**>|Client Certificate.|[optional]| +|**client\_key**|Option<**String**>|Key for the client\_cert.|[optional]| +|**issuing\_ca**|Option<**String**>|CA Certificate that is used to issue client certs, usually intermediate.|[optional]| +|**serial**|Option<**String**>|Certificate serial|[optional]| +|**expire**|Option<**String**>|Certificate expiry date|[optional]| + + +# AcceptInvitationRequest +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**domain\_id**|[**uuid::Uuid**](uuid::Uuid.md)|Domain unique identifier.|| + +# AssignReqObj +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**members**|**Vec**|Members IDs|| +|**relation**|**String**|Permission relations.|| +|**member\_kind**|**String**|Member kind.|| + +# AssignUserReqObj +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**user\_ids**|**Vec**|User IDs|| +|**relation**|**String**|Permission relations.|| + +# Attribute +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**name**|Option<**String**>|Name of the attribute.|[optional]| +|**channel**|Option<**String**>|SuperMQ channel used by attribute.|[optional]| +|**subtopic**|Option<**String**>|Subtopic used by attribute.|[optional]| +|**persist\_state**|Option<**bool**>|Trigger state creation based on the attribute.|[optional]| + + +# CertsPage +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**certs**|Option<**Vec**>||[optional]| +|**total**|Option<**i32**>|Total number of items.|[optional]| +|**offset**|Option<**i32**>|Number of items to skip during retrieval.|[optional]| +|**limit**|Option<**i32**>|Maximum number of items to return in one page.|[optional]| + + +# Channel +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**id**|Option<[**uuid::Uuid**](uuid::Uuid.md)>|Unique channel identifier generated by the service.|[optional]| +|**name**|Option<**String**>|Free-form channel name. Channel name is unique on the given hierarchy level.|[optional]| +|**domain\_id**|Option<[**uuid::Uuid**](uuid::Uuid.md)>|ID of the domain to which the group belongs.|[optional]| +|**parent\_id**|Option<[**uuid::Uuid**](uuid::Uuid.md)>|Channel parent identifier.|[optional]| +|**description**|Option<**String**>|Channel description, free form text.|[optional]| +|**metadata**|Option<[**serde_json::Value**](.md)>|Arbitrary, object-encoded channels's data.|[optional]| +|**path**|Option<**String**>|Hierarchy path, concatenated ids of channel ancestors.|[optional]| +|**level**|Option<**i32**>|Level in hierarchy, distance from the root channel.|[optional]| +|**created\_at**|Option<**String**>|Datetime when the channel was created.|[optional]| +|**updated\_at**|Option<**String**>|Datetime when the channel was created.|[optional]| +|**status**|Option<**String**>|Channel Status|[optional]| + + +# \CertsApi +All URIs are relative to *http://localhost:9001* + +|Method|HTTP request|Description| +| :-: | :-: | :-: | +|[**create_cert**](CertsApi.md#create_cert)|**POST** /{domainID}/certs|Creates a certificate for client| +|[**get_cert**](CertsApi.md#get_cert)|**GET** /{domainID}/certs/{certID}|Retrieves a certificate| +|[**get_serials**](CertsApi.md#get_serials)|**GET** /{domainID}/serials/{clientID}|Retrieves certificates' serial IDs| +|[**health_get**](CertsApi.md#health_get)|**GET** /health|Retrieves service health check info.| +|[**revoke_cert**](CertsApi.md#revoke_cert)|**DELETE** /{domainID}/certs/{certID}|Revokes a certificate| +## create\_cert +create\_cert(domain\_id, create\_cert\_request) +Creates a certificate for client + +Creates a certificate for client +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**create\_cert\_request**|Option<[**CreateCertRequest**](CreateCertRequest.md)>|Issues a certificate that is required for mTLS. To create a certificate for a client provide a client id, data identifying particular client will be embedded into the Certificate. x509 and ECC certificates are supported when using when Vault is used as PKI.||| +### Return type +(empty response body) +### Authorization +[refreshAuth](../README.md#refreshAuth), [basicAuth](../README.md#basicAuth), [bearerAuth](../README.md#bearerAuth), [clientAuth](../README.md#clientAuth) +### HTTP request headers +- **Content-Type**: application/json +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## get\_cert +crate::models::Cert get\_cert(domain\_id, cert\_id) +Retrieves a certificate + +Retrieves a certificate for a given cert ID. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**cert\_id**|**uuid::Uuid**|Serial of certificate|[required]|| +### Return type +[**crate::models::Cert**](Cert.md) +### Authorization +[refreshAuth](../README.md#refreshAuth), [basicAuth](../README.md#basicAuth), [bearerAuth](../README.md#bearerAuth), [clientAuth](../README.md#clientAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## get\_serials +crate::models::SerialsPage get\_serials(domain\_id, client\_id) +Retrieves certificates' serial IDs + +Retrieves a list of certificates' serial IDs for a given client ID. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**client\_id**|**uuid::Uuid**|Client ID|[required]|| +### Return type +[**crate::models::SerialsPage**](SerialsPage.md) +### Authorization +[refreshAuth](../README.md#refreshAuth), [basicAuth](../README.md#basicAuth), [bearerAuth](../README.md#bearerAuth), [clientAuth](../README.md#clientAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## health\_get +crate::models::HealthInfo health\_get() +Retrieves service health check info. +### Parameters +This endpoint does not need any parameter. +### Return type +[**crate::models::HealthInfo**](health_info.md) +### Authorization +No authorization required +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/health+json, application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## revoke\_cert +crate::models::Revoke revoke\_cert(domain\_id, cert\_id) +Revokes a certificate + +Revokes a certificate for a given cert ID. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**cert\_id**|**uuid::Uuid**|Serial of certificate|[required]|| +### Return type +[**crate::models::Revoke**](Revoke.md) +### Authorization +[refreshAuth](../README.md#refreshAuth), [basicAuth](../README.md#basicAuth), [bearerAuth](../README.md#bearerAuth), [clientAuth](../README.md#clientAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) + +# ChannelConnectionReqSchema +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**client\_ids**|Option<**Vec**>|Client IDs|[optional]| +|**types**|Option<**Vec**>|Connection types.|[optional]| + + +# ChannelReqObj +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**name**|**String**|Free-form channel name. Channel name is unique on the given hierarchy level.|| +|**description**|Option<**String**>|Channel description, free form text.|[optional]| +|**parent\_id**|Option<**String**>|Id of parent channel, it must be existing channel.|[optional]| +|**metadata**|Option<[**serde_json::Value**](.md)>|Arbitrary, object-encoded channels's data.|[optional]| +|**status**|Option<**String**>|Channel Status|[optional]| + + +# \ChannelsApi +All URIs are relative to *http://localhost:9001* + +|Method|HTTP request|Description| +| :-: | :-: | :-: | +|[**connect_clients_and_channels**](ChannelsApi.md#connect_clients_and_channels)|**POST** /{domainID}/channels/connect|Connects client and channel.| +|[**connect_clients_to_channel**](ChannelsApi.md#connect_clients_to_channel)|**POST** /{domainID}/channels/{chanID}/connect|Connects clients to a channel| +|[**create_channel**](ChannelsApi.md#create_channel)|**POST** /{domainID}/channels|Creates new channel| +|[**create_channels**](ChannelsApi.md#create_channels)|**POST** /{domainID}/channels/bulk|Creates new channels| +|[**disable_channel**](ChannelsApi.md#disable_channel)|**POST** /{domainID}/channels/{chanID}/disable|Disables a channel| +|[**disconnect_clients_and_channels**](ChannelsApi.md#disconnect_clients_and_channels)|**POST** /{domainID}/channels/disconnect|Disconnects client and channel.| +|[**disconnect_clients_from_channel**](ChannelsApi.md#disconnect_clients_from_channel)|**POST** /{domainID}/channels/{chanID}/disconnect|Disconnects clients from a channel| +|[**domain_id_channels_chan_id_delete**](ChannelsApi.md#domain_id_channels_chan_id_delete)|**DELETE** /{domainID}/channels/{chanID}|Delete channel for given channel id.| +|[**enable_channel**](ChannelsApi.md#enable_channel)|**POST** /{domainID}/channels/{chanID}/enable|Enables a channel| +|[**get_channel**](ChannelsApi.md#get_channel)|**GET** /{domainID}/channels/{chanID}|Retrieves channel info.| +|[**list_channels**](ChannelsApi.md#list_channels)|**GET** /{domainID}/channels|Lists channels.| +|[**remove_channel_parent_group**](ChannelsApi.md#remove_channel_parent_group)|**DELETE** /{domainID}/channels/{chanID}/parent|Removes a parent group from a channel.| +|[**set_channel_parent_group**](ChannelsApi.md#set_channel_parent_group)|**POST** /{domainID}/channels/{chanID}/parent|Sets a parent group for a channel| +|[**update_channel**](ChannelsApi.md#update_channel)|**PATCH** /{domainID}/channels/{chanID}|Updates channel data.| +|[**update_channel_tags**](ChannelsApi.md#update_channel_tags)|**PATCH** /{domainID}/channels/{chanID}/tags|Updates channel tags.| +## connect\_clients\_and\_channels +connect\_clients\_and\_channels(domain\_id, connection\_req\_schema) +Connects client and channel. + +Connect clients specified by IDs to channels specified by IDs. Channel and client are owned by user identified using the provided access token. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**connection\_req\_schema**|[**ConnectionReqSchema**](ConnectionReqSchema.md)|JSON-formatted document describing the new connection.|[required]|| +### Return type +(empty response body) +### Authorization +[refreshAuth](../README.md#refreshAuth), [basicAuth](../README.md#basicAuth), [bearerAuth](../README.md#bearerAuth), [clientAuth](../README.md#clientAuth) +### HTTP request headers +- **Content-Type**: application/json +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## connect\_clients\_to\_channel +connect\_clients\_to\_channel(domain\_id, chan\_id, channel\_connection\_req\_schema) +Connects clients to a channel + +Connects clients to a channel that is identified by the channel ID. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**chan\_id**|**uuid::Uuid**|Unique channel identifier.|[required]|| +|**channel\_connection\_req\_schema**|[**ChannelConnectionReqSchema**](ChannelConnectionReqSchema.md)|JSON-formatted document describing the new connection.|[required]|| +### Return type +(empty response body) +### Authorization +[refreshAuth](../README.md#refreshAuth), [basicAuth](../README.md#basicAuth), [bearerAuth](../README.md#bearerAuth), [clientAuth](../README.md#clientAuth) +### HTTP request headers +- **Content-Type**: application/json +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## create\_channel +crate::models::Channel create\_channel(domain\_id, channel\_req\_obj) +Creates new channel + +Creates new channel in domain. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**channel\_req\_obj**|[**ChannelReqObj**](ChannelReqObj.md)|JSON-formatted document describing the new channel to be registered|[required]|| +### Return type +[**crate::models::Channel**](Channel.md) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: application/json +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## create\_channels +Vec create\_channels(domain\_id, channel\_req\_obj) +Creates new channels + +Creates new channels in domain. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**channel\_req\_obj**|**Vec**|JSON-formatted document describing the new channels to be registered|[required]|| +### Return type +[**Vec\[crate::models::Channel**\](crate::models::Channel)**](Channel.md) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: application/json +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## disable\_channel +crate::models::Channel disable\_channel(domain\_id, chan\_id) +Disables a channel + +Disables a specific channel that is identified by the channel ID. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**chan\_id**|**uuid::Uuid**|Unique channel identifier.|[required]|| +### Return type +[**crate::models::Channel**](Channel.md) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## disconnect\_clients\_and\_channels +disconnect\_clients\_and\_channels(domain\_id, connection\_req\_schema) +Disconnects client and channel. + +Disconnect clients specified by IDs from channels specified by IDs. Channel and client are owned by user identified using the provided access token. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**connection\_req\_schema**|[**ConnectionReqSchema**](ConnectionReqSchema.md)|JSON-formatted document describing the new connection.|[required]|| +### Return type +(empty response body) +### Authorization +[refreshAuth](../README.md#refreshAuth), [basicAuth](../README.md#basicAuth), [bearerAuth](../README.md#bearerAuth), [clientAuth](../README.md#clientAuth) +### HTTP request headers +- **Content-Type**: application/json +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## disconnect\_clients\_from\_channel +disconnect\_clients\_from\_channel(domain\_id, chan\_id, channel\_connection\_req\_schema) +Disconnects clients from a channel + +Disconnects clients to a channel that is identified by the channel ID. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**chan\_id**|**uuid::Uuid**|Unique channel identifier.|[required]|| +|**channel\_connection\_req\_schema**|[**ChannelConnectionReqSchema**](ChannelConnectionReqSchema.md)|JSON-formatted document describing the new connection.|[required]|| +### Return type +(empty response body) +### Authorization +[refreshAuth](../README.md#refreshAuth), [basicAuth](../README.md#basicAuth), [bearerAuth](../README.md#bearerAuth), [clientAuth](../README.md#clientAuth) +### HTTP request headers +- **Content-Type**: application/json +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## domain\_id\_channels\_chan\_id\_delete +domain\_id\_channels\_chan\_id\_delete(domain\_id, chan\_id) +Delete channel for given channel id. + +Delete channel remove given channel id from repo and removes all the policies related to channel. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**chan\_id**|**uuid::Uuid**|Unique channel identifier.|[required]|| +### Return type +(empty response body) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## enable\_channel +crate::models::Channel enable\_channel(domain\_id, chan\_id) +Enables a channel + +Enables a specific channel that is identified by the channel ID. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**chan\_id**|**uuid::Uuid**|Unique channel identifier.|[required]|| +### Return type +[**crate::models::Channel**](Channel.md) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## get\_channel +crate::models::Channel get\_channel(domain\_id, chan\_id) +Retrieves channel info. + +Gets info on a channel specified by id. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**chan\_id**|**uuid::Uuid**|Unique channel identifier.|[required]|| +### Return type +[**crate::models::Channel**](Channel.md) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## list\_channels +crate::models::ChannelsPage list\_channels(domain\_id, limit, offset, metadata, name) +Lists channels. + +Retrieves a list of channels. Due to performance concerns, data is retrieved in subsets. The API clients must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**limit**|Option<**i32**>|Size of the subset to retrieve.||[default to 10]| +|**offset**|Option<**i32**>|Number of items to skip during retrieval.||[default to 0]| +|**metadata**|Option<**::std::collections::HashMap**>|Metadata filter. Filtering is performed matching the parameter with metadata on top level. Parameter is json.||| +|**name**|Option<**String**>|Channel's name.||| +### Return type +[**crate::models::ChannelsPage**](ChannelsPage.md) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## remove\_channel\_parent\_group +remove\_channel\_parent\_group(domain\_id, chan\_id, parent\_group\_req\_obj) +Removes a parent group from a channel. + +Removes a parent group from a specific channel that is identified by the channel ID. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**chan\_id**|**uuid::Uuid**|Unique channel identifier.|[required]|| +|**parent\_group\_req\_obj**|[**ParentGroupReqObj**](ParentGroupReqObj.md)|JSON-formated document describing the parent group to be set to or removed from a channel.|[required]|| +### Return type +(empty response body) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: application/json +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## set\_channel\_parent\_group +set\_channel\_parent\_group(domain\_id, chan\_id, parent\_group\_req\_obj) +Sets a parent group for a channel + +Sets a parent group for a specific channel that is identified by the channel ID. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**chan\_id**|**uuid::Uuid**|Unique channel identifier.|[required]|| +|**parent\_group\_req\_obj**|[**ParentGroupReqObj**](ParentGroupReqObj.md)|JSON-formated document describing the parent group to be set to or removed from a channel.|[required]|| +### Return type +(empty response body) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: application/json +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## update\_channel +crate::models::Channel update\_channel(domain\_id, chan\_id, channel\_update) +Updates channel data. + +Update is performed by replacing the current resource data with values provided in a request payload. Note that the channel's ID will not be affected. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**chan\_id**|**uuid::Uuid**|Unique channel identifier.|[required]|| +|**channel\_update**|[**ChannelUpdate**](ChannelUpdate.md)|JSON-formated document describing the metadata and name of channel to be updated.|[required]|| +### Return type +[**crate::models::Channel**](Channel.md) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: application/json +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## update\_channel\_tags +crate::models::Channel update\_channel\_tags(domain\_id, chan\_id, channel\_update) +Updates channel tags. + +Update is performed by replacing the current resource data with values provided in a request payload. Note that the channel's ID will not be affected. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**chan\_id**|**uuid::Uuid**|Unique channel identifier.|[required]|| +|**channel\_update**|[**ChannelUpdate**](ChannelUpdate.md)|JSON-formated document describing the tags of channel to be updated.|[required]|| +### Return type +[**crate::models::Channel**](Channel.md) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: application/json +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +# ChannelsPage +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**channels**|**Vec**||| +|**total**|**i32**|Total number of items.|| +|**offset**|**i32**|Number of items to skip during retrieval.|| +|**limit**|Option<**i32**>|Maximum number of items to return in one page.|[optional]| + + +# ChannelUpdate +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**name**|**String**|Free-form channel name. Channel name is unique on the given hierarchy level.|| +|**description**|**String**|Channel description, free form text.|| +|**metadata**|[**serde_json::Value**](.md)|Arbitrary, object-encoded channels's data.|| + +# ChannelUpdateTags +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**tags**|**Vec**|Channel tags.|| + +# ChildrenGroupReqObj +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**groups**|**Vec**|Children group IDs.|| + +# Client +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**id**|Option<[**uuid::Uuid**](uuid::Uuid.md)>|Client unique identifier.|[optional]| +|**name**|Option<**String**>|Client name.|[optional]| +|**tags**|Option<**Vec**>|Client tags.|[optional]| +|**domain\_id**|Option<[**uuid::Uuid**](uuid::Uuid.md)>|ID of the domain to which client belongs.|[optional]| +|**credentials**|Option<[**crate::models::ClientCredentials**](Client_credentials.md)>||[optional]| +|**metadata**|Option<[**serde_json::Value**](.md)>|Arbitrary, object-encoded client's data.|[optional]| +|**status**|Option<**String**>|Client Status|[optional]| +|**created\_at**|Option<**String**>|Time when the channel was created.|[optional]| +|**updated\_at**|Option<**String**>|Time when the channel was created.|[optional]| + + +# ClientCredentials +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**identity**|Option<**String**>|Client Identity for example email address.|[optional]| +|**secret**|Option<**String**>|Client secret password.|[optional]| + + +# ClientReqObj +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**name**|Option<**String**>|Client name.|[optional]| +|**tags**|Option<**Vec**>|Client tags.|[optional]| +|**credentials**|[**crate::models::ClientReqObjCredentials**](ClientReqObj_credentials.md)||| +|**metadata**|Option<[**serde_json::Value**](.md)>|Arbitrary, object-encoded client's data.|[optional]| +|**status**|Option<**String**>|Client Status|[optional]| + + + + +# ClientReqObjCredentials +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**identity**|Option<**String**>|Client's identity will be used as its unique identifier|[optional]| +|**secret**|Option<**String**>|Free-form account secret used for acquiring auth token(s).|[optional]| + + +# \ClientsApi +All URIs are relative to *http://localhost:9001* + +|Method|HTTP request|Description| +| :-: | :-: | :-: | +|[**add_client_role_action**](ClientsApi.md#add_client_role_action)|**POST** /{domainID}/clients/{clientID}/roles/{roleName}/actions|Adds a role action for a client role.| +|[**add_client_role_member**](ClientsApi.md#add_client_role_member)|**POST** /{domainID}/clients/{clientID}/roles/{roleName}/members|Adds a member to a client role.| +|[**bulk_create_clients**](ClientsApi.md#bulk_create_clients)|**POST** /{domainID}/clients/bulk|Bulk provisions new clients| +|[**create_client**](ClientsApi.md#create_client)|**POST** /{domainID}/clients|Adds new client| +|[**create_client_role**](ClientsApi.md#create_client_role)|**POST** /{domainID}/clients/{clientID}/roles|Creates a role for a client| +|[**delete_all_client_role_actions**](ClientsApi.md#delete_all_client_role_actions)|**POST** /{domainID}/clients/{clientID}/roles/{roleName}/actions/delete-all|Deletes all role actions for a client role.| +|[**delete_all_client_role_members**](ClientsApi.md#delete_all_client_role_members)|**POST** /{domainID}/clients/{clientID}/roles/{roleName}/members/delete-all|Deletes all members from a client role.| +|[**delete_client_role**](ClientsApi.md#delete_client_role)|**DELETE** /{domainID}/clients/{clientID}/roles/{roleName}|Deletes client role.| +|[**delete_client_role_action**](ClientsApi.md#delete_client_role_action)|**POST** /{domainID}/clients/{clientID}/roles/{roleName}/actions/delete|Deletes role actions for a client role.| +|[**delete_client_role_members**](ClientsApi.md#delete_client_role_members)|**POST** /{domainID}/clients/{clientID}/roles/{roleName}/members/delete|Deletes members from a client role.| +|[**disable_client**](ClientsApi.md#disable_client)|**POST** /{domainID}/clients/{clientID}/disable|Disables a client| +|[**domain_id_clients_client_id_delete**](ClientsApi.md#domain_id_clients_client_id_delete)|**DELETE** /{domainID}/clients/{clientID}|Delete client for a client with the given id.| +|[**enable_client**](ClientsApi.md#enable_client)|**POST** /{domainID}/clients/{clientID}/enable|Enables a client| +|[**get_client**](ClientsApi.md#get_client)|**GET** /{domainID}/clients/{clientID}|Retrieves client info| +|[**get_client_role**](ClientsApi.md#get_client_role)|**GET** /{domainID}/clients/{clientID}/roles/{roleName}|Retrieves client role.| +|[**list_available_actions**](ClientsApi.md#list_available_actions)|**GET** /{domainID}/clients/roles/available-actions|Retrieves available actions.| +|[**list_client_role_actions**](ClientsApi.md#list_client_role_actions)|**GET** /{domainID}/clients/{clientID}/roles/{roleName}/actions|Lists client role actions.| +|[**list_client_role_members**](ClientsApi.md#list_client_role_members)|**GET** /{domainID}/clients/{clientID}/roles/{roleName}/members|Lists client role members.| +|[**list_client_roles**](ClientsApi.md#list_client_roles)|**GET** /{domainID}/clients/{clientID}/roles|Retrieves clients roles.| +|[**list_clients**](ClientsApi.md#list_clients)|**GET** /{domainID}/clients|Retrieves clients| +|[**list_user_clients**](ClientsApi.md#list_user_clients)|**GET** /{domainID}/users/{userID}/clients|List clients asssociated with a user.| +|[**remove_client_parent_group**](ClientsApi.md#remove_client_parent_group)|**DELETE** /{domainID}/clients/{clientID}/parent|Removes a parent group from a client.| +|[**set_client_parent_group**](ClientsApi.md#set_client_parent_group)|**POST** /{domainID}/clients/{clientID}/parent|Sets a parent group for a client| +|[**update_client**](ClientsApi.md#update_client)|**PATCH** /{domainID}/clients/{clientID}|Updates name and metadata of the client.| +|[**update_client_role**](ClientsApi.md#update_client_role)|**PUT** /{domainID}/clients/{clientID}/roles/{roleName}|Updates client role.| +|[**update_client_secret**](ClientsApi.md#update_client_secret)|**PATCH** /{domainID}/clients/{clientID}/secret|Updates Secret of the identified client.| +|[**update_client_tags**](ClientsApi.md#update_client_tags)|**PATCH** /{domainID}/clients/{clientID}/tags|Updates tags the client.| +## add\_client\_role\_action +crate::models::RoleActionsObj add\_client\_role\_action(domain\_id, client\_id, role\_name, role\_actions\_obj) +Adds a role action for a client role. + +Adds a role action for a specific client role that is identified by the role name. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**client\_id**|**uuid::Uuid**|Unique client identifier.|[required]|| +|**role\_name**|**String**|Role's name.|[required]|| +|**role\_actions\_obj**|[**RoleActionsObj**](RoleActionsObj.md)|JSON- formatted object decsribing an action to be added to a role.|[required]|| +### Return type +[**crate::models::RoleActionsObj**](RoleActionsObj.md) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: application/json +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## add\_client\_role\_member +crate::models::RoleMembersObj add\_client\_role\_member(domain\_id, client\_id, role\_name, role\_members\_obj) +Adds a member to a client role. + +Adds a member to a specific client role that is identified by the role name. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**client\_id**|**uuid::Uuid**|Unique client identifier.|[required]|| +|**role\_name**|**String**|Role's name.|[required]|| +|**role\_members\_obj**|[**RoleMembersObj**](RoleMembersObj.md)|JSON- formatted object decsribing a member to be added to a role.|[required]|| +### Return type +[**crate::models::RoleMembersObj**](RoleMembersObj.md) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: application/json +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## bulk\_create\_clients +crate::models::ClientsPage bulk\_create\_clients(domain\_id, client\_req\_obj) +Bulk provisions new clients + +Adds a list of new clients to the list of clients owned by user identified using the provided access token. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**client\_req\_obj**|**Vec**|JSON-formatted document describing the new clients.|[required]|| +### Return type +[**crate::models::ClientsPage**](ClientsPage.md) +### Authorization +[refreshAuth](../README.md#refreshAuth), [basicAuth](../README.md#basicAuth), [bearerAuth](../README.md#bearerAuth), [clientAuth](../README.md#clientAuth) +### HTTP request headers +- **Content-Type**: application/json +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## create\_client +crate::models::Client create\_client(domain\_id, client\_req\_obj) +Adds new client + +Adds new client to the list of clients owned by user identified using the provided access token. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**client\_req\_obj**|[**ClientReqObj**](ClientReqObj.md)|JSON-formatted document describing the new client to be registered|[required]|| +### Return type +[**crate::models::Client**](Client.md) +### Authorization +[refreshAuth](../README.md#refreshAuth), [basicAuth](../README.md#basicAuth), [bearerAuth](../README.md#bearerAuth), [clientAuth](../README.md#clientAuth) +### HTTP request headers +- **Content-Type**: application/json +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## create\_client\_role +crate::models::NewRole create\_client\_role(domain\_id, client\_id, create\_role\_obj) +Creates a role for a client + +Creates a role for a specific client that is identified by the client ID. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**client\_id**|**uuid::Uuid**|Unique client identifier.|[required]|| +|**create\_role\_obj**|[**CreateRoleObj**](CreateRoleObj.md)|JSON- formatted object decsribing a new role to be created.|[required]|| +### Return type +[**crate::models::NewRole**](NewRole.md) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: application/json +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## delete\_all\_client\_role\_actions +delete\_all\_client\_role\_actions(domain\_id, client\_id, role\_name) +Deletes all role actions for a client role. + +Deletes all role actions for a specific client role that is identified by the role name. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**client\_id**|**uuid::Uuid**|Unique client identifier.|[required]|| +|**role\_name**|**String**|Role's name.|[required]|| +### Return type +(empty response body) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## delete\_all\_client\_role\_members +delete\_all\_client\_role\_members(domain\_id, client\_id, role\_name) +Deletes all members from a client role. + +Deletes all members from a specific client role that is identified by the role name. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**client\_id**|**uuid::Uuid**|Unique client identifier.|[required]|| +|**role\_name**|**String**|Role's name.|[required]|| +### Return type +(empty response body) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## delete\_client\_role +delete\_client\_role(domain\_id, client\_id, role\_name) +Deletes client role. + +Deletes a specific client role that is identified by the role name. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**client\_id**|**uuid::Uuid**|Unique client identifier.|[required]|| +|**role\_name**|**String**|Role's name.|[required]|| +### Return type +(empty response body) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## delete\_client\_role\_action +delete\_client\_role\_action(domain\_id, client\_id, role\_name, role\_actions\_obj) +Deletes role actions for a client role. + +Deletes a role action for a specific client role that is identified by the role name. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**client\_id**|**uuid::Uuid**|Unique client identifier.|[required]|| +|**role\_name**|**String**|Role's name.|[required]|| +|**role\_actions\_obj**|[**RoleActionsObj**](RoleActionsObj.md)|JSON- formatted object decsribing an action to be added to a role.|[required]|| +### Return type +(empty response body) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: application/json +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## delete\_client\_role\_members +delete\_client\_role\_members(domain\_id, client\_id, role\_name, role\_members\_obj) +Deletes members from a client role. + +Deletes a member from a specific client role that is identified by the role name. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**client\_id**|**uuid::Uuid**|Unique client identifier.|[required]|| +|**role\_name**|**String**|Role's name.|[required]|| +|**role\_members\_obj**|[**RoleMembersObj**](RoleMembersObj.md)|JSON- formatted object decsribing a member to be added to a role.|[required]|| +### Return type +(empty response body) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: application/json +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## disable\_client +crate::models::Client disable\_client(domain\_id, client\_id) +Disables a client + +Disables a specific client that is identified by the client ID. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**client\_id**|**uuid::Uuid**|Unique client identifier.|[required]|| +### Return type +[**crate::models::Client**](Client.md) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## domain\_id\_clients\_client\_id\_delete +domain\_id\_clients\_client\_id\_delete(domain\_id, client\_id) +Delete client for a client with the given id. + +Delete client removes a client with the given id from repo and removes all the policies related to this client. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**client\_id**|**uuid::Uuid**|Unique client identifier.|[required]|| +### Return type +(empty response body) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## enable\_client +crate::models::Client enable\_client(domain\_id, client\_id) +Enables a client + +Enables a specific client that is identified by the client ID. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**client\_id**|**uuid::Uuid**|Unique client identifier.|[required]|| +### Return type +[**crate::models::Client**](Client.md) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## get\_client +crate::models::Client get\_client(domain\_id, client\_id) +Retrieves client info + +Retrieves a specific client that is identified by the client ID. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**client\_id**|**uuid::Uuid**|Unique client identifier.|[required]|| +### Return type +[**crate::models::Client**](Client.md) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## get\_client\_role +crate::models::Role get\_client\_role(domain\_id, client\_id, role\_name) +Retrieves client role. + +Retrieves a specific client role that is identified by the role name. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**client\_id**|**uuid::Uuid**|Unique client identifier.|[required]|| +|**role\_name**|**String**|Role's name.|[required]|| +### Return type +[**crate::models::Role**](Role.md) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## list\_available\_actions +crate::models::AvailableActionsObj list\_available\_actions(domain\_id) +Retrieves available actions. + +Retrieves a list of available actions. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +### Return type +[**crate::models::AvailableActionsObj**](AvailableActionsObj.md) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## list\_client\_role\_actions +crate::models::RoleActionsObj list\_client\_role\_actions(domain\_id, client\_id, role\_name) +Lists client role actions. + +Retrieves a list of client role actions. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**client\_id**|**uuid::Uuid**|Unique client identifier.|[required]|| +|**role\_name**|**String**|Role's name.|[required]|| +### Return type +[**crate::models::RoleActionsObj**](RoleActionsObj.md) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## list\_client\_role\_members +crate::models::RoleMembersObj list\_client\_role\_members(domain\_id, client\_id, role\_name) +Lists client role members. + +Retrieves a list of client role members. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**client\_id**|**uuid::Uuid**|Unique client identifier.|[required]|| +|**role\_name**|**String**|Role's name.|[required]|| +### Return type +[**crate::models::RoleMembersObj**](RoleMembersObj.md) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## list\_client\_roles +crate::models::RolesPage list\_client\_roles(domain\_id, client\_id, limit, offset) +Retrieves clients roles. + +Retrieves a list of client roles. Due to performance concerns, data is retrieved in subsets. The API clients must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**client\_id**|**uuid::Uuid**|Unique client identifier.|[required]|| +|**limit**|Option<**i32**>|Size of the subset to retrieve.||[default to 10]| +|**offset**|Option<**i32**>|Number of items to skip during retrieval.||[default to 0]| +### Return type +[**crate::models::RolesPage**](RolesPage.md) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## list\_clients +crate::models::ClientsPage list\_clients(domain\_id, limit, offset, metadata, status, name, tags) +Retrieves clients + +Retrieves a list of clients. Due to performance concerns, data is retrieved in subsets. The API clients must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**limit**|Option<**i32**>|Size of the subset to retrieve.||[default to 10]| +|**offset**|Option<**i32**>|Number of items to skip during retrieval.||[default to 0]| +|**metadata**|Option<**::std::collections::HashMap**>|Metadata filter. Filtering is performed matching the parameter with metadata on top level. Parameter is json.||| +|**status**|Option<**String**>|Client account status.||[default to enabled]| +|**name**|Option<**String**>|Client's name.||| +|**tags**|Option<**Vec**>|Client tags.||| +### Return type +[**crate::models::ClientsPage**](ClientsPage.md) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## list\_user\_clients +crate::models::ClientsPage list\_user\_clients(domain\_id, user\_id, limit, offset, metadata, status, name, tags) +List clients asssociated with a user. + +Lists clients associated with a user identified by the user ID. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**user\_id**|**uuid::Uuid**|Unique user identifier.|[required]|| +|**limit**|Option<**i32**>|Size of the subset to retrieve.||[default to 10]| +|**offset**|Option<**i32**>|Number of items to skip during retrieval.||[default to 0]| +|**metadata**|Option<**::std::collections::HashMap**>|Metadata filter. Filtering is performed matching the parameter with metadata on top level. Parameter is json.||| +|**status**|Option<**String**>|Client account status.||[default to enabled]| +|**name**|Option<**String**>|Client's name.||| +|**tags**|Option<**Vec**>|Client tags.||| +### Return type +[**crate::models::ClientsPage**](ClientsPage.md) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## remove\_client\_parent\_group +remove\_client\_parent\_group(domain\_id, client\_id, parent\_group\_req\_obj) +Removes a parent group from a client. + +Removes a parent group from a specific client that is identified by the client ID. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**client\_id**|**uuid::Uuid**|Unique client identifier.|[required]|| +|**parent\_group\_req\_obj**|[**ParentGroupReqObj**](ParentGroupReqObj.md)|JSON-formated document describing the parent group to be set to or removed from a client.|[required]|| +### Return type +(empty response body) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: application/json +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## set\_client\_parent\_group +set\_client\_parent\_group(domain\_id, client\_id, parent\_group\_req\_obj) +Sets a parent group for a client + +Sets a parent group for a specific client that is identified by the client ID. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**client\_id**|**uuid::Uuid**|Unique client identifier.|[required]|| +|**parent\_group\_req\_obj**|[**ParentGroupReqObj**](ParentGroupReqObj.md)|JSON-formated document describing the parent group to be set to or removed from a client.|[required]|| +### Return type +(empty response body) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: application/json +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## update\_client +crate::models::Client update\_client(domain\_id, client\_id, client\_update) +Updates name and metadata of the client. + +Update is performed by replacing the current resource data with values provided in a request payload. Note that the client's type and ID cannot be changed. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**client\_id**|**uuid::Uuid**|Unique client identifier.|[required]|| +|**client\_update**|[**ClientUpdate**](ClientUpdate.md)|JSON-formated document describing the metadata and name of client to be update|[required]|| +### Return type +[**crate::models::Client**](Client.md) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: application/json +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## update\_client\_role +crate::models::Role update\_client\_role(domain\_id, client\_id, role\_name, update\_role\_obj) +Updates client role. + +Updates a specific client role that is identified by the role name. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**client\_id**|**uuid::Uuid**|Unique client identifier.|[required]|| +|**role\_name**|**String**|Role's name.|[required]|| +|**update\_role\_obj**|[**UpdateRoleObj**](UpdateRoleObj.md)|JSON- formatted object decsribing a role to be updated.|[required]|| +### Return type +[**crate::models::Role**](Role.md) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: application/json +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## update\_client\_secret +crate::models::Client update\_client\_secret(domain\_id, client\_id, client\_secret) +Updates Secret of the identified client. + +Updates secret of the identified in client. Secret is updated using authorization token and the new received info. Update is performed by replacing current key with a new one. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**client\_id**|**uuid::Uuid**|Unique client identifier.|[required]|| +|**client\_secret**|[**ClientSecret**](ClientSecret.md)|Secret change data. Client can change its secret.|[required]|| +### Return type +[**crate::models::Client**](Client.md) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: application/json +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## update\_client\_tags +crate::models::Client update\_client\_tags(domain\_id, client\_id, client\_tags) +Updates tags the client. + +Updates tags of the client with provided ID. Tags is updated using authorization token and the new tags received in request. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**client\_id**|**uuid::Uuid**|Unique client identifier.|[required]|| +|**client\_tags**|[**ClientTags**](ClientTags.md)|JSON-formated document describing the tags of client to be update|[required]|| +### Return type +[**crate::models::Client**](Client.md) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: application/json +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +# ClientSecret +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**secret**|**String**|New client secret.|| + +# ClientsPage +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**clients**|**Vec**||| +|**total**|**i32**|Total number of items.|| +|**offset**|**i32**|Number of items to skip during retrieval.|| +|**limit**|Option<**i32**>|Maximum number of items to return in one page.|[optional]| + + +# ClientTags +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**tags**|Option<**Vec**>|Client tags.|[optional]| + + +# ClientUpdate +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**name**|**String**|Client name.|| +|**metadata**|[**serde_json::Value**](.md)|Arbitrary, object-encoded client's data.|| + +# ClientWithEmptySecret +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**id**|Option<[**uuid::Uuid**](uuid::Uuid.md)>|Client unique identifier.|[optional]| +|**name**|Option<**String**>|Client name.|[optional]| +|**tags**|Option<**Vec**>|Client tags.|[optional]| +|**domain\_id**|Option<[**uuid::Uuid**](uuid::Uuid.md)>|ID of the domain to which client belongs.|[optional]| +|**credentials**|Option<[**crate::models::ClientWithEmptySecretCredentials**](ClientWithEmptySecret_credentials.md)>||[optional]| +|**metadata**|Option<[**serde_json::Value**](.md)>|Arbitrary, object-encoded client's data.|[optional]| +|**status**|Option<**String**>|Client Status|[optional]| +|**created\_at**|Option<**String**>|Time when the channel was created.|[optional]| +|**updated\_at**|Option<**String**>|Time when the channel was created.|[optional]| + + +# ClientWithEmptySecretCredentials +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**identity**|Option<**String**>|Client Identity for example email address.|[optional]| +|**secret**|Option<**String**>|Client secret password.|[optional]| + + +# Config +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**client\_id**|Option<[**uuid::Uuid**](uuid::Uuid.md)>|Corresponding SuperMQ Client ID.|[optional]| +|**magistrala\_secret**|Option<[**uuid::Uuid**](uuid::Uuid.md)>|Corresponding SuperMQ Client key.|[optional]| +|**channels**|Option<**Vec**>||[optional]| +|**external\_id**|**String**|External ID (MAC address or some unique identifier).|| +|**external\_key**|**String**|External key.|| +|**content**|Option<**String**>|Free-form custom configuration.|[optional]| +|**state**|Option<[**crate::models::State**](State.md)>||[optional]| +|**client\_cert**|Option<**String**>|Client certificate.|[optional]| +|**ca\_cert**|Option<**String**>|Issuing CA certificate.|[optional]| + + +# ConfigChannelsInner +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**id**|Option<[**uuid::Uuid**](uuid::Uuid.md)>|Channel unique identifier.|[optional]| +|**name**|Option<**String**>|Name of the Channel.|[optional]| +|**metadata**|Option<[**serde_json::Value**](.md)>|Custom metadata related to the Channel.|[optional]| + + + +# ConfigList +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**total**|Option<**i32**>|Total number of results.|[optional]| +|**offset**|Option<**i32**>|Number of items to skip during retrieval.|[optional][default to 0]| +|**limit**|Option<**i32**>|Size of the subset to retrieve.|[optional][default to 10]| +|**configs**|**Vec**||| + +# \ConfigsApi +All URIs are relative to *http://localhost:9001* + +|Method|HTTP request|Description| +| :-: | :-: | :-: | +|[**create_config**](ConfigsApi.md#create_config)|**POST** /{domainID}/clients/configs|Adds new config| +|[**get_bootstrap_config**](ConfigsApi.md#get_bootstrap_config)|**GET** /clients/bootstrap/{externalId}|Retrieves configuration.| +|[**get_config**](ConfigsApi.md#get_config)|**GET** /{domainID}/clients/configs/{configId}|Retrieves config info (with channels).| +|[**get_configs**](ConfigsApi.md#get_configs)|**GET** /{domainID}/clients/configs|Retrieves managed configs| +|[**get_secure_bootstrap_config**](ConfigsApi.md#get_secure_bootstrap_config)|**GET** /clients/bootstrap/secure/{externalId}|Retrieves configuration.| +|[**remove_config**](ConfigsApi.md#remove_config)|**DELETE** /{domainID}/clients/configs/{configId}|Removes a Config| +|[**update_config**](ConfigsApi.md#update_config)|**PUT** /{domainID}/clients/configs/{configId}|Updates config info| +|[**update_config_certs**](ConfigsApi.md#update_config_certs)|**PATCH** /{domainID}/clients/configs/certs/{configId}|Updates certs| +|[**update_config_connections**](ConfigsApi.md#update_config_connections)|**PUT** /{domainID}/clients/configs/connections/{configId}|Updates channels the client is connected to| +|[**update_config_state**](ConfigsApi.md#update_config_state)|**PUT** /{domainID}/clients/state/{configId}|Updates Config state.| +## create\_config +create\_config(domain\_id, create\_config\_request) +Adds new config + +Adds new config to the list of config owned by user identified using the provided access token. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**create\_config\_request**|[**CreateConfigRequest**](CreateConfigRequest.md)|JSON-formatted document describing the new config.|[required]|| +### Return type +(empty response body) +### Authorization +[refreshAuth](../README.md#refreshAuth), [basicAuth](../README.md#basicAuth), [bearerAuth](../README.md#bearerAuth), [clientAuth](../README.md#clientAuth) +### HTTP request headers +- **Content-Type**: application/json +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## get\_bootstrap\_config +crate::models::BootstrapConfig get\_bootstrap\_config(external\_id) +Retrieves configuration. + +Retrieves a configuration with given external ID and external key. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**external\_id**|**String**|Unique Config identifier provided by external entity.|[required]|| +### Return type +[**crate::models::BootstrapConfig**](BootstrapConfig.md) +### Authorization +[bootstrapAuth](../README.md#bootstrapAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## get\_config +crate::models::Config get\_config(domain\_id, config\_id) +Retrieves config info (with channels). +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**config\_id**|**uuid::Uuid**|Unique Config identifier. It's the ID of the corresponding Client.|[required]|| +### Return type +[**crate::models::Config**](Config.md) +### Authorization +[refreshAuth](../README.md#refreshAuth), [basicAuth](../README.md#basicAuth), [bearerAuth](../README.md#bearerAuth), [clientAuth](../README.md#clientAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## get\_configs +crate::models::ConfigList get\_configs(domain\_id, limit, offset, state, name) +Retrieves managed configs + +Retrieves a list of managed configs. Due to performance concerns, data is retrieved in subsets. The API configs must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**limit**|Option<**i32**>|Size of the subset to retrieve.||[default to 10]| +|**offset**|Option<**i32**>|Number of items to skip during retrieval.||[default to 0]| +|**state**|Option<[**State**](.md)>|A state of items||| +|**name**|Option<**String**>|Name of the config. Search by name is partial-match and case-insensitive.||| +### Return type +[**crate::models::ConfigList**](ConfigList.md) +### Authorization +[refreshAuth](../README.md#refreshAuth), [basicAuth](../README.md#basicAuth), [bearerAuth](../README.md#bearerAuth), [clientAuth](../README.md#clientAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## get\_secure\_bootstrap\_config +crate::models::BootstrapConfig get\_secure\_bootstrap\_config(external\_id) +Retrieves configuration. + +Retrieves a configuration with given external ID and encrypted external key. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**external\_id**|**String**|Unique Config identifier provided by external entity.|[required]|| +### Return type +[**crate::models::BootstrapConfig**](BootstrapConfig.md) +### Authorization +[bootstrapEncAuth](../README.md#bootstrapEncAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## remove\_config +remove\_config(domain\_id, config\_id) +Removes a Config + +Removes a Config. In case of successful removal the service will ensure that the removed config is disconnected from all of the SuperMQ channels. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**config\_id**|**uuid::Uuid**|Unique Config identifier. It's the ID of the corresponding Client.|[required]|| +### Return type +(empty response body) +### Authorization +[refreshAuth](../README.md#refreshAuth), [basicAuth](../README.md#basicAuth), [bearerAuth](../README.md#bearerAuth), [clientAuth](../README.md#clientAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## update\_config +update\_config(domain\_id, config\_id, update\_config\_request) +Updates config info + +Update is performed by replacing the current resource data with values provided in a request payload. Note that the owner, ID, external ID, external key, SuperMQ Client ID and key cannot be changed. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**config\_id**|**uuid::Uuid**|Unique Config identifier. It's the ID of the corresponding Client.|[required]|| +|**update\_config\_request**|Option<[**UpdateConfigRequest**](UpdateConfigRequest.md)>|JSON-formatted document describing the updated client.||| +### Return type +(empty response body) +### Authorization +[refreshAuth](../README.md#refreshAuth), [basicAuth](../README.md#basicAuth), [bearerAuth](../README.md#bearerAuth), [clientAuth](../README.md#clientAuth) +### HTTP request headers +- **Content-Type**: application/json +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## update\_config\_certs +crate::models::ConfigUpdateCerts update\_config\_certs(domain\_id, config\_id, update\_config\_certs\_request) +Updates certs + +Update is performed by replacing the current certificate data with values provided in a request payload. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**config\_id**|**uuid::Uuid**|Unique Config identifier. It's the ID of the corresponding Client.|[required]|| +|**update\_config\_certs\_request**|Option<[**UpdateConfigCertsRequest**](UpdateConfigCertsRequest.md)>|JSON-formatted document describing the updated client.||| +### Return type +[**crate::models::ConfigUpdateCerts**](ConfigUpdateCerts.md) +### Authorization +[refreshAuth](../README.md#refreshAuth), [basicAuth](../README.md#basicAuth), [bearerAuth](../README.md#bearerAuth), [clientAuth](../README.md#clientAuth) +### HTTP request headers +- **Content-Type**: application/json +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## update\_config\_connections +update\_config\_connections(domain\_id, config\_id, update\_config\_connections\_request) +Updates channels the client is connected to + +Update connections performs update of the channel list corresponding Client is connected to. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**config\_id**|**uuid::Uuid**|Unique Config identifier. It's the ID of the corresponding Client.|[required]|| +|**update\_config\_connections\_request**|Option<[**UpdateConfigConnectionsRequest**](UpdateConfigConnectionsRequest.md)>|Array if IDs the client is be connected to.||| +### Return type +(empty response body) +### Authorization +[refreshAuth](../README.md#refreshAuth), [basicAuth](../README.md#basicAuth), [bearerAuth](../README.md#bearerAuth), [clientAuth](../README.md#clientAuth) +### HTTP request headers +- **Content-Type**: application/json +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## update\_config\_state +update\_config\_state(domain\_id, config\_id, update\_config\_state\_request) +Updates Config state. + +Updating state represents enabling/disabling Config, i.e. connecting and disconnecting corresponding SuperMQ Client to the list of Channels. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**config\_id**|**uuid::Uuid**|Unique Config identifier. It's the ID of the corresponding Client.|[required]|| +|**update\_config\_state\_request**|Option<[**UpdateConfigStateRequest**](UpdateConfigStateRequest.md)>|Update the state of the Config.||| +### Return type +(empty response body) +### Authorization +[refreshAuth](../README.md#refreshAuth), [basicAuth](../README.md#basicAuth), [bearerAuth](../README.md#bearerAuth), [clientAuth](../README.md#clientAuth) +### HTTP request headers +- **Content-Type**: application/json +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +# ConfigUpdateCerts +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**client\_id**|[**uuid::Uuid**](uuid::Uuid.md)|Corresponding SuperMQ Client ID.|| +|**client\_cert**|Option<**String**>|Client certificate.|[optional]| +|**client\_key**|**String**|Key for the client\_cert.|| +|**ca\_cert**|Option<**String**>|Issuing CA certificate.|[optional]| + + +# ConnectionReqSchema +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**channel\_ids**|Option<**Vec**>|Channel IDs.|[optional]| +|**client\_ids**|Option<**Vec**>|Client IDs|[optional]| +|**types**|Option<**Vec**>|Connection types.|[optional]| + + +# CreateCertRequest +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**client\_id**|[**uuid::Uuid**](uuid::Uuid.md)||| +|**ttl**|**String**||| + +# CreateConfigRequest +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**external\_id**|**String**|External ID (MAC address or some unique identifier).|| +|**external\_key**|**String**|External key.|| +|**client\_id**|Option<[**uuid::Uuid**](uuid::Uuid.md)>|ID of the corresponding SuperMQ Client.|[optional]| +|**channels**|Option<**Vec**>||[optional]| +|**content**|Option<**String**>||[optional]| +|**name**|Option<**String**>||[optional]| +|**client\_cert**|Option<**String**>|Client Certificate.|[optional]| +|**client\_key**|Option<**String**>|Client Private Key.|[optional]| +|**ca\_cert**|Option<**String**>||[optional]| + + +# CreateRoleObj +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**role\_name**|Option<**String**>|Role's name.|[optional]| +|**optional\_actions**|Option<**Vec**>|List of optional actions.|[optional]| +|**optional\_members**|Option<**Vec**>|List of optional members.|[optional]| + + +# CreateSubscription +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**topic**|Option<**String**>|Topic to which the user subscribes.|[optional]| +|**contact**|Option<**String**>|The contact of the user to which the notification will be sent.|[optional]| + + +# Definition +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**delta**|Option<**f32**>|Minimal time delay before new state creation.|[optional]| +|**attributes**|Option<**Vec**>||[optional]| + + +# Domain +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**id**|Option<[**uuid::Uuid**](uuid::Uuid.md)>|Domain unique identified.|[optional]| +|**name**|Option<**String**>|Domain name.|[optional]| +|**tags**|Option<**Vec**>|domain tags.|[optional]| +|**metadata**|Option<[**serde_json::Value**](.md)>|Arbitrary, object-encoded domain's data.|[optional]| +|**alias**|Option<**String**>|Domain alias.|[optional]| +|**status**|Option<**String**>|Domain Status|[optional]| +|**created\_by**|Option<[**uuid::Uuid**](uuid::Uuid.md)>|User ID of the user who created the domain.|[optional]| +|**created\_at**|Option<**String**>|Time when the domain was created.|[optional]| +|**updated\_by**|Option<[**uuid::Uuid**](uuid::Uuid.md)>|User ID of the user who last updated the domain.|[optional]| +|**updated\_at**|Option<**String**>|Time when the domain was last updated.|[optional]| + + + + +# DomainIdMappingPostRequest +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**external\_id**|**String**||| +|**external\_key**|**String**||| +|**name**|Option<**String**>||[optional]| + + +# DomainReqObj +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**name**|**String**|Domain name.|| +|**tags**|Option<**Vec**>|domain tags.|[optional]| +|**metadata**|Option<[**serde_json::Value**](.md)>|Arbitrary, object-encoded domain's data.|[optional]| +|**alias**|**String**|Domain alias.|| + +# \DomainsApi +All URIs are relative to *http://localhost:9001* + +|Method|HTTP request|Description| +| :-: | :-: | :-: | +|[**add_domain_role_action**](DomainsApi.md#add_domain_role_action)|**POST** /domains/{domainID}/roles/{roleName}/actions|Adds a role action for a domain role.| +|[**add_domain_role_member**](DomainsApi.md#add_domain_role_member)|**POST** /domains/{domainID}/roles/{roleName}/members|Adds a member to a domain role.| +|[**create_domain_role**](DomainsApi.md#create_domain_role)|**POST** /domains/{domainID}/roles|Creates a role for a domain| +|[**delete_all_domain_role_actions**](DomainsApi.md#delete_all_domain_role_actions)|**POST** /domains/{domainID}/roles/{roleName}/actions/delete-all|Deletes all role actions for a domain role.| +|[**delete_all_domain_role_members**](DomainsApi.md#delete_all_domain_role_members)|**POST** /domains/{domainID}/roles/{roleName}/members/delete-all|Deletes all members from a domain role.| +|[**delete_domain_role**](DomainsApi.md#delete_domain_role)|**DELETE** /domains/{domainID}/roles/{roleName}|Deletes domain role.| +|[**delete_domain_role_action**](DomainsApi.md#delete_domain_role_action)|**POST** /domains/{domainID}/roles/{roleName}/actions/delete|Deletes role actions for a domain role.| +|[**delete_domain_role_members**](DomainsApi.md#delete_domain_role_members)|**POST** /domains/{domainID}/roles/{roleName}/members/delete|Deletes members from a domain role.| +|[**domains_domain_id_disable_post**](DomainsApi.md#domains_domain_id_disable_post)|**POST** /domains/{domainID}/disable|Disable a domain| +|[**domains_domain_id_enable_post**](DomainsApi.md#domains_domain_id_enable_post)|**POST** /domains/{domainID}/enable|Enables a domain| +|[**domains_domain_id_freeze_post**](DomainsApi.md#domains_domain_id_freeze_post)|**POST** /domains/{domainID}/freeze|Freeze a domain| +|[**domains_domain_id_get**](DomainsApi.md#domains_domain_id_get)|**GET** /domains/{domainID}|Retrieves domain information| +|[**domains_domain_id_patch**](DomainsApi.md#domains_domain_id_patch)|**PATCH** /domains/{domainID}|Updates name, metadata, tags and alias of the domain.| +|[**domains_get**](DomainsApi.md#domains_get)|**GET** /domains|Retrieves list of domains.| +|[**domains_post**](DomainsApi.md#domains_post)|**POST** /domains|Adds new domain| +|[**get_domain_role**](DomainsApi.md#get_domain_role)|**GET** /domains/{domainID}/roles/{roleName}|Retrieves domain role.| +|[**list_available_domain_actions**](DomainsApi.md#list_available_domain_actions)|**GET** /domains/roles/available-actions|Retrieves available actions.| +|[**list_domain_role_actions**](DomainsApi.md#list_domain_role_actions)|**GET** /domains/{domainID}/roles/{roleName}/actions|Lists domain role actions.| +|[**list_domain_role_members**](DomainsApi.md#list_domain_role_members)|**GET** /domains/{domainID}/roles/{roleName}/members|Lists domain role members.| +|[**list_domain_roles**](DomainsApi.md#list_domain_roles)|**GET** /domains/{domainID}/roles|Retrieves domains roles.| +|[**update_domain_role**](DomainsApi.md#update_domain_role)|**PUT** /domains/{domainID}/roles/{roleName}|Updates domain role.| +## add\_domain\_role\_action +crate::models::RoleActionsObj add\_domain\_role\_action(domain\_id, role\_name, role\_actions\_obj) +Adds a role action for a domain role. + +Adds a role action for a specific domain role that is identified by the role name. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**role\_name**|**String**|Role's name.|[required]|| +|**role\_actions\_obj**|[**RoleActionsObj**](RoleActionsObj.md)|JSON- formatted object decsribing an action to be added to a role.|[required]|| +### Return type +[**crate::models::RoleActionsObj**](RoleActionsObj.md) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: application/json +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## add\_domain\_role\_member +crate::models::RoleMembersObj add\_domain\_role\_member(domain\_id, role\_name, role\_members\_obj) +Adds a member to a domain role. + +Adds a member to a specific domain role that is identified by the role name. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**role\_name**|**String**|Role's name.|[required]|| +|**role\_members\_obj**|[**RoleMembersObj**](RoleMembersObj.md)|JSON- formatted object decsribing a member to be added to a role.|[required]|| +### Return type +[**crate::models::RoleMembersObj**](RoleMembersObj.md) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: application/json +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## create\_domain\_role +crate::models::NewRole create\_domain\_role(domain\_id, create\_role\_obj) +Creates a role for a domain + +Creates a role for a specific domain that is identified by the domain ID. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**create\_role\_obj**|[**CreateRoleObj**](CreateRoleObj.md)|JSON- formatted object decsribing a new role to be created.|[required]|| +### Return type +[**crate::models::NewRole**](NewRole.md) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: application/json +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## delete\_all\_domain\_role\_actions +delete\_all\_domain\_role\_actions(domain\_id, role\_name) +Deletes all role actions for a domain role. + +Deletes all role actions for a specific domain role that is identified by the role name. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**role\_name**|**String**|Role's name.|[required]|| +### Return type +(empty response body) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## delete\_all\_domain\_role\_members +delete\_all\_domain\_role\_members(domain\_id, role\_name) +Deletes all members from a domain role. + +Deletes all members from a specific domain role that is identified by the role name. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**role\_name**|**String**|Role's name.|[required]|| +### Return type +(empty response body) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## delete\_domain\_role +delete\_domain\_role(domain\_id, role\_name) +Deletes domain role. + +Deletes a specific domain role that is identified by the role name. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**role\_name**|**String**|Role's name.|[required]|| +### Return type +(empty response body) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## delete\_domain\_role\_action +delete\_domain\_role\_action(domain\_id, role\_name, role\_actions\_obj) +Deletes role actions for a domain role. + +Deletes a role action for a specific domain role that is identified by the role name. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**role\_name**|**String**|Role's name.|[required]|| +|**role\_actions\_obj**|[**RoleActionsObj**](RoleActionsObj.md)|JSON- formatted object decsribing an action to be added to a role.|[required]|| +### Return type +(empty response body) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: application/json +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## delete\_domain\_role\_members +delete\_domain\_role\_members(domain\_id, role\_name, role\_members\_obj) +Deletes members from a domain role. + +Deletes a member from a specific domain role that is identified by the role name. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**role\_name**|**String**|Role's name.|[required]|| +|**role\_members\_obj**|[**RoleMembersObj**](RoleMembersObj.md)|JSON- formatted object decsribing a member to be added to a role.|[required]|| +### Return type +(empty response body) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: application/json +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## domains\_domain\_id\_disable\_post +domains\_domain\_id\_disable\_post(domain\_id) +Disable a domain + +Disable a specific domain that is identified by the domain ID. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +### Return type +(empty response body) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## domains\_domain\_id\_enable\_post +domains\_domain\_id\_enable\_post(domain\_id) +Enables a domain + +Enables a specific domain that is identified by the domain ID. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +### Return type +(empty response body) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## domains\_domain\_id\_freeze\_post +domains\_domain\_id\_freeze\_post(domain\_id) +Freeze a domain + +Freeze a specific domain that is identified by the domain ID. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +### Return type +(empty response body) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## domains\_domain\_id\_get +crate::models::Domain domains\_domain\_id\_get(domain\_id) +Retrieves domain information + +Retrieves a specific domain that is identified by the domain ID. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +### Return type +[**crate::models::Domain**](Domain.md) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## domains\_domain\_id\_patch +crate::models::Domain domains\_domain\_id\_patch(domain\_id, domain\_update) +Updates name, metadata, tags and alias of the domain. + +Updates name, metadata, tags and alias of the domain. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**domain\_update**|[**DomainUpdate**](DomainUpdate.md)|JSON-formated document describing the name, alias, tags, and metadata of the domain to be updated|[required]|| +### Return type +[**crate::models::Domain**](Domain.md) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: application/json +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## domains\_get +crate::models::DomainsPage domains\_get(limit, offset, metadata, status, name, permission) +Retrieves list of domains. + +Retrieves list of domains that the user have access. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**limit**|Option<**i32**>|Size of the subset to retrieve.||[default to 10]| +|**offset**|Option<**i32**>|Number of items to skip during retrieval.||[default to 0]| +|**metadata**|Option<**::std::collections::HashMap**>|Metadata filter. Filtering is performed matching the parameter with metadata on top level. Parameter is json.||| +|**status**|Option<**String**>|Client account status.||[default to enabled]| +|**name**|Option<**String**>|Domain's name.||| +|**permission**|Option<**String**>|permission.||| +### Return type +[**crate::models::DomainsPage**](DomainsPage.md) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## domains\_post +crate::models::Domain domains\_post(domain\_req\_obj) +Adds new domain + +Adds new domain. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_req\_obj**|[**DomainReqObj**](DomainReqObj.md)|JSON-formatted document describing the new domain to be registered|[required]|| +### Return type +[**crate::models::Domain**](Domain.md) +### Authorization +[refreshAuth](../README.md#refreshAuth), [basicAuth](../README.md#basicAuth), [bearerAuth](../README.md#bearerAuth), [clientAuth](../README.md#clientAuth) +### HTTP request headers +- **Content-Type**: application/json +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## get\_domain\_role +crate::models::Role get\_domain\_role(domain\_id, role\_name) +Retrieves domain role. + +Retrieves a specific domain role that is identified by the role name. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**role\_name**|**String**|Role's name.|[required]|| +### Return type +[**crate::models::Role**](Role.md) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## list\_available\_domain\_actions +crate::models::AvailableActionsObj list\_available\_domain\_actions(domain\_id) +Retrieves available actions. + +Retrieves a list of available actions. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +### Return type +[**crate::models::AvailableActionsObj**](AvailableActionsObj.md) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## list\_domain\_role\_actions +crate::models::RoleActionsObj list\_domain\_role\_actions(domain\_id, role\_name) +Lists domain role actions. + +Retrieves a list of domain role actions. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**role\_name**|**String**|Role's name.|[required]|| +### Return type +[**crate::models::RoleActionsObj**](RoleActionsObj.md) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## list\_domain\_role\_members +crate::models::RoleMembersObj list\_domain\_role\_members(domain\_id, role\_name) +Lists domain role members. + +Retrieves a list of domain role members. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**role\_name**|**String**|Role's name.|[required]|| +### Return type +[**crate::models::RoleMembersObj**](RoleMembersObj.md) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## list\_domain\_roles +crate::models::RolesPage list\_domain\_roles(domain\_id, limit, offset) +Retrieves domains roles. + +Retrieves a list of domain roles. Due to performance concerns, data is retrieved in subsets. The API domains must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**limit**|Option<**i32**>|Size of the subset to retrieve.||[default to 10]| +|**offset**|Option<**i32**>|Number of items to skip during retrieval.||[default to 0]| +### Return type +[**crate::models::RolesPage**](RolesPage.md) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## update\_domain\_role +crate::models::Role update\_domain\_role(domain\_id, role\_name, update\_role\_obj) +Updates domain role. + +Updates a specific domain role that is identified by the role name. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**role\_name**|**String**|Role's name.|[required]|| +|**update\_role\_obj**|[**UpdateRoleObj**](UpdateRoleObj.md)|JSON- formatted object decsribing a role to be updated.|[required]|| +### Return type +[**crate::models::Role**](Role.md) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: application/json +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +# DomainsPage +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**domains**|**Vec**||| +|**total**|**i32**|Total number of items.|| +|**offset**|**i32**|Number of items to skip during retrieval.|| +|**limit**|Option<**i32**>|Maximum number of items to return in one page.|[optional]| + + +# DomainUpdate +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**name**|Option<**String**>|Domain name.|[optional]| +|**tags**|Option<**Vec**>|domain tags.|[optional]| +|**metadata**|Option<[**serde_json::Value**](.md)>|Arbitrary, object-encoded domain's data.|[optional]| +|**alias**|Option<**String**>|Domain alias.|[optional]| + + +# Email +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**email**|**String**|User email address.|| + +# Error +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**error**|Option<**String**>|Error message|[optional]| + + +# Group +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**id**|Option<[**uuid::Uuid**](uuid::Uuid.md)>|Unique group identifier generated by the service.|[optional]| +|**name**|Option<**String**>|Free-form group name. Group name is unique on the given hierarchy level.|[optional]| +|**domain\_id**|Option<[**uuid::Uuid**](uuid::Uuid.md)>|ID of the domain to which the group belongs..|[optional]| +|**parent\_id**|Option<[**uuid::Uuid**](uuid::Uuid.md)>|Group parent identifier.|[optional]| +|**description**|Option<**String**>|Group description, free form text.|[optional]| +|**metadata**|Option<[**serde_json::Value**](.md)>|Arbitrary, object-encoded groups's data.|[optional]| +|**path**|Option<**String**>|Hierarchy path, concatenated ids of group ancestors.|[optional]| +|**level**|Option<**i32**>|Level in hierarchy, distance from the root group.|[optional]| +|**created\_at**|Option<**String**>|Datetime when the group was created.|[optional]| +|**updated\_at**|Option<**String**>|Datetime when the group was created.|[optional]| +|**status**|Option<**String**>|Group Status|[optional]| + + +# GroupReqObj +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**name**|**String**|Free-form group name. Group name is unique on the given hierarchy level.|| +|**description**|Option<**String**>|Group description, free form text.|[optional]| +|**parent\_id**|Option<**String**>|Id of parent group, it must be existing group.|[optional]| +|**metadata**|Option<[**serde_json::Value**](.md)>|Arbitrary, object-encoded groups's data.|[optional]| +|**status**|Option<**String**>|Group Status|[optional]| + + +# \GroupsApi +All URIs are relative to *http://localhost:9001* + +|Method|HTTP request|Description| +| :-: | :-: | :-: | +|[**add_children_groups**](GroupsApi.md#add_children_groups)|**POST** /{domainID}/groups/{groupID}/children|Add children groups.| +|[**add_group_role_action**](GroupsApi.md#add_group_role_action)|**POST** /{domainID}/groups/{groupID}/roles/{roleName}/actions|Adds a role action for a group role.| +|[**add_group_role_member**](GroupsApi.md#add_group_role_member)|**POST** /{domainID}/groups/{groupID}/roles/{roleName}/members|Adds a member to a group role.| +|[**create_group**](GroupsApi.md#create_group)|**POST** /{domainID}/groups|Creates new group| +|[**create_group_role**](GroupsApi.md#create_group_role)|**POST** /{domainID}/groups/{groupID}/roles|Creates a role for a group| +|[**delete_all_group_role_actions**](GroupsApi.md#delete_all_group_role_actions)|**POST** /{domainID}/groups/{groupID}/roles/{roleName}/actions/delete-all|Deletes all role actions for a group role.| +|[**delete_all_group_role_members**](GroupsApi.md#delete_all_group_role_members)|**POST** /{domainID}/groups/{groupID}/roles/{roleName}/members/delete-all|Deletes all members from a group role.| +|[**delete_group_role**](GroupsApi.md#delete_group_role)|**DELETE** /{domainID}/groups/{groupID}/roles/{roleName}|Deletes group role.| +|[**delete_group_role_action**](GroupsApi.md#delete_group_role_action)|**POST** /{domainID}/groups/{groupID}/roles/{roleName}/actions/delete|Deletes role actions for a group role.| +|[**delete_group_role_members**](GroupsApi.md#delete_group_role_members)|**POST** /{domainID}/groups/{groupID}/roles/{roleName}/members/delete|Deletes members from a group role.| +|[**disable_group**](GroupsApi.md#disable_group)|**POST** /{domainID}/groups/{groupID}/disable|Disables a group| +|[**domain_id_groups_group_id_delete**](GroupsApi.md#domain_id_groups_group_id_delete)|**DELETE** /{domainID}/groups/{groupID}|Delete group for a group with the given id.| +|[**enable_group**](GroupsApi.md#enable_group)|**POST** /{domainID}/groups/{groupID}/enable|Enables a group| +|[**get_group**](GroupsApi.md#get_group)|**GET** /{domainID}/groups/{groupID}|Gets group info.| +|[**get_group_role**](GroupsApi.md#get_group_role)|**GET** /{domainID}/groups/{groupID}/roles/{roleName}|Retrieves group role.| +|[**list_available_group_actions**](GroupsApi.md#list_available_group_actions)|**GET** /{domainID}/groups/roles/available-actions|Retrieves available actions.| +|[**list_children_groups**](GroupsApi.md#list_children_groups)|**GET** /{domainID}/groups/{groupID}/children|List children of a certain group| +|[**list_group_hierarchy**](GroupsApi.md#list_group_hierarchy)|**GET** /{domainID}/groups/{groupID}/hierarchy|Lists groups hierarchy.| +|[**list_group_role_actions**](GroupsApi.md#list_group_role_actions)|**GET** /{domainID}/groups/{groupID}/roles/{roleName}/actions|Lists group role actions.| +|[**list_group_role_members**](GroupsApi.md#list_group_role_members)|**GET** /{domainID}/groups/{groupID}/roles/{roleName}/members|Lists group role members.| +|[**list_group_roles**](GroupsApi.md#list_group_roles)|**GET** /{domainID}/groups/{groupID}/roles|Retrieves groups roles.| +|[**list_groups**](GroupsApi.md#list_groups)|**GET** /{domainID}/groups|Lists groups.| +|[**remove_all_children_groups**](GroupsApi.md#remove_all_children_groups)|**DELETE** /{domainID}/groups/{groupID}/children/all|Remove all children groups.| +|[**remove_children_groups**](GroupsApi.md#remove_children_groups)|**DELETE** /{domainID}/groups/{groupID}/children|Remove children groups.| +|[**remove_group_parent_group**](GroupsApi.md#remove_group_parent_group)|**DELETE** /{domainID}/groups/{groupID}/parent|Removes a parent group from a group.| +|[**set_group_parent_group**](GroupsApi.md#set_group_parent_group)|**POST** /{domainID}/groups/{groupID}/parent|Sets a parent group for a group.| +|[**update_group**](GroupsApi.md#update_group)|**PUT** /{domainID}/groups/{groupID}|Updates group data.| +|[**update_group_role**](GroupsApi.md#update_group_role)|**PUT** /{domainID}/groups/{groupID}/roles/{roleName}|Updates group role.| +## add\_children\_groups +> add\_children\_groups(domain\_id, group\_id, children\_group\_req\_obj) +> Add children groups. + +Adds children groups for a specific group that is identified by the group ID. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**group\_id**|**uuid::Uuid**|Unique group identifier.|[required]|| +|**children\_group\_req\_obj**|[**ChildrenGroupReqObj**](ChildrenGroupReqObj.md)|JSON-formated document describing the children groups to be added to a group.|[required]|| +### Return type +(empty response body) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: application/json +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## add\_group\_role\_action +> crate::models::RoleActionsObj add\_group\_role\_action(domain\_id, group\_id, role\_name, role\_actions\_obj) +> Adds a role action for a group role. + +Adds a role action for a specific group role that is identified by the role name. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**group\_id**|**uuid::Uuid**|Unique group identifier.|[required]|| +|**role\_name**|**String**|Role's name.|[required]|| +|**role\_actions\_obj**|[**RoleActionsObj**](RoleActionsObj.md)|JSON- formatted object decsribing an action to be added to a role.|[required]|| +### Return type +[**crate::models::RoleActionsObj**](RoleActionsObj.md) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: application/json +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## add\_group\_role\_member +> crate::models::RoleMembersObj add\_group\_role\_member(domain\_id, group\_id, role\_name, role\_members\_obj) +> Adds a member to a group role. + +Adds a member to a specific group role that is identified by the role name. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**group\_id**|**uuid::Uuid**|Unique group identifier.|[required]|| +|**role\_name**|**String**|Role's name.|[required]|| +|**role\_members\_obj**|[**RoleMembersObj**](RoleMembersObj.md)|JSON- formatted object decsribing a member to be added to a role.|[required]|| +### Return type +[**crate::models::RoleMembersObj**](RoleMembersObj.md) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: application/json +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## create\_group +> crate::models::Group create\_group(domain\_id, group\_req\_obj) +> Creates new group + +Creates new group that can be used for grouping entities. New account will be uniquely identified by its identity. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**group\_req\_obj**|[**GroupReqObj**](GroupReqObj.md)|JSON-formatted document describing the new group to be registered|[required]|| +### Return type +[**crate::models::Group**](Group.md) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: application/json +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## create\_group\_role +> crate::models::NewRole create\_group\_role(domain\_id, group\_id, create\_role\_obj) +> Creates a role for a group + +Creates a role for a specific group that is identified by the group ID. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**group\_id**|**uuid::Uuid**|Unique group identifier.|[required]|| +|**create\_role\_obj**|[**CreateRoleObj**](CreateRoleObj.md)|JSON- formatted object decsribing a new role to be created.|[required]|| +### Return type +[**crate::models::NewRole**](NewRole.md) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: application/json +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## delete\_all\_group\_role\_actions +> delete\_all\_group\_role\_actions(domain\_id, group\_id, role\_name) +> Deletes all role actions for a group role. + +Deletes all role actions for a specific group role that is identified by the role name. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**group\_id**|**uuid::Uuid**|Unique group identifier.|[required]|| +|**role\_name**|**String**|Role's name.|[required]|| +### Return type +(empty response body) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## delete\_all\_group\_role\_members +> delete\_all\_group\_role\_members(domain\_id, group\_id, role\_name) +> Deletes all members from a group role. + +Deletes all members from a specific group role that is identified by the role name. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**group\_id**|**uuid::Uuid**|Unique group identifier.|[required]|| +|**role\_name**|**String**|Role's name.|[required]|| +### Return type +(empty response body) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## delete\_group\_role +> delete\_group\_role(domain\_id, group\_id, role\_name) +> Deletes group role. + +Deletes a specific group role that is identifier by the role name. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**group\_id**|**uuid::Uuid**|Unique group identifier.|[required]|| +|**role\_name**|**String**|Role's name.|[required]|| +### Return type +(empty response body) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## delete\_group\_role\_action +> delete\_group\_role\_action(domain\_id, group\_id, role\_name, role\_actions\_obj) +> Deletes role actions for a group role. + +Deletes a role action for a specific group role that is identified by the role name. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**group\_id**|**uuid::Uuid**|Unique group identifier.|[required]|| +|**role\_name**|**String**|Role's name.|[required]|| +|**role\_actions\_obj**|[**RoleActionsObj**](RoleActionsObj.md)|JSON- formatted object decsribing an action to be added to a role.|[required]|| +### Return type +(empty response body) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: application/json +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## delete\_group\_role\_members +> delete\_group\_role\_members(domain\_id, group\_id, role\_name, role\_members\_obj) +> Deletes members from a group role. + +Deletes a member from a specific group role that is identified by the role name. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**group\_id**|**uuid::Uuid**|Unique group identifier.|[required]|| +|**role\_name**|**String**|Role's name.|[required]|| +|**role\_members\_obj**|[**RoleMembersObj**](RoleMembersObj.md)|JSON- formatted object decsribing a member to be added to a role.|[required]|| +### Return type +(empty response body) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: application/json +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## disable\_group +> crate::models::Group disable\_group(domain\_id, group\_id) +> Disables a group + +Disables a specific group that is identifier by the group ID. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**group\_id**|**uuid::Uuid**|Unique group identifier.|[required]|| +### Return type +[**crate::models::Group**](Group.md) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## domain\_id\_groups\_group\_id\_delete +> domain\_id\_groups\_group\_id\_delete(domain\_id, group\_id) +> Delete group for a group with the given id. + +Delete group removes a group with the given id from repo and removes all the policies related to this group. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**group\_id**|**uuid::Uuid**|Unique group identifier.|[required]|| +### Return type +(empty response body) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## enable\_group +> crate::models::Group enable\_group(domain\_id, group\_id) +> Enables a group + +Enables a specific group that is identifier by the group ID. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**group\_id**|**uuid::Uuid**|Unique group identifier.|[required]|| +### Return type +[**crate::models::Group**](Group.md) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## get\_group +> crate::models::Group get\_group(domain\_id, group\_id) +> Gets group info. + +Gets info on a group specified by id. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**group\_id**|**uuid::Uuid**|Unique group identifier.|[required]|| +### Return type +[**crate::models::Group**](Group.md) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## get\_group\_role +> crate::models::Role get\_group\_role(domain\_id, group\_id, role\_name) +> Retrieves group role. + +Retrieves a specific group role that is identified by the role name. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**group\_id**|**uuid::Uuid**|Unique group identifier.|[required]|| +|**role\_name**|**String**|Role's name.|[required]|| +### Return type +[**crate::models::Role**](Role.md) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## list\_available\_group\_actions +> crate::models::AvailableActionsObj list\_available\_group\_actions(domain\_id) +> Retrieves available actions. + +Retrieves a list of available actions. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +### Return type +[**crate::models::AvailableActionsObj**](AvailableActionsObj.md) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## list\_children\_groups +> crate::models::GroupsPage list\_children\_groups(domain\_id, group\_id, limit, offset, start\_level, end\_level, tree, metadata, name) +> List children of a certain group + +Lists groups up to a max level of hierarchy that can be fetched in one request ( max level = 5). Result can be filtered by metadata. Groups will be returned as JSON array or JSON tree. Due to performance concerns, result is returned in subsets. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**group\_id**|**uuid::Uuid**|Unique group identifier.|[required]|| +|**limit**|Option<**i32**>|Size of the subset to retrieve.||[default to 10]| +|**offset**|Option<**i32**>|Number of items to skip during retrieval.||[default to 0]| +|**start\_level**|Option<**i32**>|Level of hierarchy from which to start retrieving groups from given group id.||| +|**end\_level**|Option<**i32**>|Level of hierarchy up to which to retrieve groups from given group id.||| +|**tree**|Option<**bool**>|Specify type of response, JSON array or tree.||[default to false]| +|**metadata**|Option<**::std::collections::HashMap**>|Metadata filter. Filtering is performed matching the parameter with metadata on top level. Parameter is json.||| +|**name**|Option<**String**>|Group's name.||| +### Return type +[**crate::models::GroupsPage**](GroupsPage.md) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## list\_group\_hierarchy +> crate::models::GroupsHierarchyPage list\_group\_hierarchy(domain\_id, group\_id, level, tree, direction) +> Lists groups hierarchy. + +Lists groups heirarchy up to a max level of hierarchy that can be fetched in one request ( max level = 5). Result can be filtered by metadata. Groups will be returned as JSON array or JSON tree. Due to performance concerns, result is returned in subsets. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**group\_id**|**uuid::Uuid**|Unique group identifier.|[required]|| +|**level**|Option<**i32**>|Level of hierarchy up to which to retrieve groups from given group id.||| +|**tree**|Option<**bool**>|Specify type of response, JSON array or tree.||[default to false]| +|**direction**|Option<**i32**>|Direction of hierarchy traversal.||| +### Return type +[**crate::models::GroupsHierarchyPage**](GroupsHierarchyPage.md) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## list\_group\_role\_actions +> crate::models::RoleActionsObj list\_group\_role\_actions(domain\_id, group\_id, role\_name) +> Lists group role actions. + +Retrieves a list of group role actions. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**group\_id**|**uuid::Uuid**|Unique group identifier.|[required]|| +|**role\_name**|**String**|Role's name.|[required]|| +### Return type +[**crate::models::RoleActionsObj**](RoleActionsObj.md) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## list\_group\_role\_members +> crate::models::RoleMembersObj list\_group\_role\_members(domain\_id, group\_id, role\_name) +> Lists group role members. + +Retrieves a list of group role members. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**group\_id**|**uuid::Uuid**|Unique group identifier.|[required]|| +|**role\_name**|**String**|Role's name.|[required]|| +### Return type +[**crate::models::RoleMembersObj**](RoleMembersObj.md) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## list\_group\_roles +> crate::models::RolesPage list\_group\_roles(domain\_id, group\_id, limit, offset) +> Retrieves groups roles. + +Retrieves a list of group roles. Due to performance concerns, data is retrieved in subsets. The API groups must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**group\_id**|**uuid::Uuid**|Unique group identifier.|[required]|| +|**limit**|Option<**i32**>|Size of the subset to retrieve.||[default to 10]| +|**offset**|Option<**i32**>|Number of items to skip during retrieval.||[default to 0]| +### Return type +[**crate::models::RolesPage**](RolesPage.md) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## list\_groups +> crate::models::GroupsPage list\_groups(domain\_id, limit, offset, level, tree, metadata, name, parent\_id) +> Lists groups. + +Lists groups up to a max level of hierarchy that can be fetched in one request ( max level = 5). Result can be filtered by metadata. Groups will be returned as JSON array or JSON tree. Due to performance concerns, result is returned in subsets. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**limit**|Option<**i32**>|Size of the subset to retrieve.||[default to 10]| +|**offset**|Option<**i32**>|Number of items to skip during retrieval.||[default to 0]| +|**level**|Option<**i32**>|Level of hierarchy up to which to retrieve groups from given group id.||| +|**tree**|Option<**bool**>|Specify type of response, JSON array or tree.||[default to false]| +|**metadata**|Option<**::std::collections::HashMap**>|Metadata filter. Filtering is performed matching the parameter with metadata on top level. Parameter is json.||| +|**name**|Option<**String**>|Group's name.||| +|**parent\_id**|Option<**uuid::Uuid**>|Unique parent identifier for a group.||| +### Return type +[**crate::models::GroupsPage**](GroupsPage.md) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## remove\_all\_children\_groups +> remove\_all\_children\_groups(domain\_id, group\_id) +> Remove all children groups. + +Removes all children groups for a specific group that is identified by the group ID. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**group\_id**|**uuid::Uuid**|Unique group identifier.|[required]|| +### Return type +(empty response body) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## remove\_children\_groups +> remove\_children\_groups(domain\_id, group\_id, children\_group\_req\_obj) +> Remove children groups. + +Removes children groups for a specific group that is identified by the group ID. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**group\_id**|**uuid::Uuid**|Unique group identifier.|[required]|| +|**children\_group\_req\_obj**|[**ChildrenGroupReqObj**](ChildrenGroupReqObj.md)|JSON-formated document describing the children groups to be added to a group.|[required]|| +### Return type +(empty response body) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: application/json +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## remove\_group\_parent\_group +> remove\_group\_parent\_group(domain\_id, group\_id, parent\_group\_req\_obj2) +> Removes a parent group from a group. + +Removes a parent group from a specific group that is identified by the group ID. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**group\_id**|**uuid::Uuid**|Unique group identifier.|[required]|| +|**parent\_group\_req\_obj2**|[**ParentGroupReqObj2**](ParentGroupReqObj2.md)|JSON-formated document describing the parent group to be set to or removed from a group.|[required]|| +### Return type +(empty response body) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: application/json +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## set\_group\_parent\_group +> set\_group\_parent\_group(domain\_id, group\_id, parent\_group\_req\_obj2) +> Sets a parent group for a group. + +Sets a parent group for a specific group that is identified by the group ID. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**group\_id**|**uuid::Uuid**|Unique group identifier.|[required]|| +|**parent\_group\_req\_obj2**|[**ParentGroupReqObj2**](ParentGroupReqObj2.md)|JSON-formated document describing the parent group to be set to or removed from a group.|[required]|| +### Return type +(empty response body) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: application/json +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## update\_group +> crate::models::Group update\_group(domain\_id, group\_id, group\_update) +> Updates group data. + +Updates Name, Description or Metadata of a group. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**group\_id**|**uuid::Uuid**|Unique group identifier.|[required]|| +|**group\_update**|[**GroupUpdate**](GroupUpdate.md)|JSON-formated document describing the metadata and name of group to be update|[required]|| +### Return type +[**crate::models::Group**](Group.md) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: application/json +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## update\_group\_role +> crate::models::Role update\_group\_role(domain\_id, group\_id, role\_name, update\_role\_obj) +> Updates group role. + +Updates a specific group role that is identified by the role name. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**group\_id**|**uuid::Uuid**|Unique group identifier.|[required]|| +|**role\_name**|**String**|Role's name.|[required]|| +|**update\_role\_obj**|[**UpdateRoleObj**](UpdateRoleObj.md)|JSON- formatted object decsribing a role to be updated.|[required]|| +### Return type +[**crate::models::Role**](Role.md) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: application/json +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) + + +# GroupsHierarchyPage +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**level**|Option<**i32**>|Level of hierarchy.|[optional]| +|**direction**|Option<**i32**>|Direction of hierarchy traversal.|[optional]| +|**groups**|Option<**Vec**>||[optional]| + + +# GroupsPage +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**groups**|**Vec**||| +|**total**|**i32**|Total number of items.|| +|**offset**|**i32**|Number of items to skip during retrieval.|| +|**limit**|Option<**i32**>|Maximum number of items to return in one page.|[optional]| + + +# GroupUpdate +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**name**|**String**|Free-form group name. Group name is unique on the given hierarchy level.|| +|**description**|**String**|Group description, free form text.|| +|**metadata**|[**serde_json::Value**](.md)|Arbitrary, object-encoded groups's data.|| + +# HealthInfo +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**status**|Option<**String**>|Service status.|[optional]| +|**version**|Option<**String**>|Service version.|[optional]| +|**commit**|Option<**String**>|Service commit hash.|[optional]| +|**description**|Option<**String**>|Service description.|[optional]| +|**build\_time**|Option<**String**>|Service build time.|[optional]| +|**instance\_id**|Option<**String**>|Service instance ID.|[optional]| + + +# HealthRes +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**status**|Option<**String**>|Service status.|[optional]| +|**version**|Option<**String**>|Service version.|[optional]| +|**commit**|Option<**String**>|Service commit hash.|[optional]| +|**description**|Option<**String**>|Service description.|[optional]| +|**build\_time**|Option<**String**>|Service build time.|[optional]| + + +# Invitation +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**invited\_by**|Option<[**uuid::Uuid**](uuid::Uuid.md)>|User unique identifier.|[optional]| +|**user\_id**|Option<[**uuid::Uuid**](uuid::Uuid.md)>|User unique identifier.|[optional]| +|**domain\_id**|Option<[**uuid::Uuid**](uuid::Uuid.md)>|Domain unique identifier.|[optional]| +|**relation**|Option<**String**>|Relation between user and domain.|[optional]| +|**created\_at**|Option<**String**>|Time when the group was created.|[optional]| +|**updated\_at**|Option<**String**>|Time when the group was created.|[optional]| +|**confirmed\_at**|Option<**String**>|Time when the group was created.|[optional]| + + +# InvitationPage +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**invitations**|**Vec**||| +|**total**|**i32**|Total number of items.|| +|**offset**|**i32**|Number of items to skip during retrieval.|| +|**limit**|Option<**i32**>|Maximum number of items to return in one page.|[optional]| + + +# \InvitationsApi +All URIs are relative to *http://localhost:9001* + +|Method|HTTP request|Description| +| :-: | :-: | :-: | +|[**accept_invitation**](InvitationsApi.md#accept_invitation)|**POST** /invitations/accept|Accept invitation| +|[**delete_invitation**](InvitationsApi.md#delete_invitation)|**DELETE** /invitations/{user\_id}/{domain\_id}|Deletes a specific invitation| +|[**get_invitation**](InvitationsApi.md#get_invitation)|**GET** /invitations/{user\_id}/{domain\_id}|Retrieves a specific invitation| +|[**list_invitations**](InvitationsApi.md#list_invitations)|**GET** /invitations|List invitations| +|[**reject_invitation**](InvitationsApi.md#reject_invitation)|**POST** /invitations/reject|Reject invitation| +|[**send_invitation**](InvitationsApi.md#send_invitation)|**POST** /invitations|Send invitation| +## accept\_invitation +accept\_invitation(accept\_invitation\_request) +Accept invitation + +Current logged in user accepts invitation to join domain. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**accept\_invitation\_request**|[**AcceptInvitationRequest**](AcceptInvitationRequest.md)|JSON-formatted document describing request for accepting invitation|[required]|| +### Return type +(empty response body) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: application/json +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## delete\_invitation +delete\_invitation(user\_id, domain\_id) +Deletes a specific invitation + +Deletes a specific invitation that is identifier by the user ID and domain ID. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**user\_id**|**uuid::Uuid**|Unique user identifier.|[required]|| +|**domain\_id**|**uuid::Uuid**|Unique identifier for a domain.|[required]|| +### Return type +(empty response body) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## get\_invitation +crate::models::Invitation get\_invitation(user\_id, domain\_id) +Retrieves a specific invitation + +Retrieves a specific invitation that is identifier by the user ID and domain ID. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**user\_id**|**uuid::Uuid**|Unique user identifier.|[required]|| +|**domain\_id**|**uuid::Uuid**|Unique identifier for a domain.|[required]|| +### Return type +[**crate::models::Invitation**](Invitation.md) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## list\_invitations +crate::models::InvitationPage list\_invitations(user\_id, domain\_id, limit, offset, invited\_by, relation, state) +List invitations + +Retrieves a list of invitations. Due to performance concerns, data is retrieved in subsets. The API must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**user\_id**|**uuid::Uuid**|Unique user identifier.|[required]|| +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**limit**|Option<**i32**>|Size of the subset to retrieve.||[default to 10]| +|**offset**|Option<**i32**>|Number of items to skip during retrieval.||[default to 0]| +|**invited\_by**|Option<**uuid::Uuid**>|Unique identifier for a user that invited the user.||| +|**relation**|Option<**String**>|Relation between user and domain.||| +|**state**|Option<**String**>|Invitation state.||| +### Return type +[**crate::models::InvitationPage**](InvitationPage.md) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## reject\_invitation +reject\_invitation(accept\_invitation\_request) +Reject invitation + +Current logged in user rejects invitation to join domain. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**accept\_invitation\_request**|[**AcceptInvitationRequest**](AcceptInvitationRequest.md)|JSON-formatted document describing request for accepting invitation|[required]|| +### Return type +(empty response body) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: application/json +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## send\_invitation +send\_invitation(send\_invitation\_req\_obj) +Send invitation + +Send invitation to user to join domain. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**send\_invitation\_req\_obj**|[**SendInvitationReqObj**](SendInvitationReqObj.md)|JSON-formatted document describing request for sending invitation|[required]|| +### Return type +(empty response body) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: application/json +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +# IssueKeyRequest +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**r#type**|Option<**i32**>|API key type. Keys of different type are processed differently.|[optional]| +|**duration**|Option<**f32**>|Number of seconds issued token is valid for.|[optional]| + + +# IssueToken +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**identity**|**String**|User identity - email address.|| +|**secret**|**String**|User secret password.|| + + + +# IssueToken200Response +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**access\_token**|Option<**String**>|User access token.|[optional]| +|**refresh\_token**|Option<**String**>|User refresh token.|[optional]| +|**access\_type**|Option<**String**>|User access token type.|[optional]| + + +# Journal +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**operation**|Option<**String**>|Journal operation.|[optional]| +|**occurred\_at**|Option<**String**>|Time when the journal occurred.|[optional]| +|**attributes**|Option<[**serde_json::Value**](.md)>|Journal attributes.|[optional]| +|**metadata**|Option<[**serde_json::Value**](.md)>|Journal payload.|[optional]| + + +# \JournalLogApi +All URIs are relative to *http://localhost:9001* + +|Method|HTTP request|Description| +| :-: | :-: | :-: | +|[**domain_id_journal_entity_type_id_get**](JournalLogApi.md#domain_id_journal_entity_type_id_get)|**GET** /{domainID}/journal/{entityType}/{id}|List entity journal log| +|[**journal_user_user_id_get**](JournalLogApi.md#journal_user_user_id_get)|**GET** /journal/user/{userID}|List user journal log| +## domain\_id\_journal\_entity\_type\_id\_get +crate::models::JournalPage domain\_id\_journal\_entity\_type\_id\_get(domain\_id, entity\_type, id, offset, limit, operation, with\_attributes, with\_metadata, from, to, dir) +List entity journal log + +Retrieves a list of journal. Due to performance concerns, data is retrieved in subsets. The API must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique identifier for a domain.|[required]|| +|**entity\_type**|**String**|Type of entity, e.g. user, group, client, etc.entityType|[required]|| +|**id**|**uuid::Uuid**|Unique identifier for an entity, e.g. group, channel or thing. Used together with entity\_type.|[required]|| +|**offset**|Option<**i32**>|Number of items to skip during retrieval.||[default to 0]| +|**limit**|Option<**i32**>|Size of the subset to retrieve.||[default to 10]| +|**operation**|Option<**String**>|Journal operation.||| +|**with\_attributes**|Option<**bool**>|Include journal attributes.||| +|**with\_metadata**|Option<**bool**>|Include journal metadata.||| +|**from**|Option<**String**>|Start date in unix time.||| +|**to**|Option<**String**>|End date in unix time.||| +|**dir**|Option<**String**>|Sort direction.||| +### Return type +[**crate::models::JournalPage**](JournalPage.md) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## journal\_user\_user\_id\_get +crate::models::JournalPage journal\_user\_user\_id\_get(user\_id, offset, limit, operation, with\_attributes, with\_metadata, from, to, dir) +List user journal log + +Retrieves a list of journal. Due to performance concerns, data is retrieved in subsets. The API must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**user\_id**|**uuid::Uuid**|Unique identifier for a user.|[required]|| +|**offset**|Option<**i32**>|Number of items to skip during retrieval.||[default to 0]| +|**limit**|Option<**i32**>|Size of the subset to retrieve.||[default to 10]| +|**operation**|Option<**String**>|Journal operation.||| +|**with\_attributes**|Option<**bool**>|Include journal attributes.||| +|**with\_metadata**|Option<**bool**>|Include journal metadata.||| +|**from**|Option<**String**>|Start date in unix time.||| +|**to**|Option<**String**>|End date in unix time.||| +|**dir**|Option<**String**>|Sort direction.||| +### Return type +[**crate::models::JournalPage**](JournalPage.md) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +# JournalPage +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**journals**|**Vec**||| +|**total**|**i32**|Total number of items.|| +|**offset**|**i32**|Number of items to skip during retrieval.|| +|**limit**|Option<**i32**>|Maximum number of items to return in one page.|[optional]| + + +# Key +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**id**|Option<[**uuid::Uuid**](uuid::Uuid.md)>|API key unique identifier|[optional]| +|**issuer\_id**|Option<[**uuid::Uuid**](uuid::Uuid.md)>|In ID of the entity that issued the token.|[optional]| +|**r#type**|Option<**i32**>|API key type. Keys of different type are processed differently.|[optional]| +|**subject**|Option<**String**>|User's email or service identifier of API key subject.|[optional]| +|**issued\_at**|Option<**String**>|Time when the key is generated.|[optional]| +|**expires\_at**|Option<**String**>|Time when the Key expires. If this field is missing, that means that Key is valid indefinitely.|[optional]| + + +# \KeysApi +All URIs are relative to *http://localhost:9001* + +|Method|HTTP request|Description| +| :-: | :-: | :-: | +|[**get_key**](KeysApi.md#get_key)|**GET** /keys/{keyID}|Gets API key details.| +|[**issue_key**](KeysApi.md#issue_key)|**POST** /keys|Issue API key| +|[**revoke_key**](KeysApi.md#revoke_key)|**DELETE** /keys/{keyID}|Revoke API key| +## get\_key +> crate::models::Key get\_key(key\_id) +> Gets API key details. + +Gets API key details for the given key. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**key\_id**|**uuid::Uuid**|API Key ID.|[required]|| +### Return type +[**crate::models::Key**](Key.md) +### Authorization +[refreshAuth](../README.md#refreshAuth), [basicAuth](../README.md#basicAuth), [bearerAuth](../README.md#bearerAuth), [clientAuth](../README.md#clientAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## issue\_key +> issue\_key(issue\_key\_request) +> Issue API key + +Generates a new API key. Thew new API key will be uniquely identified by its ID. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**issue\_key\_request**|[**IssueKeyRequest**](IssueKeyRequest.md)|JSON-formatted document describing key request.|[required]|| +### Return type +(empty response body) +### Authorization +[refreshAuth](../README.md#refreshAuth), [basicAuth](../README.md#basicAuth), [bearerAuth](../README.md#bearerAuth), [clientAuth](../README.md#clientAuth) +### HTTP request headers +- **Content-Type**: application/json +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## revoke\_key +> revoke\_key(key\_id) +> Revoke API key + +Revoke API key identified by the given ID. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**key\_id**|**uuid::Uuid**|API Key ID.|[required]|| +### Return type +(empty response body) +### Authorization +[refreshAuth](../README.md#refreshAuth), [basicAuth](../README.md#basicAuth), [bearerAuth](../README.md#bearerAuth), [clientAuth](../README.md#clientAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +# Members +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**id**|Option<[**uuid::Uuid**](uuid::Uuid.md)>|User unique identifier.|[optional]| +|**first\_name**|Option<**String**>|User's first name.|[optional]| +|**last\_name**|Option<**String**>|User's last name.|[optional]| +|**email**|Option<**String**>|User's email address.|[optional]| +|**tags**|Option<**Vec**>|User tags.|[optional]| +|**credentials**|Option<[**crate::models::MembersCredentials**](Members_credentials.md)>||[optional]| +|**metadata**|Option<[**serde_json::Value**](.md)>|Arbitrary, object-encoded user's data.|[optional]| +|**status**|Option<**String**>|User Status|[optional]| +|**created\_at**|Option<**String**>|Time when the group was created.|[optional]| +|**updated\_at**|Option<**String**>|Time when the group was created.|[optional]| + + +# MembersCredentials +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**username**|Option<**String**>|User's username.|[optional]| +|**secret**|Option<**String**>|User secret password.|[optional]| + + +# MembersPage +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**members**|**Vec**||| +|**total**|**i32**|Total number of items.|| +|**offset**|Option<**i32**>|Number of items to skip during retrieval.|[optional]| +|**limit**|Option<**i32**>|Maximum number of items to return in one page.|[optional]| + + +# \MessagesApi +All URIs are relative to *http://localhost:9001* + +|Method|HTTP request|Description| +| :-: | :-: | :-: | +|[**channels_id_messages_post**](MessagesApi.md#channels_id_messages_post)|**POST** /channels/{id}/messages|Sends message to the communication channel| +## channels\_id\_messages\_post +> channels\_id\_messages\_post(id, sen\_ml\_record) +> Sends message to the communication channel + +Sends message to the communication channel. Messages can be sent as JSON formatted SenML or as blob. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**id**|**uuid::Uuid**|Unique channel identifier.|[required]|| +|**sen\_ml\_record**|**Vec**|Message to be distributed. Since the platform expects messages to be properly formatted SenML in order to be post-processed, clients are obliged to specify Content-Type header for each published message. Note that all messages that aren't SenML will be accepted and published, but no post-processing will be applied.|[required]|| +### Return type +(empty response body) +### Authorization +[refreshAuth](../README.md#refreshAuth), [basicAuth](../README.md#basicAuth), [bearerAuth](../README.md#bearerAuth), [clientAuth](../README.md#clientAuth) +### HTTP request headers +- **Content-Type**: application/json +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) + +# MessagesPage +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**total**|Option<**f32**>|Total number of items that are present on the system.|[optional]| +|**offset**|Option<**f32**>|Number of items that were skipped during retrieval.|[optional]| +|**limit**|Option<**f32**>|Size of the subset that was retrieved.|[optional]| +|**messages**|Option<**Vec**>||[optional]| + + +# MessagesPageMessagesInner +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**channel**|Option<**i32**>|Unique channel id.|[optional]| +|**publisher**|Option<**i32**>|Unique publisher id.|[optional]| +|**protocol**|Option<**String**>|Protocol name.|[optional]| +|**name**|Option<**String**>|Measured parameter name.|[optional]| +|**unit**|Option<**String**>|Value unit.|[optional]| +|**value**|Option<**f32**>|Measured value in number.|[optional]| +|**string\_value**|Option<**String**>|Measured value in string format.|[optional]| +|**bool\_value**|Option<**bool**>|Measured value in boolean format.|[optional]| +|**data\_value**|Option<**String**>|Measured value in binary format.|[optional]| +|**value\_sum**|Option<**f32**>|Sum value.|[optional]| +|**time**|Option<**f32**>|Time of measurement.|[optional]| +|**update\_time**|Option<**f32**>|Time of updating measurement.|[optional]| + + +# NewRole +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**role\_id**|Option<[**uuid::Uuid**](uuid::Uuid.md)>|Role unique identifier.|[optional]| +|**role\_name**|Option<**String**>|Role's name.|[optional]| +|**entity\_id**|Option<[**uuid::Uuid**](uuid::Uuid.md)>|Entity unique identifier.|[optional]| +|**created\_by**|Option<[**uuid::Uuid**](uuid::Uuid.md)>|Role creator unique identifier.|[optional]| +|**created\_at**|Option<**String**>|Time when the channel was created.|[optional]| +|**updated\_by**|Option<[**uuid::Uuid**](uuid::Uuid.md)>|Role updater unique identifier.|[optional]| +|**updated\_at**|Option<**String**>|Time when the channel was created.|[optional]| + + +# \NotifiersApi +All URIs are relative to *http://localhost:9001* + +|Method|HTTP request|Description| +| :-: | :-: | :-: | +|[**create_subscription**](NotifiersApi.md#create_subscription)|**POST** /subscriptions|Create subscription| +|[**list_subscriptions**](NotifiersApi.md#list_subscriptions)|**GET** /subscriptions|List subscriptions| +|[**remove_subscription**](NotifiersApi.md#remove_subscription)|**DELETE** /subscriptions/{id}|Delete subscription with the provided id| +|[**view_subscription**](NotifiersApi.md#view_subscription)|**GET** /subscriptions/{id}|Get subscription with the provided id| +## create\_subscription +create\_subscription(create\_subscription) +Create subscription + +Creates a new subscription give a topic and contact. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**create\_subscription**|[**CreateSubscription**](CreateSubscription.md)|JSON-formatted document describing the new subscription to be created|[required]|| +### Return type +(empty response body) +### Authorization +[refreshAuth](../README.md#refreshAuth), [basicAuth](../README.md#basicAuth), [bearerAuth](../README.md#bearerAuth), [clientAuth](../README.md#clientAuth) +### HTTP request headers +- **Content-Type**: application/json +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## list\_subscriptions +crate::models::Page list\_subscriptions(topic, contact, offset, limit) +List subscriptions + +List subscriptions given list parameters. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**topic**|Option<**String**>|Topic name.||| +|**contact**|Option<**String**>|Subscription contact.||| +|**offset**|Option<**i32**>|Number of items to skip during retrieval.||[default to 0]| +|**limit**|Option<**i32**>|Size of the subset to retrieve.||[default to 10]| +### Return type +[**crate::models::Page**](Page.md) +### Authorization +[refreshAuth](../README.md#refreshAuth), [basicAuth](../README.md#basicAuth), [bearerAuth](../README.md#bearerAuth), [clientAuth](../README.md#clientAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## remove\_subscription +remove\_subscription(id) +Delete subscription with the provided id + +Removes a subscription with the provided id. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**id**|**String**|Unique identifier.|[required]|| +### Return type +(empty response body) +### Authorization +[refreshAuth](../README.md#refreshAuth), [basicAuth](../README.md#basicAuth), [bearerAuth](../README.md#bearerAuth), [clientAuth](../README.md#clientAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## view\_subscription +crate::models::Subscription view\_subscription(id) +Get subscription with the provided id + +Retrieves a subscription with the provided id. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**id**|**String**|Unique identifier.|[required]|| +### Return type +[**crate::models::Subscription**](Subscription.md) +### Authorization +[refreshAuth](../README.md#refreshAuth), [basicAuth](../README.md#basicAuth), [bearerAuth](../README.md#bearerAuth), [clientAuth](../README.md#clientAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +# Page +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**subscriptions**|Option<**Vec**>||[optional]| +|**total**|Option<**i32**>|Total number of items.|[optional]| +|**offset**|Option<**i32**>|Number of items to skip during retrieval.|[optional]| +|**limit**|Option<**i32**>|Maximum number of items to return in one page.|[optional]| + + +# ParentGroupReqObj +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**parent\_group\_id**|[**uuid::Uuid**](uuid::Uuid.md)|Parent group unique identifier.|| + +# ParentGroupReqObj2 +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**group\_id**|[**uuid::Uuid**](uuid::Uuid.md)|Parent group unique identifier.|| + +# \ProvisionApi +All URIs are relative to *http://localhost:9001* + +|Method|HTTP request|Description| +| :-: | :-: | :-: | +|[**domain_id_mapping_get**](ProvisionApi.md#domain_id_mapping_get)|**GET** /{domainID}/mapping|Gets current mapping.| +|[**domain_id_mapping_post**](ProvisionApi.md#domain_id_mapping_post)|**POST** /{domainID}/mapping|Adds new device to proxy| +## domain\_id\_mapping\_get +> serde\_json::Value domain\_id\_mapping\_get(domain\_id) +> Gets current mapping. + +Gets current mapping. This can be used in UI so that when bootstrap config is created from UI matches configuration created with provision service. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +### Return type +[**serde_json::Value**](serde_json::Value.md) +### Authorization +[refreshAuth](../README.md#refreshAuth), [basicAuth](../README.md#basicAuth), [bearerAuth](../README.md#bearerAuth), [clientAuth](../README.md#clientAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## domain\_id\_mapping\_post +> domain\_id\_mapping\_post(domain\_id, domain\_id\_mapping\_post\_request) +> Adds new device to proxy + +Adds new device to proxy +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**domain\_id\_mapping\_post\_request**|Option<[**DomainIdMappingPostRequest**](DomainIdMappingPostRequest.md)>|MAC address of device or other identifier||| +### Return type +(empty response body) +### Authorization +[refreshAuth](../README.md#refreshAuth), [basicAuth](../README.md#basicAuth), [bearerAuth](../README.md#bearerAuth), [clientAuth](../README.md#clientAuth) +### HTTP request headers +- **Content-Type**: application/json +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +# \ReadersApi +All URIs are relative to *http://localhost:9001* + +|Method|HTTP request|Description| +| :-: | :-: | :-: | +|[**get_messages**](ReadersApi.md#get_messages)|**GET** /channels/{chanId}/messages|Retrieves messages sent to single channel| +## get\_messages +> crate::models::MessagesPage get\_messages(chan\_id, limit, offset, publisher, name, v, vb, vs, vd, from, to, aggregation, interval) +> Retrieves messages sent to single channel + +Retrieves a list of messages sent to specific channel. Due to performance concerns, data is retrieved in subsets. The API readers must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**chan\_id**|**uuid::Uuid**|Unique channel identifier.|[required]|| +|**limit**|Option<**i32**>|Size of the subset to retrieve.||[default to 10]| +|**offset**|Option<**i32**>|Number of items to skip during retrieval.||[default to 0]| +|**publisher**|Option<**uuid::Uuid**>|Unique client identifier.||| +|**name**|Option<**String**>|SenML message name.||| +|**v**|Option<**String**>|SenML message value.||| +|**vb**|Option<**bool**>|SenML message bool value.||| +|**vs**|Option<**String**>|SenML message string value.||| +|**vd**|Option<**String**>|SenML message data value.||| +|**from**|Option<**f32**>|SenML message time in nanoseconds (integer part represents seconds).||| +|**to**|Option<**f32**>|SenML message time in nanoseconds (integer part represents seconds).||| +|**aggregation**|Option<**String**>|Aggregation function.||| +|**interval**|Option<**String**>|Aggregation interval.||| +### Return type +[**crate::models::MessagesPage**](MessagesPage.md) +### Authorization +[refreshAuth](../README.md#refreshAuth), [basicAuth](../README.md#basicAuth), [bearerAuth](../README.md#bearerAuth), [clientAuth](../README.md#clientAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +# RequestPasswordResetRequest +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**email**|Option<**String**>|User email.|[optional]| +|**host**|Option<**String**>|Email host.|[optional]| + + + +# ResetPasswordRequest +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**password**|Option<**String**>|New password.|[optional]| +|**confirm\_password**|Option<**String**>|New confirmation password.|[optional]| +|**token**|Option<**String**>|Reset token generated and sent in email.|[optional]| + + +# Revoke +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**revocation\_time**|Option<**String**>|Certificate revocation time|[optional]| + + +# Role +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**role\_id**|Option<[**uuid::Uuid**](uuid::Uuid.md)>|Role unique identifier.|[optional]| +|**role\_name**|Option<**String**>|Role's name.|[optional]| +|**entity\_id**|Option<[**uuid::Uuid**](uuid::Uuid.md)>|Entity unique identifier.|[optional]| +|**created\_by**|Option<[**uuid::Uuid**](uuid::Uuid.md)>|Role creator unique identifier.|[optional]| +|**created\_at**|Option<**String**>|Time when the channel was created.|[optional]| +|**updated\_by**|Option<[**uuid::Uuid**](uuid::Uuid.md)>|Role updater unique identifier.|[optional]| +|**updated\_at**|Option<**String**>|Time when the channel was created.|[optional]| + + +# RoleActionsObj +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**actions**|Option<**Vec**>|List of actions to be added to a role.|[optional]| + + +# RoleMembersObj +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**members**|Option<**Vec**>|List of members to be added to a role.|[optional]| + + +# RolesPage +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**roles**|Option<**Vec**>|List of roles.|[optional]| +|**total**|Option<**i32**>|Total number of roles.|[optional]| +|**offset**|Option<**i32**>|Number of items to skip during retrieval.|[optional]| +|**limit**|Option<**i32**>|Maximum number of items to return in one page.|[optional]| + + +# SendInvitationReqObj +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**user\_id**|[**uuid::Uuid**](uuid::Uuid.md)|User unique identifier.|| +|**domain\_id**|[**uuid::Uuid**](uuid::Uuid.md)|Domain unique identifier.|| +|**relation**|**String**|Relation between user and domain.|| +|**resend**|Option<**bool**>|Resend invitation.|[optional]| + + +# SenMlRecord +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**bn**|Option<**String**>|Base Name|[optional]| +|**bt**|Option<**f64**>|Base Time|[optional]| +|**bu**|Option<**f64**>|Base Unit|[optional]| +|**bv**|Option<**f64**>|Base Value|[optional]| +|**bs**|Option<**f64**>|Base Sum|[optional]| +|**bver**|Option<**f64**>|Version|[optional]| +|**n**|Option<**String**>|Name|[optional]| +|**u**|Option<**String**>|Unit|[optional]| +|**v**|Option<**f64**>|Value|[optional]| +|**vs**|Option<**String**>|String Value|[optional]| +|**vb**|Option<**bool**>|Boolean Value|[optional]| +|**vd**|Option<**String**>|Data Value|[optional]| +|**s**|Option<**f64**>|Value Sum|[optional]| +|**t**|Option<**f64**>|Time|[optional]| +|**ut**|Option<**f64**>|Update Time|[optional]| + + +# Serial +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**serial**|Option<**String**>|Certificate serial|[optional]| + + +# SerialsPage +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**serials**|Option<**Vec**>|Certificate serials IDs.|[optional]| +|**total**|Option<**i32**>|Total number of items.|[optional]| +|**offset**|Option<**i32**>|Number of items to skip during retrieval.|[optional]| +|**limit**|Option<**i32**>|Maximum number of items to return in one page.|[optional]| + + + +# State +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | + + +# State2 +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**twin\_id**|Option<[**uuid::Uuid**](uuid::Uuid.md)>|ID of twin state belongs to.|[optional]| +|**id**|Option<**f32**>|State position in a time row of states.|[optional]| +|**created**|Option<[**String**](string.md)>|State creation date.|[optional]| +|**payload**|Option<[**serde_json::Value**](.md)>|Object-encoded states's payload.|[optional]| + + +# \StatesApi +All URIs are relative to *http://localhost:9001* + +|Method|HTTP request|Description| +| :-: | :-: | :-: | +|[**get_states**](StatesApi.md#get_states)|**GET** /states/{twinID}|Retrieves states of twin with id twinID| +## get\_states +crate::models::StatesPage get\_states(twin\_id, limit, offset) +Retrieves states of twin with id twinID + +Retrieves a list of states. Due to performance concerns, data is retrieved in subsets. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**twin\_id**|**uuid::Uuid**|Unique twin identifier.|[required]|| +|**limit**|Option<**i32**>|Size of the subset to retrieve.||[default to 10]| +|**offset**|Option<**i32**>|Number of items to skip during retrieval.||[default to 0]| +### Return type +[**crate::models::StatesPage**](StatesPage.md) +### Authorization +[refreshAuth](../README.md#refreshAuth), [basicAuth](../README.md#basicAuth), [bearerAuth](../README.md#bearerAuth), [clientAuth](../README.md#clientAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +# StatesPage +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**states**|**Vec**||| +|**total**|Option<**i32**>|Total number of items.|[optional]| +|**offset**|Option<**i32**>|Number of items to skip during retrieval.|[optional]| +|**limit**|Option<**i32**>|Maximum number of items to return in one page.|[optional]| + + +# Subscription +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**id**|Option<**String**>|ULID id of the subscription.|[optional]| +|**owner\_id**|Option<[**uuid::Uuid**](uuid::Uuid.md)>|An id of the owner who created subscription.|[optional]| +|**topic**|Option<**String**>|Topic to which the user subscribes.|[optional]| +|**contact**|Option<**String**>|The contact of the user to which the notification will be sent.|[optional]| + + +# TwinReqObj +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**name**|Option<**String**>|Free-form twin name.|[optional]| +|**metadata**|Option<[**serde_json::Value**](.md)>|Arbitrary, object-encoded twin's data.|[optional]| +|**definition**|Option<[**crate::models::Definition**](Definition.md)>||[optional]| + + +# TwinResObj +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**owner**|Option<**String**>|Email address of SuperMQ user that owns twin.|[optional]| +|**id**|Option<[**uuid::Uuid**](uuid::Uuid.md)>|Unique twin identifier generated by the service.|[optional]| +|**name**|Option<**String**>|Free-form twin name.|[optional]| +|**revision**|Option<**f32**>|Oridnal revision number of twin.|[optional]| +|**created**|Option<[**String**](string.md)>|Twin creation date and time.|[optional]| +|**updated**|Option<[**String**](string.md)>|Twin update date and time.|[optional]| +|**definitions**|Option<**Vec**>||[optional]| +|**metadata**|Option<[**serde_json::Value**](.md)>|Arbitrary, object-encoded twin's data.|[optional]| + + +# \TwinsApi +All URIs are relative to *http://localhost:9001* + +|Method|HTTP request|Description| +| :-: | :-: | :-: | +|[**create_twin**](TwinsApi.md#create_twin)|**POST** /twins|Adds new twin| +|[**get_twin**](TwinsApi.md#get_twin)|**GET** /twins/{twinID}|Retrieves twin info| +|[**get_twins**](TwinsApi.md#get_twins)|**GET** /twins|Retrieves twins| +|[**remove_twin**](TwinsApi.md#remove_twin)|**DELETE** /twins/{twinID}|Removes a twin| +|[**update_twin**](TwinsApi.md#update_twin)|**PUT** /twins/{twinID}|Updates twin info| +## create\_twin +> create\_twin(twin\_req\_obj) +> Adds new twin + +Adds new twin to the list of twins owned by user identified using the provided access token. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**twin\_req\_obj**|[**TwinReqObj**](TwinReqObj.md)|JSON-formatted document describing the twin to create or update.|[required]|| +### Return type +(empty response body) +### Authorization +[refreshAuth](../README.md#refreshAuth), [basicAuth](../README.md#basicAuth), [bearerAuth](../README.md#bearerAuth), [clientAuth](../README.md#clientAuth) +### HTTP request headers +- **Content-Type**: application/json +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## get\_twin +> crate::models::TwinResObj get\_twin(twin\_id) +> Retrieves twin info +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**twin\_id**|**uuid::Uuid**|Unique twin identifier.|[required]|| +### Return type +[**crate::models::TwinResObj**](TwinResObj.md) +### Authorization +[refreshAuth](../README.md#refreshAuth), [basicAuth](../README.md#basicAuth), [bearerAuth](../README.md#bearerAuth), [clientAuth](../README.md#clientAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## get\_twins +> crate::models::TwinsPage get\_twins(limit, offset, name, metadata) +> Retrieves twins + +Retrieves a list of twins. Due to performance concerns, data is retrieved in subsets. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**limit**|Option<**i32**>|Size of the subset to retrieve.||[default to 10]| +|**offset**|Option<**i32**>|Number of items to skip during retrieval.||[default to 0]| +|**name**|Option<**String**>|Twin name||| +|**metadata**|Option<**::std::collections::HashMap**>|Metadata filter. Filtering is performed matching the parameter with metadata on top level. Parameter is json.||| +### Return type +[**crate::models::TwinsPage**](TwinsPage.md) +### Authorization +[refreshAuth](../README.md#refreshAuth), [basicAuth](../README.md#basicAuth), [bearerAuth](../README.md#bearerAuth), [clientAuth](../README.md#clientAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## remove\_twin +> remove\_twin(twin\_id) +> Removes a twin + +Removes a twin. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**twin\_id**|**uuid::Uuid**|Unique twin identifier.|[required]|| +### Return type +(empty response body) +### Authorization +[refreshAuth](../README.md#refreshAuth), [basicAuth](../README.md#basicAuth), [bearerAuth](../README.md#bearerAuth), [clientAuth](../README.md#clientAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## update\_twin +> update\_twin(twin\_id, twin\_req\_obj) +> Updates twin info + +Update is performed by replacing the current resource data with values provided in a request payload. Note that the twin's ID cannot be changed. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**twin\_id**|**uuid::Uuid**|Unique twin identifier.|[required]|| +|**twin\_req\_obj**|[**TwinReqObj**](TwinReqObj.md)|JSON-formatted document describing the twin to create or update.|[required]|| +### Return type +(empty response body) +### Authorization +[refreshAuth](../README.md#refreshAuth), [basicAuth](../README.md#basicAuth), [bearerAuth](../README.md#bearerAuth), [clientAuth](../README.md#clientAuth) +### HTTP request headers +- **Content-Type**: application/json +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +# TwinsPage +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**twins**|**Vec**||| +|**total**|Option<**i32**>|Total number of items.|[optional]| +|**offset**|Option<**i32**>|Number of items to skip during retrieval.|[optional]| +|**limit**|Option<**i32**>|Maximum number of items to return in one page.|[optional]| + + +# UpdateConfigCertsRequest +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**client\_cert**|Option<**String**>||[optional]| +|**client\_key**|Option<**String**>||[optional]| +|**ca\_cert**|Option<**String**>||[optional]| + + + +# UpdateConfigConnectionsRequest +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**channels**|Option<**Vec**>||[optional]| + + +# UpdateConfigRequest +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**content**|**String**||| +|**name**|**String**||| + +# UpdateConfigStateRequest +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**state**|Option<[**crate::models::State**](State.md)>||[optional]| + + +# UpdateRoleObj +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**name**|Option<**String**>|Role's name.|[optional]| + + +# User +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**id**|Option<[**uuid::Uuid**](uuid::Uuid.md)>|User unique identifier.|[optional]| +|**first\_name**|Option<**String**>|User's first name.|[optional]| +|**last\_name**|Option<**String**>|User's last name.|[optional]| +|**tags**|Option<**Vec**>|User tags.|[optional]| +|**email**|Option<**String**>|User email for example email address.|[optional]| +|**credentials**|Option<[**crate::models::UserCredentials**](User_credentials.md)>||[optional]| +|**metadata**|Option<[**serde_json::Value**](.md)>|Arbitrary, object-encoded user's data.|[optional]| +|**profile\_picture**|Option<**String**>|User's profile picture URL that is represented as a string.|[optional]| +|**status**|Option<**String**>|User Status|[optional]| +|**created\_at**|Option<**String**>|Time when the group was created.|[optional]| +|**updated\_at**|Option<**String**>|Time when the group was created.|[optional]| + + +# UserCredentials +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**username**|Option<**String**>|User's username for example john\_doe for Mr John Doe.|[optional]| + + +# Username +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**username**|**String**|User's username for example 'admin' will be used as its unique identifier.|| + +# UserProfilePicture +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**profile\_picture**|**String**|User's profile picture URL that is represented as a string.|| + +# UserReqObj +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**first\_name**|Option<**String**>|User's first name.|[optional]| +|**last\_name**|Option<**String**>|User's last name.|[optional]| +|**email**|Option<**String**>|User's email address will be used as its unique identifier.|[optional]| +|**tags**|Option<**Vec**>|User tags.|[optional]| +|**credentials**|[**crate::models::UserReqObjCredentials**](UserReqObj_credentials.md)||| +|**metadata**|Option<[**serde_json::Value**](.md)>|Arbitrary, object-encoded user's data.|[optional]| +|**profile\_picture**|Option<**String**>|User's profile picture URL that is represented as a string.|[optional]| +|**status**|Option<**String**>|User Status|[optional]| + + +# UserReqObjCredentials +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**username**|Option<**String**>|User's username for example 'admin' will be used as its unique identifier.|[optional]| +|**secret**|Option<**String**>|Free-form account secret used for acquiring auth token(s).|[optional]| + + + + +# UserRole +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**role**|**String**|User role example.|| + +# \UsersApi +All URIs are relative to *http://localhost:9001* + +|Method|HTTP request|Description| +| :-: | :-: | :-: | +|[**create_user**](UsersApi.md#create_user)|**POST** /users|Registers user account| +|[**disable_user**](UsersApi.md#disable_user)|**POST** /users/{userID}/disable|Disables a user| +|[**domain_id_users_get**](UsersApi.md#domain_id_users_get)|**GET** /{domainID}/users|List users assigned to domain| +|[**enable_user**](UsersApi.md#enable_user)|**POST** /users/{userID}/enable|Enables a user| +|[**get_profile**](UsersApi.md#get_profile)|**GET** /users/profile|Gets info on currently logged in user.| +|[**get_user**](UsersApi.md#get_user)|**GET** /users/{userID}|Retrieves a user| +|[**issue_token**](UsersApi.md#issue_token)|**POST** /users/tokens/issue|Issue Token| +|[**list_users**](UsersApi.md#list_users)|**GET** /users|List users| +|[**list_users_in_channel**](UsersApi.md#list_users_in_channel)|**GET** /{domainID}/channels/{channelID}/users|List users in a channel| +|[**list_users_in_client**](UsersApi.md#list_users_in_client)|**GET** /{domainID}/clients/{clientID}/users|List users associated with a client| +|[**list_users_in_group**](UsersApi.md#list_users_in_group)|**GET** /{domainID}/groups/{groupID}/users|List users in a group| +|[**refresh_token**](UsersApi.md#refresh_token)|**POST** /users/tokens/refresh|Refresh Token| +|[**request_password_reset**](UsersApi.md#request_password_reset)|**POST** /password/reset-request|User password reset request| +|[**reset_password**](UsersApi.md#reset_password)|**PUT** /password/reset|User password reset endpoint| +|[**search_users**](UsersApi.md#search_users)|**GET** /users/search|Search users| +|[**update_email**](UsersApi.md#update_email)|**PATCH** /users/{userID}/email|Updates email of the user.| +|[**update_profile_picture**](UsersApi.md#update_profile_picture)|**PATCH** /users/{userID}/picture|Updates the user's profile picture.| +|[**update_role**](UsersApi.md#update_role)|**PATCH** /users/{userID}/role|Updates the user's role.| +|[**update_secret**](UsersApi.md#update_secret)|**PATCH** /users/secret|Updates secret of currently logged in user.| +|[**update_tags**](UsersApi.md#update_tags)|**PATCH** /users/{userID}/tags|Updates tags of the user.| +|[**update_user**](UsersApi.md#update_user)|**PATCH** /users/{userID}|Updates first, last name and metadata of the user.| +|[**update_username**](UsersApi.md#update_username)|**PATCH** /users/{userID}/username|Updates user's username.| +|[**users_user_id_delete**](UsersApi.md#users_user_id_delete)|**DELETE** /users/{userID}|Delete a user| +## create\_user +crate::models::User create\_user(user\_req\_obj) +Registers user account + +Registers new user account given email and password. New account will be uniquely identified by its email address. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**user\_req\_obj**|[**UserReqObj**](UserReqObj.md)|JSON-formatted document describing the new user to be registered|[required]|| +### Return type +[**crate::models::User**](User.md) +### Authorization +[refreshAuth](../README.md#refreshAuth), [basicAuth](../README.md#basicAuth), [bearerAuth](../README.md#bearerAuth), [clientAuth](../README.md#clientAuth) +### HTTP request headers +- **Content-Type**: application/json +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## disable\_user +crate::models::User disable\_user(user\_id) +Disables a user + +Disables a specific user that is identifier by the user ID. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**user\_id**|**uuid::Uuid**|Unique user identifier.|[required]|| +### Return type +[**crate::models::User**](User.md) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## domain\_id\_users\_get +crate::models::UsersPage domain\_id\_users\_get(domain\_id, limit, offset, metadata, status) +List users assigned to domain + +List users assigned to domain that is identified by the domain ID. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**limit**|Option<**i32**>|Size of the subset to retrieve.||[default to 10]| +|**offset**|Option<**i32**>|Number of items to skip during retrieval.||[default to 0]| +|**metadata**|Option<**::std::collections::HashMap**>|Metadata filter. Filtering is performed matching the parameter with metadata on top level. Parameter is json.||| +|**status**|Option<**String**>|Client account status.||[default to enabled]| +### Return type +[**crate::models::UsersPage**](UsersPage.md) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## enable\_user +crate::models::User enable\_user(user\_id) +Enables a user + +Enables a specific user that is identifier by the user ID. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**user\_id**|**uuid::Uuid**|Unique user identifier.|[required]|| +### Return type +[**crate::models::User**](User.md) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## get\_profile +crate::models::User get\_profile() +Gets info on currently logged in user. + +Gets info on currently logged in user. Info is obtained using authorization token +### Parameters +This endpoint does not need any parameter. +### Return type +[**crate::models::User**](User.md) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## get\_user +crate::models::User get\_user(user\_id) +Retrieves a user + +Retrieves a specific user that is identifier by the user ID. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**user\_id**|**uuid::Uuid**|Unique user identifier.|[required]|| +### Return type +[**crate::models::User**](User.md) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## issue\_token +crate::models::IssueToken200Response issue\_token(issue\_token) +Issue Token + +Issue Access and Refresh Token used for authenticating into the system. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**issue\_token**|[**IssueToken**](IssueToken.md)|Login credentials.|[required]|| +### Return type +[**crate::models::IssueToken200Response**](issueToken_200_response.md) +### Authorization +[refreshAuth](../README.md#refreshAuth), [basicAuth](../README.md#basicAuth), [bearerAuth](../README.md#bearerAuth), [clientAuth](../README.md#clientAuth) +### HTTP request headers +- **Content-Type**: application/json +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## list\_users +crate::models::UsersPage list\_users(limit, offset, metadata, status, first\_name, last\_name, username, email, tags) +List users + +Retrieves a list of users. Due to performance concerns, data is retrieved in subsets. The API must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**limit**|Option<**i32**>|Size of the subset to retrieve.||[default to 10]| +|**offset**|Option<**i32**>|Number of items to skip during retrieval.||[default to 0]| +|**metadata**|Option<**::std::collections::HashMap**>|Metadata filter. Filtering is performed matching the parameter with metadata on top level. Parameter is json.||| +|**status**|Option<**String**>|Client account status.||[default to enabled]| +|**first\_name**|Option<**String**>|User's first name.||| +|**last\_name**|Option<**String**>|User's last name.||| +|**username**|Option<**String**>|User's username.||| +|**email**|Option<**String**>|User's email address.||| +|**tags**|Option<**Vec**>|Client tags.||| +### Return type +[**crate::models::UsersPage**](UsersPage.md) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## list\_users\_in\_channel +crate::models::MembersPage list\_users\_in\_channel(domain\_id, channel\_id, limit, offset, level, tree, metadata, name, parent\_id) +List users in a channel + +Retrieves a list of users in a channel. Due to performance concerns, data is retrieved in subsets. The API must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**channel\_id**|**uuid::Uuid**|Unique channel identifier.|[required]|| +|**limit**|Option<**i32**>|Size of the subset to retrieve.||[default to 10]| +|**offset**|Option<**i32**>|Number of items to skip during retrieval.||[default to 0]| +|**level**|Option<**i32**>|Level of hierarchy up to which to retrieve groups from given group id.||| +|**tree**|Option<**bool**>|Specify type of response, JSON array or tree.||[default to false]| +|**metadata**|Option<**::std::collections::HashMap**>|Metadata filter. Filtering is performed matching the parameter with metadata on top level. Parameter is json.||| +|**name**|Option<**String**>|Channel's name.||| +|**parent\_id**|Option<**uuid::Uuid**>|Unique parent identifier for a group.||| +### Return type +[**crate::models::MembersPage**](MembersPage.md) +### Authorization +[refreshAuth](../README.md#refreshAuth), [basicAuth](../README.md#basicAuth), [bearerAuth](../README.md#bearerAuth), [clientAuth](../README.md#clientAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## list\_users\_in\_client +crate::models::MembersPage list\_users\_in\_client(domain\_id, client\_id, limit, offset, level, tree, metadata, name, parent\_id) +List users associated with a client + +Retrieves a list of users associated with a client. Due to performance concerns, data is retrieved in subsets. The API must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**client\_id**|**uuid::Uuid**|Unique client identifier.|[required]|| +|**limit**|Option<**i32**>|Size of the subset to retrieve.||[default to 10]| +|**offset**|Option<**i32**>|Number of items to skip during retrieval.||[default to 0]| +|**level**|Option<**i32**>|Level of hierarchy up to which to retrieve groups from given group id.||| +|**tree**|Option<**bool**>|Specify type of response, JSON array or tree.||[default to false]| +|**metadata**|Option<**::std::collections::HashMap**>|Metadata filter. Filtering is performed matching the parameter with metadata on top level. Parameter is json.||| +|**name**|Option<**String**>|Channel's name.||| +|**parent\_id**|Option<**uuid::Uuid**>|Unique parent identifier for a group.||| +### Return type +[**crate::models::MembersPage**](MembersPage.md) +### Authorization +[refreshAuth](../README.md#refreshAuth), [basicAuth](../README.md#basicAuth), [bearerAuth](../README.md#bearerAuth), [clientAuth](../README.md#clientAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## list\_users\_in\_group +crate::models::MembersPage list\_users\_in\_group(domain\_id, group\_id, limit, offset, level, tree, metadata, name, parent\_id) +List users in a group + +Retrieves a list of users in a group. Due to performance concerns, data is retrieved in subsets. The API must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**domain\_id**|**uuid::Uuid**|Unique domain identifier.|[required]|| +|**group\_id**|**uuid::Uuid**|Unique group identifier.|[required]|| +|**limit**|Option<**i32**>|Size of the subset to retrieve.||[default to 10]| +|**offset**|Option<**i32**>|Number of items to skip during retrieval.||[default to 0]| +|**level**|Option<**i32**>|Level of hierarchy up to which to retrieve groups from given group id.||| +|**tree**|Option<**bool**>|Specify type of response, JSON array or tree.||[default to false]| +|**metadata**|Option<**::std::collections::HashMap**>|Metadata filter. Filtering is performed matching the parameter with metadata on top level. Parameter is json.||| +|**name**|Option<**String**>|Group's name.||| +|**parent\_id**|Option<**uuid::Uuid**>|Unique parent identifier for a group.||| +### Return type +[**crate::models::MembersPage**](MembersPage.md) +### Authorization +[refreshAuth](../README.md#refreshAuth), [basicAuth](../README.md#basicAuth), [bearerAuth](../README.md#bearerAuth), [clientAuth](../README.md#clientAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## refresh\_token +crate::models::IssueToken200Response refresh\_token() +Refresh Token + +Refreshes Access and Refresh Token used for authenticating into the system. +### Parameters +This endpoint does not need any parameter. +### Return type +[**crate::models::IssueToken200Response**](issueToken_200_response.md) +### Authorization +[refreshAuth](../README.md#refreshAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## request\_password\_reset +request\_password\_reset(referer, request\_password\_reset\_request) +User password reset request + +Generates a reset token and sends and email with link for resetting password. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**referer**|**String**|Host being sent by browser.|[required]|| +|**request\_password\_reset\_request**|[**RequestPasswordResetRequest**](RequestPasswordResetRequest.md)|Initiate password request procedure.|[required]|| +### Return type +(empty response body) +### Authorization +[refreshAuth](../README.md#refreshAuth), [basicAuth](../README.md#basicAuth), [bearerAuth](../README.md#bearerAuth), [clientAuth](../README.md#clientAuth) +### HTTP request headers +- **Content-Type**: application/json +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## reset\_password +reset\_password(reset\_password\_request) +User password reset endpoint + +When user gets reset token, after he submitted email to /password/reset-request, posting a new password along to this endpoint will change password. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**reset\_password\_request**|Option<[**ResetPasswordRequest**](ResetPasswordRequest.md)>|Password reset request data, new password and token that is appended on password reset link received in email.||| +### Return type +(empty response body) +### Authorization +[refreshAuth](../README.md#refreshAuth), [basicAuth](../README.md#basicAuth), [bearerAuth](../README.md#bearerAuth), [clientAuth](../README.md#clientAuth) +### HTTP request headers +- **Content-Type**: application/json +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## search\_users +crate::models::UsersPage search\_users(user\_id, limit, offset, username, first\_name, last\_name, email) +Search users + +Search users by name and identity. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**user\_id**|**uuid::Uuid**|Unique user identifier.|[required]|| +|**limit**|Option<**i32**>|Size of the subset to retrieve.||[default to 10]| +|**offset**|Option<**i32**>|Number of items to skip during retrieval.||[default to 0]| +|**username**|Option<**String**>|User's username.||| +|**first\_name**|Option<**String**>|User's first name.||| +|**last\_name**|Option<**String**>|User's last name.||| +|**email**|Option<**String**>|User's email address.||| +### Return type +[**crate::models::UsersPage**](UsersPage.md) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## update\_email +crate::models::User update\_email(user\_id, email) +Updates email of the user. + +Updates email of the user with provided ID. Email is updated using authorization token and the new received email. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**user\_id**|**uuid::Uuid**|Unique user identifier.|[required]|| +|**email**|[**Email**](Email.md)|Email change data. User can change its email.|[required]|| +### Return type +[**crate::models::User**](User.md) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: application/json +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## update\_profile\_picture +crate::models::User update\_profile\_picture(user\_id, user\_profile\_picture) +Updates the user's profile picture. + +Updates the user's profile picture with provided ID. Profile picture is updated using authorization token and the new received picture. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**user\_id**|**uuid::Uuid**|Unique user identifier.|[required]|| +|**user\_profile\_picture**|[**UserProfilePicture**](UserProfilePicture.md)|JSON-formated document describing the profile picture of user to be update|[required]|| +### Return type +[**crate::models::User**](User.md) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: application/json +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## update\_role +crate::models::User update\_role(user\_id, user\_role) +Updates the user's role. + +Updates role for the user with provided ID. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**user\_id**|**uuid::Uuid**|Unique user identifier.|[required]|| +|**user\_role**|[**UserRole**](UserRole.md)|JSON-formated document describing the role of the user to be updated|[required]|| +### Return type +[**crate::models::User**](User.md) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: application/json +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## update\_secret +crate::models::User update\_secret(user\_secret) +Updates secret of currently logged in user. + +Updates secret of currently logged in user. Secret is updated using authorization token and the new received info. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**user\_secret**|[**UserSecret**](UserSecret.md)|Secret change data. User can change its secret.|[required]|| +### Return type +[**crate::models::User**](User.md) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: application/json +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## update\_tags +crate::models::User update\_tags(user\_id, user\_tags) +Updates tags of the user. + +Updates tags of the user with provided ID. Tags is updated using authorization token and the new tags received in request. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**user\_id**|**uuid::Uuid**|Unique user identifier.|[required]|| +|**user\_tags**|[**UserTags**](UserTags.md)|JSON-formated document describing the tags of user to be update|[required]|| +### Return type +[**crate::models::User**](User.md) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: application/json +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## update\_user +crate::models::User update\_user(user\_id, user\_update) +Updates first, last name and metadata of the user. + +Updates name and metadata of the user with provided ID. Name and metadata is updated using authorization token and the new received info. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**user\_id**|**uuid::Uuid**|Unique user identifier.|[required]|| +|**user\_update**|[**UserUpdate**](UserUpdate.md)|JSON-formated document describing the metadata and name of user to be update|[required]|| +### Return type +[**crate::models::User**](User.md) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: application/json +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## update\_username +crate::models::User update\_username(user\_id, username) +Updates user's username. + +Updates username of the user with provided ID. Username is updated using authorization token and the new received username. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**user\_id**|**uuid::Uuid**|Unique user identifier.|[required]|| +|**username**|[**Username**](Username.md)|JSON-formated document describing the username of the user to be updated|[required]|| +### Return type +[**crate::models::User**](User.md) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: application/json +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +## users\_user\_id\_delete +users\_user\_id\_delete(user\_id) +Delete a user + +Delete a specific user that is identifier by the user ID. +### Parameters + +|Name|Type|Description|Required|Notes| +| :-: | :-: | :-: | :-: | :-: | +|**user\_id**|**uuid::Uuid**|Unique user identifier.|[required]|| +### Return type +(empty response body) +### Authorization +[bearerAuth](../README.md#bearerAuth) +### HTTP request headers +- **Content-Type**: Not defined +- **Accept**: application/json + +[\[Back to top\]]() [\[Back to API list\]](../README.md#documentation-for-api-endpoints) [\[Back to Model list\]](../README.md#documentation-for-models) [\[Back to README\]](../README.md) +# UserSecret +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**old\_secret**|**String**|Old user secret password.|| +|**new\_secret**|**String**|New user secret password.|| + +# UsersPage +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**users**|**Vec**||| +|**total**|**i32**|Total number of items.|| +|**offset**|**i32**|Number of items to skip during retrieval.|| +|**limit**|Option<**i32**>|Maximum number of items to return in one page.|[optional]| + + +# UserTags +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**tags**|Option<**Vec**>|User tags.|[optional]| + + +# UserUpdate +## Properties + +|Name|Type|Description|Notes| +| :-: | :-: | :-: | :-: | +|**first\_name**|**String**|User's first name.|| +|**last\_name**|**String**|User's last name.|| +|**metadata**|[**serde_json::Value**](.md)|Arbitrary, object-encoded user's data.|| + diff --git a/README.md b/README.md index 9540c8ef..f6501d3d 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,196 @@ -# sdk-rust -Rust SDK for SuperMQ +# Rust API client for openapi + +This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. +Some useful links: +- [The SuperMQ repository](https://github.com/absmach/supermq) + + + +## Overview + +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://openapis.org) from a remote server, you can easily generate an API client. + +- API version: 0.15.1 +- Package version: 0.15.1 +- Build package: `org.openapitools.codegen.languages.RustClientCodegen` + +## Installation + +Put the package under your project folder in a directory named `openapi` and add the following to `Cargo.toml` under `[dependencies]`: + +``` +openapi = { path = "./openapi" } +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost:9001* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*CertsApi* | [**create_cert**](docs/CertsApi.md#create_cert) | **POST** /{domainID}/certs | Creates a certificate for client +*CertsApi* | [**get_cert**](docs/CertsApi.md#get_cert) | **GET** /{domainID}/certs/{certID} | Retrieves a certificate +*CertsApi* | [**get_serials**](docs/CertsApi.md#get_serials) | **GET** /{domainID}/serials/{clientID} | Retrieves certificates' serial IDs +*CertsApi* | [**health_get**](docs/CertsApi.md#health_get) | **GET** /health | Retrieves service health check info. +*CertsApi* | [**revoke_cert**](docs/CertsApi.md#revoke_cert) | **DELETE** /{domainID}/certs/{certID} | Revokes a certificate +*ChannelsApi* | [**connect_clients_and_channels**](docs/ChannelsApi.md#connect_clients_and_channels) | **POST** /{domainID}/channels/connect | Connects client and channel. +*ChannelsApi* | [**connect_clients_to_channel**](docs/ChannelsApi.md#connect_clients_to_channel) | **POST** /{domainID}/channels/{chanID}/connect | Connects clients to a channel +*ChannelsApi* | [**create_channel**](docs/ChannelsApi.md#create_channel) | **POST** /{domainID}/channels | Creates new channel +*ChannelsApi* | [**create_channels**](docs/ChannelsApi.md#create_channels) | **POST** /{domainID}/channels/bulk | Creates new channels +*ChannelsApi* | [**disable_channel**](docs/ChannelsApi.md#disable_channel) | **POST** /{domainID}/channels/{chanID}/disable | Disables a channel +*ChannelsApi* | [**disconnect_clients_and_channels**](docs/ChannelsApi.md#disconnect_clients_and_channels) | **POST** /{domainID}/channels/disconnect | Disconnects client and channel. +*ChannelsApi* | [**disconnect_clients_from_channel**](docs/ChannelsApi.md#disconnect_clients_from_channel) | **POST** /{domainID}/channels/{chanID}/disconnect | Disconnects clients from a channel +*ChannelsApi* | [**domain_id_channels_chan_id_delete**](docs/ChannelsApi.md#domain_id_channels_chan_id_delete) | **DELETE** /{domainID}/channels/{chanID} | Delete channel for given channel id. +*ChannelsApi* | [**enable_channel**](docs/ChannelsApi.md#enable_channel) | **POST** /{domainID}/channels/{chanID}/enable | Enables a channel +*ChannelsApi* | [**get_channel**](docs/ChannelsApi.md#get_channel) | **GET** /{domainID}/channels/{chanID} | Retrieves channel info. +*ChannelsApi* | [**list_channels**](docs/ChannelsApi.md#list_channels) | **GET** /{domainID}/channels | Lists channels. +*ChannelsApi* | [**remove_channel_parent_group**](docs/ChannelsApi.md#remove_channel_parent_group) | **DELETE** /{domainID}/channels/{chanID}/parent | Removes a parent group from a channel. +*ChannelsApi* | [**set_channel_parent_group**](docs/ChannelsApi.md#set_channel_parent_group) | **POST** /{domainID}/channels/{chanID}/parent | Sets a parent group for a channel +*ChannelsApi* | [**update_channel**](docs/ChannelsApi.md#update_channel) | **PATCH** /{domainID}/channels/{chanID} | Updates channel data. +*ChannelsApi* | [**update_channel_tags**](docs/ChannelsApi.md#update_channel_tags) | **PATCH** /{domainID}/channels/{chanID}/tags | Updates channel tags. +*ClientsApi* | [**add_client_role_action**](docs/ClientsApi.md#add_client_role_action) | **POST** /{domainID}/clients/{clientID}/roles/{roleName}/actions | Adds a role action for a client role. +*ClientsApi* | [**add_client_role_member**](docs/ClientsApi.md#add_client_role_member) | **POST** /{domainID}/clients/{clientID}/roles/{roleName}/members | Adds a member to a client role. +*ClientsApi* | [**bulk_create_clients**](docs/ClientsApi.md#bulk_create_clients) | **POST** /{domainID}/clients/bulk | Bulk provisions new clients +*ClientsApi* | [**create_client**](docs/ClientsApi.md#create_client) | **POST** /{domainID}/clients | Adds new client +*ClientsApi* | [**create_client_role**](docs/ClientsApi.md#create_client_role) | **POST** /{domainID}/clients/{clientID}/roles | Creates a role for a client +*ClientsApi* | [**delete_all_client_role_actions**](docs/ClientsApi.md#delete_all_client_role_actions) | **POST** /{domainID}/clients/{clientID}/roles/{roleName}/actions/delete-all | Deletes all role actions for a client role. +*ClientsApi* | [**delete_all_client_role_members**](docs/ClientsApi.md#delete_all_client_role_members) | **POST** /{domainID}/clients/{clientID}/roles/{roleName}/members/delete-all | Deletes all members from a client role. +*ClientsApi* | [**delete_client_role**](docs/ClientsApi.md#delete_client_role) | **DELETE** /{domainID}/clients/{clientID}/roles/{roleName} | Deletes client role. +*ClientsApi* | [**delete_client_role_action**](docs/ClientsApi.md#delete_client_role_action) | **POST** /{domainID}/clients/{clientID}/roles/{roleName}/actions/delete | Deletes role actions for a client role. +*ClientsApi* | [**delete_client_role_members**](docs/ClientsApi.md#delete_client_role_members) | **POST** /{domainID}/clients/{clientID}/roles/{roleName}/members/delete | Deletes members from a client role. +*ClientsApi* | [**disable_client**](docs/ClientsApi.md#disable_client) | **POST** /{domainID}/clients/{clientID}/disable | Disables a client +*ClientsApi* | [**domain_id_clients_client_id_delete**](docs/ClientsApi.md#domain_id_clients_client_id_delete) | **DELETE** /{domainID}/clients/{clientID} | Delete client for a client with the given id. +*ClientsApi* | [**enable_client**](docs/ClientsApi.md#enable_client) | **POST** /{domainID}/clients/{clientID}/enable | Enables a client +*ClientsApi* | [**get_client**](docs/ClientsApi.md#get_client) | **GET** /{domainID}/clients/{clientID} | Retrieves client info +*ClientsApi* | [**get_client_role**](docs/ClientsApi.md#get_client_role) | **GET** /{domainID}/clients/{clientID}/roles/{roleName} | Retrieves client role. +*ClientsApi* | [**list_available_actions**](docs/ClientsApi.md#list_available_actions) | **GET** /{domainID}/clients/roles/available-actions | Retrieves available actions. +*ClientsApi* | [**list_client_role_actions**](docs/ClientsApi.md#list_client_role_actions) | **GET** /{domainID}/clients/{clientID}/roles/{roleName}/actions | Lists client role actions. +*ClientsApi* | [**list_client_role_members**](docs/ClientsApi.md#list_client_role_members) | **GET** /{domainID}/clients/{clientID}/roles/{roleName}/members | Lists client role members. +*ClientsApi* | [**list_client_roles**](docs/ClientsApi.md#list_client_roles) | **GET** /{domainID}/clients/{clientID}/roles | Retrieves clients roles. +*ClientsApi* | [**list_clients**](docs/ClientsApi.md#list_clients) | **GET** /{domainID}/clients | Retrieves clients +*ClientsApi* | [**list_user_clients**](docs/ClientsApi.md#list_user_clients) | **GET** /{domainID}/users/{userID}/clients | List clients asssociated with a user. +*ClientsApi* | [**remove_client_parent_group**](docs/ClientsApi.md#remove_client_parent_group) | **DELETE** /{domainID}/clients/{clientID}/parent | Removes a parent group from a client. +*ClientsApi* | [**set_client_parent_group**](docs/ClientsApi.md#set_client_parent_group) | **POST** /{domainID}/clients/{clientID}/parent | Sets a parent group for a client +*ClientsApi* | [**update_client**](docs/ClientsApi.md#update_client) | **PATCH** /{domainID}/clients/{clientID} | Updates name and metadata of the client. +*ClientsApi* | [**update_client_role**](docs/ClientsApi.md#update_client_role) | **PUT** /{domainID}/clients/{clientID}/roles/{roleName} | Updates client role. +*ClientsApi* | [**update_client_secret**](docs/ClientsApi.md#update_client_secret) | **PATCH** /{domainID}/clients/{clientID}/secret | Updates Secret of the identified client. +*ClientsApi* | [**update_client_tags**](docs/ClientsApi.md#update_client_tags) | **PATCH** /{domainID}/clients/{clientID}/tags | Updates tags the client. +*ConfigsApi* | [**create_config**](docs/ConfigsApi.md#create_config) | **POST** /{domainID}/clients/configs | Adds new config +*ConfigsApi* | [**get_bootstrap_config**](docs/ConfigsApi.md#get_bootstrap_config) | **GET** /clients/bootstrap/{externalId} | Retrieves configuration. +*ConfigsApi* | [**get_config**](docs/ConfigsApi.md#get_config) | **GET** /{domainID}/clients/configs/{configId} | Retrieves config info (with channels). +*ConfigsApi* | [**get_configs**](docs/ConfigsApi.md#get_configs) | **GET** /{domainID}/clients/configs | Retrieves managed configs +*ConfigsApi* | [**get_secure_bootstrap_config**](docs/ConfigsApi.md#get_secure_bootstrap_config) | **GET** /clients/bootstrap/secure/{externalId} | Retrieves configuration. +*ConfigsApi* | [**remove_config**](docs/ConfigsApi.md#remove_config) | **DELETE** /{domainID}/clients/configs/{configId} | Removes a Config +*ConfigsApi* | [**update_config**](docs/ConfigsApi.md#update_config) | **PUT** /{domainID}/clients/configs/{configId} | Updates config info +*ConfigsApi* | [**update_config_certs**](docs/ConfigsApi.md#update_config_certs) | **PATCH** /{domainID}/clients/configs/certs/{configId} | Updates certs +*ConfigsApi* | [**update_config_connections**](docs/ConfigsApi.md#update_config_connections) | **PUT** /{domainID}/clients/configs/connections/{configId} | Updates channels the client is connected to +*ConfigsApi* | [**update_config_state**](docs/ConfigsApi.md#update_config_state) | **PUT** /{domainID}/clients/state/{configId} | Updates Config state. +*DomainsApi* | [**add_domain_role_action**](docs/DomainsApi.md#add_domain_role_action) | **POST** /domains/{domainID}/roles/{roleName}/actions | Adds a role action for a domain role. +*DomainsApi* | [**add_domain_role_member**](docs/DomainsApi.md#add_domain_role_member) | **POST** /domains/{domainID}/roles/{roleName}/members | Adds a member to a domain role. +*DomainsApi* | [**create_domain_role**](docs/DomainsApi.md#create_domain_role) | **POST** /domains/{domainID}/roles | Creates a role for a domain +*DomainsApi* | [**delete_all_domain_role_actions**](docs/DomainsApi.md#delete_all_domain_role_actions) | **POST** /domains/{domainID}/roles/{roleName}/actions/delete-all | Deletes all role actions for a domain role. +*DomainsApi* | [**delete_all_domain_role_members**](docs/DomainsApi.md#delete_all_domain_role_members) | **POST** /domains/{domainID}/roles/{roleName}/members/delete-all | Deletes all members from a domain role. +*DomainsApi* | [**delete_domain_role**](docs/DomainsApi.md#delete_domain_role) | **DELETE** /domains/{domainID}/roles/{roleName} | Deletes domain role. +*DomainsApi* | [**delete_domain_role_action**](docs/DomainsApi.md#delete_domain_role_action) | **POST** /domains/{domainID}/roles/{roleName}/actions/delete | Deletes role actions for a domain role. +*DomainsApi* | [**delete_domain_role_members**](docs/DomainsApi.md#delete_domain_role_members) | **POST** /domains/{domainID}/roles/{roleName}/members/delete | Deletes members from a domain role. +*DomainsApi* | [**domains_domain_id_disable_post**](docs/DomainsApi.md#domains_domain_id_disable_post) | **POST** /domains/{domainID}/disable | Disable a domain +*DomainsApi* | [**domains_domain_id_enable_post**](docs/DomainsApi.md#domains_domain_id_enable_post) | **POST** /domains/{domainID}/enable | Enables a domain +*DomainsApi* | [**domains_domain_id_freeze_post**](docs/DomainsApi.md#domains_domain_id_freeze_post) | **POST** /domains/{domainID}/freeze | Freeze a domain +*DomainsApi* | [**domains_domain_id_get**](docs/DomainsApi.md#domains_domain_id_get) | **GET** /domains/{domainID} | Retrieves domain information +*DomainsApi* | [**domains_domain_id_patch**](docs/DomainsApi.md#domains_domain_id_patch) | **PATCH** /domains/{domainID} | Updates name, metadata, tags and alias of the domain. +*DomainsApi* | [**domains_get**](docs/DomainsApi.md#domains_get) | **GET** /domains | Retrieves list of domains. +*DomainsApi* | [**domains_post**](docs/DomainsApi.md#domains_post) | **POST** /domains | Adds new domain +*DomainsApi* | [**get_domain_role**](docs/DomainsApi.md#get_domain_role) | **GET** /domains/{domainID}/roles/{roleName} | Retrieves domain role. +*DomainsApi* | [**list_available_domain_actions**](docs/DomainsApi.md#list_available_domain_actions) | **GET** /domains/roles/available-actions | Retrieves available actions. +*DomainsApi* | [**list_domain_role_actions**](docs/DomainsApi.md#list_domain_role_actions) | **GET** /domains/{domainID}/roles/{roleName}/actions | Lists domain role actions. +*DomainsApi* | [**list_domain_role_members**](docs/DomainsApi.md#list_domain_role_members) | **GET** /domains/{domainID}/roles/{roleName}/members | Lists domain role members. +*DomainsApi* | [**list_domain_roles**](docs/DomainsApi.md#list_domain_roles) | **GET** /domains/{domainID}/roles | Retrieves domains roles. +*DomainsApi* | [**update_domain_role**](docs/DomainsApi.md#update_domain_role) | **PUT** /domains/{domainID}/roles/{roleName} | Updates domain role. +*GroupsApi* | [**add_children_groups**](docs/GroupsApi.md#add_children_groups) | **POST** /{domainID}/groups/{groupID}/children | Add children groups. +*GroupsApi* | [**add_group_role_action**](docs/GroupsApi.md#add_group_role_action) | **POST** /{domainID}/groups/{groupID}/roles/{roleName}/actions | Adds a role action for a group role. +*GroupsApi* | [**add_group_role_member**](docs/GroupsApi.md#add_group_role_member) | **POST** /{domainID}/groups/{groupID}/roles/{roleName}/members | Adds a member to a group role. +*GroupsApi* | [**create_group**](docs/GroupsApi.md#create_group) | **POST** /{domainID}/groups | Creates new group +*GroupsApi* | [**create_group_role**](docs/GroupsApi.md#create_group_role) | **POST** /{domainID}/groups/{groupID}/roles | Creates a role for a group +*GroupsApi* | [**delete_all_group_role_actions**](docs/GroupsApi.md#delete_all_group_role_actions) | **POST** /{domainID}/groups/{groupID}/roles/{roleName}/actions/delete-all | Deletes all role actions for a group role. +*GroupsApi* | [**delete_all_group_role_members**](docs/GroupsApi.md#delete_all_group_role_members) | **POST** /{domainID}/groups/{groupID}/roles/{roleName}/members/delete-all | Deletes all members from a group role. +*GroupsApi* | [**delete_group_role**](docs/GroupsApi.md#delete_group_role) | **DELETE** /{domainID}/groups/{groupID}/roles/{roleName} | Deletes group role. +*GroupsApi* | [**delete_group_role_action**](docs/GroupsApi.md#delete_group_role_action) | **POST** /{domainID}/groups/{groupID}/roles/{roleName}/actions/delete | Deletes role actions for a group role. +*GroupsApi* | [**delete_group_role_members**](docs/GroupsApi.md#delete_group_role_members) | **POST** /{domainID}/groups/{groupID}/roles/{roleName}/members/delete | Deletes members from a group role. +*GroupsApi* | [**disable_group**](docs/GroupsApi.md#disable_group) | **POST** /{domainID}/groups/{groupID}/disable | Disables a group +*GroupsApi* | [**domain_id_groups_group_id_delete**](docs/GroupsApi.md#domain_id_groups_group_id_delete) | **DELETE** /{domainID}/groups/{groupID} | Delete group for a group with the given id. +*GroupsApi* | [**enable_group**](docs/GroupsApi.md#enable_group) | **POST** /{domainID}/groups/{groupID}/enable | Enables a group +*GroupsApi* | [**get_group**](docs/GroupsApi.md#get_group) | **GET** /{domainID}/groups/{groupID} | Gets group info. +*GroupsApi* | [**get_group_role**](docs/GroupsApi.md#get_group_role) | **GET** /{domainID}/groups/{groupID}/roles/{roleName} | Retrieves group role. +*GroupsApi* | [**list_available_group_actions**](docs/GroupsApi.md#list_available_group_actions) | **GET** /{domainID}/groups/roles/available-actions | Retrieves available actions. +*GroupsApi* | [**list_children_groups**](docs/GroupsApi.md#list_children_groups) | **GET** /{domainID}/groups/{groupID}/children | List children of a certain group +*GroupsApi* | [**list_group_hierarchy**](docs/GroupsApi.md#list_group_hierarchy) | **GET** /{domainID}/groups/{groupID}/hierarchy | Lists groups hierarchy. +*GroupsApi* | [**list_group_role_actions**](docs/GroupsApi.md#list_group_role_actions) | **GET** /{domainID}/groups/{groupID}/roles/{roleName}/actions | Lists group role actions. +*GroupsApi* | [**list_group_role_members**](docs/GroupsApi.md#list_group_role_members) | **GET** /{domainID}/groups/{groupID}/roles/{roleName}/members | Lists group role members. +*GroupsApi* | [**list_group_roles**](docs/GroupsApi.md#list_group_roles) | **GET** /{domainID}/groups/{groupID}/roles | Retrieves groups roles. +*GroupsApi* | [**list_groups**](docs/GroupsApi.md#list_groups) | **GET** /{domainID}/groups | Lists groups. +*GroupsApi* | [**remove_all_children_groups**](docs/GroupsApi.md#remove_all_children_groups) | **DELETE** /{domainID}/groups/{groupID}/children/all | Remove all children groups. +*GroupsApi* | [**remove_children_groups**](docs/GroupsApi.md#remove_children_groups) | **DELETE** /{domainID}/groups/{groupID}/children | Remove children groups. +*GroupsApi* | [**remove_group_parent_group**](docs/GroupsApi.md#remove_group_parent_group) | **DELETE** /{domainID}/groups/{groupID}/parent | Removes a parent group from a group. +*GroupsApi* | [**set_group_parent_group**](docs/GroupsApi.md#set_group_parent_group) | **POST** /{domainID}/groups/{groupID}/parent | Sets a parent group for a group. +*GroupsApi* | [**update_group**](docs/GroupsApi.md#update_group) | **PUT** /{domainID}/groups/{groupID} | Updates group data. +*GroupsApi* | [**update_group_role**](docs/GroupsApi.md#update_group_role) | **PUT** /{domainID}/groups/{groupID}/roles/{roleName} | Updates group role. +*InvitationsApi* | [**accept_invitation**](docs/InvitationsApi.md#accept_invitation) | **POST** /invitations/accept | Accept invitation +*InvitationsApi* | [**delete_invitation**](docs/InvitationsApi.md#delete_invitation) | **DELETE** /invitations/{user_id}/{domain_id} | Deletes a specific invitation +*InvitationsApi* | [**get_invitation**](docs/InvitationsApi.md#get_invitation) | **GET** /invitations/{user_id}/{domain_id} | Retrieves a specific invitation +*InvitationsApi* | [**list_invitations**](docs/InvitationsApi.md#list_invitations) | **GET** /invitations | List invitations +*InvitationsApi* | [**reject_invitation**](docs/InvitationsApi.md#reject_invitation) | **POST** /invitations/reject | Reject invitation +*InvitationsApi* | [**send_invitation**](docs/InvitationsApi.md#send_invitation) | **POST** /invitations | Send invitation +*JournalLogApi* | [**domain_id_journal_entity_type_id_get**](docs/JournalLogApi.md#domain_id_journal_entity_type_id_get) | **GET** /{domainID}/journal/{entityType}/{id} | List entity journal log +*JournalLogApi* | [**journal_user_user_id_get**](docs/JournalLogApi.md#journal_user_user_id_get) | **GET** /journal/user/{userID} | List user journal log +*KeysApi* | [**get_key**](docs/KeysApi.md#get_key) | **GET** /keys/{keyID} | Gets API key details. +*KeysApi* | [**issue_key**](docs/KeysApi.md#issue_key) | **POST** /keys | Issue API key +*KeysApi* | [**revoke_key**](docs/KeysApi.md#revoke_key) | **DELETE** /keys/{keyID} | Revoke API key +*MessagesApi* | [**channels_id_messages_post**](docs/MessagesApi.md#channels_id_messages_post) | **POST** /channels/{id}/messages | Sends message to the communication channel +*NotifiersApi* | [**create_subscription**](docs/NotifiersApi.md#create_subscription) | **POST** /subscriptions | Create subscription +*NotifiersApi* | [**list_subscriptions**](docs/NotifiersApi.md#list_subscriptions) | **GET** /subscriptions | List subscriptions +*NotifiersApi* | [**remove_subscription**](docs/NotifiersApi.md#remove_subscription) | **DELETE** /subscriptions/{id} | Delete subscription with the provided id +*NotifiersApi* | [**view_subscription**](docs/NotifiersApi.md#view_subscription) | **GET** /subscriptions/{id} | Get subscription with the provided id +*ProvisionApi* | [**domain_id_mapping_get**](docs/ProvisionApi.md#domain_id_mapping_get) | **GET** /{domainID}/mapping | Gets current mapping. +*ProvisionApi* | [**domain_id_mapping_post**](docs/ProvisionApi.md#domain_id_mapping_post) | **POST** /{domainID}/mapping | Adds new device to proxy +*ReadersApi* | [**get_messages**](docs/ReadersApi.md#get_messages) | **GET** /channels/{chanId}/messages | Retrieves messages sent to single channel +*StatesApi* | [**get_states**](docs/StatesApi.md#get_states) | **GET** /states/{twinID} | Retrieves states of twin with id twinID +*TwinsApi* | [**create_twin**](docs/TwinsApi.md#create_twin) | **POST** /twins | Adds new twin +*TwinsApi* | [**get_twin**](docs/TwinsApi.md#get_twin) | **GET** /twins/{twinID} | Retrieves twin info +*TwinsApi* | [**get_twins**](docs/TwinsApi.md#get_twins) | **GET** /twins | Retrieves twins +*TwinsApi* | [**remove_twin**](docs/TwinsApi.md#remove_twin) | **DELETE** /twins/{twinID} | Removes a twin +*TwinsApi* | [**update_twin**](docs/TwinsApi.md#update_twin) | **PUT** /twins/{twinID} | Updates twin info +*UsersApi* | [**create_user**](docs/UsersApi.md#create_user) | **POST** /users | Registers user account +*UsersApi* | [**disable_user**](docs/UsersApi.md#disable_user) | **POST** /users/{userID}/disable | Disables a user +*UsersApi* | [**domain_id_users_get**](docs/UsersApi.md#domain_id_users_get) | **GET** /{domainID}/users | List users assigned to domain +*UsersApi* | [**enable_user**](docs/UsersApi.md#enable_user) | **POST** /users/{userID}/enable | Enables a user +*UsersApi* | [**get_profile**](docs/UsersApi.md#get_profile) | **GET** /users/profile | Gets info on currently logged in user. +*UsersApi* | [**get_user**](docs/UsersApi.md#get_user) | **GET** /users/{userID} | Retrieves a user +*UsersApi* | [**issue_token**](docs/UsersApi.md#issue_token) | **POST** /users/tokens/issue | Issue Token +*UsersApi* | [**list_users**](docs/UsersApi.md#list_users) | **GET** /users | List users +*UsersApi* | [**list_users_in_channel**](docs/UsersApi.md#list_users_in_channel) | **GET** /{domainID}/channels/{channelID}/users | List users in a channel +*UsersApi* | [**list_users_in_client**](docs/UsersApi.md#list_users_in_client) | **GET** /{domainID}/clients/{clientID}/users | List users associated with a client +*UsersApi* | [**list_users_in_group**](docs/UsersApi.md#list_users_in_group) | **GET** /{domainID}/groups/{groupID}/users | List users in a group +*UsersApi* | [**refresh_token**](docs/UsersApi.md#refresh_token) | **POST** /users/tokens/refresh | Refresh Token +*UsersApi* | [**request_password_reset**](docs/UsersApi.md#request_password_reset) | **POST** /password/reset-request | User password reset request +*UsersApi* | [**reset_password**](docs/UsersApi.md#reset_password) | **PUT** /password/reset | User password reset endpoint +*UsersApi* | [**search_users**](docs/UsersApi.md#search_users) | **GET** /users/search | Search users +*UsersApi* | [**update_email**](docs/UsersApi.md#update_email) | **PATCH** /users/{userID}/email | Updates email of the user. +*UsersApi* | [**update_profile_picture**](docs/UsersApi.md#update_profile_picture) | **PATCH** /users/{userID}/picture | Updates the user's profile picture. +*UsersApi* | [**update_role**](docs/UsersApi.md#update_role) | **PATCH** /users/{userID}/role | Updates the user's role. +*UsersApi* | [**update_secret**](docs/UsersApi.md#update_secret) | **PATCH** /users/secret | Updates secret of currently logged in user. +*UsersApi* | [**update_tags**](docs/UsersApi.md#update_tags) | **PATCH** /users/{userID}/tags | Updates tags of the user. +*UsersApi* | [**update_user**](docs/UsersApi.md#update_user) | **PATCH** /users/{userID} | Updates first, last name and metadata of the user. +*UsersApi* | [**update_username**](docs/UsersApi.md#update_username) | **PATCH** /users/{userID}/username | Updates user's username. +*UsersApi* | [**users_user_id_delete**](docs/UsersApi.md#users_user_id_delete) | **DELETE** /users/{userID} | Delete a user + + +To get access to the crate's generated documentation, use: + +``` +cargo doc --open +``` + +## Author + +info@abstractmachines.fr + From b0c1a71a0425755da23bd639b26c8e9b4b87ee0c Mon Sep 17 00:00:00 2001 From: Dorcas Litunya Date: Sun, 12 Jan 2025 17:04:24 +0300 Subject: [PATCH 05/10] Add proper referencing in README --- README.md | 308 +++++++++++++++++++++++++++--------------------------- 1 file changed, 154 insertions(+), 154 deletions(-) diff --git a/README.md b/README.md index f6501d3d..9445ed01 100644 --- a/README.md +++ b/README.md @@ -28,160 +28,160 @@ All URIs are relative to *http://localhost:9001* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*CertsApi* | [**create_cert**](docs/CertsApi.md#create_cert) | **POST** /{domainID}/certs | Creates a certificate for client -*CertsApi* | [**get_cert**](docs/CertsApi.md#get_cert) | **GET** /{domainID}/certs/{certID} | Retrieves a certificate -*CertsApi* | [**get_serials**](docs/CertsApi.md#get_serials) | **GET** /{domainID}/serials/{clientID} | Retrieves certificates' serial IDs -*CertsApi* | [**health_get**](docs/CertsApi.md#health_get) | **GET** /health | Retrieves service health check info. -*CertsApi* | [**revoke_cert**](docs/CertsApi.md#revoke_cert) | **DELETE** /{domainID}/certs/{certID} | Revokes a certificate -*ChannelsApi* | [**connect_clients_and_channels**](docs/ChannelsApi.md#connect_clients_and_channels) | **POST** /{domainID}/channels/connect | Connects client and channel. -*ChannelsApi* | [**connect_clients_to_channel**](docs/ChannelsApi.md#connect_clients_to_channel) | **POST** /{domainID}/channels/{chanID}/connect | Connects clients to a channel -*ChannelsApi* | [**create_channel**](docs/ChannelsApi.md#create_channel) | **POST** /{domainID}/channels | Creates new channel -*ChannelsApi* | [**create_channels**](docs/ChannelsApi.md#create_channels) | **POST** /{domainID}/channels/bulk | Creates new channels -*ChannelsApi* | [**disable_channel**](docs/ChannelsApi.md#disable_channel) | **POST** /{domainID}/channels/{chanID}/disable | Disables a channel -*ChannelsApi* | [**disconnect_clients_and_channels**](docs/ChannelsApi.md#disconnect_clients_and_channels) | **POST** /{domainID}/channels/disconnect | Disconnects client and channel. -*ChannelsApi* | [**disconnect_clients_from_channel**](docs/ChannelsApi.md#disconnect_clients_from_channel) | **POST** /{domainID}/channels/{chanID}/disconnect | Disconnects clients from a channel -*ChannelsApi* | [**domain_id_channels_chan_id_delete**](docs/ChannelsApi.md#domain_id_channels_chan_id_delete) | **DELETE** /{domainID}/channels/{chanID} | Delete channel for given channel id. -*ChannelsApi* | [**enable_channel**](docs/ChannelsApi.md#enable_channel) | **POST** /{domainID}/channels/{chanID}/enable | Enables a channel -*ChannelsApi* | [**get_channel**](docs/ChannelsApi.md#get_channel) | **GET** /{domainID}/channels/{chanID} | Retrieves channel info. -*ChannelsApi* | [**list_channels**](docs/ChannelsApi.md#list_channels) | **GET** /{domainID}/channels | Lists channels. -*ChannelsApi* | [**remove_channel_parent_group**](docs/ChannelsApi.md#remove_channel_parent_group) | **DELETE** /{domainID}/channels/{chanID}/parent | Removes a parent group from a channel. -*ChannelsApi* | [**set_channel_parent_group**](docs/ChannelsApi.md#set_channel_parent_group) | **POST** /{domainID}/channels/{chanID}/parent | Sets a parent group for a channel -*ChannelsApi* | [**update_channel**](docs/ChannelsApi.md#update_channel) | **PATCH** /{domainID}/channels/{chanID} | Updates channel data. -*ChannelsApi* | [**update_channel_tags**](docs/ChannelsApi.md#update_channel_tags) | **PATCH** /{domainID}/channels/{chanID}/tags | Updates channel tags. -*ClientsApi* | [**add_client_role_action**](docs/ClientsApi.md#add_client_role_action) | **POST** /{domainID}/clients/{clientID}/roles/{roleName}/actions | Adds a role action for a client role. -*ClientsApi* | [**add_client_role_member**](docs/ClientsApi.md#add_client_role_member) | **POST** /{domainID}/clients/{clientID}/roles/{roleName}/members | Adds a member to a client role. -*ClientsApi* | [**bulk_create_clients**](docs/ClientsApi.md#bulk_create_clients) | **POST** /{domainID}/clients/bulk | Bulk provisions new clients -*ClientsApi* | [**create_client**](docs/ClientsApi.md#create_client) | **POST** /{domainID}/clients | Adds new client -*ClientsApi* | [**create_client_role**](docs/ClientsApi.md#create_client_role) | **POST** /{domainID}/clients/{clientID}/roles | Creates a role for a client -*ClientsApi* | [**delete_all_client_role_actions**](docs/ClientsApi.md#delete_all_client_role_actions) | **POST** /{domainID}/clients/{clientID}/roles/{roleName}/actions/delete-all | Deletes all role actions for a client role. -*ClientsApi* | [**delete_all_client_role_members**](docs/ClientsApi.md#delete_all_client_role_members) | **POST** /{domainID}/clients/{clientID}/roles/{roleName}/members/delete-all | Deletes all members from a client role. -*ClientsApi* | [**delete_client_role**](docs/ClientsApi.md#delete_client_role) | **DELETE** /{domainID}/clients/{clientID}/roles/{roleName} | Deletes client role. -*ClientsApi* | [**delete_client_role_action**](docs/ClientsApi.md#delete_client_role_action) | **POST** /{domainID}/clients/{clientID}/roles/{roleName}/actions/delete | Deletes role actions for a client role. -*ClientsApi* | [**delete_client_role_members**](docs/ClientsApi.md#delete_client_role_members) | **POST** /{domainID}/clients/{clientID}/roles/{roleName}/members/delete | Deletes members from a client role. -*ClientsApi* | [**disable_client**](docs/ClientsApi.md#disable_client) | **POST** /{domainID}/clients/{clientID}/disable | Disables a client -*ClientsApi* | [**domain_id_clients_client_id_delete**](docs/ClientsApi.md#domain_id_clients_client_id_delete) | **DELETE** /{domainID}/clients/{clientID} | Delete client for a client with the given id. -*ClientsApi* | [**enable_client**](docs/ClientsApi.md#enable_client) | **POST** /{domainID}/clients/{clientID}/enable | Enables a client -*ClientsApi* | [**get_client**](docs/ClientsApi.md#get_client) | **GET** /{domainID}/clients/{clientID} | Retrieves client info -*ClientsApi* | [**get_client_role**](docs/ClientsApi.md#get_client_role) | **GET** /{domainID}/clients/{clientID}/roles/{roleName} | Retrieves client role. -*ClientsApi* | [**list_available_actions**](docs/ClientsApi.md#list_available_actions) | **GET** /{domainID}/clients/roles/available-actions | Retrieves available actions. -*ClientsApi* | [**list_client_role_actions**](docs/ClientsApi.md#list_client_role_actions) | **GET** /{domainID}/clients/{clientID}/roles/{roleName}/actions | Lists client role actions. -*ClientsApi* | [**list_client_role_members**](docs/ClientsApi.md#list_client_role_members) | **GET** /{domainID}/clients/{clientID}/roles/{roleName}/members | Lists client role members. -*ClientsApi* | [**list_client_roles**](docs/ClientsApi.md#list_client_roles) | **GET** /{domainID}/clients/{clientID}/roles | Retrieves clients roles. -*ClientsApi* | [**list_clients**](docs/ClientsApi.md#list_clients) | **GET** /{domainID}/clients | Retrieves clients -*ClientsApi* | [**list_user_clients**](docs/ClientsApi.md#list_user_clients) | **GET** /{domainID}/users/{userID}/clients | List clients asssociated with a user. -*ClientsApi* | [**remove_client_parent_group**](docs/ClientsApi.md#remove_client_parent_group) | **DELETE** /{domainID}/clients/{clientID}/parent | Removes a parent group from a client. -*ClientsApi* | [**set_client_parent_group**](docs/ClientsApi.md#set_client_parent_group) | **POST** /{domainID}/clients/{clientID}/parent | Sets a parent group for a client -*ClientsApi* | [**update_client**](docs/ClientsApi.md#update_client) | **PATCH** /{domainID}/clients/{clientID} | Updates name and metadata of the client. -*ClientsApi* | [**update_client_role**](docs/ClientsApi.md#update_client_role) | **PUT** /{domainID}/clients/{clientID}/roles/{roleName} | Updates client role. -*ClientsApi* | [**update_client_secret**](docs/ClientsApi.md#update_client_secret) | **PATCH** /{domainID}/clients/{clientID}/secret | Updates Secret of the identified client. -*ClientsApi* | [**update_client_tags**](docs/ClientsApi.md#update_client_tags) | **PATCH** /{domainID}/clients/{clientID}/tags | Updates tags the client. -*ConfigsApi* | [**create_config**](docs/ConfigsApi.md#create_config) | **POST** /{domainID}/clients/configs | Adds new config -*ConfigsApi* | [**get_bootstrap_config**](docs/ConfigsApi.md#get_bootstrap_config) | **GET** /clients/bootstrap/{externalId} | Retrieves configuration. -*ConfigsApi* | [**get_config**](docs/ConfigsApi.md#get_config) | **GET** /{domainID}/clients/configs/{configId} | Retrieves config info (with channels). -*ConfigsApi* | [**get_configs**](docs/ConfigsApi.md#get_configs) | **GET** /{domainID}/clients/configs | Retrieves managed configs -*ConfigsApi* | [**get_secure_bootstrap_config**](docs/ConfigsApi.md#get_secure_bootstrap_config) | **GET** /clients/bootstrap/secure/{externalId} | Retrieves configuration. -*ConfigsApi* | [**remove_config**](docs/ConfigsApi.md#remove_config) | **DELETE** /{domainID}/clients/configs/{configId} | Removes a Config -*ConfigsApi* | [**update_config**](docs/ConfigsApi.md#update_config) | **PUT** /{domainID}/clients/configs/{configId} | Updates config info -*ConfigsApi* | [**update_config_certs**](docs/ConfigsApi.md#update_config_certs) | **PATCH** /{domainID}/clients/configs/certs/{configId} | Updates certs -*ConfigsApi* | [**update_config_connections**](docs/ConfigsApi.md#update_config_connections) | **PUT** /{domainID}/clients/configs/connections/{configId} | Updates channels the client is connected to -*ConfigsApi* | [**update_config_state**](docs/ConfigsApi.md#update_config_state) | **PUT** /{domainID}/clients/state/{configId} | Updates Config state. -*DomainsApi* | [**add_domain_role_action**](docs/DomainsApi.md#add_domain_role_action) | **POST** /domains/{domainID}/roles/{roleName}/actions | Adds a role action for a domain role. -*DomainsApi* | [**add_domain_role_member**](docs/DomainsApi.md#add_domain_role_member) | **POST** /domains/{domainID}/roles/{roleName}/members | Adds a member to a domain role. -*DomainsApi* | [**create_domain_role**](docs/DomainsApi.md#create_domain_role) | **POST** /domains/{domainID}/roles | Creates a role for a domain -*DomainsApi* | [**delete_all_domain_role_actions**](docs/DomainsApi.md#delete_all_domain_role_actions) | **POST** /domains/{domainID}/roles/{roleName}/actions/delete-all | Deletes all role actions for a domain role. -*DomainsApi* | [**delete_all_domain_role_members**](docs/DomainsApi.md#delete_all_domain_role_members) | **POST** /domains/{domainID}/roles/{roleName}/members/delete-all | Deletes all members from a domain role. -*DomainsApi* | [**delete_domain_role**](docs/DomainsApi.md#delete_domain_role) | **DELETE** /domains/{domainID}/roles/{roleName} | Deletes domain role. -*DomainsApi* | [**delete_domain_role_action**](docs/DomainsApi.md#delete_domain_role_action) | **POST** /domains/{domainID}/roles/{roleName}/actions/delete | Deletes role actions for a domain role. -*DomainsApi* | [**delete_domain_role_members**](docs/DomainsApi.md#delete_domain_role_members) | **POST** /domains/{domainID}/roles/{roleName}/members/delete | Deletes members from a domain role. -*DomainsApi* | [**domains_domain_id_disable_post**](docs/DomainsApi.md#domains_domain_id_disable_post) | **POST** /domains/{domainID}/disable | Disable a domain -*DomainsApi* | [**domains_domain_id_enable_post**](docs/DomainsApi.md#domains_domain_id_enable_post) | **POST** /domains/{domainID}/enable | Enables a domain -*DomainsApi* | [**domains_domain_id_freeze_post**](docs/DomainsApi.md#domains_domain_id_freeze_post) | **POST** /domains/{domainID}/freeze | Freeze a domain -*DomainsApi* | [**domains_domain_id_get**](docs/DomainsApi.md#domains_domain_id_get) | **GET** /domains/{domainID} | Retrieves domain information -*DomainsApi* | [**domains_domain_id_patch**](docs/DomainsApi.md#domains_domain_id_patch) | **PATCH** /domains/{domainID} | Updates name, metadata, tags and alias of the domain. -*DomainsApi* | [**domains_get**](docs/DomainsApi.md#domains_get) | **GET** /domains | Retrieves list of domains. -*DomainsApi* | [**domains_post**](docs/DomainsApi.md#domains_post) | **POST** /domains | Adds new domain -*DomainsApi* | [**get_domain_role**](docs/DomainsApi.md#get_domain_role) | **GET** /domains/{domainID}/roles/{roleName} | Retrieves domain role. -*DomainsApi* | [**list_available_domain_actions**](docs/DomainsApi.md#list_available_domain_actions) | **GET** /domains/roles/available-actions | Retrieves available actions. -*DomainsApi* | [**list_domain_role_actions**](docs/DomainsApi.md#list_domain_role_actions) | **GET** /domains/{domainID}/roles/{roleName}/actions | Lists domain role actions. -*DomainsApi* | [**list_domain_role_members**](docs/DomainsApi.md#list_domain_role_members) | **GET** /domains/{domainID}/roles/{roleName}/members | Lists domain role members. -*DomainsApi* | [**list_domain_roles**](docs/DomainsApi.md#list_domain_roles) | **GET** /domains/{domainID}/roles | Retrieves domains roles. -*DomainsApi* | [**update_domain_role**](docs/DomainsApi.md#update_domain_role) | **PUT** /domains/{domainID}/roles/{roleName} | Updates domain role. -*GroupsApi* | [**add_children_groups**](docs/GroupsApi.md#add_children_groups) | **POST** /{domainID}/groups/{groupID}/children | Add children groups. -*GroupsApi* | [**add_group_role_action**](docs/GroupsApi.md#add_group_role_action) | **POST** /{domainID}/groups/{groupID}/roles/{roleName}/actions | Adds a role action for a group role. -*GroupsApi* | [**add_group_role_member**](docs/GroupsApi.md#add_group_role_member) | **POST** /{domainID}/groups/{groupID}/roles/{roleName}/members | Adds a member to a group role. -*GroupsApi* | [**create_group**](docs/GroupsApi.md#create_group) | **POST** /{domainID}/groups | Creates new group -*GroupsApi* | [**create_group_role**](docs/GroupsApi.md#create_group_role) | **POST** /{domainID}/groups/{groupID}/roles | Creates a role for a group -*GroupsApi* | [**delete_all_group_role_actions**](docs/GroupsApi.md#delete_all_group_role_actions) | **POST** /{domainID}/groups/{groupID}/roles/{roleName}/actions/delete-all | Deletes all role actions for a group role. -*GroupsApi* | [**delete_all_group_role_members**](docs/GroupsApi.md#delete_all_group_role_members) | **POST** /{domainID}/groups/{groupID}/roles/{roleName}/members/delete-all | Deletes all members from a group role. -*GroupsApi* | [**delete_group_role**](docs/GroupsApi.md#delete_group_role) | **DELETE** /{domainID}/groups/{groupID}/roles/{roleName} | Deletes group role. -*GroupsApi* | [**delete_group_role_action**](docs/GroupsApi.md#delete_group_role_action) | **POST** /{domainID}/groups/{groupID}/roles/{roleName}/actions/delete | Deletes role actions for a group role. -*GroupsApi* | [**delete_group_role_members**](docs/GroupsApi.md#delete_group_role_members) | **POST** /{domainID}/groups/{groupID}/roles/{roleName}/members/delete | Deletes members from a group role. -*GroupsApi* | [**disable_group**](docs/GroupsApi.md#disable_group) | **POST** /{domainID}/groups/{groupID}/disable | Disables a group -*GroupsApi* | [**domain_id_groups_group_id_delete**](docs/GroupsApi.md#domain_id_groups_group_id_delete) | **DELETE** /{domainID}/groups/{groupID} | Delete group for a group with the given id. -*GroupsApi* | [**enable_group**](docs/GroupsApi.md#enable_group) | **POST** /{domainID}/groups/{groupID}/enable | Enables a group -*GroupsApi* | [**get_group**](docs/GroupsApi.md#get_group) | **GET** /{domainID}/groups/{groupID} | Gets group info. -*GroupsApi* | [**get_group_role**](docs/GroupsApi.md#get_group_role) | **GET** /{domainID}/groups/{groupID}/roles/{roleName} | Retrieves group role. -*GroupsApi* | [**list_available_group_actions**](docs/GroupsApi.md#list_available_group_actions) | **GET** /{domainID}/groups/roles/available-actions | Retrieves available actions. -*GroupsApi* | [**list_children_groups**](docs/GroupsApi.md#list_children_groups) | **GET** /{domainID}/groups/{groupID}/children | List children of a certain group -*GroupsApi* | [**list_group_hierarchy**](docs/GroupsApi.md#list_group_hierarchy) | **GET** /{domainID}/groups/{groupID}/hierarchy | Lists groups hierarchy. -*GroupsApi* | [**list_group_role_actions**](docs/GroupsApi.md#list_group_role_actions) | **GET** /{domainID}/groups/{groupID}/roles/{roleName}/actions | Lists group role actions. -*GroupsApi* | [**list_group_role_members**](docs/GroupsApi.md#list_group_role_members) | **GET** /{domainID}/groups/{groupID}/roles/{roleName}/members | Lists group role members. -*GroupsApi* | [**list_group_roles**](docs/GroupsApi.md#list_group_roles) | **GET** /{domainID}/groups/{groupID}/roles | Retrieves groups roles. -*GroupsApi* | [**list_groups**](docs/GroupsApi.md#list_groups) | **GET** /{domainID}/groups | Lists groups. -*GroupsApi* | [**remove_all_children_groups**](docs/GroupsApi.md#remove_all_children_groups) | **DELETE** /{domainID}/groups/{groupID}/children/all | Remove all children groups. -*GroupsApi* | [**remove_children_groups**](docs/GroupsApi.md#remove_children_groups) | **DELETE** /{domainID}/groups/{groupID}/children | Remove children groups. -*GroupsApi* | [**remove_group_parent_group**](docs/GroupsApi.md#remove_group_parent_group) | **DELETE** /{domainID}/groups/{groupID}/parent | Removes a parent group from a group. -*GroupsApi* | [**set_group_parent_group**](docs/GroupsApi.md#set_group_parent_group) | **POST** /{domainID}/groups/{groupID}/parent | Sets a parent group for a group. -*GroupsApi* | [**update_group**](docs/GroupsApi.md#update_group) | **PUT** /{domainID}/groups/{groupID} | Updates group data. -*GroupsApi* | [**update_group_role**](docs/GroupsApi.md#update_group_role) | **PUT** /{domainID}/groups/{groupID}/roles/{roleName} | Updates group role. -*InvitationsApi* | [**accept_invitation**](docs/InvitationsApi.md#accept_invitation) | **POST** /invitations/accept | Accept invitation -*InvitationsApi* | [**delete_invitation**](docs/InvitationsApi.md#delete_invitation) | **DELETE** /invitations/{user_id}/{domain_id} | Deletes a specific invitation -*InvitationsApi* | [**get_invitation**](docs/InvitationsApi.md#get_invitation) | **GET** /invitations/{user_id}/{domain_id} | Retrieves a specific invitation -*InvitationsApi* | [**list_invitations**](docs/InvitationsApi.md#list_invitations) | **GET** /invitations | List invitations -*InvitationsApi* | [**reject_invitation**](docs/InvitationsApi.md#reject_invitation) | **POST** /invitations/reject | Reject invitation -*InvitationsApi* | [**send_invitation**](docs/InvitationsApi.md#send_invitation) | **POST** /invitations | Send invitation -*JournalLogApi* | [**domain_id_journal_entity_type_id_get**](docs/JournalLogApi.md#domain_id_journal_entity_type_id_get) | **GET** /{domainID}/journal/{entityType}/{id} | List entity journal log -*JournalLogApi* | [**journal_user_user_id_get**](docs/JournalLogApi.md#journal_user_user_id_get) | **GET** /journal/user/{userID} | List user journal log -*KeysApi* | [**get_key**](docs/KeysApi.md#get_key) | **GET** /keys/{keyID} | Gets API key details. -*KeysApi* | [**issue_key**](docs/KeysApi.md#issue_key) | **POST** /keys | Issue API key -*KeysApi* | [**revoke_key**](docs/KeysApi.md#revoke_key) | **DELETE** /keys/{keyID} | Revoke API key -*MessagesApi* | [**channels_id_messages_post**](docs/MessagesApi.md#channels_id_messages_post) | **POST** /channels/{id}/messages | Sends message to the communication channel -*NotifiersApi* | [**create_subscription**](docs/NotifiersApi.md#create_subscription) | **POST** /subscriptions | Create subscription -*NotifiersApi* | [**list_subscriptions**](docs/NotifiersApi.md#list_subscriptions) | **GET** /subscriptions | List subscriptions -*NotifiersApi* | [**remove_subscription**](docs/NotifiersApi.md#remove_subscription) | **DELETE** /subscriptions/{id} | Delete subscription with the provided id -*NotifiersApi* | [**view_subscription**](docs/NotifiersApi.md#view_subscription) | **GET** /subscriptions/{id} | Get subscription with the provided id -*ProvisionApi* | [**domain_id_mapping_get**](docs/ProvisionApi.md#domain_id_mapping_get) | **GET** /{domainID}/mapping | Gets current mapping. -*ProvisionApi* | [**domain_id_mapping_post**](docs/ProvisionApi.md#domain_id_mapping_post) | **POST** /{domainID}/mapping | Adds new device to proxy -*ReadersApi* | [**get_messages**](docs/ReadersApi.md#get_messages) | **GET** /channels/{chanId}/messages | Retrieves messages sent to single channel -*StatesApi* | [**get_states**](docs/StatesApi.md#get_states) | **GET** /states/{twinID} | Retrieves states of twin with id twinID -*TwinsApi* | [**create_twin**](docs/TwinsApi.md#create_twin) | **POST** /twins | Adds new twin -*TwinsApi* | [**get_twin**](docs/TwinsApi.md#get_twin) | **GET** /twins/{twinID} | Retrieves twin info -*TwinsApi* | [**get_twins**](docs/TwinsApi.md#get_twins) | **GET** /twins | Retrieves twins -*TwinsApi* | [**remove_twin**](docs/TwinsApi.md#remove_twin) | **DELETE** /twins/{twinID} | Removes a twin -*TwinsApi* | [**update_twin**](docs/TwinsApi.md#update_twin) | **PUT** /twins/{twinID} | Updates twin info -*UsersApi* | [**create_user**](docs/UsersApi.md#create_user) | **POST** /users | Registers user account -*UsersApi* | [**disable_user**](docs/UsersApi.md#disable_user) | **POST** /users/{userID}/disable | Disables a user -*UsersApi* | [**domain_id_users_get**](docs/UsersApi.md#domain_id_users_get) | **GET** /{domainID}/users | List users assigned to domain -*UsersApi* | [**enable_user**](docs/UsersApi.md#enable_user) | **POST** /users/{userID}/enable | Enables a user -*UsersApi* | [**get_profile**](docs/UsersApi.md#get_profile) | **GET** /users/profile | Gets info on currently logged in user. -*UsersApi* | [**get_user**](docs/UsersApi.md#get_user) | **GET** /users/{userID} | Retrieves a user -*UsersApi* | [**issue_token**](docs/UsersApi.md#issue_token) | **POST** /users/tokens/issue | Issue Token -*UsersApi* | [**list_users**](docs/UsersApi.md#list_users) | **GET** /users | List users -*UsersApi* | [**list_users_in_channel**](docs/UsersApi.md#list_users_in_channel) | **GET** /{domainID}/channels/{channelID}/users | List users in a channel -*UsersApi* | [**list_users_in_client**](docs/UsersApi.md#list_users_in_client) | **GET** /{domainID}/clients/{clientID}/users | List users associated with a client -*UsersApi* | [**list_users_in_group**](docs/UsersApi.md#list_users_in_group) | **GET** /{domainID}/groups/{groupID}/users | List users in a group -*UsersApi* | [**refresh_token**](docs/UsersApi.md#refresh_token) | **POST** /users/tokens/refresh | Refresh Token -*UsersApi* | [**request_password_reset**](docs/UsersApi.md#request_password_reset) | **POST** /password/reset-request | User password reset request -*UsersApi* | [**reset_password**](docs/UsersApi.md#reset_password) | **PUT** /password/reset | User password reset endpoint -*UsersApi* | [**search_users**](docs/UsersApi.md#search_users) | **GET** /users/search | Search users -*UsersApi* | [**update_email**](docs/UsersApi.md#update_email) | **PATCH** /users/{userID}/email | Updates email of the user. -*UsersApi* | [**update_profile_picture**](docs/UsersApi.md#update_profile_picture) | **PATCH** /users/{userID}/picture | Updates the user's profile picture. -*UsersApi* | [**update_role**](docs/UsersApi.md#update_role) | **PATCH** /users/{userID}/role | Updates the user's role. -*UsersApi* | [**update_secret**](docs/UsersApi.md#update_secret) | **PATCH** /users/secret | Updates secret of currently logged in user. -*UsersApi* | [**update_tags**](docs/UsersApi.md#update_tags) | **PATCH** /users/{userID}/tags | Updates tags of the user. -*UsersApi* | [**update_user**](docs/UsersApi.md#update_user) | **PATCH** /users/{userID} | Updates first, last name and metadata of the user. -*UsersApi* | [**update_username**](docs/UsersApi.md#update_username) | **PATCH** /users/{userID}/username | Updates user's username. -*UsersApi* | [**users_user_id_delete**](docs/UsersApi.md#users_user_id_delete) | **DELETE** /users/{userID} | Delete a user +*CertsApi* | [**create_cert**](Models.md#create_cert) | **POST** /{domainID}/certs | Creates a certificate for client +*CertsApi* | [**get_cert**](Models.md#get_cert) | **GET** /{domainID}/certs/{certID} | Retrieves a certificate +*CertsApi* | [**get_serials**](Models.md#get_serials) | **GET** /{domainID}/serials/{clientID} | Retrieves certificates' serial IDs +*CertsApi* | [**health_get**](Models.md#health_get) | **GET** /health | Retrieves service health check info. +*CertsApi* | [**revoke_cert**](Models.md#revoke_cert) | **DELETE** /{domainID}/certs/{certID} | Revokes a certificate +*ChannelsApi* | [**connect_clients_and_channels**](Models.md#connect_clients_and_channels) | **POST** /{domainID}/channels/connect | Connects client and channel. +*ChannelsApi* | [**connect_clients_to_channel**](Models.md#connect_clients_to_channel) | **POST** /{domainID}/channels/{chanID}/connect | Connects clients to a channel +*ChannelsApi* | [**create_channel**](Models.md#create_channel) | **POST** /{domainID}/channels | Creates new channel +*ChannelsApi* | [**create_channels**](Models.md#create_channels) | **POST** /{domainID}/channels/bulk | Creates new channels +*ChannelsApi* | [**disable_channel**](Models.md#disable_channel) | **POST** /{domainID}/channels/{chanID}/disable | Disables a channel +*ChannelsApi* | [**disconnect_clients_and_channels**](Models.md#disconnect_clients_and_channels) | **POST** /{domainID}/channels/disconnect | Disconnects client and channel. +*ChannelsApi* | [**disconnect_clients_from_channel**](Models.md#disconnect_clients_from_channel) | **POST** /{domainID}/channels/{chanID}/disconnect | Disconnects clients from a channel +*ChannelsApi* | [**domain_id_channels_chan_id_delete**](Models.md#domain_id_channels_chan_id_delete) | **DELETE** /{domainID}/channels/{chanID} | Delete channel for given channel id. +*ChannelsApi* | [**enable_channel**](Models.md#enable_channel) | **POST** /{domainID}/channels/{chanID}/enable | Enables a channel +*ChannelsApi* | [**get_channel**](Models.md#get_channel) | **GET** /{domainID}/channels/{chanID} | Retrieves channel info. +*ChannelsApi* | [**list_channels**](Models.md#list_channels) | **GET** /{domainID}/channels | Lists channels. +*ChannelsApi* | [**remove_channel_parent_group**](Models.md#remove_channel_parent_group) | **DELETE** /{domainID}/channels/{chanID}/parent | Removes a parent group from a channel. +*ChannelsApi* | [**set_channel_parent_group**](Models.md#set_channel_parent_group) | **POST** /{domainID}/channels/{chanID}/parent | Sets a parent group for a channel +*ChannelsApi* | [**update_channel**](Models.md#update_channel) | **PATCH** /{domainID}/channels/{chanID} | Updates channel data. +*ChannelsApi* | [**update_channel_tags**](Models.md#update_channel_tags) | **PATCH** /{domainID}/channels/{chanID}/tags | Updates channel tags. +*ClientsApi* | [**add_client_role_action**](Models.md#add_client_role_action) | **POST** /{domainID}/clients/{clientID}/roles/{roleName}/actions | Adds a role action for a client role. +*ClientsApi* | [**add_client_role_member**](Models.md#add_client_role_member) | **POST** /{domainID}/clients/{clientID}/roles/{roleName}/members | Adds a member to a client role. +*ClientsApi* | [**bulk_create_clients**](Models.md#bulk_create_clients) | **POST** /{domainID}/clients/bulk | Bulk provisions new clients +*ClientsApi* | [**create_client**](Models.md#create_client) | **POST** /{domainID}/clients | Adds new client +*ClientsApi* | [**create_client_role**](Models.md#create_client_role) | **POST** /{domainID}/clients/{clientID}/roles | Creates a role for a client +*ClientsApi* | [**delete_all_client_role_actions**](Models.md#delete_all_client_role_actions) | **POST** /{domainID}/clients/{clientID}/roles/{roleName}/actions/delete-all | Deletes all role actions for a client role. +*ClientsApi* | [**delete_all_client_role_members**](Models.md#delete_all_client_role_members) | **POST** /{domainID}/clients/{clientID}/roles/{roleName}/members/delete-all | Deletes all members from a client role. +*ClientsApi* | [**delete_client_role**](Models.md#delete_client_role) | **DELETE** /{domainID}/clients/{clientID}/roles/{roleName} | Deletes client role. +*ClientsApi* | [**delete_client_role_action**](Models.md#delete_client_role_action) | **POST** /{domainID}/clients/{clientID}/roles/{roleName}/actions/delete | Deletes role actions for a client role. +*ClientsApi* | [**delete_client_role_members**](Models.md#delete_client_role_members) | **POST** /{domainID}/clients/{clientID}/roles/{roleName}/members/delete | Deletes members from a client role. +*ClientsApi* | [**disable_client**](Models.md#disable_client) | **POST** /{domainID}/clients/{clientID}/disable | Disables a client +*ClientsApi* | [**domain_id_clients_client_id_delete**](Models.md#domain_id_clients_client_id_delete) | **DELETE** /{domainID}/clients/{clientID} | Delete client for a client with the given id. +*ClientsApi* | [**enable_client**](Models.md#enable_client) | **POST** /{domainID}/clients/{clientID}/enable | Enables a client +*ClientsApi* | [**get_client**](Models.md#get_client) | **GET** /{domainID}/clients/{clientID} | Retrieves client info +*ClientsApi* | [**get_client_role**](Models.md#get_client_role) | **GET** /{domainID}/clients/{clientID}/roles/{roleName} | Retrieves client role. +*ClientsApi* | [**list_available_actions**](Models.md#list_available_actions) | **GET** /{domainID}/clients/roles/available-actions | Retrieves available actions. +*ClientsApi* | [**list_client_role_actions**](Models.md#list_client_role_actions) | **GET** /{domainID}/clients/{clientID}/roles/{roleName}/actions | Lists client role actions. +*ClientsApi* | [**list_client_role_members**](Models.md#list_client_role_members) | **GET** /{domainID}/clients/{clientID}/roles/{roleName}/members | Lists client role members. +*ClientsApi* | [**list_client_roles**](Models.md#list_client_roles) | **GET** /{domainID}/clients/{clientID}/roles | Retrieves clients roles. +*ClientsApi* | [**list_clients**](Models.md#list_clients) | **GET** /{domainID}/clients | Retrieves clients +*ClientsApi* | [**list_user_clients**](Models.md#list_user_clients) | **GET** /{domainID}/users/{userID}/clients | List clients asssociated with a user. +*ClientsApi* | [**remove_client_parent_group**](Models.md#remove_client_parent_group) | **DELETE** /{domainID}/clients/{clientID}/parent | Removes a parent group from a client. +*ClientsApi* | [**set_client_parent_group**](Models.md#set_client_parent_group) | **POST** /{domainID}/clients/{clientID}/parent | Sets a parent group for a client +*ClientsApi* | [**update_client**](Models.md#update_client) | **PATCH** /{domainID}/clients/{clientID} | Updates name and metadata of the client. +*ClientsApi* | [**update_client_role**](Models.md#update_client_role) | **PUT** /{domainID}/clients/{clientID}/roles/{roleName} | Updates client role. +*ClientsApi* | [**update_client_secret**](Models.md#update_client_secret) | **PATCH** /{domainID}/clients/{clientID}/secret | Updates Secret of the identified client. +*ClientsApi* | [**update_client_tags**](Models.md#update_client_tags) | **PATCH** /{domainID}/clients/{clientID}/tags | Updates tags the client. +*ConfigsApi* | [**create_config**](Models.md#create_config) | **POST** /{domainID}/clients/configs | Adds new config +*ConfigsApi* | [**get_bootstrap_config**](Models.md#get_bootstrap_config) | **GET** /clients/bootstrap/{externalId} | Retrieves configuration. +*ConfigsApi* | [**get_config**](Models.md#get_config) | **GET** /{domainID}/clients/configs/{configId} | Retrieves config info (with channels). +*ConfigsApi* | [**get_configs**](Models.md#get_configs) | **GET** /{domainID}/clients/configs | Retrieves managed configs +*ConfigsApi* | [**get_secure_bootstrap_config**](Models.md#get_secure_bootstrap_config) | **GET** /clients/bootstrap/secure/{externalId} | Retrieves configuration. +*ConfigsApi* | [**remove_config**](Models.md#remove_config) | **DELETE** /{domainID}/clients/configs/{configId} | Removes a Config +*ConfigsApi* | [**update_config**](Models.md#update_config) | **PUT** /{domainID}/clients/configs/{configId} | Updates config info +*ConfigsApi* | [**update_config_certs**](Models.md#update_config_certs) | **PATCH** /{domainID}/clients/configs/certs/{configId} | Updates certs +*ConfigsApi* | [**update_config_connections**](Models.md#update_config_connections) | **PUT** /{domainID}/clients/configs/connections/{configId} | Updates channels the client is connected to +*ConfigsApi* | [**update_config_state**](Models.md#update_config_state) | **PUT** /{domainID}/clients/state/{configId} | Updates Config state. +*DomainsApi* | [**add_domain_role_action**](Models.md#add_domain_role_action) | **POST** /domains/{domainID}/roles/{roleName}/actions | Adds a role action for a domain role. +*DomainsApi* | [**add_domain_role_member**](Models.md#add_domain_role_member) | **POST** /domains/{domainID}/roles/{roleName}/members | Adds a member to a domain role. +*DomainsApi* | [**create_domain_role**](Models.md#create_domain_role) | **POST** /domains/{domainID}/roles | Creates a role for a domain +*DomainsApi* | [**delete_all_domain_role_actions**](Models.md#delete_all_domain_role_actions) | **POST** /domains/{domainID}/roles/{roleName}/actions/delete-all | Deletes all role actions for a domain role. +*DomainsApi* | [**delete_all_domain_role_members**](Models.md#delete_all_domain_role_members) | **POST** /domains/{domainID}/roles/{roleName}/members/delete-all | Deletes all members from a domain role. +*DomainsApi* | [**delete_domain_role**](Models.md#delete_domain_role) | **DELETE** /domains/{domainID}/roles/{roleName} | Deletes domain role. +*DomainsApi* | [**delete_domain_role_action**](Models.md#delete_domain_role_action) | **POST** /domains/{domainID}/roles/{roleName}/actions/delete | Deletes role actions for a domain role. +*DomainsApi* | [**delete_domain_role_members**](Models.md#delete_domain_role_members) | **POST** /domains/{domainID}/roles/{roleName}/members/delete | Deletes members from a domain role. +*DomainsApi* | [**domains_domain_id_disable_post**](Models.md#domains_domain_id_disable_post) | **POST** /domains/{domainID}/disable | Disable a domain +*DomainsApi* | [**domains_domain_id_enable_post**](Models.md#domains_domain_id_enable_post) | **POST** /domains/{domainID}/enable | Enables a domain +*DomainsApi* | [**domains_domain_id_freeze_post**](Models.md#domains_domain_id_freeze_post) | **POST** /domains/{domainID}/freeze | Freeze a domain +*DomainsApi* | [**domains_domain_id_get**](Models.md#domains_domain_id_get) | **GET** /domains/{domainID} | Retrieves domain information +*DomainsApi* | [**domains_domain_id_patch**](Models.md#domains_domain_id_patch) | **PATCH** /domains/{domainID} | Updates name, metadata, tags and alias of the domain. +*DomainsApi* | [**domains_get**](Models.md#domains_get) | **GET** /domains | Retrieves list of domains. +*DomainsApi* | [**domains_post**](Models.md#domains_post) | **POST** /domains | Adds new domain +*DomainsApi* | [**get_domain_role**](Models.md#get_domain_role) | **GET** /domains/{domainID}/roles/{roleName} | Retrieves domain role. +*DomainsApi* | [**list_available_domain_actions**](Models.md#list_available_domain_actions) | **GET** /domains/roles/available-actions | Retrieves available actions. +*DomainsApi* | [**list_domain_role_actions**](Models.md#list_domain_role_actions) | **GET** /domains/{domainID}/roles/{roleName}/actions | Lists domain role actions. +*DomainsApi* | [**list_domain_role_members**](Models.md#list_domain_role_members) | **GET** /domains/{domainID}/roles/{roleName}/members | Lists domain role members. +*DomainsApi* | [**list_domain_roles**](Models.md#list_domain_roles) | **GET** /domains/{domainID}/roles | Retrieves domains roles. +*DomainsApi* | [**update_domain_role**](Models.md#update_domain_role) | **PUT** /domains/{domainID}/roles/{roleName} | Updates domain role. +*GroupsApi* | [**add_children_groups**](Models.md#add_children_groups) | **POST** /{domainID}/groups/{groupID}/children | Add children groups. +*GroupsApi* | [**add_group_role_action**](Models.md#add_group_role_action) | **POST** /{domainID}/groups/{groupID}/roles/{roleName}/actions | Adds a role action for a group role. +*GroupsApi* | [**add_group_role_member**](Models.md#add_group_role_member) | **POST** /{domainID}/groups/{groupID}/roles/{roleName}/members | Adds a member to a group role. +*GroupsApi* | [**create_group**](Models.md#create_group) | **POST** /{domainID}/groups | Creates new group +*GroupsApi* | [**create_group_role**](Models.md#create_group_role) | **POST** /{domainID}/groups/{groupID}/roles | Creates a role for a group +*GroupsApi* | [**delete_all_group_role_actions**](Models.md#delete_all_group_role_actions) | **POST** /{domainID}/groups/{groupID}/roles/{roleName}/actions/delete-all | Deletes all role actions for a group role. +*GroupsApi* | [**delete_all_group_role_members**](Models.md#delete_all_group_role_members) | **POST** /{domainID}/groups/{groupID}/roles/{roleName}/members/delete-all | Deletes all members from a group role. +*GroupsApi* | [**delete_group_role**](Models.md#delete_group_role) | **DELETE** /{domainID}/groups/{groupID}/roles/{roleName} | Deletes group role. +*GroupsApi* | [**delete_group_role_action**](Models.md#delete_group_role_action) | **POST** /{domainID}/groups/{groupID}/roles/{roleName}/actions/delete | Deletes role actions for a group role. +*GroupsApi* | [**delete_group_role_members**](Models.md#delete_group_role_members) | **POST** /{domainID}/groups/{groupID}/roles/{roleName}/members/delete | Deletes members from a group role. +*GroupsApi* | [**disable_group**](Models.md#disable_group) | **POST** /{domainID}/groups/{groupID}/disable | Disables a group +*GroupsApi* | [**domain_id_groups_group_id_delete**](Models.md#domain_id_groups_group_id_delete) | **DELETE** /{domainID}/groups/{groupID} | Delete group for a group with the given id. +*GroupsApi* | [**enable_group**](Models.md#enable_group) | **POST** /{domainID}/groups/{groupID}/enable | Enables a group +*GroupsApi* | [**get_group**](Models.md#get_group) | **GET** /{domainID}/groups/{groupID} | Gets group info. +*GroupsApi* | [**get_group_role**](Models.md#get_group_role) | **GET** /{domainID}/groups/{groupID}/roles/{roleName} | Retrieves group role. +*GroupsApi* | [**list_available_group_actions**](Models.md#list_available_group_actions) | **GET** /{domainID}/groups/roles/available-actions | Retrieves available actions. +*GroupsApi* | [**list_children_groups**](Models.md#list_children_groups) | **GET** /{domainID}/groups/{groupID}/children | List children of a certain group +*GroupsApi* | [**list_group_hierarchy**](Models.md#list_group_hierarchy) | **GET** /{domainID}/groups/{groupID}/hierarchy | Lists groups hierarchy. +*GroupsApi* | [**list_group_role_actions**](Models.md#list_group_role_actions) | **GET** /{domainID}/groups/{groupID}/roles/{roleName}/actions | Lists group role actions. +*GroupsApi* | [**list_group_role_members**](Models.md#list_group_role_members) | **GET** /{domainID}/groups/{groupID}/roles/{roleName}/members | Lists group role members. +*GroupsApi* | [**list_group_roles**](Models.md#list_group_roles) | **GET** /{domainID}/groups/{groupID}/roles | Retrieves groups roles. +*GroupsApi* | [**list_groups**](Models.md#list_groups) | **GET** /{domainID}/groups | Lists groups. +*GroupsApi* | [**remove_all_children_groups**](Models.md#remove_all_children_groups) | **DELETE** /{domainID}/groups/{groupID}/children/all | Remove all children groups. +*GroupsApi* | [**remove_children_groups**](Models.md#remove_children_groups) | **DELETE** /{domainID}/groups/{groupID}/children | Remove children groups. +*GroupsApi* | [**remove_group_parent_group**](Models.md#remove_group_parent_group) | **DELETE** /{domainID}/groups/{groupID}/parent | Removes a parent group from a group. +*GroupsApi* | [**set_group_parent_group**](Models.md#set_group_parent_group) | **POST** /{domainID}/groups/{groupID}/parent | Sets a parent group for a group. +*GroupsApi* | [**update_group**](Models.md#update_group) | **PUT** /{domainID}/groups/{groupID} | Updates group data. +*GroupsApi* | [**update_group_role**](Models.md#update_group_role) | **PUT** /{domainID}/groups/{groupID}/roles/{roleName} | Updates group role. +*InvitationsApi* | [**accept_invitation**](Models.md#accept_invitation) | **POST** /invitations/accept | Accept invitation +*InvitationsApi* | [**delete_invitation**](Models.md#delete_invitation) | **DELETE** /invitations/{user_id}/{domain_id} | Deletes a specific invitation +*InvitationsApi* | [**get_invitation**](Models.md#get_invitation) | **GET** /invitations/{user_id}/{domain_id} | Retrieves a specific invitation +*InvitationsApi* | [**list_invitations**](Models.md#list_invitations) | **GET** /invitations | List invitations +*InvitationsApi* | [**reject_invitation**](Models.md#reject_invitation) | **POST** /invitations/reject | Reject invitation +*InvitationsApi* | [**send_invitation**](Models.md#send_invitation) | **POST** /invitations | Send invitation +*JournalLogApi* | [**domain_id_journal_entity_type_id_get**](Models.md#domain_id_journal_entity_type_id_get) | **GET** /{domainID}/journal/{entityType}/{id} | List entity journal log +*JournalLogApi* | [**journal_user_user_id_get**](Models.md#journal_user_user_id_get) | **GET** /journal/user/{userID} | List user journal log +*KeysApi* | [**get_key**](Models.md#get_key) | **GET** /keys/{keyID} | Gets API key details. +*KeysApi* | [**issue_key**](Models.md#issue_key) | **POST** /keys | Issue API key +*KeysApi* | [**revoke_key**](Models.md#revoke_key) | **DELETE** /keys/{keyID} | Revoke API key +*MessagesApi* | [**channels_id_messages_post**](Models.md#channels_id_messages_post) | **POST** /channels/{id}/messages | Sends message to the communication channel +*NotifiersApi* | [**create_subscription**](Models.md#create_subscription) | **POST** /subscriptions | Create subscription +*NotifiersApi* | [**list_subscriptions**](Models.md#list_subscriptions) | **GET** /subscriptions | List subscriptions +*NotifiersApi* | [**remove_subscription**](Models.md#remove_subscription) | **DELETE** /subscriptions/{id} | Delete subscription with the provided id +*NotifiersApi* | [**view_subscription**](Models.md#view_subscription) | **GET** /subscriptions/{id} | Get subscription with the provided id +*ProvisionApi* | [**domain_id_mapping_get**](Models.md#domain_id_mapping_get) | **GET** /{domainID}/mapping | Gets current mapping. +*ProvisionApi* | [**domain_id_mapping_post**](Models.md#domain_id_mapping_post) | **POST** /{domainID}/mapping | Adds new device to proxy +*ReadersApi* | [**get_messages**](Models.md#get_messages) | **GET** /channels/{chanId}/messages | Retrieves messages sent to single channel +*StatesApi* | [**get_states**](Models.md#get_states) | **GET** /states/{twinID} | Retrieves states of twin with id twinID +*TwinsApi* | [**create_twin**](Models.md#create_twin) | **POST** /twins | Adds new twin +*TwinsApi* | [**get_twin**](Models.md#get_twin) | **GET** /twins/{twinID} | Retrieves twin info +*TwinsApi* | [**get_twins**](Models.md#get_twins) | **GET** /twins | Retrieves twins +*TwinsApi* | [**remove_twin**](Models.md#remove_twin) | **DELETE** /twins/{twinID} | Removes a twin +*TwinsApi* | [**update_twin**](Models.md#update_twin) | **PUT** /twins/{twinID} | Updates twin info +*UsersApi* | [**create_user**](Models.md#create_user) | **POST** /users | Registers user account +*UsersApi* | [**disable_user**](Models.md#disable_user) | **POST** /users/{userID}/disable | Disables a user +*UsersApi* | [**domain_id_users_get**](Models.md#domain_id_users_get) | **GET** /{domainID}/users | List users assigned to domain +*UsersApi* | [**enable_user**](Models.md#enable_user) | **POST** /users/{userID}/enable | Enables a user +*UsersApi* | [**get_profile**](Models.md#get_profile) | **GET** /users/profile | Gets info on currently logged in user. +*UsersApi* | [**get_user**](Models.md#get_user) | **GET** /users/{userID} | Retrieves a user +*UsersApi* | [**issue_token**](Models.md#issue_token) | **POST** /users/tokens/issue | Issue Token +*UsersApi* | [**list_users**](Models.md#list_users) | **GET** /users | List users +*UsersApi* | [**list_users_in_channel**](Models.md#list_users_in_channel) | **GET** /{domainID}/channels/{channelID}/users | List users in a channel +*UsersApi* | [**list_users_in_client**](Models.md#list_users_in_client) | **GET** /{domainID}/clients/{clientID}/users | List users associated with a client +*UsersApi* | [**list_users_in_group**](Models.md#list_users_in_group) | **GET** /{domainID}/groups/{groupID}/users | List users in a group +*UsersApi* | [**refresh_token**](Models.md#refresh_token) | **POST** /users/tokens/refresh | Refresh Token +*UsersApi* | [**request_password_reset**](Models.md#request_password_reset) | **POST** /password/reset-request | User password reset request +*UsersApi* | [**reset_password**](Models.md#reset_password) | **PUT** /password/reset | User password reset endpoint +*UsersApi* | [**search_users**](Models.md#search_users) | **GET** /users/search | Search users +*UsersApi* | [**update_email**](Models.md#update_email) | **PATCH** /users/{userID}/email | Updates email of the user. +*UsersApi* | [**update_profile_picture**](Models.md#update_profile_picture) | **PATCH** /users/{userID}/picture | Updates the user's profile picture. +*UsersApi* | [**update_role**](Models.md#update_role) | **PATCH** /users/{userID}/role | Updates the user's role. +*UsersApi* | [**update_secret**](Models.md#update_secret) | **PATCH** /users/secret | Updates secret of currently logged in user. +*UsersApi* | [**update_tags**](Models.md#update_tags) | **PATCH** /users/{userID}/tags | Updates tags of the user. +*UsersApi* | [**update_user**](Models.md#update_user) | **PATCH** /users/{userID} | Updates first, last name and metadata of the user. +*UsersApi* | [**update_username**](Models.md#update_username) | **PATCH** /users/{userID}/username | Updates user's username. +*UsersApi* | [**users_user_id_delete**](Models.md#users_user_id_delete) | **DELETE** /users/{userID} | Delete a user To get access to the crate's generated documentation, use: From 61a2035f09f003d00cb85fab541492575b89914d Mon Sep 17 00:00:00 2001 From: Dorcas Litunya Date: Mon, 13 Jan 2025 02:05:41 +0300 Subject: [PATCH 06/10] Refactor SDK --- Cargo.lock | 583 ++------ Cargo.toml | 38 +- auth/.gitignore | 3 - auth/.openapi-generator-ignore | 23 - auth/.openapi-generator/FILES | 20 - auth/.openapi-generator/VERSION | 1 - auth/.travis.yml | 1 - auth/Cargo.toml | 15 - auth/README.md | 54 - auth/docs/HealthApi.md | 34 - auth/docs/HealthInfo.md | 16 - auth/docs/IssueKeyRequest.md | 12 - auth/docs/Key.md | 16 - auth/docs/KeysApi.md | 101 -- auth/git_push.sh | 57 - auth/src/apis/health_api.rs | 53 - auth/src/apis/mod.rs | 96 -- auth/src/models/health_info.rs | 60 - auth/src/models/mod.rs | 6 - bootstrap/.gitignore | 3 - bootstrap/.openapi-generator-ignore | 23 - bootstrap/.openapi-generator/FILES | 38 - bootstrap/.openapi-generator/VERSION | 1 - bootstrap/.travis.yml | 1 - bootstrap/Cargo.toml | 15 - bootstrap/README.md | 70 - bootstrap/docs/BootstrapConfig.md | 15 - bootstrap/docs/Config.md | 19 - bootstrap/docs/ConfigChannelsInner.md | 13 - bootstrap/docs/ConfigList.md | 14 - bootstrap/docs/ConfigUpdateCerts.md | 14 - bootstrap/docs/ConfigsApi.md | 331 ---- bootstrap/docs/CreateConfigRequest.md | 19 - bootstrap/docs/HealthApi.md | 34 - bootstrap/docs/HealthInfo.md | 16 - bootstrap/docs/State.md | 13 - bootstrap/docs/UpdateConfigCertsRequest.md | 13 - .../docs/UpdateConfigConnectionsRequest.md | 11 - bootstrap/docs/UpdateConfigRequest.md | 12 - bootstrap/docs/UpdateConfigStateRequest.md | 11 - bootstrap/git_push.sh | 57 - bootstrap/src/apis/configs_api.rs | 475 ------ bootstrap/src/apis/configuration.rs | 51 - bootstrap/src/apis/health_api.rs | 53 - bootstrap/src/apis/mod.rs | 96 -- bootstrap/src/lib.rs | 11 - bootstrap/src/models/bootstrap_config.rs | 43 - bootstrap/src/models/config.rs | 58 - bootstrap/src/models/config_list.rs | 39 - bootstrap/src/models/config_update_certs.rs | 40 - bootstrap/src/models/health_info.rs | 60 - bootstrap/src/models/mod.rs | 24 - bootstrap/src/models/state.rs | 37 - .../src/models/update_config_state_request.rs | 27 - certs/.gitignore | 3 - certs/.openapi-generator-ignore | 23 - certs/.openapi-generator/FILES | 28 - certs/.openapi-generator/VERSION | 1 - certs/.travis.yml | 1 - certs/Cargo.toml | 15 - certs/README.md | 59 - certs/docs/Cert.md | 16 - certs/docs/CertsApi.md | 136 -- certs/docs/CertsPage.md | 14 - certs/docs/CreateCertRequest.md | 12 - certs/docs/HealthApi.md | 34 - certs/docs/HealthInfo.md | 16 - certs/docs/Revoke.md | 11 - certs/docs/Serial.md | 11 - certs/docs/SerialsPage.md | 14 - certs/git_push.sh | 57 - certs/src/apis/configuration.rs | 51 - certs/src/apis/health_api.rs | 53 - certs/src/apis/mod.rs | 96 -- certs/src/lib.rs | 11 - certs/src/models/health_info.rs | 60 - certs/src/models/mod.rs | 14 - channels/.gitignore | 3 - channels/.openapi-generator-ignore | 23 - channels/.openapi-generator/FILES | 36 - channels/.openapi-generator/VERSION | 1 - channels/.travis.yml | 1 - channels/Cargo.toml | 15 - channels/README.md | 73 - channels/docs/Channel.md | 21 - channels/docs/ChannelConnectionReqSchema.md | 12 - channels/docs/ChannelReqObj.md | 15 - channels/docs/ChannelUpdate.md | 13 - channels/docs/ChannelUpdateTags.md | 11 - channels/docs/ChannelsApi.md | 367 ----- channels/docs/ChannelsPage.md | 14 - channels/docs/ConnectionReqSchema.md | 13 - channels/docs/ConnectionsApi.md | 138 -- channels/docs/Error.md | 11 - channels/docs/HealthApi.md | 34 - channels/docs/HealthRes.md | 15 - channels/docs/ParentGroupReqObj.md | 11 - channels/git_push.sh | 57 - channels/src/apis/configuration.rs | 51 - channels/src/apis/connections_api.rs | 202 --- channels/src/apis/health_api.rs | 53 - channels/src/apis/mod.rs | 97 -- channels/src/lib.rs | 11 - channels/src/models/channel_update_tags.rs | 28 - channels/src/models/error.rs | 28 - channels/src/models/health_res.rs | 56 - channels/src/models/mod.rs | 20 - channels/src/models/parent_group_req_obj.rs | 28 - clients/.gitignore | 3 - clients/.openapi-generator-ignore | 23 - clients/.openapi-generator/FILES | 58 - clients/.openapi-generator/VERSION | 1 - clients/.travis.yml | 1 - clients/Cargo.toml | 15 - clients/README.md | 96 -- clients/docs/AvailableActionsObj.md | 11 - clients/docs/Client.md | 19 - clients/docs/ClientCredentials.md | 12 - clients/docs/ClientReqObj.md | 15 - clients/docs/ClientReqObjCredentials.md | 12 - clients/docs/ClientSecret.md | 11 - clients/docs/ClientTags.md | 11 - clients/docs/ClientUpdate.md | 12 - clients/docs/ClientWithEmptySecret.md | 19 - .../docs/ClientWithEmptySecretCredentials.md | 12 - clients/docs/ClientsApi.md | 440 ------ clients/docs/ClientsPage.md | 14 - clients/docs/CreateRoleObj.md | 13 - clients/docs/Error.md | 11 - clients/docs/HealthApi.md | 34 - clients/docs/HealthRes.md | 15 - clients/docs/NewRole.md | 17 - clients/docs/ParentGroupReqObj.md | 11 - clients/docs/Role.md | 17 - clients/docs/RoleActionsObj.md | 11 - clients/docs/RoleMembersObj.md | 11 - clients/docs/RolesApi.md | 474 ------ clients/docs/RolesPage.md | 14 - clients/docs/UpdateRoleObj.md | 11 - clients/git_push.sh | 57 - clients/src/apis/clients_api.rs | 647 -------- clients/src/apis/configuration.rs | 51 - clients/src/apis/health_api.rs | 53 - clients/src/apis/mod.rs | 97 -- clients/src/apis/roles_api.rs | 646 -------- clients/src/lib.rs | 11 - clients/src/models/available_actions_obj.rs | 28 - clients/src/models/client_secret.rs | 28 - clients/src/models/client_tags.rs | 28 - clients/src/models/create_role_obj.rs | 36 - clients/src/models/error.rs | 28 - clients/src/models/health_res.rs | 56 - clients/src/models/mod.rs | 42 - clients/src/models/new_role.rs | 52 - clients/src/models/role.rs | 52 - clients/src/models/role_actions_obj.rs | 28 - clients/src/models/role_members_obj.rs | 28 - clients/src/models/roles_page.rs | 40 - clients/src/models/update_role_obj.rs | 28 - domains/.gitignore | 3 - domains/.openapi-generator-ignore | 23 - domains/.openapi-generator/FILES | 42 - domains/.openapi-generator/VERSION | 1 - domains/.travis.yml | 1 - domains/Cargo.toml | 15 - domains/README.md | 82 - domains/docs/AvailableActionsObj.md | 11 - domains/docs/CreateRoleObj.md | 13 - domains/docs/Domain.md | 20 - domains/docs/DomainReqObj.md | 14 - domains/docs/DomainUpdate.md | 14 - domains/docs/DomainsApi.md | 231 --- domains/docs/DomainsPage.md | 14 - domains/docs/HealthApi.md | 34 - domains/docs/HealthInfo.md | 16 - domains/docs/NewRole.md | 17 - domains/docs/Role.md | 17 - domains/docs/RoleActionsObj.md | 11 - domains/docs/RoleMembersObj.md | 11 - domains/docs/RolesApi.md | 461 ------ domains/docs/RolesPage.md | 14 - domains/docs/UpdateRoleObj.md | 11 - domains/git_push.sh | 57 - domains/src/apis/configuration.rs | 51 - domains/src/apis/domains_api.rs | 350 ----- domains/src/apis/health_api.rs | 53 - domains/src/apis/mod.rs | 97 -- domains/src/lib.rs | 11 - domains/src/models/available_actions_obj.rs | 28 - domains/src/models/create_role_obj.rs | 36 - domains/src/models/health_info.rs | 60 - domains/src/models/mod.rs | 26 - domains/src/models/new_role.rs | 52 - domains/src/models/role.rs | 52 - domains/src/models/role_actions_obj.rs | 28 - domains/src/models/role_members_obj.rs | 28 - domains/src/models/roles_page.rs | 40 - domains/src/models/update_role_obj.rs | 28 - examples/Cargo.toml | 36 - examples/src/lib.rs | 9 - groups/.gitignore | 3 - groups/.openapi-generator-ignore | 23 - groups/.openapi-generator/FILES | 56 - groups/.openapi-generator/VERSION | 1 - groups/.travis.yml | 1 - groups/Cargo.toml | 15 - groups/README.md | 96 -- groups/docs/AvailableActionsObj.md | 11 - groups/docs/ChildrenGroupReqObj.md | 11 - groups/docs/CreateRoleObj.md | 13 - groups/docs/Error.md | 11 - groups/docs/Group.md | 21 - groups/docs/GroupReqObj.md | 15 - groups/docs/GroupUpdate.md | 13 - groups/docs/GroupsApi.md | 477 ------ groups/docs/GroupsHierarchyPage.md | 13 - groups/docs/GroupsPage.md | 14 - groups/docs/HealthApi.md | 34 - groups/docs/HealthRes.md | 15 - groups/docs/Members.md | 20 - groups/docs/MembersCredentials.md | 12 - groups/docs/MembersPage.md | 14 - groups/docs/NewRole.md | 17 - groups/docs/ParentGroupReqObj.md | 11 - groups/docs/Role.md | 17 - groups/docs/RoleActionsObj.md | 11 - groups/docs/RoleMembersObj.md | 11 - groups/docs/RolesApi.md | 474 ------ groups/docs/RolesPage.md | 14 - groups/docs/UpdateRoleObj.md | 11 - groups/git_push.sh | 57 - groups/src/apis/configuration.rs | 51 - groups/src/apis/groups_api.rs | 704 --------- groups/src/apis/health_api.rs | 53 - groups/src/apis/mod.rs | 97 -- groups/src/apis/roles_api.rs | 646 -------- groups/src/lib.rs | 11 - groups/src/models/children_group_req_obj.rs | 28 - groups/src/models/error.rs | 28 - groups/src/models/health_res.rs | 56 - groups/src/models/members.rs | 63 - groups/src/models/members_credentials.rs | 32 - groups/src/models/members_page.rs | 39 - groups/src/models/mod.rs | 40 - groups/src/models/parent_group_req_obj.rs | 28 - groups/src/models/update_role_obj.rs | 28 - http/.gitignore | 3 - http/.openapi-generator-ignore | 23 - http/.openapi-generator/FILES | 18 - http/.openapi-generator/VERSION | 1 - http/.travis.yml | 1 - http/Cargo.toml | 15 - http/README.md | 51 - http/docs/HealthApi.md | 34 - http/docs/HealthInfo.md | 16 - http/docs/MessagesApi.md | 40 - http/docs/SenMlRecord.md | 25 - http/git_push.sh | 57 - http/src/apis/configuration.rs | 51 - http/src/apis/health_api.rs | 53 - http/src/apis/mod.rs | 96 -- http/src/lib.rs | 11 - http/src/models/mod.rs | 4 - invitations/.gitignore | 3 - invitations/.openapi-generator-ignore | 23 - invitations/.openapi-generator/FILES | 26 - invitations/.openapi-generator/VERSION | 1 - invitations/.travis.yml | 1 - invitations/Cargo.toml | 15 - invitations/README.md | 60 - invitations/docs/AcceptInvitationRequest.md | 11 - invitations/docs/Error.md | 11 - invitations/docs/HealthApi.md | 34 - invitations/docs/HealthRes.md | 15 - invitations/docs/Invitation.md | 17 - invitations/docs/InvitationPage.md | 14 - invitations/docs/InvitationsApi.md | 202 --- invitations/docs/SendInvitationReqObj.md | 14 - invitations/git_push.sh | 57 - invitations/src/apis/configuration.rs | 51 - invitations/src/apis/health_api.rs | 53 - invitations/src/apis/mod.rs | 96 -- invitations/src/lib.rs | 11 - .../src/models/accept_invitation_request.rs | 28 - invitations/src/models/error.rs | 28 - invitations/src/models/health_res.rs | 56 - invitations/src/models/mod.rs | 12 - journal/.gitignore | 3 - journal/.openapi-generator-ignore | 23 - journal/.openapi-generator/FILES | 22 - journal/.openapi-generator/VERSION | 1 - journal/.travis.yml | 1 - journal/Cargo.toml | 15 - journal/README.md | 54 - journal/docs/Error.md | 11 - journal/docs/HealthApi.md | 34 - journal/docs/HealthInfo.md | 16 - journal/docs/Journal.md | 14 - journal/docs/JournalLogApi.md | 88 -- journal/docs/JournalPage.md | 14 - journal/git_push.sh | 57 - journal/src/apis/configuration.rs | 51 - journal/src/apis/health_api.rs | 53 - journal/src/apis/mod.rs | 96 -- journal/src/lib.rs | 11 - journal/src/models/error.rs | 28 - journal/src/models/health_info.rs | 60 - journal/src/models/mod.rs | 8 - notifiers/.gitignore | 3 - notifiers/.openapi-generator-ignore | 23 - notifiers/.openapi-generator/FILES | 22 - notifiers/.openapi-generator/VERSION | 1 - notifiers/.travis.yml | 1 - notifiers/Cargo.toml | 15 - notifiers/README.md | 56 - notifiers/docs/CreateSubscription.md | 12 - notifiers/docs/HealthApi.md | 34 - notifiers/docs/HealthInfo.md | 16 - notifiers/docs/NotifiersApi.md | 135 -- notifiers/docs/Page.md | 14 - notifiers/docs/Subscription.md | 14 - notifiers/git_push.sh | 57 - notifiers/src/apis/configuration.rs | 51 - notifiers/src/apis/health_api.rs | 53 - notifiers/src/apis/mod.rs | 96 -- notifiers/src/lib.rs | 11 - notifiers/src/models/health_info.rs | 60 - notifiers/src/models/mod.rs | 8 - provision/.gitignore | 3 - provision/.openapi-generator-ignore | 23 - provision/.openapi-generator/FILES | 18 - provision/.openapi-generator/VERSION | 1 - provision/.travis.yml | 1 - provision/Cargo.toml | 15 - provision/README.md | 52 - provision/docs/DomainIdMappingPostRequest.md | 13 - provision/docs/HealthApi.md | 34 - provision/docs/HealthInfo.md | 16 - provision/docs/ProvisionApi.md | 71 - provision/git_push.sh | 57 - provision/src/apis/configuration.rs | 51 - provision/src/apis/health_api.rs | 53 - provision/src/apis/mod.rs | 96 -- provision/src/lib.rs | 11 - provision/src/models/health_info.rs | 60 - provision/src/models/mod.rs | 4 - readers/.gitignore | 3 - readers/.openapi-generator-ignore | 23 - readers/.openapi-generator/FILES | 20 - readers/.openapi-generator/VERSION | 1 - readers/.travis.yml | 1 - readers/Cargo.toml | 15 - readers/README.md | 52 - readers/docs/HealthApi.md | 34 - readers/docs/HealthInfo.md | 16 - readers/docs/MessagesPage.md | 14 - readers/docs/MessagesPageMessagesInner.md | 22 - readers/docs/ReadersApi.md | 51 - readers/git_push.sh | 57 - readers/src/apis/configuration.rs | 51 - readers/src/apis/health_api.rs | 53 - readers/src/apis/mod.rs | 96 -- readers/src/lib.rs | 11 - readers/src/models/health_info.rs | 60 - readers/src/models/mod.rs | 6 - {certs/src => src}/apis/certs_api.rs | 95 +- {channels/src => src}/apis/channels_api.rs | 270 +++- src/apis/clients_api.rs | 1293 ++++++++++++++++ {auth/src => src}/apis/configuration.rs | 6 +- .../roles_api.rs => src/apis/domains_api.rs | 400 ++++- examples/src/main.rs => src/apis/examples.rs | 162 +- src/apis/groups_api.rs | 1332 +++++++++++++++++ .../src => src}/apis/invitations_api.rs | 33 +- {journal/src => src}/apis/journal_log_api.rs | 18 +- {auth/src => src}/apis/keys_api.rs | 45 +- {http/src => src}/apis/messages_api.rs | 18 +- {twins/src => src}/apis/mod.rs | 17 +- {notifiers/src => src}/apis/notifiers_api.rs | 58 +- {provision/src => src}/apis/provision_api.rs | 34 +- {readers/src => src}/apis/readers_api.rs | 18 +- {twins/src => src}/apis/states_api.rs | 21 +- {twins/src => src}/apis/twins_api.rs | 71 +- {users/src => src}/apis/users_api.rs | 144 +- {auth/src => src}/lib.rs | 5 +- src/main.rs | 12 + .../__domain_id__mapping_post_request.rs | 13 +- src/models/accept_invitation_request.rs | 29 + {users/src => src}/models/assign_req_obj.rs | 11 +- .../src => src}/models/assign_user_req_obj.rs | 11 +- {twins/src => src}/models/attribute.rs | 11 +- .../models/available_actions_obj.rs | 11 +- {certs/src => src}/models/cert.rs | 11 +- {certs/src => src}/models/certs_page.rs | 13 +- {channels/src => src}/models/channel.rs | 11 +- .../models/channel_connection_req_schema.rs | 11 +- .../src => src}/models/channel_req_obj.rs | 11 +- .../src => src}/models/channel_update.rs | 11 +- src/models/channel_update_tags.rs | 29 + {channels/src => src}/models/channels_page.rs | 15 +- src/models/children_group_req_obj.rs | 29 + {clients/src => src}/models/client.rs | 13 +- .../src => src}/models/client_credentials.rs | 11 +- {clients/src => src}/models/client_req_obj.rs | 15 +- .../models/client_req_obj_credentials.rs | 11 +- src/models/client_secret.rs | 29 + src/models/client_tags.rs | 29 + {clients/src => src}/models/client_update.rs | 11 +- .../models/client_with_empty_secret.rs | 13 +- .../client_with_empty_secret_credentials.rs | 11 +- {clients/src => src}/models/clients_page.rs | 15 +- .../models/config_channels_inner.rs | 11 +- .../models/connection_req_schema.rs | 11 +- .../src => src}/models/create_cert_request.rs | 11 +- .../models/create_config_request.rs | 11 +- {groups/src => src}/models/create_role_obj.rs | 11 +- .../src => src}/models/create_subscription.rs | 11 +- {twins/src => src}/models/definition.rs | 15 +- {domains/src => src}/models/domain.rs | 11 +- {domains/src => src}/models/domain_req_obj.rs | 11 +- {domains/src => src}/models/domain_update.rs | 11 +- {domains/src => src}/models/domains_page.rs | 15 +- src/models/email.rs | 29 + src/models/error.rs | 29 + {groups/src => src}/models/group.rs | 11 +- {groups/src => src}/models/group_req_obj.rs | 11 +- {groups/src => src}/models/group_update.rs | 11 +- .../models/groups_hierarchy_page.rs | 13 +- {groups/src => src}/models/groups_page.rs | 15 +- {http/src => src}/models/health_info.rs | 11 +- {users/src => src}/models/health_res.rs | 11 +- {invitations/src => src}/models/invitation.rs | 11 +- .../src => src}/models/invitation_page.rs | 15 +- {auth/src => src}/models/issue_key_request.rs | 13 +- {users/src => src}/models/issue_token.rs | 11 +- .../models/issue_token_200_response.rs | 11 +- {journal/src => src}/models/journal.rs | 13 +- {journal/src => src}/models/journal_page.rs | 17 +- {auth/src => src}/models/key.rs | 11 +- {users/src => src}/models/members.rs | 13 +- .../src => src}/models/members_credentials.rs | 11 +- {users/src => src}/models/members_page.rs | 15 +- {readers/src => src}/models/messages_page.rs | 19 +- .../models/messages_page_messages_inner.rs | 19 +- src/models/mod.rs | 192 +++ {groups/src => src}/models/new_role.rs | 11 +- {notifiers/src => src}/models/page.rs | 13 +- .../models/parent_group_req_obj.rs | 11 +- src/models/parent_group_req_obj2.rs | 29 + .../models/request_password_reset_request.rs | 11 +- .../models/reset_password_request.rs | 11 +- {certs/src => src}/models/revoke.rs | 11 +- {groups/src => src}/models/role.rs | 11 +- .../src => src}/models/role_actions_obj.rs | 11 +- .../src => src}/models/role_members_obj.rs | 11 +- {groups/src => src}/models/roles_page.rs | 13 +- {http/src => src}/models/sen_ml_record.rs | 11 +- .../models/send_invitation_req_obj.rs | 11 +- {certs/src => src}/models/serial.rs | 11 +- {certs/src => src}/models/serials_page.rs | 11 +- src/models/state.rs | 39 + .../models/state.rs => src/models/state2.rs | 21 +- {twins/src => src}/models/states_page.rs | 15 +- {notifiers/src => src}/models/subscription.rs | 11 +- {twins/src => src}/models/twin_req_obj.rs | 13 +- {twins/src => src}/models/twin_res_obj.rs | 15 +- {twins/src => src}/models/twins_page.rs | 15 +- .../models/update_config_certs_request.rs | 11 +- .../update_config_connections_request.rs | 11 +- .../models/update_config_request.rs | 11 +- src/models/update_config_state_request.rs | 28 + src/models/update_role_obj.rs | 29 + {users/src => src}/models/user.rs | 13 +- {users/src => src}/models/user_credentials.rs | 11 +- .../models/user_profile_picture.rs | 11 +- {users/src => src}/models/user_req_obj.rs | 15 +- .../models/user_req_obj_credentials.rs | 11 +- {users/src => src}/models/user_role.rs | 11 +- {users/src => src}/models/user_secret.rs | 11 +- src/models/user_tags.rs | 29 + {users/src => src}/models/user_update.rs | 11 +- src/models/username.rs | 29 + {users/src => src}/models/users_page.rs | 15 +- twins/.gitignore | 3 - twins/.openapi-generator-ignore | 23 - twins/.openapi-generator/FILES | 32 - twins/.openapi-generator/VERSION | 1 - twins/.travis.yml | 1 - twins/Cargo.toml | 15 - twins/README.md | 62 - twins/docs/Attribute.md | 14 - twins/docs/Definition.md | 12 - twins/docs/HealthApi.md | 34 - twins/docs/HealthInfo.md | 16 - twins/docs/State.md | 14 - twins/docs/StatesApi.md | 41 - twins/docs/StatesPage.md | 14 - twins/docs/TwinReqObj.md | 13 - twins/docs/TwinResObj.md | 18 - twins/docs/TwinsApi.md | 165 -- twins/docs/TwinsPage.md | 14 - twins/git_push.sh | 57 - twins/src/apis/configuration.rs | 51 - twins/src/apis/health_api.rs | 53 - twins/src/lib.rs | 11 - twins/src/models/health_info.rs | 60 - twins/src/models/mod.rs | 16 - users/.gitignore | 3 - users/.openapi-generator-ignore | 23 - users/.openapi-generator/FILES | 60 - users/.openapi-generator/VERSION | 1 - users/.travis.yml | 1 - users/Cargo.toml | 16 - users/README.md | 94 -- users/docs/AssignReqObj.md | 13 - users/docs/AssignUserReqObj.md | 12 - users/docs/Email.md | 11 - users/docs/Error.md | 11 - users/docs/HealthApi.md | 34 - users/docs/HealthRes.md | 15 - users/docs/IssueToken.md | 12 - users/docs/IssueToken200Response.md | 13 - users/docs/Members.md | 20 - users/docs/MembersCredentials.md | 12 - users/docs/MembersPage.md | 14 - users/docs/RequestPasswordResetRequest.md | 12 - users/docs/ResetPasswordRequest.md | 13 - users/docs/User.md | 21 - users/docs/UserCredentials.md | 11 - users/docs/UserProfilePicture.md | 11 - users/docs/UserReqObj.md | 18 - users/docs/UserReqObjCredentials.md | 12 - users/docs/UserRole.md | 11 - users/docs/UserSecret.md | 12 - users/docs/UserTags.md | 11 - users/docs/UserUpdate.md | 13 - users/docs/Username.md | 11 - users/docs/UsersApi.md | 764 ---------- users/docs/UsersPage.md | 14 - users/git_push.sh | 57 - users/src/apis/configuration.rs | 51 - users/src/apis/health_api.rs | 53 - users/src/apis/mod.rs | 96 -- users/src/lib.rs | 11 - users/src/models/email.rs | 28 - users/src/models/error.rs | 28 - users/src/models/mod.rs | 46 - users/src/models/user_tags.rs | 28 - users/src/models/username.rs | 28 - 548 files changed, 5044 insertions(+), 21051 deletions(-) delete mode 100644 auth/.gitignore delete mode 100644 auth/.openapi-generator-ignore delete mode 100644 auth/.openapi-generator/FILES delete mode 100644 auth/.openapi-generator/VERSION delete mode 100644 auth/.travis.yml delete mode 100644 auth/Cargo.toml delete mode 100644 auth/README.md delete mode 100644 auth/docs/HealthApi.md delete mode 100644 auth/docs/HealthInfo.md delete mode 100644 auth/docs/IssueKeyRequest.md delete mode 100644 auth/docs/Key.md delete mode 100644 auth/docs/KeysApi.md delete mode 100644 auth/git_push.sh delete mode 100644 auth/src/apis/health_api.rs delete mode 100644 auth/src/apis/mod.rs delete mode 100644 auth/src/models/health_info.rs delete mode 100644 auth/src/models/mod.rs delete mode 100644 bootstrap/.gitignore delete mode 100644 bootstrap/.openapi-generator-ignore delete mode 100644 bootstrap/.openapi-generator/FILES delete mode 100644 bootstrap/.openapi-generator/VERSION delete mode 100644 bootstrap/.travis.yml delete mode 100644 bootstrap/Cargo.toml delete mode 100644 bootstrap/README.md delete mode 100644 bootstrap/docs/BootstrapConfig.md delete mode 100644 bootstrap/docs/Config.md delete mode 100644 bootstrap/docs/ConfigChannelsInner.md delete mode 100644 bootstrap/docs/ConfigList.md delete mode 100644 bootstrap/docs/ConfigUpdateCerts.md delete mode 100644 bootstrap/docs/ConfigsApi.md delete mode 100644 bootstrap/docs/CreateConfigRequest.md delete mode 100644 bootstrap/docs/HealthApi.md delete mode 100644 bootstrap/docs/HealthInfo.md delete mode 100644 bootstrap/docs/State.md delete mode 100644 bootstrap/docs/UpdateConfigCertsRequest.md delete mode 100644 bootstrap/docs/UpdateConfigConnectionsRequest.md delete mode 100644 bootstrap/docs/UpdateConfigRequest.md delete mode 100644 bootstrap/docs/UpdateConfigStateRequest.md delete mode 100644 bootstrap/git_push.sh delete mode 100644 bootstrap/src/apis/configs_api.rs delete mode 100644 bootstrap/src/apis/configuration.rs delete mode 100644 bootstrap/src/apis/health_api.rs delete mode 100644 bootstrap/src/apis/mod.rs delete mode 100644 bootstrap/src/lib.rs delete mode 100644 bootstrap/src/models/bootstrap_config.rs delete mode 100644 bootstrap/src/models/config.rs delete mode 100644 bootstrap/src/models/config_list.rs delete mode 100644 bootstrap/src/models/config_update_certs.rs delete mode 100644 bootstrap/src/models/health_info.rs delete mode 100644 bootstrap/src/models/mod.rs delete mode 100644 bootstrap/src/models/state.rs delete mode 100644 bootstrap/src/models/update_config_state_request.rs delete mode 100644 certs/.gitignore delete mode 100644 certs/.openapi-generator-ignore delete mode 100644 certs/.openapi-generator/FILES delete mode 100644 certs/.openapi-generator/VERSION delete mode 100644 certs/.travis.yml delete mode 100644 certs/Cargo.toml delete mode 100644 certs/README.md delete mode 100644 certs/docs/Cert.md delete mode 100644 certs/docs/CertsApi.md delete mode 100644 certs/docs/CertsPage.md delete mode 100644 certs/docs/CreateCertRequest.md delete mode 100644 certs/docs/HealthApi.md delete mode 100644 certs/docs/HealthInfo.md delete mode 100644 certs/docs/Revoke.md delete mode 100644 certs/docs/Serial.md delete mode 100644 certs/docs/SerialsPage.md delete mode 100644 certs/git_push.sh delete mode 100644 certs/src/apis/configuration.rs delete mode 100644 certs/src/apis/health_api.rs delete mode 100644 certs/src/apis/mod.rs delete mode 100644 certs/src/lib.rs delete mode 100644 certs/src/models/health_info.rs delete mode 100644 certs/src/models/mod.rs delete mode 100644 channels/.gitignore delete mode 100644 channels/.openapi-generator-ignore delete mode 100644 channels/.openapi-generator/FILES delete mode 100644 channels/.openapi-generator/VERSION delete mode 100644 channels/.travis.yml delete mode 100644 channels/Cargo.toml delete mode 100644 channels/README.md delete mode 100644 channels/docs/Channel.md delete mode 100644 channels/docs/ChannelConnectionReqSchema.md delete mode 100644 channels/docs/ChannelReqObj.md delete mode 100644 channels/docs/ChannelUpdate.md delete mode 100644 channels/docs/ChannelUpdateTags.md delete mode 100644 channels/docs/ChannelsApi.md delete mode 100644 channels/docs/ChannelsPage.md delete mode 100644 channels/docs/ConnectionReqSchema.md delete mode 100644 channels/docs/ConnectionsApi.md delete mode 100644 channels/docs/Error.md delete mode 100644 channels/docs/HealthApi.md delete mode 100644 channels/docs/HealthRes.md delete mode 100644 channels/docs/ParentGroupReqObj.md delete mode 100644 channels/git_push.sh delete mode 100644 channels/src/apis/configuration.rs delete mode 100644 channels/src/apis/connections_api.rs delete mode 100644 channels/src/apis/health_api.rs delete mode 100644 channels/src/apis/mod.rs delete mode 100644 channels/src/lib.rs delete mode 100644 channels/src/models/channel_update_tags.rs delete mode 100644 channels/src/models/error.rs delete mode 100644 channels/src/models/health_res.rs delete mode 100644 channels/src/models/mod.rs delete mode 100644 channels/src/models/parent_group_req_obj.rs delete mode 100644 clients/.gitignore delete mode 100644 clients/.openapi-generator-ignore delete mode 100644 clients/.openapi-generator/FILES delete mode 100644 clients/.openapi-generator/VERSION delete mode 100644 clients/.travis.yml delete mode 100644 clients/Cargo.toml delete mode 100644 clients/README.md delete mode 100644 clients/docs/AvailableActionsObj.md delete mode 100644 clients/docs/Client.md delete mode 100644 clients/docs/ClientCredentials.md delete mode 100644 clients/docs/ClientReqObj.md delete mode 100644 clients/docs/ClientReqObjCredentials.md delete mode 100644 clients/docs/ClientSecret.md delete mode 100644 clients/docs/ClientTags.md delete mode 100644 clients/docs/ClientUpdate.md delete mode 100644 clients/docs/ClientWithEmptySecret.md delete mode 100644 clients/docs/ClientWithEmptySecretCredentials.md delete mode 100644 clients/docs/ClientsApi.md delete mode 100644 clients/docs/ClientsPage.md delete mode 100644 clients/docs/CreateRoleObj.md delete mode 100644 clients/docs/Error.md delete mode 100644 clients/docs/HealthApi.md delete mode 100644 clients/docs/HealthRes.md delete mode 100644 clients/docs/NewRole.md delete mode 100644 clients/docs/ParentGroupReqObj.md delete mode 100644 clients/docs/Role.md delete mode 100644 clients/docs/RoleActionsObj.md delete mode 100644 clients/docs/RoleMembersObj.md delete mode 100644 clients/docs/RolesApi.md delete mode 100644 clients/docs/RolesPage.md delete mode 100644 clients/docs/UpdateRoleObj.md delete mode 100644 clients/git_push.sh delete mode 100644 clients/src/apis/clients_api.rs delete mode 100644 clients/src/apis/configuration.rs delete mode 100644 clients/src/apis/health_api.rs delete mode 100644 clients/src/apis/mod.rs delete mode 100644 clients/src/apis/roles_api.rs delete mode 100644 clients/src/lib.rs delete mode 100644 clients/src/models/available_actions_obj.rs delete mode 100644 clients/src/models/client_secret.rs delete mode 100644 clients/src/models/client_tags.rs delete mode 100644 clients/src/models/create_role_obj.rs delete mode 100644 clients/src/models/error.rs delete mode 100644 clients/src/models/health_res.rs delete mode 100644 clients/src/models/mod.rs delete mode 100644 clients/src/models/new_role.rs delete mode 100644 clients/src/models/role.rs delete mode 100644 clients/src/models/role_actions_obj.rs delete mode 100644 clients/src/models/role_members_obj.rs delete mode 100644 clients/src/models/roles_page.rs delete mode 100644 clients/src/models/update_role_obj.rs delete mode 100644 domains/.gitignore delete mode 100644 domains/.openapi-generator-ignore delete mode 100644 domains/.openapi-generator/FILES delete mode 100644 domains/.openapi-generator/VERSION delete mode 100644 domains/.travis.yml delete mode 100644 domains/Cargo.toml delete mode 100644 domains/README.md delete mode 100644 domains/docs/AvailableActionsObj.md delete mode 100644 domains/docs/CreateRoleObj.md delete mode 100644 domains/docs/Domain.md delete mode 100644 domains/docs/DomainReqObj.md delete mode 100644 domains/docs/DomainUpdate.md delete mode 100644 domains/docs/DomainsApi.md delete mode 100644 domains/docs/DomainsPage.md delete mode 100644 domains/docs/HealthApi.md delete mode 100644 domains/docs/HealthInfo.md delete mode 100644 domains/docs/NewRole.md delete mode 100644 domains/docs/Role.md delete mode 100644 domains/docs/RoleActionsObj.md delete mode 100644 domains/docs/RoleMembersObj.md delete mode 100644 domains/docs/RolesApi.md delete mode 100644 domains/docs/RolesPage.md delete mode 100644 domains/docs/UpdateRoleObj.md delete mode 100644 domains/git_push.sh delete mode 100644 domains/src/apis/configuration.rs delete mode 100644 domains/src/apis/domains_api.rs delete mode 100644 domains/src/apis/health_api.rs delete mode 100644 domains/src/apis/mod.rs delete mode 100644 domains/src/lib.rs delete mode 100644 domains/src/models/available_actions_obj.rs delete mode 100644 domains/src/models/create_role_obj.rs delete mode 100644 domains/src/models/health_info.rs delete mode 100644 domains/src/models/mod.rs delete mode 100644 domains/src/models/new_role.rs delete mode 100644 domains/src/models/role.rs delete mode 100644 domains/src/models/role_actions_obj.rs delete mode 100644 domains/src/models/role_members_obj.rs delete mode 100644 domains/src/models/roles_page.rs delete mode 100644 domains/src/models/update_role_obj.rs delete mode 100644 examples/Cargo.toml delete mode 100644 examples/src/lib.rs delete mode 100644 groups/.gitignore delete mode 100644 groups/.openapi-generator-ignore delete mode 100644 groups/.openapi-generator/FILES delete mode 100644 groups/.openapi-generator/VERSION delete mode 100644 groups/.travis.yml delete mode 100644 groups/Cargo.toml delete mode 100644 groups/README.md delete mode 100644 groups/docs/AvailableActionsObj.md delete mode 100644 groups/docs/ChildrenGroupReqObj.md delete mode 100644 groups/docs/CreateRoleObj.md delete mode 100644 groups/docs/Error.md delete mode 100644 groups/docs/Group.md delete mode 100644 groups/docs/GroupReqObj.md delete mode 100644 groups/docs/GroupUpdate.md delete mode 100644 groups/docs/GroupsApi.md delete mode 100644 groups/docs/GroupsHierarchyPage.md delete mode 100644 groups/docs/GroupsPage.md delete mode 100644 groups/docs/HealthApi.md delete mode 100644 groups/docs/HealthRes.md delete mode 100644 groups/docs/Members.md delete mode 100644 groups/docs/MembersCredentials.md delete mode 100644 groups/docs/MembersPage.md delete mode 100644 groups/docs/NewRole.md delete mode 100644 groups/docs/ParentGroupReqObj.md delete mode 100644 groups/docs/Role.md delete mode 100644 groups/docs/RoleActionsObj.md delete mode 100644 groups/docs/RoleMembersObj.md delete mode 100644 groups/docs/RolesApi.md delete mode 100644 groups/docs/RolesPage.md delete mode 100644 groups/docs/UpdateRoleObj.md delete mode 100644 groups/git_push.sh delete mode 100644 groups/src/apis/configuration.rs delete mode 100644 groups/src/apis/groups_api.rs delete mode 100644 groups/src/apis/health_api.rs delete mode 100644 groups/src/apis/mod.rs delete mode 100644 groups/src/apis/roles_api.rs delete mode 100644 groups/src/lib.rs delete mode 100644 groups/src/models/children_group_req_obj.rs delete mode 100644 groups/src/models/error.rs delete mode 100644 groups/src/models/health_res.rs delete mode 100644 groups/src/models/members.rs delete mode 100644 groups/src/models/members_credentials.rs delete mode 100644 groups/src/models/members_page.rs delete mode 100644 groups/src/models/mod.rs delete mode 100644 groups/src/models/parent_group_req_obj.rs delete mode 100644 groups/src/models/update_role_obj.rs delete mode 100644 http/.gitignore delete mode 100644 http/.openapi-generator-ignore delete mode 100644 http/.openapi-generator/FILES delete mode 100644 http/.openapi-generator/VERSION delete mode 100644 http/.travis.yml delete mode 100644 http/Cargo.toml delete mode 100644 http/README.md delete mode 100644 http/docs/HealthApi.md delete mode 100644 http/docs/HealthInfo.md delete mode 100644 http/docs/MessagesApi.md delete mode 100644 http/docs/SenMlRecord.md delete mode 100644 http/git_push.sh delete mode 100644 http/src/apis/configuration.rs delete mode 100644 http/src/apis/health_api.rs delete mode 100644 http/src/apis/mod.rs delete mode 100644 http/src/lib.rs delete mode 100644 http/src/models/mod.rs delete mode 100644 invitations/.gitignore delete mode 100644 invitations/.openapi-generator-ignore delete mode 100644 invitations/.openapi-generator/FILES delete mode 100644 invitations/.openapi-generator/VERSION delete mode 100644 invitations/.travis.yml delete mode 100644 invitations/Cargo.toml delete mode 100644 invitations/README.md delete mode 100644 invitations/docs/AcceptInvitationRequest.md delete mode 100644 invitations/docs/Error.md delete mode 100644 invitations/docs/HealthApi.md delete mode 100644 invitations/docs/HealthRes.md delete mode 100644 invitations/docs/Invitation.md delete mode 100644 invitations/docs/InvitationPage.md delete mode 100644 invitations/docs/InvitationsApi.md delete mode 100644 invitations/docs/SendInvitationReqObj.md delete mode 100644 invitations/git_push.sh delete mode 100644 invitations/src/apis/configuration.rs delete mode 100644 invitations/src/apis/health_api.rs delete mode 100644 invitations/src/apis/mod.rs delete mode 100644 invitations/src/lib.rs delete mode 100644 invitations/src/models/accept_invitation_request.rs delete mode 100644 invitations/src/models/error.rs delete mode 100644 invitations/src/models/health_res.rs delete mode 100644 invitations/src/models/mod.rs delete mode 100644 journal/.gitignore delete mode 100644 journal/.openapi-generator-ignore delete mode 100644 journal/.openapi-generator/FILES delete mode 100644 journal/.openapi-generator/VERSION delete mode 100644 journal/.travis.yml delete mode 100644 journal/Cargo.toml delete mode 100644 journal/README.md delete mode 100644 journal/docs/Error.md delete mode 100644 journal/docs/HealthApi.md delete mode 100644 journal/docs/HealthInfo.md delete mode 100644 journal/docs/Journal.md delete mode 100644 journal/docs/JournalLogApi.md delete mode 100644 journal/docs/JournalPage.md delete mode 100644 journal/git_push.sh delete mode 100644 journal/src/apis/configuration.rs delete mode 100644 journal/src/apis/health_api.rs delete mode 100644 journal/src/apis/mod.rs delete mode 100644 journal/src/lib.rs delete mode 100644 journal/src/models/error.rs delete mode 100644 journal/src/models/health_info.rs delete mode 100644 journal/src/models/mod.rs delete mode 100644 notifiers/.gitignore delete mode 100644 notifiers/.openapi-generator-ignore delete mode 100644 notifiers/.openapi-generator/FILES delete mode 100644 notifiers/.openapi-generator/VERSION delete mode 100644 notifiers/.travis.yml delete mode 100644 notifiers/Cargo.toml delete mode 100644 notifiers/README.md delete mode 100644 notifiers/docs/CreateSubscription.md delete mode 100644 notifiers/docs/HealthApi.md delete mode 100644 notifiers/docs/HealthInfo.md delete mode 100644 notifiers/docs/NotifiersApi.md delete mode 100644 notifiers/docs/Page.md delete mode 100644 notifiers/docs/Subscription.md delete mode 100644 notifiers/git_push.sh delete mode 100644 notifiers/src/apis/configuration.rs delete mode 100644 notifiers/src/apis/health_api.rs delete mode 100644 notifiers/src/apis/mod.rs delete mode 100644 notifiers/src/lib.rs delete mode 100644 notifiers/src/models/health_info.rs delete mode 100644 notifiers/src/models/mod.rs delete mode 100644 provision/.gitignore delete mode 100644 provision/.openapi-generator-ignore delete mode 100644 provision/.openapi-generator/FILES delete mode 100644 provision/.openapi-generator/VERSION delete mode 100644 provision/.travis.yml delete mode 100644 provision/Cargo.toml delete mode 100644 provision/README.md delete mode 100644 provision/docs/DomainIdMappingPostRequest.md delete mode 100644 provision/docs/HealthApi.md delete mode 100644 provision/docs/HealthInfo.md delete mode 100644 provision/docs/ProvisionApi.md delete mode 100644 provision/git_push.sh delete mode 100644 provision/src/apis/configuration.rs delete mode 100644 provision/src/apis/health_api.rs delete mode 100644 provision/src/apis/mod.rs delete mode 100644 provision/src/lib.rs delete mode 100644 provision/src/models/health_info.rs delete mode 100644 provision/src/models/mod.rs delete mode 100644 readers/.gitignore delete mode 100644 readers/.openapi-generator-ignore delete mode 100644 readers/.openapi-generator/FILES delete mode 100644 readers/.openapi-generator/VERSION delete mode 100644 readers/.travis.yml delete mode 100644 readers/Cargo.toml delete mode 100644 readers/README.md delete mode 100644 readers/docs/HealthApi.md delete mode 100644 readers/docs/HealthInfo.md delete mode 100644 readers/docs/MessagesPage.md delete mode 100644 readers/docs/MessagesPageMessagesInner.md delete mode 100644 readers/docs/ReadersApi.md delete mode 100644 readers/git_push.sh delete mode 100644 readers/src/apis/configuration.rs delete mode 100644 readers/src/apis/health_api.rs delete mode 100644 readers/src/apis/mod.rs delete mode 100644 readers/src/lib.rs delete mode 100644 readers/src/models/health_info.rs delete mode 100644 readers/src/models/mod.rs rename {certs/src => src}/apis/certs_api.rs (61%) rename {channels/src => src}/apis/channels_api.rs (63%) create mode 100644 src/apis/clients_api.rs rename {auth/src => src}/apis/configuration.rs (73%) rename domains/src/apis/roles_api.rs => src/apis/domains_api.rs (61%) rename examples/src/main.rs => src/apis/examples.rs (90%) create mode 100644 src/apis/groups_api.rs rename {invitations/src => src}/apis/invitations_api.rs (89%) rename {journal/src => src}/apis/journal_log_api.rs (91%) rename {auth/src => src}/apis/keys_api.rs (69%) rename {http/src => src}/apis/messages_api.rs (71%) rename {twins/src => src}/apis/mod.rs (90%) rename {notifiers/src => src}/apis/notifiers_api.rs (72%) rename {provision/src => src}/apis/provision_api.rs (70%) rename {readers/src => src}/apis/readers_api.rs (82%) rename {twins/src => src}/apis/states_api.rs (69%) rename {twins/src => src}/apis/twins_api.rs (72%) rename {users/src => src}/apis/users_api.rs (89%) rename {auth/src => src}/lib.rs (56%) create mode 100644 src/main.rs rename {provision/src => src}/models/__domain_id__mapping_post_request.rs (59%) create mode 100644 src/models/accept_invitation_request.rs rename {users/src => src}/models/assign_req_obj.rs (59%) rename {users/src => src}/models/assign_user_req_obj.rs (54%) rename {twins/src => src}/models/attribute.rs (70%) rename {groups/src => src}/models/available_actions_obj.rs (52%) rename {certs/src => src}/models/cert.rs (76%) rename {certs/src => src}/models/certs_page.rs (65%) rename {channels/src => src}/models/channel.rs (83%) rename {channels/src => src}/models/channel_connection_req_schema.rs (59%) rename {channels/src => src}/models/channel_req_obj.rs (72%) rename {channels/src => src}/models/channel_update.rs (62%) create mode 100644 src/models/channel_update_tags.rs rename {channels/src => src}/models/channels_page.rs (54%) create mode 100644 src/models/children_group_req_obj.rs rename {clients/src => src}/models/client.rs (76%) rename {clients/src => src}/models/client_credentials.rs (58%) rename {clients/src => src}/models/client_req_obj.rs (61%) rename {clients/src => src}/models/client_req_obj_credentials.rs (61%) create mode 100644 src/models/client_secret.rs create mode 100644 src/models/client_tags.rs rename {clients/src => src}/models/client_update.rs (54%) rename {clients/src => src}/models/client_with_empty_secret.rs (77%) rename {clients/src => src}/models/client_with_empty_secret_credentials.rs (60%) rename {clients/src => src}/models/clients_page.rs (53%) rename {bootstrap/src => src}/models/config_channels_inner.rs (66%) rename {channels/src => src}/models/connection_req_schema.rs (64%) rename {certs/src => src}/models/create_cert_request.rs (54%) rename {bootstrap/src => src}/models/create_config_request.rs (80%) rename {groups/src => src}/models/create_role_obj.rs (64%) rename {notifiers/src => src}/models/create_subscription.rs (62%) rename {twins/src => src}/models/definition.rs (51%) rename {domains/src => src}/models/domain.rs (80%) rename {domains/src => src}/models/domain_req_obj.rs (64%) rename {domains/src => src}/models/domain_update.rs (66%) rename {domains/src => src}/models/domains_page.rs (54%) create mode 100644 src/models/email.rs create mode 100644 src/models/error.rs rename {groups/src => src}/models/group.rs (83%) rename {groups/src => src}/models/group_req_obj.rs (71%) rename {groups/src => src}/models/group_update.rs (62%) rename {groups/src => src}/models/groups_hierarchy_page.rs (59%) rename {groups/src => src}/models/groups_page.rs (54%) rename {http/src => src}/models/health_info.rs (78%) rename {users/src => src}/models/health_res.rs (74%) rename {invitations/src => src}/models/invitation.rs (82%) rename {invitations/src => src}/models/invitation_page.rs (53%) rename {auth/src => src}/models/issue_key_request.rs (57%) rename {users/src => src}/models/issue_token.rs (53%) rename {users/src => src}/models/issue_token_200_response.rs (65%) rename {journal/src => src}/models/journal.rs (65%) rename {journal/src => src}/models/journal_page.rs (51%) rename {auth/src => src}/models/key.rs (75%) rename {users/src => src}/models/members.rs (78%) rename {users/src => src}/models/members_credentials.rs (57%) rename {users/src => src}/models/members_page.rs (57%) rename {readers/src => src}/models/messages_page.rs (59%) rename {readers/src => src}/models/messages_page_messages_inner.rs (80%) create mode 100644 src/models/mod.rs rename {groups/src => src}/models/new_role.rs (76%) rename {notifiers/src => src}/models/page.rs (64%) rename {clients/src => src}/models/parent_group_req_obj.rs (50%) create mode 100644 src/models/parent_group_req_obj2.rs rename {users/src => src}/models/request_password_reset_request.rs (58%) rename {users/src => src}/models/reset_password_request.rs (64%) rename {certs/src => src}/models/revoke.rs (52%) rename {groups/src => src}/models/role.rs (76%) rename {groups/src => src}/models/role_actions_obj.rs (50%) rename {groups/src => src}/models/role_members_obj.rs (50%) rename {groups/src => src}/models/roles_page.rs (64%) rename {http/src => src}/models/sen_ml_record.rs (84%) rename {invitations/src => src}/models/send_invitation_req_obj.rs (77%) rename {certs/src => src}/models/serial.rs (50%) rename {certs/src => src}/models/serials_page.rs (70%) create mode 100644 src/models/state.rs rename twins/src/models/state.rs => src/models/state2.rs (61%) rename {twins/src => src}/models/states_page.rs (60%) rename {notifiers/src => src}/models/subscription.rs (71%) rename {twins/src => src}/models/twin_req_obj.rs (60%) rename {twins/src => src}/models/twin_res_obj.rs (75%) rename {twins/src => src}/models/twins_page.rs (60%) rename {bootstrap/src => src}/models/update_config_certs_request.rs (64%) rename {bootstrap/src => src}/models/update_config_connections_request.rs (54%) rename {bootstrap/src => src}/models/update_config_request.rs (54%) create mode 100644 src/models/update_config_state_request.rs create mode 100644 src/models/update_role_obj.rs rename {users/src => src}/models/user.rs (80%) rename {users/src => src}/models/user_credentials.rs (51%) rename {users/src => src}/models/user_profile_picture.rs (52%) rename {users/src => src}/models/user_req_obj.rs (72%) rename {users/src => src}/models/user_req_obj_credentials.rs (61%) rename {users/src => src}/models/user_role.rs (59%) rename {users/src => src}/models/user_secret.rs (54%) create mode 100644 src/models/user_tags.rs rename {users/src => src}/models/user_update.rs (60%) create mode 100644 src/models/username.rs rename {users/src => src}/models/users_page.rs (54%) delete mode 100644 twins/.gitignore delete mode 100644 twins/.openapi-generator-ignore delete mode 100644 twins/.openapi-generator/FILES delete mode 100644 twins/.openapi-generator/VERSION delete mode 100644 twins/.travis.yml delete mode 100644 twins/Cargo.toml delete mode 100644 twins/README.md delete mode 100644 twins/docs/Attribute.md delete mode 100644 twins/docs/Definition.md delete mode 100644 twins/docs/HealthApi.md delete mode 100644 twins/docs/HealthInfo.md delete mode 100644 twins/docs/State.md delete mode 100644 twins/docs/StatesApi.md delete mode 100644 twins/docs/StatesPage.md delete mode 100644 twins/docs/TwinReqObj.md delete mode 100644 twins/docs/TwinResObj.md delete mode 100644 twins/docs/TwinsApi.md delete mode 100644 twins/docs/TwinsPage.md delete mode 100644 twins/git_push.sh delete mode 100644 twins/src/apis/configuration.rs delete mode 100644 twins/src/apis/health_api.rs delete mode 100644 twins/src/lib.rs delete mode 100644 twins/src/models/health_info.rs delete mode 100644 twins/src/models/mod.rs delete mode 100644 users/.gitignore delete mode 100644 users/.openapi-generator-ignore delete mode 100644 users/.openapi-generator/FILES delete mode 100644 users/.openapi-generator/VERSION delete mode 100644 users/.travis.yml delete mode 100644 users/Cargo.toml delete mode 100644 users/README.md delete mode 100644 users/docs/AssignReqObj.md delete mode 100644 users/docs/AssignUserReqObj.md delete mode 100644 users/docs/Email.md delete mode 100644 users/docs/Error.md delete mode 100644 users/docs/HealthApi.md delete mode 100644 users/docs/HealthRes.md delete mode 100644 users/docs/IssueToken.md delete mode 100644 users/docs/IssueToken200Response.md delete mode 100644 users/docs/Members.md delete mode 100644 users/docs/MembersCredentials.md delete mode 100644 users/docs/MembersPage.md delete mode 100644 users/docs/RequestPasswordResetRequest.md delete mode 100644 users/docs/ResetPasswordRequest.md delete mode 100644 users/docs/User.md delete mode 100644 users/docs/UserCredentials.md delete mode 100644 users/docs/UserProfilePicture.md delete mode 100644 users/docs/UserReqObj.md delete mode 100644 users/docs/UserReqObjCredentials.md delete mode 100644 users/docs/UserRole.md delete mode 100644 users/docs/UserSecret.md delete mode 100644 users/docs/UserTags.md delete mode 100644 users/docs/UserUpdate.md delete mode 100644 users/docs/Username.md delete mode 100644 users/docs/UsersApi.md delete mode 100644 users/docs/UsersPage.md delete mode 100644 users/git_push.sh delete mode 100644 users/src/apis/configuration.rs delete mode 100644 users/src/apis/health_api.rs delete mode 100644 users/src/apis/mod.rs delete mode 100644 users/src/lib.rs delete mode 100644 users/src/models/email.rs delete mode 100644 users/src/models/error.rs delete mode 100644 users/src/models/mod.rs delete mode 100644 users/src/models/user_tags.rs delete mode 100644 users/src/models/username.rs diff --git a/Cargo.lock b/Cargo.lock index 4e68c221..e2e3316b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,187 +2,6 @@ # It is not intended for manual editing. version = 4 -[[package]] -name = "Auth" -version = "0.15.1" -dependencies = [ - "reqwest", - "serde", - "serde_json", - "serde_repr", - "url", - "uuid", -] - -[[package]] -name = "Bootstrap" -version = "0.15.1" -dependencies = [ - "reqwest", - "serde", - "serde_json", - "serde_repr", - "url", - "uuid", -] - -[[package]] -name = "Certs" -version = "0.15.1" -dependencies = [ - "reqwest", - "serde", - "serde_json", - "serde_repr", - "url", - "uuid", -] - -[[package]] -name = "Channels" -version = "0.15.1" -dependencies = [ - "reqwest", - "serde", - "serde_json", - "serde_repr", - "url", - "uuid", -] - -[[package]] -name = "Clients" -version = "0.15.1" -dependencies = [ - "reqwest", - "serde", - "serde_json", - "serde_repr", - "url", - "uuid", -] - -[[package]] -name = "Domains" -version = "0.15.1" -dependencies = [ - "reqwest", - "serde", - "serde_json", - "serde_repr", - "url", - "uuid", -] - -[[package]] -name = "Groups" -version = "0.15.1" -dependencies = [ - "reqwest", - "serde", - "serde_json", - "serde_repr", - "url", - "uuid", -] - -[[package]] -name = "Http" -version = "0.15.1" -dependencies = [ - "reqwest", - "serde", - "serde_json", - "serde_repr", - "url", - "uuid", -] - -[[package]] -name = "Invitations" -version = "0.15.1" -dependencies = [ - "reqwest", - "serde", - "serde_json", - "serde_repr", - "url", - "uuid", -] - -[[package]] -name = "Journal" -version = "0.15.1" -dependencies = [ - "reqwest", - "serde", - "serde_json", - "serde_repr", - "url", - "uuid", -] - -[[package]] -name = "Notifiers" -version = "0.15.1" -dependencies = [ - "reqwest", - "serde", - "serde_json", - "serde_repr", - "url", - "uuid", -] - -[[package]] -name = "Provision" -version = "0.15.1" -dependencies = [ - "reqwest", - "serde", - "serde_json", - "serde_repr", - "url", - "uuid", -] - -[[package]] -name = "Readers" -version = "0.15.1" -dependencies = [ - "reqwest", - "serde", - "serde_json", - "serde_repr", - "url", - "uuid", -] - -[[package]] -name = "Twins" -version = "0.15.1" -dependencies = [ - "reqwest", - "serde", - "serde_json", - "serde_repr", - "url", - "uuid", -] - -[[package]] -name = "Users" -version = "0.15.1" -dependencies = [ - "reqwest", - "serde", - "serde_json", - "serde_repr", - "tokio", - "url", - "uuid", -] - [[package]] name = "addr2line" version = "0.24.2" @@ -198,12 +17,6 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" - [[package]] name = "autocfg" version = "1.4.0" @@ -222,14 +35,20 @@ dependencies = [ "miniz_oxide", "object", "rustc-demangle", - "windows-targets", + "windows-targets 0.52.6", ] [[package]] name = "base64" -version = "0.22.1" +version = "0.21.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" + +[[package]] +name = "bitflags" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" @@ -316,34 +135,6 @@ dependencies = [ "windows-sys 0.59.0", ] -[[package]] -name = "examples-openapi" -version = "0.15.1" -dependencies = [ - "Auth", - "Bootstrap", - "Certs", - "Channels", - "Clients", - "Domains", - "Groups", - "Http", - "Invitations", - "Journal", - "Notifiers", - "Provision", - "Readers", - "Twins", - "Users", - "reqwest", - "serde", - "serde_json", - "serde_repr", - "tokio", - "url", - "uuid", -] - [[package]] name = "fastrand" version = "2.3.0" @@ -419,17 +210,6 @@ dependencies = [ "pin-utils", ] -[[package]] -name = "getrandom" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" -dependencies = [ - "cfg-if", - "libc", - "wasi", -] - [[package]] name = "gimli" version = "0.31.1" @@ -438,15 +218,15 @@ checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] name = "h2" -version = "0.4.7" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccae279728d634d083c00f6099cb58f01cc99c145b84b8be2f6c74618d79922e" +checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" dependencies = [ - "atomic-waker", "bytes", "fnv", "futures-core", "futures-sink", + "futures-util", "http", "indexmap", "slab", @@ -463,9 +243,9 @@ checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" [[package]] name = "http" -version = "1.2.0" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f16ca2af56261c99fba8bac40a10251ce8188205a4c448fbb745a2e4daa76fea" +checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" dependencies = [ "bytes", "fnv", @@ -474,24 +254,12 @@ dependencies = [ [[package]] name = "http-body" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" -dependencies = [ - "bytes", - "http", -] - -[[package]] -name = "http-body-util" -version = "0.1.2" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" dependencies = [ "bytes", - "futures-util", "http", - "http-body", "pin-project-lite", ] @@ -501,76 +269,47 @@ version = "1.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7d71d3574edd2771538b901e6549113b4006ece66150fb69c0fb6d9a2adae946" +[[package]] +name = "httpdate" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" + [[package]] name = "hyper" -version = "1.5.2" +version = "0.14.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "256fb8d4bd6413123cc9d91832d78325c48ff41677595be797d90f42969beae0" +checksum = "41dfc780fdec9373c01bae43289ea34c972e40ee3c9f6b3c8801a35f35586ce7" dependencies = [ "bytes", "futures-channel", + "futures-core", "futures-util", "h2", "http", "http-body", "httparse", + "httpdate", "itoa", "pin-project-lite", - "smallvec", - "tokio", - "want", -] - -[[package]] -name = "hyper-rustls" -version = "0.27.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6884a48c6826ec44f524c7456b163cebe9e55a18d7b5e307cb4f100371cc767" -dependencies = [ - "futures-util", - "http", - "hyper", - "hyper-util", - "rustls", - "rustls-pki-types", + "socket2", "tokio", - "tokio-rustls", "tower-service", + "tracing", + "want", ] [[package]] name = "hyper-tls" -version = "0.6.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" +checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" dependencies = [ "bytes", - "http-body-util", "hyper", - "hyper-util", "native-tls", "tokio", "tokio-native-tls", - "tower-service", -] - -[[package]] -name = "hyper-util" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df2dcfbe0677734ab2f3ffa7fa7bfd4706bfdc1ef393f2ee30184aed67e631b4" -dependencies = [ - "bytes", - "futures-channel", - "futures-util", - "http", - "http-body", - "hyper", - "pin-project-lite", - "socket2", - "tokio", - "tower-service", - "tracing", ] [[package]] @@ -858,7 +597,7 @@ version = "0.10.68" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6174bc48f102d208783c2c84bf931bb75927a617866870de8a4ea85597f871f5" dependencies = [ - "bitflags", + "bitflags 2.6.0", "cfg-if", "foreign-types", "libc", @@ -916,7 +655,7 @@ dependencies = [ "libc", "redox_syscall", "smallvec", - "windows-targets", + "windows-targets 0.52.6", ] [[package]] @@ -967,14 +706,14 @@ version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" dependencies = [ - "bitflags", + "bitflags 2.6.0", ] [[package]] name = "reqwest" -version = "0.12.9" +version = "0.11.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a77c62af46e79de0a562e1a9849205ffcb7fc1238876e9bd743357570e04046f" +checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" dependencies = [ "base64", "bytes", @@ -984,11 +723,8 @@ dependencies = [ "h2", "http", "http-body", - "http-body-util", "hyper", - "hyper-rustls", "hyper-tls", - "hyper-util", "ipnet", "js-sys", "log", @@ -1011,22 +747,7 @@ dependencies = [ "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "windows-registry", -] - -[[package]] -name = "ring" -version = "0.17.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" -dependencies = [ - "cc", - "cfg-if", - "getrandom", - "libc", - "spin", - "untrusted", - "windows-sys 0.52.0", + "winreg", ] [[package]] @@ -1041,50 +762,20 @@ version = "0.38.42" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f93dc38ecbab2eb790ff964bb77fa94faf256fd3e73285fd7ba0903b76bedb85" dependencies = [ - "bitflags", + "bitflags 2.6.0", "errno", "libc", "linux-raw-sys", "windows-sys 0.59.0", ] -[[package]] -name = "rustls" -version = "0.23.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5065c3f250cbd332cd894be57c40fa52387247659b14a2d6041d121547903b1b" -dependencies = [ - "once_cell", - "rustls-pki-types", - "rustls-webpki", - "subtle", - "zeroize", -] - [[package]] name = "rustls-pemfile" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" -dependencies = [ - "rustls-pki-types", -] - -[[package]] -name = "rustls-pki-types" -version = "1.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2bf47e6ff922db3825eb750c4e2ff784c6ff8fb9e13046ef6a1d1c5401b0b37" - -[[package]] -name = "rustls-webpki" -version = "0.102.8" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" dependencies = [ - "ring", - "rustls-pki-types", - "untrusted", + "base64", ] [[package]] @@ -1108,13 +799,26 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +[[package]] +name = "sdk-rust" +version = "0.15.1" +dependencies = [ + "reqwest", + "serde", + "serde_derive", + "serde_json", + "tokio", + "url", + "uuid", +] + [[package]] name = "security-framework" version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ - "bitflags", + "bitflags 2.6.0", "core-foundation", "core-foundation-sys", "libc", @@ -1163,17 +867,6 @@ dependencies = [ "serde", ] -[[package]] -name = "serde_repr" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "serde_urlencoded" version = "0.7.1" @@ -1226,24 +919,12 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "spin" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" - [[package]] name = "stable_deref_trait" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" -[[package]] -name = "subtle" -version = "2.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" - [[package]] name = "syn" version = "2.0.90" @@ -1257,12 +938,9 @@ dependencies = [ [[package]] name = "sync_wrapper" -version = "1.0.2" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" -dependencies = [ - "futures-core", -] +checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" [[package]] name = "synstructure" @@ -1277,20 +955,20 @@ dependencies = [ [[package]] name = "system-configuration" -version = "0.6.1" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" +checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" dependencies = [ - "bitflags", + "bitflags 1.3.2", "core-foundation", "system-configuration-sys", ] [[package]] name = "system-configuration-sys" -version = "0.6.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" +checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" dependencies = [ "core-foundation-sys", "libc", @@ -1358,16 +1036,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-rustls" -version = "0.26.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f6d0975eaace0cf0fcadee4e4aaa5da15b5c079146f2cffb67c113be122bf37" -dependencies = [ - "rustls", - "tokio", -] - [[package]] name = "tokio-util" version = "0.7.13" @@ -1424,12 +1092,6 @@ version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" -[[package]] -name = "untrusted" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" - [[package]] name = "url" version = "2.5.4" @@ -1459,7 +1121,6 @@ version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8c5f0a0af699448548ad1a2fbf920fb4bee257eae39953ba95cb84891a0446a" dependencies = [ - "getrandom", "serde", ] @@ -1562,33 +1223,12 @@ dependencies = [ ] [[package]] -name = "windows-registry" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e400001bb720a623c1c69032f8e3e4cf09984deec740f007dd2b03ec864804b0" -dependencies = [ - "windows-result", - "windows-strings", - "windows-targets", -] - -[[package]] -name = "windows-result" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" -dependencies = [ - "windows-targets", -] - -[[package]] -name = "windows-strings" -version = "0.1.0" +name = "windows-sys" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-result", - "windows-targets", + "windows-targets 0.48.5", ] [[package]] @@ -1597,7 +1237,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets", + "windows-targets 0.52.6", ] [[package]] @@ -1606,7 +1246,22 @@ version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" dependencies = [ - "windows-targets", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", ] [[package]] @@ -1615,28 +1270,46 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", "windows_i686_gnullvm", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", ] +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + [[package]] name = "windows_aarch64_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + [[package]] name = "windows_aarch64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + [[package]] name = "windows_i686_gnu" version = "0.52.6" @@ -1649,30 +1322,64 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + [[package]] name = "windows_i686_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + [[package]] name = "windows_x86_64_gnu" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + [[package]] name = "windows_x86_64_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + [[package]] name = "windows_x86_64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" +[[package]] +name = "winreg" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" +dependencies = [ + "cfg-if", + "windows-sys 0.48.0", +] + [[package]] name = "write16" version = "1.0.0" @@ -1730,12 +1437,6 @@ dependencies = [ "synstructure", ] -[[package]] -name = "zeroize" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" - [[package]] name = "zerovec" version = "0.10.4" diff --git a/Cargo.toml b/Cargo.toml index 23b6fd52..6798121a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,21 +1,21 @@ -[workspace] -members = [ - "auth", - "bootstrap", - "certs", - "channels", - "clients", - "domains", - "examples", - "groups", - "http", - "invitations", - "journal", - "notifiers", - "provision", - "readers", - "twins", - "users" +[package] +name = "sdk-rust" +version = "0.15.1" +authors = ["info@abstractmachines.fr"] +description = "This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) " +license = "Apache 2.0" +edition = "2018" -] +[dependencies] +serde = "^1.0" +serde_derive = "^1.0" +serde_json = "^1.0" +url = "^2.2" +uuid = { version = "^1.0", features = ["serde"] } +tokio = { version = "1", features = ["full"] } + + +[dependencies.reqwest] +version = "^0.11" +features = ["json", "multipart"] diff --git a/auth/.gitignore b/auth/.gitignore deleted file mode 100644 index 6aa10640..00000000 --- a/auth/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/target/ -**/*.rs.bk -Cargo.lock diff --git a/auth/.openapi-generator-ignore b/auth/.openapi-generator-ignore deleted file mode 100644 index 7484ee59..00000000 --- a/auth/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/auth/.openapi-generator/FILES b/auth/.openapi-generator/FILES deleted file mode 100644 index b5ce70fc..00000000 --- a/auth/.openapi-generator/FILES +++ /dev/null @@ -1,20 +0,0 @@ -.gitignore -.openapi-generator-ignore -.travis.yml -Cargo.toml -README.md -docs/HealthApi.md -docs/HealthInfo.md -docs/IssueKeyRequest.md -docs/Key.md -docs/KeysApi.md -git_push.sh -src/apis/configuration.rs -src/apis/health_api.rs -src/apis/keys_api.rs -src/apis/mod.rs -src/lib.rs -src/models/health_info.rs -src/models/issue_key_request.rs -src/models/key.rs -src/models/mod.rs diff --git a/auth/.openapi-generator/VERSION b/auth/.openapi-generator/VERSION deleted file mode 100644 index 758bb9c8..00000000 --- a/auth/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -7.10.0 diff --git a/auth/.travis.yml b/auth/.travis.yml deleted file mode 100644 index 22761ba7..00000000 --- a/auth/.travis.yml +++ /dev/null @@ -1 +0,0 @@ -language: rust diff --git a/auth/Cargo.toml b/auth/Cargo.toml deleted file mode 100644 index 2f51b962..00000000 --- a/auth/Cargo.toml +++ /dev/null @@ -1,15 +0,0 @@ -[package] -name = "Auth" -version = "0.15.1" -authors = ["info@abstractmachines.fr"] -description = "This is the Auth Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) " -license = "Apache 2.0" -edition = "2021" - -[dependencies] -serde = { version = "^1.0", features = ["derive"] } -serde_json = "^1.0" -serde_repr = "^0.1" -url = "^2.5" -uuid = { version = "^1.8", features = ["serde", "v4"] } -reqwest = { version = "^0.12", features = ["json", "multipart"] } diff --git a/auth/README.md b/auth/README.md deleted file mode 100644 index e02118ce..00000000 --- a/auth/README.md +++ /dev/null @@ -1,54 +0,0 @@ -# Rust API client for openapi - -This is the Auth Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. -Some useful links: -- [The SuperMQ repository](https://github.com/absmach/supermq) - - - -## Overview - -This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://openapis.org) from a remote server, you can easily generate an API client. - -- API version: 0.15.1 -- Package version: 0.15.1 -- Generator version: 7.10.0 -- Build package: `org.openapitools.codegen.languages.RustClientCodegen` - -## Installation - -Put the package under your project folder in a directory named `openapi` and add the following to `Cargo.toml` under `[dependencies]`: - -``` -openapi = { path = "./openapi" } -``` - -## Documentation for API Endpoints - -All URIs are relative to *http://localhost:9001* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*HealthApi* | [**health_get**](docs/HealthApi.md#health_get) | **GET** /health | Retrieves service health check info. -*KeysApi* | [**get_key**](docs/KeysApi.md#get_key) | **GET** /keys/{keyID} | Gets API key details. -*KeysApi* | [**issue_key**](docs/KeysApi.md#issue_key) | **POST** /keys | Issue API key -*KeysApi* | [**revoke_key**](docs/KeysApi.md#revoke_key) | **DELETE** /keys/{keyID} | Revoke API key - - -## Documentation For Models - - - [HealthInfo](docs/HealthInfo.md) - - [IssueKeyRequest](docs/IssueKeyRequest.md) - - [Key](docs/Key.md) - - -To get access to the crate's generated documentation, use: - -``` -cargo doc --open -``` - -## Author - -info@abstractmachines.fr - diff --git a/auth/docs/HealthApi.md b/auth/docs/HealthApi.md deleted file mode 100644 index 72a6cd65..00000000 --- a/auth/docs/HealthApi.md +++ /dev/null @@ -1,34 +0,0 @@ -# \HealthApi - -All URIs are relative to *http://localhost:9001* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**health_get**](HealthApi.md#health_get) | **GET** /health | Retrieves service health check info. - - - -## health_get - -> models::HealthInfo health_get() -Retrieves service health check info. - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -[**models::HealthInfo**](health_info.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/health+json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/auth/docs/HealthInfo.md b/auth/docs/HealthInfo.md deleted file mode 100644 index ee8f5c6b..00000000 --- a/auth/docs/HealthInfo.md +++ /dev/null @@ -1,16 +0,0 @@ -# HealthInfo - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | Option<**String**> | Service status. | [optional] -**version** | Option<**String**> | Service version. | [optional] -**commit** | Option<**String**> | Service commit hash. | [optional] -**description** | Option<**String**> | Service description. | [optional] -**build_time** | Option<**String**> | Service build time. | [optional] -**instance_id** | Option<**String**> | Service instance ID. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/auth/docs/IssueKeyRequest.md b/auth/docs/IssueKeyRequest.md deleted file mode 100644 index 40a55b68..00000000 --- a/auth/docs/IssueKeyRequest.md +++ /dev/null @@ -1,12 +0,0 @@ -# IssueKeyRequest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**r#type** | Option<**i32**> | API key type. Keys of different type are processed differently. | [optional] -**duration** | Option<**f64**> | Number of seconds issued token is valid for. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/auth/docs/Key.md b/auth/docs/Key.md deleted file mode 100644 index 4e045d67..00000000 --- a/auth/docs/Key.md +++ /dev/null @@ -1,16 +0,0 @@ -# Key - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | API key unique identifier | [optional] -**issuer_id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | In ID of the entity that issued the token. | [optional] -**r#type** | Option<**i32**> | API key type. Keys of different type are processed differently. | [optional] -**subject** | Option<**String**> | User's email or service identifier of API key subject. | [optional] -**issued_at** | Option<**String**> | Time when the key is generated. | [optional] -**expires_at** | Option<**String**> | Time when the Key expires. If this field is missing, that means that Key is valid indefinitely. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/auth/docs/KeysApi.md b/auth/docs/KeysApi.md deleted file mode 100644 index f73b4ccc..00000000 --- a/auth/docs/KeysApi.md +++ /dev/null @@ -1,101 +0,0 @@ -# \KeysApi - -All URIs are relative to *http://localhost:9001* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**get_key**](KeysApi.md#get_key) | **GET** /keys/{keyID} | Gets API key details. -[**issue_key**](KeysApi.md#issue_key) | **POST** /keys | Issue API key -[**revoke_key**](KeysApi.md#revoke_key) | **DELETE** /keys/{keyID} | Revoke API key - - - -## get_key - -> models::Key get_key(key_id) -Gets API key details. - -Gets API key details for the given key. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**key_id** | **uuid::Uuid** | API Key ID. | [required] | - -### Return type - -[**models::Key**](Key.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## issue_key - -> issue_key(issue_key_request) -Issue API key - -Generates a new API key. Thew new API key will be uniquely identified by its ID. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**issue_key_request** | [**IssueKeyRequest**](IssueKeyRequest.md) | JSON-formatted document describing key request. | [required] | - -### Return type - - (empty response body) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## revoke_key - -> revoke_key(key_id) -Revoke API key - -Revoke API key identified by the given ID. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**key_id** | **uuid::Uuid** | API Key ID. | [required] | - -### Return type - - (empty response body) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/auth/git_push.sh b/auth/git_push.sh deleted file mode 100644 index f53a75d4..00000000 --- a/auth/git_push.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 -git_host=$4 - -if [ "$git_host" = "" ]; then - git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" -fi - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' diff --git a/auth/src/apis/health_api.rs b/auth/src/apis/health_api.rs deleted file mode 100644 index ea1aca7e..00000000 --- a/auth/src/apis/health_api.rs +++ /dev/null @@ -1,53 +0,0 @@ -/* - * SuperMQ Auth Service - * - * This is the Auth Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - - -use reqwest; -use serde::{Deserialize, Serialize}; -use crate::{apis::ResponseContent, models}; -use super::{Error, configuration}; - - -/// struct for typed errors of method [`health_get`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum HealthGetError { - Status500(), - UnknownValue(serde_json::Value), -} - - -pub async fn health_get(configuration: &configuration::Configuration, ) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/health", local_var_configuration.base_path); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - diff --git a/auth/src/apis/mod.rs b/auth/src/apis/mod.rs deleted file mode 100644 index 8e7db9cd..00000000 --- a/auth/src/apis/mod.rs +++ /dev/null @@ -1,96 +0,0 @@ -use std::error; -use std::fmt; - -#[derive(Debug, Clone)] -pub struct ResponseContent { - pub status: reqwest::StatusCode, - pub content: String, - pub entity: Option, -} - -#[derive(Debug)] -pub enum Error { - Reqwest(reqwest::Error), - Serde(serde_json::Error), - Io(std::io::Error), - ResponseError(ResponseContent), -} - -impl fmt::Display for Error { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - let (module, e) = match self { - Error::Reqwest(e) => ("reqwest", e.to_string()), - Error::Serde(e) => ("serde", e.to_string()), - Error::Io(e) => ("IO", e.to_string()), - Error::ResponseError(e) => ("response", format!("status code {}", e.status)), - }; - write!(f, "error in {}: {}", module, e) - } -} - -impl error::Error for Error { - fn source(&self) -> Option<&(dyn error::Error + 'static)> { - Some(match self { - Error::Reqwest(e) => e, - Error::Serde(e) => e, - Error::Io(e) => e, - Error::ResponseError(_) => return None, - }) - } -} - -impl From for Error { - fn from(e: reqwest::Error) -> Self { - Error::Reqwest(e) - } -} - -impl From for Error { - fn from(e: serde_json::Error) -> Self { - Error::Serde(e) - } -} - -impl From for Error { - fn from(e: std::io::Error) -> Self { - Error::Io(e) - } -} - -pub fn urlencode>(s: T) -> String { - ::url::form_urlencoded::byte_serialize(s.as_ref().as_bytes()).collect() -} - -pub fn parse_deep_object(prefix: &str, value: &serde_json::Value) -> Vec<(String, String)> { - if let serde_json::Value::Object(object) = value { - let mut params = vec![]; - - for (key, value) in object { - match value { - serde_json::Value::Object(_) => params.append(&mut parse_deep_object( - &format!("{}[{}]", prefix, key), - value, - )), - serde_json::Value::Array(array) => { - for (i, value) in array.iter().enumerate() { - params.append(&mut parse_deep_object( - &format!("{}[{}][{}]", prefix, key, i), - value, - )); - } - }, - serde_json::Value::String(s) => params.push((format!("{}[{}]", prefix, key), s.clone())), - _ => params.push((format!("{}[{}]", prefix, key), value.to_string())), - } - } - - return params; - } - - unimplemented!("Only objects are supported with style=deepObject") -} - -pub mod health_api; -pub mod keys_api; - -pub mod configuration; diff --git a/auth/src/models/health_info.rs b/auth/src/models/health_info.rs deleted file mode 100644 index 57989142..00000000 --- a/auth/src/models/health_info.rs +++ /dev/null @@ -1,60 +0,0 @@ -/* - * SuperMQ Auth Service - * - * This is the Auth Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct HealthInfo { - /// Service status. - #[serde(rename = "status", skip_serializing_if = "Option::is_none")] - pub status: Option, - /// Service version. - #[serde(rename = "version", skip_serializing_if = "Option::is_none")] - pub version: Option, - /// Service commit hash. - #[serde(rename = "commit", skip_serializing_if = "Option::is_none")] - pub commit: Option, - /// Service description. - #[serde(rename = "description", skip_serializing_if = "Option::is_none")] - pub description: Option, - /// Service build time. - #[serde(rename = "build_time", skip_serializing_if = "Option::is_none")] - pub build_time: Option, - /// Service instance ID. - #[serde(rename = "instance_id", skip_serializing_if = "Option::is_none")] - pub instance_id: Option, -} - -impl HealthInfo { - pub fn new() -> HealthInfo { - HealthInfo { - status: None, - version: None, - commit: None, - description: None, - build_time: None, - instance_id: None, - } - } -} -/// Service status. -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum Status { - #[serde(rename = "pass")] - Pass, -} - -impl Default for Status { - fn default() -> Status { - Self::Pass - } -} - diff --git a/auth/src/models/mod.rs b/auth/src/models/mod.rs deleted file mode 100644 index 96615106..00000000 --- a/auth/src/models/mod.rs +++ /dev/null @@ -1,6 +0,0 @@ -pub mod health_info; -pub use self::health_info::HealthInfo; -pub mod issue_key_request; -pub use self::issue_key_request::IssueKeyRequest; -pub mod key; -pub use self::key::Key; diff --git a/bootstrap/.gitignore b/bootstrap/.gitignore deleted file mode 100644 index 6aa10640..00000000 --- a/bootstrap/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/target/ -**/*.rs.bk -Cargo.lock diff --git a/bootstrap/.openapi-generator-ignore b/bootstrap/.openapi-generator-ignore deleted file mode 100644 index 7484ee59..00000000 --- a/bootstrap/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/bootstrap/.openapi-generator/FILES b/bootstrap/.openapi-generator/FILES deleted file mode 100644 index 3e242e18..00000000 --- a/bootstrap/.openapi-generator/FILES +++ /dev/null @@ -1,38 +0,0 @@ -.gitignore -.openapi-generator-ignore -.travis.yml -Cargo.toml -README.md -docs/BootstrapConfig.md -docs/Config.md -docs/ConfigChannelsInner.md -docs/ConfigList.md -docs/ConfigUpdateCerts.md -docs/ConfigsApi.md -docs/CreateConfigRequest.md -docs/HealthApi.md -docs/HealthInfo.md -docs/State.md -docs/UpdateConfigCertsRequest.md -docs/UpdateConfigConnectionsRequest.md -docs/UpdateConfigRequest.md -docs/UpdateConfigStateRequest.md -git_push.sh -src/apis/configs_api.rs -src/apis/configuration.rs -src/apis/health_api.rs -src/apis/mod.rs -src/lib.rs -src/models/bootstrap_config.rs -src/models/config.rs -src/models/config_channels_inner.rs -src/models/config_list.rs -src/models/config_update_certs.rs -src/models/create_config_request.rs -src/models/health_info.rs -src/models/mod.rs -src/models/state.rs -src/models/update_config_certs_request.rs -src/models/update_config_connections_request.rs -src/models/update_config_request.rs -src/models/update_config_state_request.rs diff --git a/bootstrap/.openapi-generator/VERSION b/bootstrap/.openapi-generator/VERSION deleted file mode 100644 index 758bb9c8..00000000 --- a/bootstrap/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -7.10.0 diff --git a/bootstrap/.travis.yml b/bootstrap/.travis.yml deleted file mode 100644 index 22761ba7..00000000 --- a/bootstrap/.travis.yml +++ /dev/null @@ -1 +0,0 @@ -language: rust diff --git a/bootstrap/Cargo.toml b/bootstrap/Cargo.toml deleted file mode 100644 index 79276bbc..00000000 --- a/bootstrap/Cargo.toml +++ /dev/null @@ -1,15 +0,0 @@ -[package] -name = "Bootstrap" -version = "0.15.1" -authors = ["info@abstractmachines.fr"] -description = "HTTP API for managing platform clients configuration. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) " -license = "Apache 2.0" -edition = "2021" - -[dependencies] -serde = { version = "^1.0", features = ["derive"] } -serde_json = "^1.0" -serde_repr = "^0.1" -url = "^2.5" -uuid = { version = "^1.8", features = ["serde", "v4"] } -reqwest = { version = "^0.12", features = ["json", "multipart"] } diff --git a/bootstrap/README.md b/bootstrap/README.md deleted file mode 100644 index ea96ac88..00000000 --- a/bootstrap/README.md +++ /dev/null @@ -1,70 +0,0 @@ -# Rust API client for openapi - -HTTP API for managing platform clients configuration. -Some useful links: -- [The SuperMQ repository](https://github.com/absmach/supermq) - - - -## Overview - -This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://openapis.org) from a remote server, you can easily generate an API client. - -- API version: 0.15.1 -- Package version: 0.15.1 -- Generator version: 7.10.0 -- Build package: `org.openapitools.codegen.languages.RustClientCodegen` - -## Installation - -Put the package under your project folder in a directory named `openapi` and add the following to `Cargo.toml` under `[dependencies]`: - -``` -openapi = { path = "./openapi" } -``` - -## Documentation for API Endpoints - -All URIs are relative to *http://localhost:9013* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*ConfigsApi* | [**create_config**](docs/ConfigsApi.md#create_config) | **POST** /{domainID}/clients/configs | Adds new config -*ConfigsApi* | [**get_bootstrap_config**](docs/ConfigsApi.md#get_bootstrap_config) | **GET** /clients/bootstrap/{externalId} | Retrieves configuration. -*ConfigsApi* | [**get_config**](docs/ConfigsApi.md#get_config) | **GET** /{domainID}/clients/configs/{configId} | Retrieves config info (with channels). -*ConfigsApi* | [**get_configs**](docs/ConfigsApi.md#get_configs) | **GET** /{domainID}/clients/configs | Retrieves managed configs -*ConfigsApi* | [**get_secure_bootstrap_config**](docs/ConfigsApi.md#get_secure_bootstrap_config) | **GET** /clients/bootstrap/secure/{externalId} | Retrieves configuration. -*ConfigsApi* | [**remove_config**](docs/ConfigsApi.md#remove_config) | **DELETE** /{domainID}/clients/configs/{configId} | Removes a Config -*ConfigsApi* | [**update_config**](docs/ConfigsApi.md#update_config) | **PUT** /{domainID}/clients/configs/{configId} | Updates config info -*ConfigsApi* | [**update_config_certs**](docs/ConfigsApi.md#update_config_certs) | **PATCH** /{domainID}/clients/configs/certs/{configId} | Updates certs -*ConfigsApi* | [**update_config_connections**](docs/ConfigsApi.md#update_config_connections) | **PUT** /{domainID}/clients/configs/connections/{configId} | Updates channels the client is connected to -*ConfigsApi* | [**update_config_state**](docs/ConfigsApi.md#update_config_state) | **PUT** /{domainID}/clients/state/{configId} | Updates Config state. -*HealthApi* | [**health_get**](docs/HealthApi.md#health_get) | **GET** /health | Retrieves service health check info. - - -## Documentation For Models - - - [BootstrapConfig](docs/BootstrapConfig.md) - - [Config](docs/Config.md) - - [ConfigChannelsInner](docs/ConfigChannelsInner.md) - - [ConfigList](docs/ConfigList.md) - - [ConfigUpdateCerts](docs/ConfigUpdateCerts.md) - - [CreateConfigRequest](docs/CreateConfigRequest.md) - - [HealthInfo](docs/HealthInfo.md) - - [State](docs/State.md) - - [UpdateConfigCertsRequest](docs/UpdateConfigCertsRequest.md) - - [UpdateConfigConnectionsRequest](docs/UpdateConfigConnectionsRequest.md) - - [UpdateConfigRequest](docs/UpdateConfigRequest.md) - - [UpdateConfigStateRequest](docs/UpdateConfigStateRequest.md) - - -To get access to the crate's generated documentation, use: - -``` -cargo doc --open -``` - -## Author - -info@abstractmachines.fr - diff --git a/bootstrap/docs/BootstrapConfig.md b/bootstrap/docs/BootstrapConfig.md deleted file mode 100644 index a90d0495..00000000 --- a/bootstrap/docs/BootstrapConfig.md +++ /dev/null @@ -1,15 +0,0 @@ -# BootstrapConfig - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**client_id** | [**uuid::Uuid**](uuid::Uuid.md) | Corresponding SuperMQ Client ID. | -**client_key** | [**uuid::Uuid**](uuid::Uuid.md) | Corresponding SuperMQ Client key. | -**channels** | **Vec** | | -**content** | **String** | Free-form custom configuration. | -**client_cert** | Option<**String**> | Client certificate. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/bootstrap/docs/Config.md b/bootstrap/docs/Config.md deleted file mode 100644 index 31e509bd..00000000 --- a/bootstrap/docs/Config.md +++ /dev/null @@ -1,19 +0,0 @@ -# Config - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**client_id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | Corresponding SuperMQ Client ID. | [optional] -**magistrala_secret** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | Corresponding SuperMQ Client key. | [optional] -**channels** | Option<[**Vec**](Config_channels_inner.md)> | | [optional] -**external_id** | **String** | External ID (MAC address or some unique identifier). | -**external_key** | **String** | External key. | -**content** | Option<**String**> | Free-form custom configuration. | [optional] -**state** | Option<[**models::State**](State.md)> | | [optional] -**client_cert** | Option<**String**> | Client certificate. | [optional] -**ca_cert** | Option<**String**> | Issuing CA certificate. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/bootstrap/docs/ConfigChannelsInner.md b/bootstrap/docs/ConfigChannelsInner.md deleted file mode 100644 index c5eebad4..00000000 --- a/bootstrap/docs/ConfigChannelsInner.md +++ /dev/null @@ -1,13 +0,0 @@ -# ConfigChannelsInner - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | Channel unique identifier. | [optional] -**name** | Option<**String**> | Name of the Channel. | [optional] -**metadata** | Option<[**serde_json::Value**](.md)> | Custom metadata related to the Channel. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/bootstrap/docs/ConfigList.md b/bootstrap/docs/ConfigList.md deleted file mode 100644 index c9295b8f..00000000 --- a/bootstrap/docs/ConfigList.md +++ /dev/null @@ -1,14 +0,0 @@ -# ConfigList - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**total** | Option<**i32**> | Total number of results. | [optional] -**offset** | Option<**i32**> | Number of items to skip during retrieval. | [optional][default to 0] -**limit** | Option<**i32**> | Size of the subset to retrieve. | [optional][default to 10] -**configs** | [**Vec**](Config.md) | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/bootstrap/docs/ConfigUpdateCerts.md b/bootstrap/docs/ConfigUpdateCerts.md deleted file mode 100644 index 7bd616c9..00000000 --- a/bootstrap/docs/ConfigUpdateCerts.md +++ /dev/null @@ -1,14 +0,0 @@ -# ConfigUpdateCerts - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**client_id** | [**uuid::Uuid**](uuid::Uuid.md) | Corresponding SuperMQ Client ID. | -**client_cert** | Option<**String**> | Client certificate. | [optional] -**client_key** | **String** | Key for the client_cert. | -**ca_cert** | Option<**String**> | Issuing CA certificate. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/bootstrap/docs/ConfigsApi.md b/bootstrap/docs/ConfigsApi.md deleted file mode 100644 index bd125a22..00000000 --- a/bootstrap/docs/ConfigsApi.md +++ /dev/null @@ -1,331 +0,0 @@ -# \ConfigsApi - -All URIs are relative to *http://localhost:9013* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**create_config**](ConfigsApi.md#create_config) | **POST** /{domainID}/clients/configs | Adds new config -[**get_bootstrap_config**](ConfigsApi.md#get_bootstrap_config) | **GET** /clients/bootstrap/{externalId} | Retrieves configuration. -[**get_config**](ConfigsApi.md#get_config) | **GET** /{domainID}/clients/configs/{configId} | Retrieves config info (with channels). -[**get_configs**](ConfigsApi.md#get_configs) | **GET** /{domainID}/clients/configs | Retrieves managed configs -[**get_secure_bootstrap_config**](ConfigsApi.md#get_secure_bootstrap_config) | **GET** /clients/bootstrap/secure/{externalId} | Retrieves configuration. -[**remove_config**](ConfigsApi.md#remove_config) | **DELETE** /{domainID}/clients/configs/{configId} | Removes a Config -[**update_config**](ConfigsApi.md#update_config) | **PUT** /{domainID}/clients/configs/{configId} | Updates config info -[**update_config_certs**](ConfigsApi.md#update_config_certs) | **PATCH** /{domainID}/clients/configs/certs/{configId} | Updates certs -[**update_config_connections**](ConfigsApi.md#update_config_connections) | **PUT** /{domainID}/clients/configs/connections/{configId} | Updates channels the client is connected to -[**update_config_state**](ConfigsApi.md#update_config_state) | **PUT** /{domainID}/clients/state/{configId} | Updates Config state. - - - -## create_config - -> create_config(domain_id, create_config_request) -Adds new config - -Adds new config to the list of config owned by user identified using the provided access token. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**create_config_request** | [**CreateConfigRequest**](CreateConfigRequest.md) | JSON-formatted document describing the new config. | [required] | - -### Return type - - (empty response body) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## get_bootstrap_config - -> models::BootstrapConfig get_bootstrap_config(external_id) -Retrieves configuration. - -Retrieves a configuration with given external ID and external key. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**external_id** | **String** | Unique Config identifier provided by external entity. | [required] | - -### Return type - -[**models::BootstrapConfig**](BootstrapConfig.md) - -### Authorization - -[bootstrapAuth](../README.md#bootstrapAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## get_config - -> models::Config get_config(domain_id, config_id) -Retrieves config info (with channels). - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**config_id** | **uuid::Uuid** | Unique Config identifier. It's the ID of the corresponding Client. | [required] | - -### Return type - -[**models::Config**](Config.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## get_configs - -> models::ConfigList get_configs(domain_id, limit, offset, state, name) -Retrieves managed configs - -Retrieves a list of managed configs. Due to performance concerns, data is retrieved in subsets. The API configs must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**limit** | Option<**i32**> | Size of the subset to retrieve. | |[default to 10] -**offset** | Option<**i32**> | Number of items to skip during retrieval. | |[default to 0] -**state** | Option<[**State**](.md)> | A state of items | | -**name** | Option<**String**> | Name of the config. Search by name is partial-match and case-insensitive. | | - -### Return type - -[**models::ConfigList**](ConfigList.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## get_secure_bootstrap_config - -> models::BootstrapConfig get_secure_bootstrap_config(external_id) -Retrieves configuration. - -Retrieves a configuration with given external ID and encrypted external key. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**external_id** | **String** | Unique Config identifier provided by external entity. | [required] | - -### Return type - -[**models::BootstrapConfig**](BootstrapConfig.md) - -### Authorization - -[bootstrapEncAuth](../README.md#bootstrapEncAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## remove_config - -> remove_config(domain_id, config_id) -Removes a Config - -Removes a Config. In case of successful removal the service will ensure that the removed config is disconnected from all of the SuperMQ channels. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**config_id** | **uuid::Uuid** | Unique Config identifier. It's the ID of the corresponding Client. | [required] | - -### Return type - - (empty response body) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## update_config - -> update_config(domain_id, config_id, update_config_request) -Updates config info - -Update is performed by replacing the current resource data with values provided in a request payload. Note that the owner, ID, external ID, external key, SuperMQ Client ID and key cannot be changed. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**config_id** | **uuid::Uuid** | Unique Config identifier. It's the ID of the corresponding Client. | [required] | -**update_config_request** | Option<[**UpdateConfigRequest**](UpdateConfigRequest.md)> | JSON-formatted document describing the updated client. | | - -### Return type - - (empty response body) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## update_config_certs - -> models::ConfigUpdateCerts update_config_certs(domain_id, config_id, update_config_certs_request) -Updates certs - -Update is performed by replacing the current certificate data with values provided in a request payload. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**config_id** | **uuid::Uuid** | Unique Config identifier. It's the ID of the corresponding Client. | [required] | -**update_config_certs_request** | Option<[**UpdateConfigCertsRequest**](UpdateConfigCertsRequest.md)> | JSON-formatted document describing the updated client. | | - -### Return type - -[**models::ConfigUpdateCerts**](ConfigUpdateCerts.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## update_config_connections - -> update_config_connections(domain_id, config_id, update_config_connections_request) -Updates channels the client is connected to - -Update connections performs update of the channel list corresponding Client is connected to. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**config_id** | **uuid::Uuid** | Unique Config identifier. It's the ID of the corresponding Client. | [required] | -**update_config_connections_request** | Option<[**UpdateConfigConnectionsRequest**](UpdateConfigConnectionsRequest.md)> | Array if IDs the client is be connected to. | | - -### Return type - - (empty response body) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## update_config_state - -> update_config_state(domain_id, config_id, update_config_state_request) -Updates Config state. - -Updating state represents enabling/disabling Config, i.e. connecting and disconnecting corresponding SuperMQ Client to the list of Channels. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**config_id** | **uuid::Uuid** | Unique Config identifier. It's the ID of the corresponding Client. | [required] | -**update_config_state_request** | Option<[**UpdateConfigStateRequest**](UpdateConfigStateRequest.md)> | Update the state of the Config. | | - -### Return type - - (empty response body) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/bootstrap/docs/CreateConfigRequest.md b/bootstrap/docs/CreateConfigRequest.md deleted file mode 100644 index ccc0089e..00000000 --- a/bootstrap/docs/CreateConfigRequest.md +++ /dev/null @@ -1,19 +0,0 @@ -# CreateConfigRequest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**external_id** | **String** | External ID (MAC address or some unique identifier). | -**external_key** | **String** | External key. | -**client_id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | ID of the corresponding SuperMQ Client. | [optional] -**channels** | Option<[**Vec**](uuid::Uuid.md)> | | [optional] -**content** | Option<**String**> | | [optional] -**name** | Option<**String**> | | [optional] -**client_cert** | Option<**String**> | Client Certificate. | [optional] -**client_key** | Option<**String**> | Client Private Key. | [optional] -**ca_cert** | Option<**String**> | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/bootstrap/docs/HealthApi.md b/bootstrap/docs/HealthApi.md deleted file mode 100644 index dc7ff32d..00000000 --- a/bootstrap/docs/HealthApi.md +++ /dev/null @@ -1,34 +0,0 @@ -# \HealthApi - -All URIs are relative to *http://localhost:9013* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**health_get**](HealthApi.md#health_get) | **GET** /health | Retrieves service health check info. - - - -## health_get - -> models::HealthInfo health_get() -Retrieves service health check info. - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -[**models::HealthInfo**](health_info.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/health+json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/bootstrap/docs/HealthInfo.md b/bootstrap/docs/HealthInfo.md deleted file mode 100644 index ee8f5c6b..00000000 --- a/bootstrap/docs/HealthInfo.md +++ /dev/null @@ -1,16 +0,0 @@ -# HealthInfo - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | Option<**String**> | Service status. | [optional] -**version** | Option<**String**> | Service version. | [optional] -**commit** | Option<**String**> | Service commit hash. | [optional] -**description** | Option<**String**> | Service description. | [optional] -**build_time** | Option<**String**> | Service build time. | [optional] -**instance_id** | Option<**String**> | Service instance ID. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/bootstrap/docs/State.md b/bootstrap/docs/State.md deleted file mode 100644 index 72082fdb..00000000 --- a/bootstrap/docs/State.md +++ /dev/null @@ -1,13 +0,0 @@ -# State - -## Enum Variants - -| Name | Value | -|---- | -----| -| Variant0 | 0 | -| Variant1 | 1 | - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/bootstrap/docs/UpdateConfigCertsRequest.md b/bootstrap/docs/UpdateConfigCertsRequest.md deleted file mode 100644 index 322c03d5..00000000 --- a/bootstrap/docs/UpdateConfigCertsRequest.md +++ /dev/null @@ -1,13 +0,0 @@ -# UpdateConfigCertsRequest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**client_cert** | Option<**String**> | | [optional] -**client_key** | Option<**String**> | | [optional] -**ca_cert** | Option<**String**> | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/bootstrap/docs/UpdateConfigConnectionsRequest.md b/bootstrap/docs/UpdateConfigConnectionsRequest.md deleted file mode 100644 index 253be96c..00000000 --- a/bootstrap/docs/UpdateConfigConnectionsRequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# UpdateConfigConnectionsRequest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**channels** | Option<[**Vec**](uuid::Uuid.md)> | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/bootstrap/docs/UpdateConfigRequest.md b/bootstrap/docs/UpdateConfigRequest.md deleted file mode 100644 index e3b0ce67..00000000 --- a/bootstrap/docs/UpdateConfigRequest.md +++ /dev/null @@ -1,12 +0,0 @@ -# UpdateConfigRequest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**content** | **String** | | -**name** | **String** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/bootstrap/docs/UpdateConfigStateRequest.md b/bootstrap/docs/UpdateConfigStateRequest.md deleted file mode 100644 index 964b8f6a..00000000 --- a/bootstrap/docs/UpdateConfigStateRequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# UpdateConfigStateRequest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**state** | Option<[**models::State**](State.md)> | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/bootstrap/git_push.sh b/bootstrap/git_push.sh deleted file mode 100644 index f53a75d4..00000000 --- a/bootstrap/git_push.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 -git_host=$4 - -if [ "$git_host" = "" ]; then - git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" -fi - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' diff --git a/bootstrap/src/apis/configs_api.rs b/bootstrap/src/apis/configs_api.rs deleted file mode 100644 index 9b55b89f..00000000 --- a/bootstrap/src/apis/configs_api.rs +++ /dev/null @@ -1,475 +0,0 @@ -/* - * SuperMQ Bootstrap service - * - * HTTP API for managing platform clients configuration. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - - -use reqwest; -use serde::{Deserialize, Serialize}; -use crate::{apis::ResponseContent, models}; -use super::{Error, configuration}; - - -/// struct for typed errors of method [`create_config`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CreateConfigError { - Status400(), - Status401(), - Status403(), - Status404(), - Status409(), - Status415(), - Status422(), - Status500(), - Status503(), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`get_bootstrap_config`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum GetBootstrapConfigError { - Status400(), - Status401(), - Status404(), - Status422(), - Status500(), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`get_config`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum GetConfigError { - Status400(), - Status401(), - Status403(), - Status404(), - Status422(), - Status500(), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`get_configs`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum GetConfigsError { - Status400(), - Status401(), - Status422(), - Status500(), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`get_secure_bootstrap_config`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum GetSecureBootstrapConfigError { - Status400(), - Status401(), - Status404(), - Status422(), - Status500(), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`remove_config`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RemoveConfigError { - Status400(), - Status401(), - Status403(), - Status422(), - Status500(), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`update_config`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UpdateConfigError { - Status400(), - Status401(), - Status403(), - Status404(), - Status415(), - Status422(), - Status500(), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`update_config_certs`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UpdateConfigCertsError { - Status400(), - Status401(), - Status403(), - Status404(), - Status415(), - Status422(), - Status500(), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`update_config_connections`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UpdateConfigConnectionsError { - Status400(), - Status401(), - Status403(), - Status404(), - Status415(), - Status422(), - Status500(), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`update_config_state`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UpdateConfigStateError { - Status400(), - Status401(), - Status404(), - Status415(), - Status422(), - Status500(), - UnknownValue(serde_json::Value), -} - - -/// Adds new config to the list of config owned by user identified using the provided access token. -pub async fn create_config(configuration: &configuration::Configuration, domain_id: &str, create_config_request: models::CreateConfigRequest) -> Result<(), Error> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/{domainID}/clients/configs", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - local_var_req_builder = local_var_req_builder.json(&create_config_request); - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - Ok(()) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Retrieves a configuration with given external ID and external key. -pub async fn get_bootstrap_config(configuration: &configuration::Configuration, external_id: &str) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/clients/bootstrap/{externalId}", local_var_configuration.base_path, externalId=crate::apis::urlencode(external_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -pub async fn get_config(configuration: &configuration::Configuration, domain_id: &str, config_id: &str) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/{domainID}/clients/configs/{configId}", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), configId=crate::apis::urlencode(config_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Retrieves a list of managed configs. Due to performance concerns, data is retrieved in subsets. The API configs must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. -pub async fn get_configs(configuration: &configuration::Configuration, domain_id: &str, limit: Option, offset: Option, state: Option, name: Option<&str>) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/{domainID}/clients/configs", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); - - if let Some(ref local_var_str) = limit { - local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); - } - if let Some(ref local_var_str) = offset { - local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); - } - if let Some(ref local_var_str) = state { - local_var_req_builder = local_var_req_builder.query(&[("state", &local_var_str.to_string())]); - } - if let Some(ref local_var_str) = name { - local_var_req_builder = local_var_req_builder.query(&[("name", &local_var_str.to_string())]); - } - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Retrieves a configuration with given external ID and encrypted external key. -pub async fn get_secure_bootstrap_config(configuration: &configuration::Configuration, external_id: &str) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/clients/bootstrap/secure/{externalId}", local_var_configuration.base_path, externalId=crate::apis::urlencode(external_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Removes a Config. In case of successful removal the service will ensure that the removed config is disconnected from all of the SuperMQ channels. -pub async fn remove_config(configuration: &configuration::Configuration, domain_id: &str, config_id: &str) -> Result<(), Error> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/{domainID}/clients/configs/{configId}", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), configId=crate::apis::urlencode(config_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - Ok(()) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Update is performed by replacing the current resource data with values provided in a request payload. Note that the owner, ID, external ID, external key, SuperMQ Client ID and key cannot be changed. -pub async fn update_config(configuration: &configuration::Configuration, domain_id: &str, config_id: &str, update_config_request: Option) -> Result<(), Error> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/{domainID}/clients/configs/{configId}", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), configId=crate::apis::urlencode(config_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - local_var_req_builder = local_var_req_builder.json(&update_config_request); - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - Ok(()) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Update is performed by replacing the current certificate data with values provided in a request payload. -pub async fn update_config_certs(configuration: &configuration::Configuration, domain_id: &str, config_id: &str, update_config_certs_request: Option) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/{domainID}/clients/configs/certs/{configId}", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), configId=crate::apis::urlencode(config_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - local_var_req_builder = local_var_req_builder.json(&update_config_certs_request); - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Update connections performs update of the channel list corresponding Client is connected to. -pub async fn update_config_connections(configuration: &configuration::Configuration, domain_id: &str, config_id: &str, update_config_connections_request: Option) -> Result<(), Error> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/{domainID}/clients/configs/connections/{configId}", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), configId=crate::apis::urlencode(config_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - local_var_req_builder = local_var_req_builder.json(&update_config_connections_request); - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - Ok(()) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Updating state represents enabling/disabling Config, i.e. connecting and disconnecting corresponding SuperMQ Client to the list of Channels. -pub async fn update_config_state(configuration: &configuration::Configuration, domain_id: &str, config_id: &str, update_config_state_request: Option) -> Result<(), Error> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/{domainID}/clients/state/{configId}", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), configId=crate::apis::urlencode(config_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - local_var_req_builder = local_var_req_builder.json(&update_config_state_request); - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - Ok(()) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - diff --git a/bootstrap/src/apis/configuration.rs b/bootstrap/src/apis/configuration.rs deleted file mode 100644 index c2bfeae3..00000000 --- a/bootstrap/src/apis/configuration.rs +++ /dev/null @@ -1,51 +0,0 @@ -/* - * SuperMQ Bootstrap service - * - * HTTP API for managing platform clients configuration. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - - - -#[derive(Debug, Clone)] -pub struct Configuration { - pub base_path: String, - pub user_agent: Option, - pub client: reqwest::Client, - pub basic_auth: Option, - pub oauth_access_token: Option, - pub bearer_access_token: Option, - pub api_key: Option, -} - -pub type BasicAuth = (String, Option); - -#[derive(Debug, Clone)] -pub struct ApiKey { - pub prefix: Option, - pub key: String, -} - - -impl Configuration { - pub fn new() -> Configuration { - Configuration::default() - } -} - -impl Default for Configuration { - fn default() -> Self { - Configuration { - base_path: "http://localhost:9013".to_owned(), - user_agent: Some("OpenAPI-Generator/0.15.1/rust".to_owned()), - client: reqwest::Client::new(), - basic_auth: None, - oauth_access_token: None, - bearer_access_token: None, - api_key: None, - } - } -} diff --git a/bootstrap/src/apis/health_api.rs b/bootstrap/src/apis/health_api.rs deleted file mode 100644 index bcd54724..00000000 --- a/bootstrap/src/apis/health_api.rs +++ /dev/null @@ -1,53 +0,0 @@ -/* - * SuperMQ Bootstrap service - * - * HTTP API for managing platform clients configuration. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - - -use reqwest; -use serde::{Deserialize, Serialize}; -use crate::{apis::ResponseContent, models}; -use super::{Error, configuration}; - - -/// struct for typed errors of method [`health_get`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum HealthGetError { - Status500(), - UnknownValue(serde_json::Value), -} - - -pub async fn health_get(configuration: &configuration::Configuration, ) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/health", local_var_configuration.base_path); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - diff --git a/bootstrap/src/apis/mod.rs b/bootstrap/src/apis/mod.rs deleted file mode 100644 index 885f9342..00000000 --- a/bootstrap/src/apis/mod.rs +++ /dev/null @@ -1,96 +0,0 @@ -use std::error; -use std::fmt; - -#[derive(Debug, Clone)] -pub struct ResponseContent { - pub status: reqwest::StatusCode, - pub content: String, - pub entity: Option, -} - -#[derive(Debug)] -pub enum Error { - Reqwest(reqwest::Error), - Serde(serde_json::Error), - Io(std::io::Error), - ResponseError(ResponseContent), -} - -impl fmt::Display for Error { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - let (module, e) = match self { - Error::Reqwest(e) => ("reqwest", e.to_string()), - Error::Serde(e) => ("serde", e.to_string()), - Error::Io(e) => ("IO", e.to_string()), - Error::ResponseError(e) => ("response", format!("status code {}", e.status)), - }; - write!(f, "error in {}: {}", module, e) - } -} - -impl error::Error for Error { - fn source(&self) -> Option<&(dyn error::Error + 'static)> { - Some(match self { - Error::Reqwest(e) => e, - Error::Serde(e) => e, - Error::Io(e) => e, - Error::ResponseError(_) => return None, - }) - } -} - -impl From for Error { - fn from(e: reqwest::Error) -> Self { - Error::Reqwest(e) - } -} - -impl From for Error { - fn from(e: serde_json::Error) -> Self { - Error::Serde(e) - } -} - -impl From for Error { - fn from(e: std::io::Error) -> Self { - Error::Io(e) - } -} - -pub fn urlencode>(s: T) -> String { - ::url::form_urlencoded::byte_serialize(s.as_ref().as_bytes()).collect() -} - -pub fn parse_deep_object(prefix: &str, value: &serde_json::Value) -> Vec<(String, String)> { - if let serde_json::Value::Object(object) = value { - let mut params = vec![]; - - for (key, value) in object { - match value { - serde_json::Value::Object(_) => params.append(&mut parse_deep_object( - &format!("{}[{}]", prefix, key), - value, - )), - serde_json::Value::Array(array) => { - for (i, value) in array.iter().enumerate() { - params.append(&mut parse_deep_object( - &format!("{}[{}][{}]", prefix, key, i), - value, - )); - } - }, - serde_json::Value::String(s) => params.push((format!("{}[{}]", prefix, key), s.clone())), - _ => params.push((format!("{}[{}]", prefix, key), value.to_string())), - } - } - - return params; - } - - unimplemented!("Only objects are supported with style=deepObject") -} - -pub mod configs_api; -pub mod health_api; - -pub mod configuration; diff --git a/bootstrap/src/lib.rs b/bootstrap/src/lib.rs deleted file mode 100644 index e1520628..00000000 --- a/bootstrap/src/lib.rs +++ /dev/null @@ -1,11 +0,0 @@ -#![allow(unused_imports)] -#![allow(clippy::too_many_arguments)] - -extern crate serde_repr; -extern crate serde; -extern crate serde_json; -extern crate url; -extern crate reqwest; - -pub mod apis; -pub mod models; diff --git a/bootstrap/src/models/bootstrap_config.rs b/bootstrap/src/models/bootstrap_config.rs deleted file mode 100644 index 90ff859a..00000000 --- a/bootstrap/src/models/bootstrap_config.rs +++ /dev/null @@ -1,43 +0,0 @@ -/* - * SuperMQ Bootstrap service - * - * HTTP API for managing platform clients configuration. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct BootstrapConfig { - /// Corresponding SuperMQ Client ID. - #[serde(rename = "client_id")] - pub client_id: uuid::Uuid, - /// Corresponding SuperMQ Client key. - #[serde(rename = "client_key")] - pub client_key: uuid::Uuid, - #[serde(rename = "channels")] - pub channels: Vec, - /// Free-form custom configuration. - #[serde(rename = "content")] - pub content: String, - /// Client certificate. - #[serde(rename = "client_cert", skip_serializing_if = "Option::is_none")] - pub client_cert: Option, -} - -impl BootstrapConfig { - pub fn new(client_id: uuid::Uuid, client_key: uuid::Uuid, channels: Vec, content: String) -> BootstrapConfig { - BootstrapConfig { - client_id, - client_key, - channels, - content, - client_cert: None, - } - } -} - diff --git a/bootstrap/src/models/config.rs b/bootstrap/src/models/config.rs deleted file mode 100644 index 88fd6bc8..00000000 --- a/bootstrap/src/models/config.rs +++ /dev/null @@ -1,58 +0,0 @@ -/* - * SuperMQ Bootstrap service - * - * HTTP API for managing platform clients configuration. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct Config { - /// Corresponding SuperMQ Client ID. - #[serde(rename = "client_id", skip_serializing_if = "Option::is_none")] - pub client_id: Option, - /// Corresponding SuperMQ Client key. - #[serde(rename = "magistrala_secret", skip_serializing_if = "Option::is_none")] - pub magistrala_secret: Option, - #[serde(rename = "channels", skip_serializing_if = "Option::is_none")] - pub channels: Option>, - /// External ID (MAC address or some unique identifier). - #[serde(rename = "external_id")] - pub external_id: String, - /// External key. - #[serde(rename = "external_key")] - pub external_key: String, - /// Free-form custom configuration. - #[serde(rename = "content", skip_serializing_if = "Option::is_none")] - pub content: Option, - #[serde(rename = "state", skip_serializing_if = "Option::is_none")] - pub state: Option, - /// Client certificate. - #[serde(rename = "client_cert", skip_serializing_if = "Option::is_none")] - pub client_cert: Option, - /// Issuing CA certificate. - #[serde(rename = "ca_cert", skip_serializing_if = "Option::is_none")] - pub ca_cert: Option, -} - -impl Config { - pub fn new(external_id: String, external_key: String) -> Config { - Config { - client_id: None, - magistrala_secret: None, - channels: None, - external_id, - external_key, - content: None, - state: None, - client_cert: None, - ca_cert: None, - } - } -} - diff --git a/bootstrap/src/models/config_list.rs b/bootstrap/src/models/config_list.rs deleted file mode 100644 index d2b683be..00000000 --- a/bootstrap/src/models/config_list.rs +++ /dev/null @@ -1,39 +0,0 @@ -/* - * SuperMQ Bootstrap service - * - * HTTP API for managing platform clients configuration. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ConfigList { - /// Total number of results. - #[serde(rename = "total", skip_serializing_if = "Option::is_none")] - pub total: Option, - /// Number of items to skip during retrieval. - #[serde(rename = "offset", skip_serializing_if = "Option::is_none")] - pub offset: Option, - /// Size of the subset to retrieve. - #[serde(rename = "limit", skip_serializing_if = "Option::is_none")] - pub limit: Option, - #[serde(rename = "configs")] - pub configs: Vec, -} - -impl ConfigList { - pub fn new(configs: Vec) -> ConfigList { - ConfigList { - total: None, - offset: None, - limit: None, - configs, - } - } -} - diff --git a/bootstrap/src/models/config_update_certs.rs b/bootstrap/src/models/config_update_certs.rs deleted file mode 100644 index 16c4dd3b..00000000 --- a/bootstrap/src/models/config_update_certs.rs +++ /dev/null @@ -1,40 +0,0 @@ -/* - * SuperMQ Bootstrap service - * - * HTTP API for managing platform clients configuration. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ConfigUpdateCerts { - /// Corresponding SuperMQ Client ID. - #[serde(rename = "client_id")] - pub client_id: uuid::Uuid, - /// Client certificate. - #[serde(rename = "client_cert", skip_serializing_if = "Option::is_none")] - pub client_cert: Option, - /// Key for the client_cert. - #[serde(rename = "client_key")] - pub client_key: String, - /// Issuing CA certificate. - #[serde(rename = "ca_cert", skip_serializing_if = "Option::is_none")] - pub ca_cert: Option, -} - -impl ConfigUpdateCerts { - pub fn new(client_id: uuid::Uuid, client_key: String) -> ConfigUpdateCerts { - ConfigUpdateCerts { - client_id, - client_cert: None, - client_key, - ca_cert: None, - } - } -} - diff --git a/bootstrap/src/models/health_info.rs b/bootstrap/src/models/health_info.rs deleted file mode 100644 index 6be663be..00000000 --- a/bootstrap/src/models/health_info.rs +++ /dev/null @@ -1,60 +0,0 @@ -/* - * SuperMQ Bootstrap service - * - * HTTP API for managing platform clients configuration. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct HealthInfo { - /// Service status. - #[serde(rename = "status", skip_serializing_if = "Option::is_none")] - pub status: Option, - /// Service version. - #[serde(rename = "version", skip_serializing_if = "Option::is_none")] - pub version: Option, - /// Service commit hash. - #[serde(rename = "commit", skip_serializing_if = "Option::is_none")] - pub commit: Option, - /// Service description. - #[serde(rename = "description", skip_serializing_if = "Option::is_none")] - pub description: Option, - /// Service build time. - #[serde(rename = "build_time", skip_serializing_if = "Option::is_none")] - pub build_time: Option, - /// Service instance ID. - #[serde(rename = "instance_id", skip_serializing_if = "Option::is_none")] - pub instance_id: Option, -} - -impl HealthInfo { - pub fn new() -> HealthInfo { - HealthInfo { - status: None, - version: None, - commit: None, - description: None, - build_time: None, - instance_id: None, - } - } -} -/// Service status. -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum Status { - #[serde(rename = "pass")] - Pass, -} - -impl Default for Status { - fn default() -> Status { - Self::Pass - } -} - diff --git a/bootstrap/src/models/mod.rs b/bootstrap/src/models/mod.rs deleted file mode 100644 index 47d59c9f..00000000 --- a/bootstrap/src/models/mod.rs +++ /dev/null @@ -1,24 +0,0 @@ -pub mod bootstrap_config; -pub use self::bootstrap_config::BootstrapConfig; -pub mod config; -pub use self::config::Config; -pub mod config_channels_inner; -pub use self::config_channels_inner::ConfigChannelsInner; -pub mod config_list; -pub use self::config_list::ConfigList; -pub mod config_update_certs; -pub use self::config_update_certs::ConfigUpdateCerts; -pub mod create_config_request; -pub use self::create_config_request::CreateConfigRequest; -pub mod health_info; -pub use self::health_info::HealthInfo; -pub mod state; -pub use self::state::State; -pub mod update_config_certs_request; -pub use self::update_config_certs_request::UpdateConfigCertsRequest; -pub mod update_config_connections_request; -pub use self::update_config_connections_request::UpdateConfigConnectionsRequest; -pub mod update_config_request; -pub use self::update_config_request::UpdateConfigRequest; -pub mod update_config_state_request; -pub use self::update_config_state_request::UpdateConfigStateRequest; diff --git a/bootstrap/src/models/state.rs b/bootstrap/src/models/state.rs deleted file mode 100644 index 36346572..00000000 --- a/bootstrap/src/models/state.rs +++ /dev/null @@ -1,37 +0,0 @@ -/* - * SuperMQ Bootstrap service - * - * HTTP API for managing platform clients configuration. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -use serde_repr::{Serialize_repr,Deserialize_repr}; -/// -#[repr(i64)] -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr)] -pub enum State { - Variant0 = 0, - Variant1 = 1, - -} - -impl std::fmt::Display for State { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "{}", match self { - Self::Variant0 => "0", - Self::Variant1 => "1", - }) - } -} -impl Default for State { - fn default() -> State { - Self::Variant0 - } -} - diff --git a/bootstrap/src/models/update_config_state_request.rs b/bootstrap/src/models/update_config_state_request.rs deleted file mode 100644 index 8b0b1afe..00000000 --- a/bootstrap/src/models/update_config_state_request.rs +++ /dev/null @@ -1,27 +0,0 @@ -/* - * SuperMQ Bootstrap service - * - * HTTP API for managing platform clients configuration. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct UpdateConfigStateRequest { - #[serde(rename = "state", skip_serializing_if = "Option::is_none")] - pub state: Option, -} - -impl UpdateConfigStateRequest { - pub fn new() -> UpdateConfigStateRequest { - UpdateConfigStateRequest { - state: None, - } - } -} - diff --git a/certs/.gitignore b/certs/.gitignore deleted file mode 100644 index 6aa10640..00000000 --- a/certs/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/target/ -**/*.rs.bk -Cargo.lock diff --git a/certs/.openapi-generator-ignore b/certs/.openapi-generator-ignore deleted file mode 100644 index 7484ee59..00000000 --- a/certs/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/certs/.openapi-generator/FILES b/certs/.openapi-generator/FILES deleted file mode 100644 index a7e76136..00000000 --- a/certs/.openapi-generator/FILES +++ /dev/null @@ -1,28 +0,0 @@ -.gitignore -.openapi-generator-ignore -.travis.yml -Cargo.toml -README.md -docs/Cert.md -docs/CertsApi.md -docs/CertsPage.md -docs/CreateCertRequest.md -docs/HealthApi.md -docs/HealthInfo.md -docs/Revoke.md -docs/Serial.md -docs/SerialsPage.md -git_push.sh -src/apis/certs_api.rs -src/apis/configuration.rs -src/apis/health_api.rs -src/apis/mod.rs -src/lib.rs -src/models/cert.rs -src/models/certs_page.rs -src/models/create_cert_request.rs -src/models/health_info.rs -src/models/mod.rs -src/models/revoke.rs -src/models/serial.rs -src/models/serials_page.rs diff --git a/certs/.openapi-generator/VERSION b/certs/.openapi-generator/VERSION deleted file mode 100644 index 758bb9c8..00000000 --- a/certs/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -7.10.0 diff --git a/certs/.travis.yml b/certs/.travis.yml deleted file mode 100644 index 22761ba7..00000000 --- a/certs/.travis.yml +++ /dev/null @@ -1 +0,0 @@ -language: rust diff --git a/certs/Cargo.toml b/certs/Cargo.toml deleted file mode 100644 index eeb05171..00000000 --- a/certs/Cargo.toml +++ /dev/null @@ -1,15 +0,0 @@ -[package] -name = "Certs" -version = "0.15.1" -authors = ["info@abstractmachines.fr"] -description = "HTTP API for Certs service Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) " -license = "Apache 2.0" -edition = "2021" - -[dependencies] -serde = { version = "^1.0", features = ["derive"] } -serde_json = "^1.0" -serde_repr = "^0.1" -url = "^2.5" -uuid = { version = "^1.8", features = ["serde", "v4"] } -reqwest = { version = "^0.12", features = ["json", "multipart"] } diff --git a/certs/README.md b/certs/README.md deleted file mode 100644 index 1e03afac..00000000 --- a/certs/README.md +++ /dev/null @@ -1,59 +0,0 @@ -# Rust API client for openapi - -HTTP API for Certs service -Some useful links: -- [The SuperMQ repository](https://github.com/absmach/supermq) - - - -## Overview - -This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://openapis.org) from a remote server, you can easily generate an API client. - -- API version: 0.15.1 -- Package version: 0.15.1 -- Generator version: 7.10.0 -- Build package: `org.openapitools.codegen.languages.RustClientCodegen` - -## Installation - -Put the package under your project folder in a directory named `openapi` and add the following to `Cargo.toml` under `[dependencies]`: - -``` -openapi = { path = "./openapi" } -``` - -## Documentation for API Endpoints - -All URIs are relative to *http://localhost:9019* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*CertsApi* | [**create_cert**](docs/CertsApi.md#create_cert) | **POST** /{domainID}/certs | Creates a certificate for client -*CertsApi* | [**get_cert**](docs/CertsApi.md#get_cert) | **GET** /{domainID}/certs/{certID} | Retrieves a certificate -*CertsApi* | [**get_serials**](docs/CertsApi.md#get_serials) | **GET** /{domainID}/serials/{clientID} | Retrieves certificates' serial IDs -*CertsApi* | [**revoke_cert**](docs/CertsApi.md#revoke_cert) | **DELETE** /{domainID}/certs/{certID} | Revokes a certificate -*HealthApi* | [**health_get**](docs/HealthApi.md#health_get) | **GET** /health | Retrieves service health check info. - - -## Documentation For Models - - - [Cert](docs/Cert.md) - - [CertsPage](docs/CertsPage.md) - - [CreateCertRequest](docs/CreateCertRequest.md) - - [HealthInfo](docs/HealthInfo.md) - - [Revoke](docs/Revoke.md) - - [Serial](docs/Serial.md) - - [SerialsPage](docs/SerialsPage.md) - - -To get access to the crate's generated documentation, use: - -``` -cargo doc --open -``` - -## Author - -info@abstractmachines.fr - diff --git a/certs/docs/Cert.md b/certs/docs/Cert.md deleted file mode 100644 index 9e8a84fb..00000000 --- a/certs/docs/Cert.md +++ /dev/null @@ -1,16 +0,0 @@ -# Cert - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**client_id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | Corresponding SuperMQ Client ID. | [optional] -**client_cert** | Option<**String**> | Client Certificate. | [optional] -**client_key** | Option<**String**> | Key for the client_cert. | [optional] -**issuing_ca** | Option<**String**> | CA Certificate that is used to issue client certs, usually intermediate. | [optional] -**serial** | Option<**String**> | Certificate serial | [optional] -**expire** | Option<**String**> | Certificate expiry date | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/certs/docs/CertsApi.md b/certs/docs/CertsApi.md deleted file mode 100644 index b6fff3ec..00000000 --- a/certs/docs/CertsApi.md +++ /dev/null @@ -1,136 +0,0 @@ -# \CertsApi - -All URIs are relative to *http://localhost:9019* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**create_cert**](CertsApi.md#create_cert) | **POST** /{domainID}/certs | Creates a certificate for client -[**get_cert**](CertsApi.md#get_cert) | **GET** /{domainID}/certs/{certID} | Retrieves a certificate -[**get_serials**](CertsApi.md#get_serials) | **GET** /{domainID}/serials/{clientID} | Retrieves certificates' serial IDs -[**revoke_cert**](CertsApi.md#revoke_cert) | **DELETE** /{domainID}/certs/{certID} | Revokes a certificate - - - -## create_cert - -> create_cert(domain_id, create_cert_request) -Creates a certificate for client - -Creates a certificate for client - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**create_cert_request** | Option<[**CreateCertRequest**](CreateCertRequest.md)> | Issues a certificate that is required for mTLS. To create a certificate for a client provide a client id, data identifying particular client will be embedded into the Certificate. x509 and ECC certificates are supported when using when Vault is used as PKI. | | - -### Return type - - (empty response body) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## get_cert - -> models::Cert get_cert(domain_id, cert_id) -Retrieves a certificate - -Retrieves a certificate for a given cert ID. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**cert_id** | **uuid::Uuid** | Serial of certificate | [required] | - -### Return type - -[**models::Cert**](Cert.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## get_serials - -> models::SerialsPage get_serials(domain_id, client_id) -Retrieves certificates' serial IDs - -Retrieves a list of certificates' serial IDs for a given client ID. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**client_id** | **uuid::Uuid** | Client ID | [required] | - -### Return type - -[**models::SerialsPage**](SerialsPage.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## revoke_cert - -> models::Revoke revoke_cert(domain_id, cert_id) -Revokes a certificate - -Revokes a certificate for a given cert ID. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**cert_id** | **uuid::Uuid** | Serial of certificate | [required] | - -### Return type - -[**models::Revoke**](Revoke.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/certs/docs/CertsPage.md b/certs/docs/CertsPage.md deleted file mode 100644 index d7d9350b..00000000 --- a/certs/docs/CertsPage.md +++ /dev/null @@ -1,14 +0,0 @@ -# CertsPage - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**certs** | Option<[**Vec**](Cert.md)> | | [optional] -**total** | Option<**i32**> | Total number of items. | [optional] -**offset** | Option<**i32**> | Number of items to skip during retrieval. | [optional] -**limit** | Option<**i32**> | Maximum number of items to return in one page. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/certs/docs/CreateCertRequest.md b/certs/docs/CreateCertRequest.md deleted file mode 100644 index dfb718ea..00000000 --- a/certs/docs/CreateCertRequest.md +++ /dev/null @@ -1,12 +0,0 @@ -# CreateCertRequest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**client_id** | [**uuid::Uuid**](uuid::Uuid.md) | | -**ttl** | **String** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/certs/docs/HealthApi.md b/certs/docs/HealthApi.md deleted file mode 100644 index f0aeb8bc..00000000 --- a/certs/docs/HealthApi.md +++ /dev/null @@ -1,34 +0,0 @@ -# \HealthApi - -All URIs are relative to *http://localhost:9019* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**health_get**](HealthApi.md#health_get) | **GET** /health | Retrieves service health check info. - - - -## health_get - -> models::HealthInfo health_get() -Retrieves service health check info. - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -[**models::HealthInfo**](health_info.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/health+json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/certs/docs/HealthInfo.md b/certs/docs/HealthInfo.md deleted file mode 100644 index ee8f5c6b..00000000 --- a/certs/docs/HealthInfo.md +++ /dev/null @@ -1,16 +0,0 @@ -# HealthInfo - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | Option<**String**> | Service status. | [optional] -**version** | Option<**String**> | Service version. | [optional] -**commit** | Option<**String**> | Service commit hash. | [optional] -**description** | Option<**String**> | Service description. | [optional] -**build_time** | Option<**String**> | Service build time. | [optional] -**instance_id** | Option<**String**> | Service instance ID. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/certs/docs/Revoke.md b/certs/docs/Revoke.md deleted file mode 100644 index 50234781..00000000 --- a/certs/docs/Revoke.md +++ /dev/null @@ -1,11 +0,0 @@ -# Revoke - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**revocation_time** | Option<**String**> | Certificate revocation time | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/certs/docs/Serial.md b/certs/docs/Serial.md deleted file mode 100644 index b2f8aa4d..00000000 --- a/certs/docs/Serial.md +++ /dev/null @@ -1,11 +0,0 @@ -# Serial - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**serial** | Option<**String**> | Certificate serial | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/certs/docs/SerialsPage.md b/certs/docs/SerialsPage.md deleted file mode 100644 index 53a02dd6..00000000 --- a/certs/docs/SerialsPage.md +++ /dev/null @@ -1,14 +0,0 @@ -# SerialsPage - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**serials** | Option<**Vec**> | Certificate serials IDs. | [optional] -**total** | Option<**i32**> | Total number of items. | [optional] -**offset** | Option<**i32**> | Number of items to skip during retrieval. | [optional] -**limit** | Option<**i32**> | Maximum number of items to return in one page. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/certs/git_push.sh b/certs/git_push.sh deleted file mode 100644 index f53a75d4..00000000 --- a/certs/git_push.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 -git_host=$4 - -if [ "$git_host" = "" ]; then - git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" -fi - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' diff --git a/certs/src/apis/configuration.rs b/certs/src/apis/configuration.rs deleted file mode 100644 index fef368bc..00000000 --- a/certs/src/apis/configuration.rs +++ /dev/null @@ -1,51 +0,0 @@ -/* - * SuperMQ Certs service - * - * HTTP API for Certs service Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - - - -#[derive(Debug, Clone)] -pub struct Configuration { - pub base_path: String, - pub user_agent: Option, - pub client: reqwest::Client, - pub basic_auth: Option, - pub oauth_access_token: Option, - pub bearer_access_token: Option, - pub api_key: Option, -} - -pub type BasicAuth = (String, Option); - -#[derive(Debug, Clone)] -pub struct ApiKey { - pub prefix: Option, - pub key: String, -} - - -impl Configuration { - pub fn new() -> Configuration { - Configuration::default() - } -} - -impl Default for Configuration { - fn default() -> Self { - Configuration { - base_path: "http://localhost:9019".to_owned(), - user_agent: Some("OpenAPI-Generator/0.15.1/rust".to_owned()), - client: reqwest::Client::new(), - basic_auth: None, - oauth_access_token: None, - bearer_access_token: None, - api_key: None, - } - } -} diff --git a/certs/src/apis/health_api.rs b/certs/src/apis/health_api.rs deleted file mode 100644 index aa6f4ff4..00000000 --- a/certs/src/apis/health_api.rs +++ /dev/null @@ -1,53 +0,0 @@ -/* - * SuperMQ Certs service - * - * HTTP API for Certs service Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - - -use reqwest; -use serde::{Deserialize, Serialize}; -use crate::{apis::ResponseContent, models}; -use super::{Error, configuration}; - - -/// struct for typed errors of method [`health_get`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum HealthGetError { - Status500(), - UnknownValue(serde_json::Value), -} - - -pub async fn health_get(configuration: &configuration::Configuration, ) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/health", local_var_configuration.base_path); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - diff --git a/certs/src/apis/mod.rs b/certs/src/apis/mod.rs deleted file mode 100644 index 807c7e84..00000000 --- a/certs/src/apis/mod.rs +++ /dev/null @@ -1,96 +0,0 @@ -use std::error; -use std::fmt; - -#[derive(Debug, Clone)] -pub struct ResponseContent { - pub status: reqwest::StatusCode, - pub content: String, - pub entity: Option, -} - -#[derive(Debug)] -pub enum Error { - Reqwest(reqwest::Error), - Serde(serde_json::Error), - Io(std::io::Error), - ResponseError(ResponseContent), -} - -impl fmt::Display for Error { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - let (module, e) = match self { - Error::Reqwest(e) => ("reqwest", e.to_string()), - Error::Serde(e) => ("serde", e.to_string()), - Error::Io(e) => ("IO", e.to_string()), - Error::ResponseError(e) => ("response", format!("status code {}", e.status)), - }; - write!(f, "error in {}: {}", module, e) - } -} - -impl error::Error for Error { - fn source(&self) -> Option<&(dyn error::Error + 'static)> { - Some(match self { - Error::Reqwest(e) => e, - Error::Serde(e) => e, - Error::Io(e) => e, - Error::ResponseError(_) => return None, - }) - } -} - -impl From for Error { - fn from(e: reqwest::Error) -> Self { - Error::Reqwest(e) - } -} - -impl From for Error { - fn from(e: serde_json::Error) -> Self { - Error::Serde(e) - } -} - -impl From for Error { - fn from(e: std::io::Error) -> Self { - Error::Io(e) - } -} - -pub fn urlencode>(s: T) -> String { - ::url::form_urlencoded::byte_serialize(s.as_ref().as_bytes()).collect() -} - -pub fn parse_deep_object(prefix: &str, value: &serde_json::Value) -> Vec<(String, String)> { - if let serde_json::Value::Object(object) = value { - let mut params = vec![]; - - for (key, value) in object { - match value { - serde_json::Value::Object(_) => params.append(&mut parse_deep_object( - &format!("{}[{}]", prefix, key), - value, - )), - serde_json::Value::Array(array) => { - for (i, value) in array.iter().enumerate() { - params.append(&mut parse_deep_object( - &format!("{}[{}][{}]", prefix, key, i), - value, - )); - } - }, - serde_json::Value::String(s) => params.push((format!("{}[{}]", prefix, key), s.clone())), - _ => params.push((format!("{}[{}]", prefix, key), value.to_string())), - } - } - - return params; - } - - unimplemented!("Only objects are supported with style=deepObject") -} - -pub mod certs_api; -pub mod health_api; - -pub mod configuration; diff --git a/certs/src/lib.rs b/certs/src/lib.rs deleted file mode 100644 index e1520628..00000000 --- a/certs/src/lib.rs +++ /dev/null @@ -1,11 +0,0 @@ -#![allow(unused_imports)] -#![allow(clippy::too_many_arguments)] - -extern crate serde_repr; -extern crate serde; -extern crate serde_json; -extern crate url; -extern crate reqwest; - -pub mod apis; -pub mod models; diff --git a/certs/src/models/health_info.rs b/certs/src/models/health_info.rs deleted file mode 100644 index b2d7b1a7..00000000 --- a/certs/src/models/health_info.rs +++ /dev/null @@ -1,60 +0,0 @@ -/* - * SuperMQ Certs service - * - * HTTP API for Certs service Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct HealthInfo { - /// Service status. - #[serde(rename = "status", skip_serializing_if = "Option::is_none")] - pub status: Option, - /// Service version. - #[serde(rename = "version", skip_serializing_if = "Option::is_none")] - pub version: Option, - /// Service commit hash. - #[serde(rename = "commit", skip_serializing_if = "Option::is_none")] - pub commit: Option, - /// Service description. - #[serde(rename = "description", skip_serializing_if = "Option::is_none")] - pub description: Option, - /// Service build time. - #[serde(rename = "build_time", skip_serializing_if = "Option::is_none")] - pub build_time: Option, - /// Service instance ID. - #[serde(rename = "instance_id", skip_serializing_if = "Option::is_none")] - pub instance_id: Option, -} - -impl HealthInfo { - pub fn new() -> HealthInfo { - HealthInfo { - status: None, - version: None, - commit: None, - description: None, - build_time: None, - instance_id: None, - } - } -} -/// Service status. -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum Status { - #[serde(rename = "pass")] - Pass, -} - -impl Default for Status { - fn default() -> Status { - Self::Pass - } -} - diff --git a/certs/src/models/mod.rs b/certs/src/models/mod.rs deleted file mode 100644 index 20fac969..00000000 --- a/certs/src/models/mod.rs +++ /dev/null @@ -1,14 +0,0 @@ -pub mod cert; -pub use self::cert::Cert; -pub mod certs_page; -pub use self::certs_page::CertsPage; -pub mod create_cert_request; -pub use self::create_cert_request::CreateCertRequest; -pub mod health_info; -pub use self::health_info::HealthInfo; -pub mod revoke; -pub use self::revoke::Revoke; -pub mod serial; -pub use self::serial::Serial; -pub mod serials_page; -pub use self::serials_page::SerialsPage; diff --git a/channels/.gitignore b/channels/.gitignore deleted file mode 100644 index 6aa10640..00000000 --- a/channels/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/target/ -**/*.rs.bk -Cargo.lock diff --git a/channels/.openapi-generator-ignore b/channels/.openapi-generator-ignore deleted file mode 100644 index 7484ee59..00000000 --- a/channels/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/channels/.openapi-generator/FILES b/channels/.openapi-generator/FILES deleted file mode 100644 index 4258000e..00000000 --- a/channels/.openapi-generator/FILES +++ /dev/null @@ -1,36 +0,0 @@ -.gitignore -.openapi-generator-ignore -.travis.yml -Cargo.toml -README.md -docs/Channel.md -docs/ChannelConnectionReqSchema.md -docs/ChannelReqObj.md -docs/ChannelUpdate.md -docs/ChannelUpdateTags.md -docs/ChannelsApi.md -docs/ChannelsPage.md -docs/ConnectionReqSchema.md -docs/ConnectionsApi.md -docs/Error.md -docs/HealthApi.md -docs/HealthRes.md -docs/ParentGroupReqObj.md -git_push.sh -src/apis/channels_api.rs -src/apis/configuration.rs -src/apis/connections_api.rs -src/apis/health_api.rs -src/apis/mod.rs -src/lib.rs -src/models/channel.rs -src/models/channel_connection_req_schema.rs -src/models/channel_req_obj.rs -src/models/channel_update.rs -src/models/channel_update_tags.rs -src/models/channels_page.rs -src/models/connection_req_schema.rs -src/models/error.rs -src/models/health_res.rs -src/models/mod.rs -src/models/parent_group_req_obj.rs diff --git a/channels/.openapi-generator/VERSION b/channels/.openapi-generator/VERSION deleted file mode 100644 index 758bb9c8..00000000 --- a/channels/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -7.10.0 diff --git a/channels/.travis.yml b/channels/.travis.yml deleted file mode 100644 index 22761ba7..00000000 --- a/channels/.travis.yml +++ /dev/null @@ -1 +0,0 @@ -language: rust diff --git a/channels/Cargo.toml b/channels/Cargo.toml deleted file mode 100644 index ba1d0258..00000000 --- a/channels/Cargo.toml +++ /dev/null @@ -1,15 +0,0 @@ -[package] -name = "Channels" -version = "0.15.1" -authors = ["info@abstractmachines.fr"] -description = "This is the Channels Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform channels. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) " -license = "Apache 2.0" -edition = "2021" - -[dependencies] -serde = { version = "^1.0", features = ["derive"] } -serde_json = "^1.0" -serde_repr = "^0.1" -url = "^2.5" -uuid = { version = "^1.8", features = ["serde", "v4"] } -reqwest = { version = "^0.12", features = ["json", "multipart"] } diff --git a/channels/README.md b/channels/README.md deleted file mode 100644 index 7cabb94f..00000000 --- a/channels/README.md +++ /dev/null @@ -1,73 +0,0 @@ -# Rust API client for openapi - -This is the Channels Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform channels. You can now help us improve the API whether it's by making changes to the definition itself or to the code. -Some useful links: -- [The SuperMQ repository](https://github.com/absmach/supermq) - - - -## Overview - -This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://openapis.org) from a remote server, you can easily generate an API client. - -- API version: 0.15.1 -- Package version: 0.15.1 -- Generator version: 7.10.0 -- Build package: `org.openapitools.codegen.languages.RustClientCodegen` - -## Installation - -Put the package under your project folder in a directory named `openapi` and add the following to `Cargo.toml` under `[dependencies]`: - -``` -openapi = { path = "./openapi" } -``` - -## Documentation for API Endpoints - -All URIs are relative to *http://localhost:9005* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*ChannelsApi* | [**create_channel**](docs/ChannelsApi.md#create_channel) | **POST** /{domainID}/channels | Creates new channel -*ChannelsApi* | [**create_channels**](docs/ChannelsApi.md#create_channels) | **POST** /{domainID}/channels/bulk | Creates new channels -*ChannelsApi* | [**disable_channel**](docs/ChannelsApi.md#disable_channel) | **POST** /{domainID}/channels/{chanID}/disable | Disables a channel -*ChannelsApi* | [**domain_id_channels_chan_id_delete**](docs/ChannelsApi.md#domain_id_channels_chan_id_delete) | **DELETE** /{domainID}/channels/{chanID} | Delete channel for given channel id. -*ChannelsApi* | [**enable_channel**](docs/ChannelsApi.md#enable_channel) | **POST** /{domainID}/channels/{chanID}/enable | Enables a channel -*ChannelsApi* | [**get_channel**](docs/ChannelsApi.md#get_channel) | **GET** /{domainID}/channels/{chanID} | Retrieves channel info. -*ChannelsApi* | [**list_channels**](docs/ChannelsApi.md#list_channels) | **GET** /{domainID}/channels | Lists channels. -*ChannelsApi* | [**remove_channel_parent_group**](docs/ChannelsApi.md#remove_channel_parent_group) | **DELETE** /{domainID}/channels/{chanID}/parent | Removes a parent group from a channel. -*ChannelsApi* | [**set_channel_parent_group**](docs/ChannelsApi.md#set_channel_parent_group) | **POST** /{domainID}/channels/{chanID}/parent | Sets a parent group for a channel -*ChannelsApi* | [**update_channel**](docs/ChannelsApi.md#update_channel) | **PATCH** /{domainID}/channels/{chanID} | Updates channel data. -*ChannelsApi* | [**update_channel_tags**](docs/ChannelsApi.md#update_channel_tags) | **PATCH** /{domainID}/channels/{chanID}/tags | Updates channel tags. -*ConnectionsApi* | [**connect_clients_and_channels**](docs/ConnectionsApi.md#connect_clients_and_channels) | **POST** /{domainID}/channels/connect | Connects client and channel. -*ConnectionsApi* | [**connect_clients_to_channel**](docs/ConnectionsApi.md#connect_clients_to_channel) | **POST** /{domainID}/channels/{chanID}/connect | Connects clients to a channel -*ConnectionsApi* | [**disconnect_clients_and_channels**](docs/ConnectionsApi.md#disconnect_clients_and_channels) | **POST** /{domainID}/channels/disconnect | Disconnects client and channel. -*ConnectionsApi* | [**disconnect_clients_from_channel**](docs/ConnectionsApi.md#disconnect_clients_from_channel) | **POST** /{domainID}/channels/{chanID}/disconnect | Disconnects clients from a channel -*HealthApi* | [**health_get**](docs/HealthApi.md#health_get) | **GET** /health | Retrieves service health check info. - - -## Documentation For Models - - - [Channel](docs/Channel.md) - - [ChannelConnectionReqSchema](docs/ChannelConnectionReqSchema.md) - - [ChannelReqObj](docs/ChannelReqObj.md) - - [ChannelUpdate](docs/ChannelUpdate.md) - - [ChannelUpdateTags](docs/ChannelUpdateTags.md) - - [ChannelsPage](docs/ChannelsPage.md) - - [ConnectionReqSchema](docs/ConnectionReqSchema.md) - - [Error](docs/Error.md) - - [HealthRes](docs/HealthRes.md) - - [ParentGroupReqObj](docs/ParentGroupReqObj.md) - - -To get access to the crate's generated documentation, use: - -``` -cargo doc --open -``` - -## Author - -info@abstractmachines.fr - diff --git a/channels/docs/Channel.md b/channels/docs/Channel.md deleted file mode 100644 index 6cc6c7aa..00000000 --- a/channels/docs/Channel.md +++ /dev/null @@ -1,21 +0,0 @@ -# Channel - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | Unique channel identifier generated by the service. | [optional] -**name** | Option<**String**> | Free-form channel name. Channel name is unique on the given hierarchy level. | [optional] -**domain_id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | ID of the domain to which the group belongs. | [optional] -**parent_id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | Channel parent identifier. | [optional] -**description** | Option<**String**> | Channel description, free form text. | [optional] -**metadata** | Option<[**serde_json::Value**](.md)> | Arbitrary, object-encoded channels's data. | [optional] -**path** | Option<**String**> | Hierarchy path, concatenated ids of channel ancestors. | [optional] -**level** | Option<**i32**> | Level in hierarchy, distance from the root channel. | [optional] -**created_at** | Option<**String**> | Datetime when the channel was created. | [optional] -**updated_at** | Option<**String**> | Datetime when the channel was created. | [optional] -**status** | Option<**String**> | Channel Status | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/channels/docs/ChannelConnectionReqSchema.md b/channels/docs/ChannelConnectionReqSchema.md deleted file mode 100644 index 83e0d4c9..00000000 --- a/channels/docs/ChannelConnectionReqSchema.md +++ /dev/null @@ -1,12 +0,0 @@ -# ChannelConnectionReqSchema - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**client_ids** | Option<[**Vec**](serde_json::Value.md)> | Client IDs | [optional] -**types** | Option<[**Vec**](serde_json::Value.md)> | Connection types. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/channels/docs/ChannelReqObj.md b/channels/docs/ChannelReqObj.md deleted file mode 100644 index 1469bb6a..00000000 --- a/channels/docs/ChannelReqObj.md +++ /dev/null @@ -1,15 +0,0 @@ -# ChannelReqObj - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | Free-form channel name. Channel name is unique on the given hierarchy level. | -**description** | Option<**String**> | Channel description, free form text. | [optional] -**parent_id** | Option<**String**> | Id of parent channel, it must be existing channel. | [optional] -**metadata** | Option<[**serde_json::Value**](.md)> | Arbitrary, object-encoded channels's data. | [optional] -**status** | Option<**String**> | Channel Status | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/channels/docs/ChannelUpdate.md b/channels/docs/ChannelUpdate.md deleted file mode 100644 index d9f72c9d..00000000 --- a/channels/docs/ChannelUpdate.md +++ /dev/null @@ -1,13 +0,0 @@ -# ChannelUpdate - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | Free-form channel name. Channel name is unique on the given hierarchy level. | -**description** | **String** | Channel description, free form text. | -**metadata** | [**serde_json::Value**](.md) | Arbitrary, object-encoded channels's data. | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/channels/docs/ChannelUpdateTags.md b/channels/docs/ChannelUpdateTags.md deleted file mode 100644 index 5ab44380..00000000 --- a/channels/docs/ChannelUpdateTags.md +++ /dev/null @@ -1,11 +0,0 @@ -# ChannelUpdateTags - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**tags** | **Vec** | Channel tags. | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/channels/docs/ChannelsApi.md b/channels/docs/ChannelsApi.md deleted file mode 100644 index f391b9e6..00000000 --- a/channels/docs/ChannelsApi.md +++ /dev/null @@ -1,367 +0,0 @@ -# \ChannelsApi - -All URIs are relative to *http://localhost:9005* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**create_channel**](ChannelsApi.md#create_channel) | **POST** /{domainID}/channels | Creates new channel -[**create_channels**](ChannelsApi.md#create_channels) | **POST** /{domainID}/channels/bulk | Creates new channels -[**disable_channel**](ChannelsApi.md#disable_channel) | **POST** /{domainID}/channels/{chanID}/disable | Disables a channel -[**domain_id_channels_chan_id_delete**](ChannelsApi.md#domain_id_channels_chan_id_delete) | **DELETE** /{domainID}/channels/{chanID} | Delete channel for given channel id. -[**enable_channel**](ChannelsApi.md#enable_channel) | **POST** /{domainID}/channels/{chanID}/enable | Enables a channel -[**get_channel**](ChannelsApi.md#get_channel) | **GET** /{domainID}/channels/{chanID} | Retrieves channel info. -[**list_channels**](ChannelsApi.md#list_channels) | **GET** /{domainID}/channels | Lists channels. -[**remove_channel_parent_group**](ChannelsApi.md#remove_channel_parent_group) | **DELETE** /{domainID}/channels/{chanID}/parent | Removes a parent group from a channel. -[**set_channel_parent_group**](ChannelsApi.md#set_channel_parent_group) | **POST** /{domainID}/channels/{chanID}/parent | Sets a parent group for a channel -[**update_channel**](ChannelsApi.md#update_channel) | **PATCH** /{domainID}/channels/{chanID} | Updates channel data. -[**update_channel_tags**](ChannelsApi.md#update_channel_tags) | **PATCH** /{domainID}/channels/{chanID}/tags | Updates channel tags. - - - -## create_channel - -> models::Channel create_channel(domain_id, channel_req_obj) -Creates new channel - -Creates new channel in domain. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**channel_req_obj** | [**ChannelReqObj**](ChannelReqObj.md) | JSON-formatted document describing the new channel to be registered | [required] | - -### Return type - -[**models::Channel**](Channel.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## create_channels - -> Vec create_channels(domain_id, channel_req_obj) -Creates new channels - -Creates new channels in domain. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**channel_req_obj** | [**Vec**](ChannelReqObj.md) | JSON-formatted document describing the new channels to be registered | [required] | - -### Return type - -[**Vec**](Channel.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## disable_channel - -> models::Channel disable_channel(domain_id, chan_id) -Disables a channel - -Disables a specific channel that is identified by the channel ID. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**chan_id** | **uuid::Uuid** | Unique channel identifier. | [required] | - -### Return type - -[**models::Channel**](Channel.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## domain_id_channels_chan_id_delete - -> domain_id_channels_chan_id_delete(domain_id, chan_id) -Delete channel for given channel id. - -Delete channel remove given channel id from repo and removes all the policies related to channel. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**chan_id** | **uuid::Uuid** | Unique channel identifier. | [required] | - -### Return type - - (empty response body) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## enable_channel - -> models::Channel enable_channel(domain_id, chan_id) -Enables a channel - -Enables a specific channel that is identified by the channel ID. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**chan_id** | **uuid::Uuid** | Unique channel identifier. | [required] | - -### Return type - -[**models::Channel**](Channel.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## get_channel - -> models::Channel get_channel(domain_id, chan_id) -Retrieves channel info. - -Gets info on a channel specified by id. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**chan_id** | **uuid::Uuid** | Unique channel identifier. | [required] | - -### Return type - -[**models::Channel**](Channel.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## list_channels - -> models::ChannelsPage list_channels(domain_id, limit, offset, metadata, name) -Lists channels. - -Retrieves a list of channels. Due to performance concerns, data is retrieved in subsets. The API clients must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**limit** | Option<**i32**> | Size of the subset to retrieve. | |[default to 10] -**offset** | Option<**i32**> | Number of items to skip during retrieval. | |[default to 0] -**metadata** | Option<**String**> | Metadata filter. Filtering is performed matching the parameter with metadata on top level. Parameter is json. | | -**name** | Option<**String**> | Channel's name. | | - -### Return type - -[**models::ChannelsPage**](ChannelsPage.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## remove_channel_parent_group - -> remove_channel_parent_group(domain_id, chan_id, parent_group_req_obj) -Removes a parent group from a channel. - -Removes a parent group from a specific channel that is identified by the channel ID. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**chan_id** | **uuid::Uuid** | Unique channel identifier. | [required] | -**parent_group_req_obj** | [**ParentGroupReqObj**](ParentGroupReqObj.md) | JSON-formated document describing the parent group to be set to or removed from a channel. | [required] | - -### Return type - - (empty response body) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## set_channel_parent_group - -> set_channel_parent_group(domain_id, chan_id, parent_group_req_obj) -Sets a parent group for a channel - -Sets a parent group for a specific channel that is identified by the channel ID. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**chan_id** | **uuid::Uuid** | Unique channel identifier. | [required] | -**parent_group_req_obj** | [**ParentGroupReqObj**](ParentGroupReqObj.md) | JSON-formated document describing the parent group to be set to or removed from a channel. | [required] | - -### Return type - - (empty response body) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## update_channel - -> models::Channel update_channel(domain_id, chan_id, channel_update) -Updates channel data. - -Update is performed by replacing the current resource data with values provided in a request payload. Note that the channel's ID will not be affected. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**chan_id** | **uuid::Uuid** | Unique channel identifier. | [required] | -**channel_update** | [**ChannelUpdate**](ChannelUpdate.md) | JSON-formated document describing the metadata and name of channel to be updated. | [required] | - -### Return type - -[**models::Channel**](Channel.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## update_channel_tags - -> models::Channel update_channel_tags(domain_id, chan_id, channel_update) -Updates channel tags. - -Update is performed by replacing the current resource data with values provided in a request payload. Note that the channel's ID will not be affected. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**chan_id** | **uuid::Uuid** | Unique channel identifier. | [required] | -**channel_update** | [**ChannelUpdate**](ChannelUpdate.md) | JSON-formated document describing the tags of channel to be updated. | [required] | - -### Return type - -[**models::Channel**](Channel.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/channels/docs/ChannelsPage.md b/channels/docs/ChannelsPage.md deleted file mode 100644 index e804e1de..00000000 --- a/channels/docs/ChannelsPage.md +++ /dev/null @@ -1,14 +0,0 @@ -# ChannelsPage - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**channels** | [**Vec**](Channel.md) | | -**total** | **i32** | Total number of items. | -**offset** | **i32** | Number of items to skip during retrieval. | -**limit** | Option<**i32**> | Maximum number of items to return in one page. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/channels/docs/ConnectionReqSchema.md b/channels/docs/ConnectionReqSchema.md deleted file mode 100644 index 8aa7c76b..00000000 --- a/channels/docs/ConnectionReqSchema.md +++ /dev/null @@ -1,13 +0,0 @@ -# ConnectionReqSchema - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**channel_ids** | Option<[**Vec**](serde_json::Value.md)> | Channel IDs. | [optional] -**client_ids** | Option<[**Vec**](serde_json::Value.md)> | Client IDs | [optional] -**types** | Option<[**Vec**](serde_json::Value.md)> | Connection types. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/channels/docs/ConnectionsApi.md b/channels/docs/ConnectionsApi.md deleted file mode 100644 index 5d38e1f5..00000000 --- a/channels/docs/ConnectionsApi.md +++ /dev/null @@ -1,138 +0,0 @@ -# \ConnectionsApi - -All URIs are relative to *http://localhost:9005* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**connect_clients_and_channels**](ConnectionsApi.md#connect_clients_and_channels) | **POST** /{domainID}/channels/connect | Connects client and channel. -[**connect_clients_to_channel**](ConnectionsApi.md#connect_clients_to_channel) | **POST** /{domainID}/channels/{chanID}/connect | Connects clients to a channel -[**disconnect_clients_and_channels**](ConnectionsApi.md#disconnect_clients_and_channels) | **POST** /{domainID}/channels/disconnect | Disconnects client and channel. -[**disconnect_clients_from_channel**](ConnectionsApi.md#disconnect_clients_from_channel) | **POST** /{domainID}/channels/{chanID}/disconnect | Disconnects clients from a channel - - - -## connect_clients_and_channels - -> connect_clients_and_channels(domain_id, connection_req_schema) -Connects client and channel. - -Connect clients specified by IDs to channels specified by IDs. Channel and client are owned by user identified using the provided access token. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**connection_req_schema** | [**ConnectionReqSchema**](ConnectionReqSchema.md) | JSON-formatted document describing the new connection. | [required] | - -### Return type - - (empty response body) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## connect_clients_to_channel - -> connect_clients_to_channel(domain_id, chan_id, channel_connection_req_schema) -Connects clients to a channel - -Connects clients to a channel that is identified by the channel ID. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**chan_id** | **uuid::Uuid** | Unique channel identifier. | [required] | -**channel_connection_req_schema** | [**ChannelConnectionReqSchema**](ChannelConnectionReqSchema.md) | JSON-formatted document describing the new connection. | [required] | - -### Return type - - (empty response body) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## disconnect_clients_and_channels - -> disconnect_clients_and_channels(domain_id, connection_req_schema) -Disconnects client and channel. - -Disconnect clients specified by IDs from channels specified by IDs. Channel and client are owned by user identified using the provided access token. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**connection_req_schema** | [**ConnectionReqSchema**](ConnectionReqSchema.md) | JSON-formatted document describing the new connection. | [required] | - -### Return type - - (empty response body) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## disconnect_clients_from_channel - -> disconnect_clients_from_channel(domain_id, chan_id, channel_connection_req_schema) -Disconnects clients from a channel - -Disconnects clients to a channel that is identified by the channel ID. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**chan_id** | **uuid::Uuid** | Unique channel identifier. | [required] | -**channel_connection_req_schema** | [**ChannelConnectionReqSchema**](ChannelConnectionReqSchema.md) | JSON-formatted document describing the new connection. | [required] | - -### Return type - - (empty response body) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/channels/docs/Error.md b/channels/docs/Error.md deleted file mode 100644 index 8e78862d..00000000 --- a/channels/docs/Error.md +++ /dev/null @@ -1,11 +0,0 @@ -# Error - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**error** | Option<**String**> | Error message | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/channels/docs/HealthApi.md b/channels/docs/HealthApi.md deleted file mode 100644 index 1ce8aefe..00000000 --- a/channels/docs/HealthApi.md +++ /dev/null @@ -1,34 +0,0 @@ -# \HealthApi - -All URIs are relative to *http://localhost:9005* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**health_get**](HealthApi.md#health_get) | **GET** /health | Retrieves service health check info. - - - -## health_get - -> models::HealthRes health_get() -Retrieves service health check info. - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -[**models::HealthRes**](HealthRes.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/health+json, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/channels/docs/HealthRes.md b/channels/docs/HealthRes.md deleted file mode 100644 index 319b16fb..00000000 --- a/channels/docs/HealthRes.md +++ /dev/null @@ -1,15 +0,0 @@ -# HealthRes - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | Option<**String**> | Service status. | [optional] -**version** | Option<**String**> | Service version. | [optional] -**commit** | Option<**String**> | Service commit hash. | [optional] -**description** | Option<**String**> | Service description. | [optional] -**build_time** | Option<**String**> | Service build time. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/channels/docs/ParentGroupReqObj.md b/channels/docs/ParentGroupReqObj.md deleted file mode 100644 index 61fb46b3..00000000 --- a/channels/docs/ParentGroupReqObj.md +++ /dev/null @@ -1,11 +0,0 @@ -# ParentGroupReqObj - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**parent_group_id** | [**uuid::Uuid**](uuid::Uuid.md) | Parent group unique identifier. | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/channels/git_push.sh b/channels/git_push.sh deleted file mode 100644 index f53a75d4..00000000 --- a/channels/git_push.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 -git_host=$4 - -if [ "$git_host" = "" ]; then - git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" -fi - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' diff --git a/channels/src/apis/configuration.rs b/channels/src/apis/configuration.rs deleted file mode 100644 index 3abd5fa1..00000000 --- a/channels/src/apis/configuration.rs +++ /dev/null @@ -1,51 +0,0 @@ -/* - * SuperMQ Channels Service - * - * This is the Channels Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform channels. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - - - -#[derive(Debug, Clone)] -pub struct Configuration { - pub base_path: String, - pub user_agent: Option, - pub client: reqwest::Client, - pub basic_auth: Option, - pub oauth_access_token: Option, - pub bearer_access_token: Option, - pub api_key: Option, -} - -pub type BasicAuth = (String, Option); - -#[derive(Debug, Clone)] -pub struct ApiKey { - pub prefix: Option, - pub key: String, -} - - -impl Configuration { - pub fn new() -> Configuration { - Configuration::default() - } -} - -impl Default for Configuration { - fn default() -> Self { - Configuration { - base_path: "http://localhost:9005".to_owned(), - user_agent: Some("OpenAPI-Generator/0.15.1/rust".to_owned()), - client: reqwest::Client::new(), - basic_auth: None, - oauth_access_token: None, - bearer_access_token: None, - api_key: None, - } - } -} diff --git a/channels/src/apis/connections_api.rs b/channels/src/apis/connections_api.rs deleted file mode 100644 index c65eb65a..00000000 --- a/channels/src/apis/connections_api.rs +++ /dev/null @@ -1,202 +0,0 @@ -/* - * SuperMQ Channels Service - * - * This is the Channels Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform channels. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - - -use reqwest; -use serde::{Deserialize, Serialize}; -use crate::{apis::ResponseContent, models}; -use super::{Error, configuration}; - - -/// struct for typed errors of method [`connect_clients_and_channels`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ConnectClientsAndChannelsError { - Status400(), - Status401(), - Status403(), - Status404(), - Status409(), - Status415(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`connect_clients_to_channel`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ConnectClientsToChannelError { - Status400(), - Status401(), - Status403(), - Status404(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`disconnect_clients_and_channels`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum DisconnectClientsAndChannelsError { - Status400(), - Status401(), - Status403(), - Status404(), - Status409(), - Status415(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`disconnect_clients_from_channel`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum DisconnectClientsFromChannelError { - Status400(), - Status401(), - Status403(), - Status404(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - - -/// Connect clients specified by IDs to channels specified by IDs. Channel and client are owned by user identified using the provided access token. -pub async fn connect_clients_and_channels(configuration: &configuration::Configuration, domain_id: &str, connection_req_schema: models::ConnectionReqSchema) -> Result<(), Error> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/{domainID}/channels/connect", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - local_var_req_builder = local_var_req_builder.json(&connection_req_schema); - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - Ok(()) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Connects clients to a channel that is identified by the channel ID. -pub async fn connect_clients_to_channel(configuration: &configuration::Configuration, domain_id: &str, chan_id: &str, channel_connection_req_schema: models::ChannelConnectionReqSchema) -> Result<(), Error> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/{domainID}/channels/{chanID}/connect", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), chanID=crate::apis::urlencode(chan_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - local_var_req_builder = local_var_req_builder.json(&channel_connection_req_schema); - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - Ok(()) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Disconnect clients specified by IDs from channels specified by IDs. Channel and client are owned by user identified using the provided access token. -pub async fn disconnect_clients_and_channels(configuration: &configuration::Configuration, domain_id: &str, connection_req_schema: models::ConnectionReqSchema) -> Result<(), Error> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/{domainID}/channels/disconnect", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - local_var_req_builder = local_var_req_builder.json(&connection_req_schema); - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - Ok(()) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Disconnects clients to a channel that is identified by the channel ID. -pub async fn disconnect_clients_from_channel(configuration: &configuration::Configuration, domain_id: &str, chan_id: &str, channel_connection_req_schema: models::ChannelConnectionReqSchema) -> Result<(), Error> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/{domainID}/channels/{chanID}/disconnect", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), chanID=crate::apis::urlencode(chan_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - local_var_req_builder = local_var_req_builder.json(&channel_connection_req_schema); - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - Ok(()) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - diff --git a/channels/src/apis/health_api.rs b/channels/src/apis/health_api.rs deleted file mode 100644 index 8a9a2015..00000000 --- a/channels/src/apis/health_api.rs +++ /dev/null @@ -1,53 +0,0 @@ -/* - * SuperMQ Channels Service - * - * This is the Channels Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform channels. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - - -use reqwest; -use serde::{Deserialize, Serialize}; -use crate::{apis::ResponseContent, models}; -use super::{Error, configuration}; - - -/// struct for typed errors of method [`health_get`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum HealthGetError { - Status500(models::Error), - UnknownValue(serde_json::Value), -} - - -pub async fn health_get(configuration: &configuration::Configuration, ) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/health", local_var_configuration.base_path); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - diff --git a/channels/src/apis/mod.rs b/channels/src/apis/mod.rs deleted file mode 100644 index b9cec318..00000000 --- a/channels/src/apis/mod.rs +++ /dev/null @@ -1,97 +0,0 @@ -use std::error; -use std::fmt; - -#[derive(Debug, Clone)] -pub struct ResponseContent { - pub status: reqwest::StatusCode, - pub content: String, - pub entity: Option, -} - -#[derive(Debug)] -pub enum Error { - Reqwest(reqwest::Error), - Serde(serde_json::Error), - Io(std::io::Error), - ResponseError(ResponseContent), -} - -impl fmt::Display for Error { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - let (module, e) = match self { - Error::Reqwest(e) => ("reqwest", e.to_string()), - Error::Serde(e) => ("serde", e.to_string()), - Error::Io(e) => ("IO", e.to_string()), - Error::ResponseError(e) => ("response", format!("status code {}", e.status)), - }; - write!(f, "error in {}: {}", module, e) - } -} - -impl error::Error for Error { - fn source(&self) -> Option<&(dyn error::Error + 'static)> { - Some(match self { - Error::Reqwest(e) => e, - Error::Serde(e) => e, - Error::Io(e) => e, - Error::ResponseError(_) => return None, - }) - } -} - -impl From for Error { - fn from(e: reqwest::Error) -> Self { - Error::Reqwest(e) - } -} - -impl From for Error { - fn from(e: serde_json::Error) -> Self { - Error::Serde(e) - } -} - -impl From for Error { - fn from(e: std::io::Error) -> Self { - Error::Io(e) - } -} - -pub fn urlencode>(s: T) -> String { - ::url::form_urlencoded::byte_serialize(s.as_ref().as_bytes()).collect() -} - -pub fn parse_deep_object(prefix: &str, value: &serde_json::Value) -> Vec<(String, String)> { - if let serde_json::Value::Object(object) = value { - let mut params = vec![]; - - for (key, value) in object { - match value { - serde_json::Value::Object(_) => params.append(&mut parse_deep_object( - &format!("{}[{}]", prefix, key), - value, - )), - serde_json::Value::Array(array) => { - for (i, value) in array.iter().enumerate() { - params.append(&mut parse_deep_object( - &format!("{}[{}][{}]", prefix, key, i), - value, - )); - } - }, - serde_json::Value::String(s) => params.push((format!("{}[{}]", prefix, key), s.clone())), - _ => params.push((format!("{}[{}]", prefix, key), value.to_string())), - } - } - - return params; - } - - unimplemented!("Only objects are supported with style=deepObject") -} - -pub mod channels_api; -pub mod connections_api; -pub mod health_api; - -pub mod configuration; diff --git a/channels/src/lib.rs b/channels/src/lib.rs deleted file mode 100644 index e1520628..00000000 --- a/channels/src/lib.rs +++ /dev/null @@ -1,11 +0,0 @@ -#![allow(unused_imports)] -#![allow(clippy::too_many_arguments)] - -extern crate serde_repr; -extern crate serde; -extern crate serde_json; -extern crate url; -extern crate reqwest; - -pub mod apis; -pub mod models; diff --git a/channels/src/models/channel_update_tags.rs b/channels/src/models/channel_update_tags.rs deleted file mode 100644 index 4f17b7a6..00000000 --- a/channels/src/models/channel_update_tags.rs +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SuperMQ Channels Service - * - * This is the Channels Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform channels. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ChannelUpdateTags { - /// Channel tags. - #[serde(rename = "tags")] - pub tags: Vec, -} - -impl ChannelUpdateTags { - pub fn new(tags: Vec) -> ChannelUpdateTags { - ChannelUpdateTags { - tags, - } - } -} - diff --git a/channels/src/models/error.rs b/channels/src/models/error.rs deleted file mode 100644 index a8297d8b..00000000 --- a/channels/src/models/error.rs +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SuperMQ Channels Service - * - * This is the Channels Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform channels. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct Error { - /// Error message - #[serde(rename = "error", skip_serializing_if = "Option::is_none")] - pub error: Option, -} - -impl Error { - pub fn new() -> Error { - Error { - error: None, - } - } -} - diff --git a/channels/src/models/health_res.rs b/channels/src/models/health_res.rs deleted file mode 100644 index a777ad14..00000000 --- a/channels/src/models/health_res.rs +++ /dev/null @@ -1,56 +0,0 @@ -/* - * SuperMQ Channels Service - * - * This is the Channels Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform channels. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct HealthRes { - /// Service status. - #[serde(rename = "status", skip_serializing_if = "Option::is_none")] - pub status: Option, - /// Service version. - #[serde(rename = "version", skip_serializing_if = "Option::is_none")] - pub version: Option, - /// Service commit hash. - #[serde(rename = "commit", skip_serializing_if = "Option::is_none")] - pub commit: Option, - /// Service description. - #[serde(rename = "description", skip_serializing_if = "Option::is_none")] - pub description: Option, - /// Service build time. - #[serde(rename = "build_time", skip_serializing_if = "Option::is_none")] - pub build_time: Option, -} - -impl HealthRes { - pub fn new() -> HealthRes { - HealthRes { - status: None, - version: None, - commit: None, - description: None, - build_time: None, - } - } -} -/// Service status. -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum Status { - #[serde(rename = "pass")] - Pass, -} - -impl Default for Status { - fn default() -> Status { - Self::Pass - } -} - diff --git a/channels/src/models/mod.rs b/channels/src/models/mod.rs deleted file mode 100644 index 2ca51007..00000000 --- a/channels/src/models/mod.rs +++ /dev/null @@ -1,20 +0,0 @@ -pub mod channel; -pub use self::channel::Channel; -pub mod channel_connection_req_schema; -pub use self::channel_connection_req_schema::ChannelConnectionReqSchema; -pub mod channel_req_obj; -pub use self::channel_req_obj::ChannelReqObj; -pub mod channel_update; -pub use self::channel_update::ChannelUpdate; -pub mod channel_update_tags; -pub use self::channel_update_tags::ChannelUpdateTags; -pub mod channels_page; -pub use self::channels_page::ChannelsPage; -pub mod connection_req_schema; -pub use self::connection_req_schema::ConnectionReqSchema; -pub mod error; -pub use self::error::Error; -pub mod health_res; -pub use self::health_res::HealthRes; -pub mod parent_group_req_obj; -pub use self::parent_group_req_obj::ParentGroupReqObj; diff --git a/channels/src/models/parent_group_req_obj.rs b/channels/src/models/parent_group_req_obj.rs deleted file mode 100644 index 0f1fd1a1..00000000 --- a/channels/src/models/parent_group_req_obj.rs +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SuperMQ Channels Service - * - * This is the Channels Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform channels. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ParentGroupReqObj { - /// Parent group unique identifier. - #[serde(rename = "parent_group_id")] - pub parent_group_id: uuid::Uuid, -} - -impl ParentGroupReqObj { - pub fn new(parent_group_id: uuid::Uuid) -> ParentGroupReqObj { - ParentGroupReqObj { - parent_group_id, - } - } -} - diff --git a/clients/.gitignore b/clients/.gitignore deleted file mode 100644 index 6aa10640..00000000 --- a/clients/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/target/ -**/*.rs.bk -Cargo.lock diff --git a/clients/.openapi-generator-ignore b/clients/.openapi-generator-ignore deleted file mode 100644 index 7484ee59..00000000 --- a/clients/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/clients/.openapi-generator/FILES b/clients/.openapi-generator/FILES deleted file mode 100644 index 1327833d..00000000 --- a/clients/.openapi-generator/FILES +++ /dev/null @@ -1,58 +0,0 @@ -.gitignore -.openapi-generator-ignore -.travis.yml -Cargo.toml -README.md -docs/AvailableActionsObj.md -docs/Client.md -docs/ClientCredentials.md -docs/ClientReqObj.md -docs/ClientReqObjCredentials.md -docs/ClientSecret.md -docs/ClientTags.md -docs/ClientUpdate.md -docs/ClientWithEmptySecret.md -docs/ClientWithEmptySecretCredentials.md -docs/ClientsApi.md -docs/ClientsPage.md -docs/CreateRoleObj.md -docs/Error.md -docs/HealthApi.md -docs/HealthRes.md -docs/NewRole.md -docs/ParentGroupReqObj.md -docs/Role.md -docs/RoleActionsObj.md -docs/RoleMembersObj.md -docs/RolesApi.md -docs/RolesPage.md -docs/UpdateRoleObj.md -git_push.sh -src/apis/clients_api.rs -src/apis/configuration.rs -src/apis/health_api.rs -src/apis/mod.rs -src/apis/roles_api.rs -src/lib.rs -src/models/available_actions_obj.rs -src/models/client.rs -src/models/client_credentials.rs -src/models/client_req_obj.rs -src/models/client_req_obj_credentials.rs -src/models/client_secret.rs -src/models/client_tags.rs -src/models/client_update.rs -src/models/client_with_empty_secret.rs -src/models/client_with_empty_secret_credentials.rs -src/models/clients_page.rs -src/models/create_role_obj.rs -src/models/error.rs -src/models/health_res.rs -src/models/mod.rs -src/models/new_role.rs -src/models/parent_group_req_obj.rs -src/models/role.rs -src/models/role_actions_obj.rs -src/models/role_members_obj.rs -src/models/roles_page.rs -src/models/update_role_obj.rs diff --git a/clients/.openapi-generator/VERSION b/clients/.openapi-generator/VERSION deleted file mode 100644 index 758bb9c8..00000000 --- a/clients/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -7.10.0 diff --git a/clients/.travis.yml b/clients/.travis.yml deleted file mode 100644 index 22761ba7..00000000 --- a/clients/.travis.yml +++ /dev/null @@ -1 +0,0 @@ -language: rust diff --git a/clients/Cargo.toml b/clients/Cargo.toml deleted file mode 100644 index b89a9142..00000000 --- a/clients/Cargo.toml +++ /dev/null @@ -1,15 +0,0 @@ -[package] -name = "Clients" -version = "0.15.1" -authors = ["info@abstractmachines.fr"] -description = "This is the Clients Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform clients. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) " -license = "Apache 2.0" -edition = "2021" - -[dependencies] -serde = { version = "^1.0", features = ["derive"] } -serde_json = "^1.0" -serde_repr = "^0.1" -url = "^2.5" -uuid = { version = "^1.8", features = ["serde", "v4"] } -reqwest = { version = "^0.12", features = ["json", "multipart"] } diff --git a/clients/README.md b/clients/README.md deleted file mode 100644 index c249adf6..00000000 --- a/clients/README.md +++ /dev/null @@ -1,96 +0,0 @@ -# Rust API client for openapi - -This is the Clients Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform clients. You can now help us improve the API whether it's by making changes to the definition itself or to the code. -Some useful links: -- [The SuperMQ repository](https://github.com/absmach/supermq) - - - -## Overview - -This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://openapis.org) from a remote server, you can easily generate an API client. - -- API version: 0.15.1 -- Package version: 0.15.1 -- Generator version: 7.10.0 -- Build package: `org.openapitools.codegen.languages.RustClientCodegen` - -## Installation - -Put the package under your project folder in a directory named `openapi` and add the following to `Cargo.toml` under `[dependencies]`: - -``` -openapi = { path = "./openapi" } -``` - -## Documentation for API Endpoints - -All URIs are relative to *http://localhost:9006* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*ClientsApi* | [**bulk_create_clients**](docs/ClientsApi.md#bulk_create_clients) | **POST** /{domainID}/clients/bulk | Bulk provisions new clients -*ClientsApi* | [**create_client**](docs/ClientsApi.md#create_client) | **POST** /{domainID}/clients | Adds new client -*ClientsApi* | [**disable_client**](docs/ClientsApi.md#disable_client) | **POST** /{domainID}/clients/{clientID}/disable | Disables a client -*ClientsApi* | [**domain_id_clients_client_id_delete**](docs/ClientsApi.md#domain_id_clients_client_id_delete) | **DELETE** /{domainID}/clients/{clientID} | Delete client for a client with the given id. -*ClientsApi* | [**enable_client**](docs/ClientsApi.md#enable_client) | **POST** /{domainID}/clients/{clientID}/enable | Enables a client -*ClientsApi* | [**get_client**](docs/ClientsApi.md#get_client) | **GET** /{domainID}/clients/{clientID} | Retrieves client info -*ClientsApi* | [**list_clients**](docs/ClientsApi.md#list_clients) | **GET** /{domainID}/clients | Retrieves clients -*ClientsApi* | [**list_user_clients**](docs/ClientsApi.md#list_user_clients) | **GET** /{domainID}/users/{userID}/clients | List clients asssociated with a user. -*ClientsApi* | [**remove_client_parent_group**](docs/ClientsApi.md#remove_client_parent_group) | **DELETE** /{domainID}/clients/{clientID}/parent | Removes a parent group from a client. -*ClientsApi* | [**set_client_parent_group**](docs/ClientsApi.md#set_client_parent_group) | **POST** /{domainID}/clients/{clientID}/parent | Sets a parent group for a client -*ClientsApi* | [**update_client**](docs/ClientsApi.md#update_client) | **PATCH** /{domainID}/clients/{clientID} | Updates name and metadata of the client. -*ClientsApi* | [**update_client_secret**](docs/ClientsApi.md#update_client_secret) | **PATCH** /{domainID}/clients/{clientID}/secret | Updates Secret of the identified client. -*ClientsApi* | [**update_client_tags**](docs/ClientsApi.md#update_client_tags) | **PATCH** /{domainID}/clients/{clientID}/tags | Updates tags the client. -*HealthApi* | [**health_get**](docs/HealthApi.md#health_get) | **GET** /health | Retrieves service health check info. -*RolesApi* | [**add_client_role_action**](docs/RolesApi.md#add_client_role_action) | **POST** /{domainID}/clients/{clientID}/roles/{roleName}/actions | Adds a role action for a client role. -*RolesApi* | [**add_client_role_member**](docs/RolesApi.md#add_client_role_member) | **POST** /{domainID}/clients/{clientID}/roles/{roleName}/members | Adds a member to a client role. -*RolesApi* | [**create_client_role**](docs/RolesApi.md#create_client_role) | **POST** /{domainID}/clients/{clientID}/roles | Creates a role for a client -*RolesApi* | [**delete_all_client_role_actions**](docs/RolesApi.md#delete_all_client_role_actions) | **POST** /{domainID}/clients/{clientID}/roles/{roleName}/actions/delete-all | Deletes all role actions for a client role. -*RolesApi* | [**delete_all_client_role_members**](docs/RolesApi.md#delete_all_client_role_members) | **POST** /{domainID}/clients/{clientID}/roles/{roleName}/members/delete-all | Deletes all members from a client role. -*RolesApi* | [**delete_client_role**](docs/RolesApi.md#delete_client_role) | **DELETE** /{domainID}/clients/{clientID}/roles/{roleName} | Deletes client role. -*RolesApi* | [**delete_client_role_action**](docs/RolesApi.md#delete_client_role_action) | **POST** /{domainID}/clients/{clientID}/roles/{roleName}/actions/delete | Deletes role actions for a client role. -*RolesApi* | [**delete_client_role_members**](docs/RolesApi.md#delete_client_role_members) | **POST** /{domainID}/clients/{clientID}/roles/{roleName}/members/delete | Deletes members from a client role. -*RolesApi* | [**get_client_role**](docs/RolesApi.md#get_client_role) | **GET** /{domainID}/clients/{clientID}/roles/{roleName} | Retrieves client role. -*RolesApi* | [**list_available_actions**](docs/RolesApi.md#list_available_actions) | **GET** /{domainID}/clients/roles/available-actions | Retrieves available actions. -*RolesApi* | [**list_client_role_actions**](docs/RolesApi.md#list_client_role_actions) | **GET** /{domainID}/clients/{clientID}/roles/{roleName}/actions | Lists client role actions. -*RolesApi* | [**list_client_role_members**](docs/RolesApi.md#list_client_role_members) | **GET** /{domainID}/clients/{clientID}/roles/{roleName}/members | Lists client role members. -*RolesApi* | [**list_client_roles**](docs/RolesApi.md#list_client_roles) | **GET** /{domainID}/clients/{clientID}/roles | Retrieves clients roles. -*RolesApi* | [**update_client_role**](docs/RolesApi.md#update_client_role) | **PUT** /{domainID}/clients/{clientID}/roles/{roleName} | Updates client role. - - -## Documentation For Models - - - [AvailableActionsObj](docs/AvailableActionsObj.md) - - [Client](docs/Client.md) - - [ClientCredentials](docs/ClientCredentials.md) - - [ClientReqObj](docs/ClientReqObj.md) - - [ClientReqObjCredentials](docs/ClientReqObjCredentials.md) - - [ClientSecret](docs/ClientSecret.md) - - [ClientTags](docs/ClientTags.md) - - [ClientUpdate](docs/ClientUpdate.md) - - [ClientWithEmptySecret](docs/ClientWithEmptySecret.md) - - [ClientWithEmptySecretCredentials](docs/ClientWithEmptySecretCredentials.md) - - [ClientsPage](docs/ClientsPage.md) - - [CreateRoleObj](docs/CreateRoleObj.md) - - [Error](docs/Error.md) - - [HealthRes](docs/HealthRes.md) - - [NewRole](docs/NewRole.md) - - [ParentGroupReqObj](docs/ParentGroupReqObj.md) - - [Role](docs/Role.md) - - [RoleActionsObj](docs/RoleActionsObj.md) - - [RoleMembersObj](docs/RoleMembersObj.md) - - [RolesPage](docs/RolesPage.md) - - [UpdateRoleObj](docs/UpdateRoleObj.md) - - -To get access to the crate's generated documentation, use: - -``` -cargo doc --open -``` - -## Author - -info@abstractmachines.fr - diff --git a/clients/docs/AvailableActionsObj.md b/clients/docs/AvailableActionsObj.md deleted file mode 100644 index 07f6848c..00000000 --- a/clients/docs/AvailableActionsObj.md +++ /dev/null @@ -1,11 +0,0 @@ -# AvailableActionsObj - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**available_actions** | Option<**Vec**> | List of all available actions. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/clients/docs/Client.md b/clients/docs/Client.md deleted file mode 100644 index 35bb2adc..00000000 --- a/clients/docs/Client.md +++ /dev/null @@ -1,19 +0,0 @@ -# Client - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | Client unique identifier. | [optional] -**name** | Option<**String**> | Client name. | [optional] -**tags** | Option<**Vec**> | Client tags. | [optional] -**domain_id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | ID of the domain to which client belongs. | [optional] -**credentials** | Option<[**models::ClientCredentials**](Client_credentials.md)> | | [optional] -**metadata** | Option<[**serde_json::Value**](.md)> | Arbitrary, object-encoded client's data. | [optional] -**status** | Option<**String**> | Client Status | [optional] -**created_at** | Option<**String**> | Time when the channel was created. | [optional] -**updated_at** | Option<**String**> | Time when the channel was created. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/clients/docs/ClientCredentials.md b/clients/docs/ClientCredentials.md deleted file mode 100644 index 08a01a1d..00000000 --- a/clients/docs/ClientCredentials.md +++ /dev/null @@ -1,12 +0,0 @@ -# ClientCredentials - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**identity** | Option<**String**> | Client Identity for example email address. | [optional] -**secret** | Option<**String**> | Client secret password. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/clients/docs/ClientReqObj.md b/clients/docs/ClientReqObj.md deleted file mode 100644 index ac2744a7..00000000 --- a/clients/docs/ClientReqObj.md +++ /dev/null @@ -1,15 +0,0 @@ -# ClientReqObj - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | Option<**String**> | Client name. | [optional] -**tags** | Option<**Vec**> | Client tags. | [optional] -**credentials** | [**models::ClientReqObjCredentials**](ClientReqObj_credentials.md) | | -**metadata** | Option<[**serde_json::Value**](.md)> | Arbitrary, object-encoded client's data. | [optional] -**status** | Option<**String**> | Client Status | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/clients/docs/ClientReqObjCredentials.md b/clients/docs/ClientReqObjCredentials.md deleted file mode 100644 index e25cb3d8..00000000 --- a/clients/docs/ClientReqObjCredentials.md +++ /dev/null @@ -1,12 +0,0 @@ -# ClientReqObjCredentials - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**identity** | Option<**String**> | Client's identity will be used as its unique identifier | [optional] -**secret** | Option<**String**> | Free-form account secret used for acquiring auth token(s). | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/clients/docs/ClientSecret.md b/clients/docs/ClientSecret.md deleted file mode 100644 index 24c9703e..00000000 --- a/clients/docs/ClientSecret.md +++ /dev/null @@ -1,11 +0,0 @@ -# ClientSecret - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**secret** | **String** | New client secret. | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/clients/docs/ClientTags.md b/clients/docs/ClientTags.md deleted file mode 100644 index 359f66a5..00000000 --- a/clients/docs/ClientTags.md +++ /dev/null @@ -1,11 +0,0 @@ -# ClientTags - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**tags** | Option<**Vec**> | Client tags. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/clients/docs/ClientUpdate.md b/clients/docs/ClientUpdate.md deleted file mode 100644 index a82f229d..00000000 --- a/clients/docs/ClientUpdate.md +++ /dev/null @@ -1,12 +0,0 @@ -# ClientUpdate - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | Client name. | -**metadata** | [**serde_json::Value**](.md) | Arbitrary, object-encoded client's data. | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/clients/docs/ClientWithEmptySecret.md b/clients/docs/ClientWithEmptySecret.md deleted file mode 100644 index 634c3678..00000000 --- a/clients/docs/ClientWithEmptySecret.md +++ /dev/null @@ -1,19 +0,0 @@ -# ClientWithEmptySecret - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | Client unique identifier. | [optional] -**name** | Option<**String**> | Client name. | [optional] -**tags** | Option<**Vec**> | Client tags. | [optional] -**domain_id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | ID of the domain to which client belongs. | [optional] -**credentials** | Option<[**models::ClientWithEmptySecretCredentials**](ClientWithEmptySecret_credentials.md)> | | [optional] -**metadata** | Option<[**serde_json::Value**](.md)> | Arbitrary, object-encoded client's data. | [optional] -**status** | Option<**String**> | Client Status | [optional] -**created_at** | Option<**String**> | Time when the channel was created. | [optional] -**updated_at** | Option<**String**> | Time when the channel was created. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/clients/docs/ClientWithEmptySecretCredentials.md b/clients/docs/ClientWithEmptySecretCredentials.md deleted file mode 100644 index 3b1a19b6..00000000 --- a/clients/docs/ClientWithEmptySecretCredentials.md +++ /dev/null @@ -1,12 +0,0 @@ -# ClientWithEmptySecretCredentials - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**identity** | Option<**String**> | Client Identity for example email address. | [optional] -**secret** | Option<**String**> | Client secret password. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/clients/docs/ClientsApi.md b/clients/docs/ClientsApi.md deleted file mode 100644 index 04f38e43..00000000 --- a/clients/docs/ClientsApi.md +++ /dev/null @@ -1,440 +0,0 @@ -# \ClientsApi - -All URIs are relative to *http://localhost:9006* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**bulk_create_clients**](ClientsApi.md#bulk_create_clients) | **POST** /{domainID}/clients/bulk | Bulk provisions new clients -[**create_client**](ClientsApi.md#create_client) | **POST** /{domainID}/clients | Adds new client -[**disable_client**](ClientsApi.md#disable_client) | **POST** /{domainID}/clients/{clientID}/disable | Disables a client -[**domain_id_clients_client_id_delete**](ClientsApi.md#domain_id_clients_client_id_delete) | **DELETE** /{domainID}/clients/{clientID} | Delete client for a client with the given id. -[**enable_client**](ClientsApi.md#enable_client) | **POST** /{domainID}/clients/{clientID}/enable | Enables a client -[**get_client**](ClientsApi.md#get_client) | **GET** /{domainID}/clients/{clientID} | Retrieves client info -[**list_clients**](ClientsApi.md#list_clients) | **GET** /{domainID}/clients | Retrieves clients -[**list_user_clients**](ClientsApi.md#list_user_clients) | **GET** /{domainID}/users/{userID}/clients | List clients asssociated with a user. -[**remove_client_parent_group**](ClientsApi.md#remove_client_parent_group) | **DELETE** /{domainID}/clients/{clientID}/parent | Removes a parent group from a client. -[**set_client_parent_group**](ClientsApi.md#set_client_parent_group) | **POST** /{domainID}/clients/{clientID}/parent | Sets a parent group for a client -[**update_client**](ClientsApi.md#update_client) | **PATCH** /{domainID}/clients/{clientID} | Updates name and metadata of the client. -[**update_client_secret**](ClientsApi.md#update_client_secret) | **PATCH** /{domainID}/clients/{clientID}/secret | Updates Secret of the identified client. -[**update_client_tags**](ClientsApi.md#update_client_tags) | **PATCH** /{domainID}/clients/{clientID}/tags | Updates tags the client. - - - -## bulk_create_clients - -> models::ClientsPage bulk_create_clients(domain_id, client_req_obj) -Bulk provisions new clients - -Adds a list of new clients to the list of clients owned by user identified using the provided access token. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**client_req_obj** | [**Vec**](ClientReqObj.md) | JSON-formatted document describing the new clients. | [required] | - -### Return type - -[**models::ClientsPage**](ClientsPage.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## create_client - -> models::Client create_client(domain_id, client_req_obj) -Adds new client - -Adds new client to the list of clients owned by user identified using the provided access token. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**client_req_obj** | [**ClientReqObj**](ClientReqObj.md) | JSON-formatted document describing the new client to be registered | [required] | - -### Return type - -[**models::Client**](Client.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## disable_client - -> models::Client disable_client(domain_id, client_id) -Disables a client - -Disables a specific client that is identified by the client ID. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**client_id** | **uuid::Uuid** | Unique client identifier. | [required] | - -### Return type - -[**models::Client**](Client.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## domain_id_clients_client_id_delete - -> domain_id_clients_client_id_delete(domain_id, client_id) -Delete client for a client with the given id. - -Delete client removes a client with the given id from repo and removes all the policies related to this client. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**client_id** | **uuid::Uuid** | Unique client identifier. | [required] | - -### Return type - - (empty response body) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## enable_client - -> models::Client enable_client(domain_id, client_id) -Enables a client - -Enables a specific client that is identified by the client ID. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**client_id** | **uuid::Uuid** | Unique client identifier. | [required] | - -### Return type - -[**models::Client**](Client.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## get_client - -> models::Client get_client(domain_id, client_id) -Retrieves client info - -Retrieves a specific client that is identified by the client ID. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**client_id** | **uuid::Uuid** | Unique client identifier. | [required] | - -### Return type - -[**models::Client**](Client.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## list_clients - -> models::ClientsPage list_clients(domain_id, limit, offset, metadata, status, name, tags) -Retrieves clients - -Retrieves a list of clients. Due to performance concerns, data is retrieved in subsets. The API clients must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**limit** | Option<**i32**> | Size of the subset to retrieve. | |[default to 10] -**offset** | Option<**i32**> | Number of items to skip during retrieval. | |[default to 0] -**metadata** | Option<**String**> | Metadata filter. Filtering is performed matching the parameter with metadata on top level. Parameter is json. | | -**status** | Option<**String**> | Client account status. | |[default to enabled] -**name** | Option<**String**> | Client's name. | | -**tags** | Option<[**Vec**](String.md)> | Client tags. | | - -### Return type - -[**models::ClientsPage**](ClientsPage.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## list_user_clients - -> models::ClientsPage list_user_clients(domain_id, user_id, limit, offset, metadata, status, name, tags) -List clients asssociated with a user. - -Lists clients associated with a user identified by the user ID. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**user_id** | **uuid::Uuid** | Unique user identifier. | [required] | -**limit** | Option<**i32**> | Size of the subset to retrieve. | |[default to 10] -**offset** | Option<**i32**> | Number of items to skip during retrieval. | |[default to 0] -**metadata** | Option<**String**> | Metadata filter. Filtering is performed matching the parameter with metadata on top level. Parameter is json. | | -**status** | Option<**String**> | Client account status. | |[default to enabled] -**name** | Option<**String**> | Client's name. | | -**tags** | Option<[**Vec**](String.md)> | Client tags. | | - -### Return type - -[**models::ClientsPage**](ClientsPage.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## remove_client_parent_group - -> remove_client_parent_group(domain_id, client_id, parent_group_req_obj) -Removes a parent group from a client. - -Removes a parent group from a specific client that is identified by the client ID. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**client_id** | **uuid::Uuid** | Unique client identifier. | [required] | -**parent_group_req_obj** | [**ParentGroupReqObj**](ParentGroupReqObj.md) | JSON-formated document describing the parent group to be set to or removed from a client. | [required] | - -### Return type - - (empty response body) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## set_client_parent_group - -> set_client_parent_group(domain_id, client_id, parent_group_req_obj) -Sets a parent group for a client - -Sets a parent group for a specific client that is identified by the client ID. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**client_id** | **uuid::Uuid** | Unique client identifier. | [required] | -**parent_group_req_obj** | [**ParentGroupReqObj**](ParentGroupReqObj.md) | JSON-formated document describing the parent group to be set to or removed from a client. | [required] | - -### Return type - - (empty response body) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## update_client - -> models::Client update_client(domain_id, client_id, client_update) -Updates name and metadata of the client. - -Update is performed by replacing the current resource data with values provided in a request payload. Note that the client's type and ID cannot be changed. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**client_id** | **uuid::Uuid** | Unique client identifier. | [required] | -**client_update** | [**ClientUpdate**](ClientUpdate.md) | JSON-formated document describing the metadata and name of client to be update | [required] | - -### Return type - -[**models::Client**](Client.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## update_client_secret - -> models::Client update_client_secret(domain_id, client_id, client_secret) -Updates Secret of the identified client. - -Updates secret of the identified in client. Secret is updated using authorization token and the new received info. Update is performed by replacing current key with a new one. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**client_id** | **uuid::Uuid** | Unique client identifier. | [required] | -**client_secret** | [**ClientSecret**](ClientSecret.md) | Secret change data. Client can change its secret. | [required] | - -### Return type - -[**models::Client**](Client.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## update_client_tags - -> models::Client update_client_tags(domain_id, client_id, client_tags) -Updates tags the client. - -Updates tags of the client with provided ID. Tags is updated using authorization token and the new tags received in request. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**client_id** | **uuid::Uuid** | Unique client identifier. | [required] | -**client_tags** | [**ClientTags**](ClientTags.md) | JSON-formated document describing the tags of client to be update | [required] | - -### Return type - -[**models::Client**](Client.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/clients/docs/ClientsPage.md b/clients/docs/ClientsPage.md deleted file mode 100644 index cf1357f4..00000000 --- a/clients/docs/ClientsPage.md +++ /dev/null @@ -1,14 +0,0 @@ -# ClientsPage - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**clients** | [**Vec**](ClientWithEmptySecret.md) | | -**total** | **i32** | Total number of items. | -**offset** | **i32** | Number of items to skip during retrieval. | -**limit** | Option<**i32**> | Maximum number of items to return in one page. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/clients/docs/CreateRoleObj.md b/clients/docs/CreateRoleObj.md deleted file mode 100644 index 59ac3f4f..00000000 --- a/clients/docs/CreateRoleObj.md +++ /dev/null @@ -1,13 +0,0 @@ -# CreateRoleObj - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**role_name** | Option<**String**> | Role's name. | [optional] -**optional_actions** | Option<**Vec**> | List of optional actions. | [optional] -**optional_members** | Option<**Vec**> | List of optional members. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/clients/docs/Error.md b/clients/docs/Error.md deleted file mode 100644 index 8e78862d..00000000 --- a/clients/docs/Error.md +++ /dev/null @@ -1,11 +0,0 @@ -# Error - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**error** | Option<**String**> | Error message | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/clients/docs/HealthApi.md b/clients/docs/HealthApi.md deleted file mode 100644 index e4985ea0..00000000 --- a/clients/docs/HealthApi.md +++ /dev/null @@ -1,34 +0,0 @@ -# \HealthApi - -All URIs are relative to *http://localhost:9006* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**health_get**](HealthApi.md#health_get) | **GET** /health | Retrieves service health check info. - - - -## health_get - -> models::HealthRes health_get() -Retrieves service health check info. - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -[**models::HealthRes**](HealthRes.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/health+json, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/clients/docs/HealthRes.md b/clients/docs/HealthRes.md deleted file mode 100644 index 319b16fb..00000000 --- a/clients/docs/HealthRes.md +++ /dev/null @@ -1,15 +0,0 @@ -# HealthRes - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | Option<**String**> | Service status. | [optional] -**version** | Option<**String**> | Service version. | [optional] -**commit** | Option<**String**> | Service commit hash. | [optional] -**description** | Option<**String**> | Service description. | [optional] -**build_time** | Option<**String**> | Service build time. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/clients/docs/NewRole.md b/clients/docs/NewRole.md deleted file mode 100644 index 8d232bc0..00000000 --- a/clients/docs/NewRole.md +++ /dev/null @@ -1,17 +0,0 @@ -# NewRole - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**role_id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | Role unique identifier. | [optional] -**role_name** | Option<**String**> | Role's name. | [optional] -**entity_id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | Entity unique identifier. | [optional] -**created_by** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | Role creator unique identifier. | [optional] -**created_at** | Option<**String**> | Time when the channel was created. | [optional] -**updated_by** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | Role updater unique identifier. | [optional] -**updated_at** | Option<**String**> | Time when the channel was created. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/clients/docs/ParentGroupReqObj.md b/clients/docs/ParentGroupReqObj.md deleted file mode 100644 index 61fb46b3..00000000 --- a/clients/docs/ParentGroupReqObj.md +++ /dev/null @@ -1,11 +0,0 @@ -# ParentGroupReqObj - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**parent_group_id** | [**uuid::Uuid**](uuid::Uuid.md) | Parent group unique identifier. | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/clients/docs/Role.md b/clients/docs/Role.md deleted file mode 100644 index c7a4694f..00000000 --- a/clients/docs/Role.md +++ /dev/null @@ -1,17 +0,0 @@ -# Role - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**role_id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | Role unique identifier. | [optional] -**role_name** | Option<**String**> | Role's name. | [optional] -**entity_id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | Entity unique identifier. | [optional] -**created_by** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | Role creator unique identifier. | [optional] -**created_at** | Option<**String**> | Time when the channel was created. | [optional] -**updated_by** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | Role updater unique identifier. | [optional] -**updated_at** | Option<**String**> | Time when the channel was created. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/clients/docs/RoleActionsObj.md b/clients/docs/RoleActionsObj.md deleted file mode 100644 index b61a2345..00000000 --- a/clients/docs/RoleActionsObj.md +++ /dev/null @@ -1,11 +0,0 @@ -# RoleActionsObj - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**actions** | Option<**Vec**> | List of actions to be added to a role. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/clients/docs/RoleMembersObj.md b/clients/docs/RoleMembersObj.md deleted file mode 100644 index 1d9d997a..00000000 --- a/clients/docs/RoleMembersObj.md +++ /dev/null @@ -1,11 +0,0 @@ -# RoleMembersObj - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**members** | Option<**Vec**> | List of members to be added to a role. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/clients/docs/RolesApi.md b/clients/docs/RolesApi.md deleted file mode 100644 index ee82c3c4..00000000 --- a/clients/docs/RolesApi.md +++ /dev/null @@ -1,474 +0,0 @@ -# \RolesApi - -All URIs are relative to *http://localhost:9006* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**add_client_role_action**](RolesApi.md#add_client_role_action) | **POST** /{domainID}/clients/{clientID}/roles/{roleName}/actions | Adds a role action for a client role. -[**add_client_role_member**](RolesApi.md#add_client_role_member) | **POST** /{domainID}/clients/{clientID}/roles/{roleName}/members | Adds a member to a client role. -[**create_client_role**](RolesApi.md#create_client_role) | **POST** /{domainID}/clients/{clientID}/roles | Creates a role for a client -[**delete_all_client_role_actions**](RolesApi.md#delete_all_client_role_actions) | **POST** /{domainID}/clients/{clientID}/roles/{roleName}/actions/delete-all | Deletes all role actions for a client role. -[**delete_all_client_role_members**](RolesApi.md#delete_all_client_role_members) | **POST** /{domainID}/clients/{clientID}/roles/{roleName}/members/delete-all | Deletes all members from a client role. -[**delete_client_role**](RolesApi.md#delete_client_role) | **DELETE** /{domainID}/clients/{clientID}/roles/{roleName} | Deletes client role. -[**delete_client_role_action**](RolesApi.md#delete_client_role_action) | **POST** /{domainID}/clients/{clientID}/roles/{roleName}/actions/delete | Deletes role actions for a client role. -[**delete_client_role_members**](RolesApi.md#delete_client_role_members) | **POST** /{domainID}/clients/{clientID}/roles/{roleName}/members/delete | Deletes members from a client role. -[**get_client_role**](RolesApi.md#get_client_role) | **GET** /{domainID}/clients/{clientID}/roles/{roleName} | Retrieves client role. -[**list_available_actions**](RolesApi.md#list_available_actions) | **GET** /{domainID}/clients/roles/available-actions | Retrieves available actions. -[**list_client_role_actions**](RolesApi.md#list_client_role_actions) | **GET** /{domainID}/clients/{clientID}/roles/{roleName}/actions | Lists client role actions. -[**list_client_role_members**](RolesApi.md#list_client_role_members) | **GET** /{domainID}/clients/{clientID}/roles/{roleName}/members | Lists client role members. -[**list_client_roles**](RolesApi.md#list_client_roles) | **GET** /{domainID}/clients/{clientID}/roles | Retrieves clients roles. -[**update_client_role**](RolesApi.md#update_client_role) | **PUT** /{domainID}/clients/{clientID}/roles/{roleName} | Updates client role. - - - -## add_client_role_action - -> models::RoleActionsObj add_client_role_action(domain_id, client_id, role_name, role_actions_obj) -Adds a role action for a client role. - -Adds a role action for a specific client role that is identified by the role name. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**client_id** | **uuid::Uuid** | Unique client identifier. | [required] | -**role_name** | **String** | Role's name. | [required] | -**role_actions_obj** | [**RoleActionsObj**](RoleActionsObj.md) | JSON- formatted object decsribing an action to be added to a role. | [required] | - -### Return type - -[**models::RoleActionsObj**](RoleActionsObj.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## add_client_role_member - -> models::RoleMembersObj add_client_role_member(domain_id, client_id, role_name, role_members_obj) -Adds a member to a client role. - -Adds a member to a specific client role that is identified by the role name. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**client_id** | **uuid::Uuid** | Unique client identifier. | [required] | -**role_name** | **String** | Role's name. | [required] | -**role_members_obj** | [**RoleMembersObj**](RoleMembersObj.md) | JSON- formatted object decsribing a member to be added to a role. | [required] | - -### Return type - -[**models::RoleMembersObj**](RoleMembersObj.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## create_client_role - -> models::NewRole create_client_role(domain_id, client_id, create_role_obj) -Creates a role for a client - -Creates a role for a specific client that is identified by the client ID. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**client_id** | **uuid::Uuid** | Unique client identifier. | [required] | -**create_role_obj** | [**CreateRoleObj**](CreateRoleObj.md) | JSON- formatted object decsribing a new role to be created. | [required] | - -### Return type - -[**models::NewRole**](NewRole.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## delete_all_client_role_actions - -> delete_all_client_role_actions(domain_id, client_id, role_name) -Deletes all role actions for a client role. - -Deletes all role actions for a specific client role that is identified by the role name. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**client_id** | **uuid::Uuid** | Unique client identifier. | [required] | -**role_name** | **String** | Role's name. | [required] | - -### Return type - - (empty response body) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## delete_all_client_role_members - -> delete_all_client_role_members(domain_id, client_id, role_name) -Deletes all members from a client role. - -Deletes all members from a specific client role that is identified by the role name. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**client_id** | **uuid::Uuid** | Unique client identifier. | [required] | -**role_name** | **String** | Role's name. | [required] | - -### Return type - - (empty response body) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## delete_client_role - -> delete_client_role(domain_id, client_id, role_name) -Deletes client role. - -Deletes a specific client role that is identified by the role name. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**client_id** | **uuid::Uuid** | Unique client identifier. | [required] | -**role_name** | **String** | Role's name. | [required] | - -### Return type - - (empty response body) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## delete_client_role_action - -> delete_client_role_action(domain_id, client_id, role_name, role_actions_obj) -Deletes role actions for a client role. - -Deletes a role action for a specific client role that is identified by the role name. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**client_id** | **uuid::Uuid** | Unique client identifier. | [required] | -**role_name** | **String** | Role's name. | [required] | -**role_actions_obj** | [**RoleActionsObj**](RoleActionsObj.md) | JSON- formatted object decsribing an action to be added to a role. | [required] | - -### Return type - - (empty response body) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## delete_client_role_members - -> delete_client_role_members(domain_id, client_id, role_name, role_members_obj) -Deletes members from a client role. - -Deletes a member from a specific client role that is identified by the role name. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**client_id** | **uuid::Uuid** | Unique client identifier. | [required] | -**role_name** | **String** | Role's name. | [required] | -**role_members_obj** | [**RoleMembersObj**](RoleMembersObj.md) | JSON- formatted object decsribing a member to be added to a role. | [required] | - -### Return type - - (empty response body) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## get_client_role - -> models::Role get_client_role(domain_id, client_id, role_name) -Retrieves client role. - -Retrieves a specific client role that is identified by the role name. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**client_id** | **uuid::Uuid** | Unique client identifier. | [required] | -**role_name** | **String** | Role's name. | [required] | - -### Return type - -[**models::Role**](Role.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## list_available_actions - -> models::AvailableActionsObj list_available_actions(domain_id) -Retrieves available actions. - -Retrieves a list of available actions. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | - -### Return type - -[**models::AvailableActionsObj**](AvailableActionsObj.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## list_client_role_actions - -> models::RoleActionsObj list_client_role_actions(domain_id, client_id, role_name) -Lists client role actions. - -Retrieves a list of client role actions. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**client_id** | **uuid::Uuid** | Unique client identifier. | [required] | -**role_name** | **String** | Role's name. | [required] | - -### Return type - -[**models::RoleActionsObj**](RoleActionsObj.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## list_client_role_members - -> models::RoleMembersObj list_client_role_members(domain_id, client_id, role_name) -Lists client role members. - -Retrieves a list of client role members. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**client_id** | **uuid::Uuid** | Unique client identifier. | [required] | -**role_name** | **String** | Role's name. | [required] | - -### Return type - -[**models::RoleMembersObj**](RoleMembersObj.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## list_client_roles - -> models::RolesPage list_client_roles(domain_id, client_id, limit, offset) -Retrieves clients roles. - -Retrieves a list of client roles. Due to performance concerns, data is retrieved in subsets. The API clients must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**client_id** | **uuid::Uuid** | Unique client identifier. | [required] | -**limit** | Option<**i32**> | Size of the subset to retrieve. | |[default to 10] -**offset** | Option<**i32**> | Number of items to skip during retrieval. | |[default to 0] - -### Return type - -[**models::RolesPage**](RolesPage.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## update_client_role - -> models::Role update_client_role(domain_id, client_id, role_name, update_role_obj) -Updates client role. - -Updates a specific client role that is identified by the role name. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**client_id** | **uuid::Uuid** | Unique client identifier. | [required] | -**role_name** | **String** | Role's name. | [required] | -**update_role_obj** | [**UpdateRoleObj**](UpdateRoleObj.md) | JSON- formatted object decsribing a role to be updated. | [required] | - -### Return type - -[**models::Role**](Role.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/clients/docs/RolesPage.md b/clients/docs/RolesPage.md deleted file mode 100644 index be544da3..00000000 --- a/clients/docs/RolesPage.md +++ /dev/null @@ -1,14 +0,0 @@ -# RolesPage - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**roles** | Option<[**Vec**](Role.md)> | List of roles. | [optional] -**total** | Option<**i32**> | Total number of roles. | [optional] -**offset** | Option<**i32**> | Number of items to skip during retrieval. | [optional] -**limit** | Option<**i32**> | Maximum number of items to return in one page. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/clients/docs/UpdateRoleObj.md b/clients/docs/UpdateRoleObj.md deleted file mode 100644 index 050c5b88..00000000 --- a/clients/docs/UpdateRoleObj.md +++ /dev/null @@ -1,11 +0,0 @@ -# UpdateRoleObj - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | Option<**String**> | Role's name. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/clients/git_push.sh b/clients/git_push.sh deleted file mode 100644 index f53a75d4..00000000 --- a/clients/git_push.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 -git_host=$4 - -if [ "$git_host" = "" ]; then - git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" -fi - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' diff --git a/clients/src/apis/clients_api.rs b/clients/src/apis/clients_api.rs deleted file mode 100644 index 536d5bea..00000000 --- a/clients/src/apis/clients_api.rs +++ /dev/null @@ -1,647 +0,0 @@ -/* - * SuperMQ Clients Service - * - * This is the Clients Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform clients. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - - -use reqwest; -use serde::{Deserialize, Serialize}; -use crate::{apis::ResponseContent, models}; -use super::{Error, configuration}; - - -/// struct for typed errors of method [`bulk_create_clients`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum BulkCreateClientsError { - Status400(), - Status401(), - Status403(), - Status404(), - Status415(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`create_client`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CreateClientError { - Status400(), - Status401(), - Status403(), - Status404(), - Status409(), - Status415(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`disable_client`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum DisableClientError { - Status400(), - Status401(), - Status403(), - Status404(), - Status409(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`domain_id_clients_client_id_delete`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum DomainIdClientsClientIdDeleteError { - Status400(), - Status401(), - Status403(), - Status404(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`enable_client`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EnableClientError { - Status400(), - Status401(), - Status403(), - Status404(), - Status409(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`get_client`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum GetClientError { - Status400(), - Status401(), - Status403(), - Status404(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`list_clients`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ListClientsError { - Status400(), - Status401(), - Status403(), - Status404(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`list_user_clients`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ListUserClientsError { - Status400(), - Status401(), - Status403(), - Status404(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`remove_client_parent_group`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RemoveClientParentGroupError { - Status400(), - Status401(), - Status403(), - Status404(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`set_client_parent_group`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SetClientParentGroupError { - Status400(), - Status401(), - Status403(), - Status404(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`update_client`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UpdateClientError { - Status400(), - Status401(), - Status403(), - Status404(), - Status409(), - Status415(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`update_client_secret`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UpdateClientSecretError { - Status400(), - Status401(), - Status403(), - Status404(), - Status409(), - Status415(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`update_client_tags`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UpdateClientTagsError { - Status400(), - Status403(), - Status404(), - Status401(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - - -/// Adds a list of new clients to the list of clients owned by user identified using the provided access token. -pub async fn bulk_create_clients(configuration: &configuration::Configuration, domain_id: &str, client_req_obj: Vec) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/{domainID}/clients/bulk", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - local_var_req_builder = local_var_req_builder.json(&client_req_obj); - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Adds new client to the list of clients owned by user identified using the provided access token. -pub async fn create_client(configuration: &configuration::Configuration, domain_id: &str, client_req_obj: models::ClientReqObj) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/{domainID}/clients", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - local_var_req_builder = local_var_req_builder.json(&client_req_obj); - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Disables a specific client that is identified by the client ID. -pub async fn disable_client(configuration: &configuration::Configuration, domain_id: &str, client_id: &str) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/{domainID}/clients/{clientID}/disable", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), clientID=crate::apis::urlencode(client_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Delete client removes a client with the given id from repo and removes all the policies related to this client. -pub async fn domain_id_clients_client_id_delete(configuration: &configuration::Configuration, domain_id: &str, client_id: &str) -> Result<(), Error> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/{domainID}/clients/{clientID}", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), clientID=crate::apis::urlencode(client_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - Ok(()) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Enables a specific client that is identified by the client ID. -pub async fn enable_client(configuration: &configuration::Configuration, domain_id: &str, client_id: &str) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/{domainID}/clients/{clientID}/enable", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), clientID=crate::apis::urlencode(client_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Retrieves a specific client that is identified by the client ID. -pub async fn get_client(configuration: &configuration::Configuration, domain_id: &str, client_id: &str) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/{domainID}/clients/{clientID}", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), clientID=crate::apis::urlencode(client_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Retrieves a list of clients. Due to performance concerns, data is retrieved in subsets. The API clients must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. -pub async fn list_clients(configuration: &configuration::Configuration, domain_id: &str, limit: Option, offset: Option, metadata: Option<&str>, status: Option<&str>, name: Option<&str>, tags: Option>) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/{domainID}/clients", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); - - if let Some(ref local_var_str) = limit { - local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); - } - if let Some(ref local_var_str) = offset { - local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); - } - if let Some(ref local_var_str) = metadata { - local_var_req_builder = local_var_req_builder.query(&[("metadata", &local_var_str.to_string())]); - } - if let Some(ref local_var_str) = status { - local_var_req_builder = local_var_req_builder.query(&[("status", &local_var_str.to_string())]); - } - if let Some(ref local_var_str) = name { - local_var_req_builder = local_var_req_builder.query(&[("name", &local_var_str.to_string())]); - } - if let Some(ref local_var_str) = tags { - local_var_req_builder = match "multi" { - "multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("tags".to_owned(), p.to_string())).collect::>()), - _ => local_var_req_builder.query(&[("tags", &local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), - }; - } - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Lists clients associated with a user identified by the user ID. -pub async fn list_user_clients(configuration: &configuration::Configuration, domain_id: &str, user_id: &str, limit: Option, offset: Option, metadata: Option<&str>, status: Option<&str>, name: Option<&str>, tags: Option>) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/{domainID}/users/{userID}/clients", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), userID=crate::apis::urlencode(user_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); - - if let Some(ref local_var_str) = limit { - local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); - } - if let Some(ref local_var_str) = offset { - local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); - } - if let Some(ref local_var_str) = metadata { - local_var_req_builder = local_var_req_builder.query(&[("metadata", &local_var_str.to_string())]); - } - if let Some(ref local_var_str) = status { - local_var_req_builder = local_var_req_builder.query(&[("status", &local_var_str.to_string())]); - } - if let Some(ref local_var_str) = name { - local_var_req_builder = local_var_req_builder.query(&[("name", &local_var_str.to_string())]); - } - if let Some(ref local_var_str) = tags { - local_var_req_builder = match "multi" { - "multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("tags".to_owned(), p.to_string())).collect::>()), - _ => local_var_req_builder.query(&[("tags", &local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), - }; - } - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Removes a parent group from a specific client that is identified by the client ID. -pub async fn remove_client_parent_group(configuration: &configuration::Configuration, domain_id: &str, client_id: &str, parent_group_req_obj: models::ParentGroupReqObj) -> Result<(), Error> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/{domainID}/clients/{clientID}/parent", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), clientID=crate::apis::urlencode(client_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - local_var_req_builder = local_var_req_builder.json(&parent_group_req_obj); - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - Ok(()) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Sets a parent group for a specific client that is identified by the client ID. -pub async fn set_client_parent_group(configuration: &configuration::Configuration, domain_id: &str, client_id: &str, parent_group_req_obj: models::ParentGroupReqObj) -> Result<(), Error> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/{domainID}/clients/{clientID}/parent", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), clientID=crate::apis::urlencode(client_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - local_var_req_builder = local_var_req_builder.json(&parent_group_req_obj); - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - Ok(()) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Update is performed by replacing the current resource data with values provided in a request payload. Note that the client's type and ID cannot be changed. -pub async fn update_client(configuration: &configuration::Configuration, domain_id: &str, client_id: &str, client_update: models::ClientUpdate) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/{domainID}/clients/{clientID}", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), clientID=crate::apis::urlencode(client_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - local_var_req_builder = local_var_req_builder.json(&client_update); - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Updates secret of the identified in client. Secret is updated using authorization token and the new received info. Update is performed by replacing current key with a new one. -pub async fn update_client_secret(configuration: &configuration::Configuration, domain_id: &str, client_id: &str, client_secret: models::ClientSecret) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/{domainID}/clients/{clientID}/secret", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), clientID=crate::apis::urlencode(client_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - local_var_req_builder = local_var_req_builder.json(&client_secret); - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Updates tags of the client with provided ID. Tags is updated using authorization token and the new tags received in request. -pub async fn update_client_tags(configuration: &configuration::Configuration, domain_id: &str, client_id: &str, client_tags: models::ClientTags) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/{domainID}/clients/{clientID}/tags", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), clientID=crate::apis::urlencode(client_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - local_var_req_builder = local_var_req_builder.json(&client_tags); - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - diff --git a/clients/src/apis/configuration.rs b/clients/src/apis/configuration.rs deleted file mode 100644 index ce858730..00000000 --- a/clients/src/apis/configuration.rs +++ /dev/null @@ -1,51 +0,0 @@ -/* - * SuperMQ Clients Service - * - * This is the Clients Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform clients. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - - - -#[derive(Debug, Clone)] -pub struct Configuration { - pub base_path: String, - pub user_agent: Option, - pub client: reqwest::Client, - pub basic_auth: Option, - pub oauth_access_token: Option, - pub bearer_access_token: Option, - pub api_key: Option, -} - -pub type BasicAuth = (String, Option); - -#[derive(Debug, Clone)] -pub struct ApiKey { - pub prefix: Option, - pub key: String, -} - - -impl Configuration { - pub fn new() -> Configuration { - Configuration::default() - } -} - -impl Default for Configuration { - fn default() -> Self { - Configuration { - base_path: "http://localhost:9006".to_owned(), - user_agent: Some("OpenAPI-Generator/0.15.1/rust".to_owned()), - client: reqwest::Client::new(), - basic_auth: None, - oauth_access_token: None, - bearer_access_token: None, - api_key: None, - } - } -} diff --git a/clients/src/apis/health_api.rs b/clients/src/apis/health_api.rs deleted file mode 100644 index a3c17305..00000000 --- a/clients/src/apis/health_api.rs +++ /dev/null @@ -1,53 +0,0 @@ -/* - * SuperMQ Clients Service - * - * This is the Clients Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform clients. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - - -use reqwest; -use serde::{Deserialize, Serialize}; -use crate::{apis::ResponseContent, models}; -use super::{Error, configuration}; - - -/// struct for typed errors of method [`health_get`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum HealthGetError { - Status500(models::Error), - UnknownValue(serde_json::Value), -} - - -pub async fn health_get(configuration: &configuration::Configuration, ) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/health", local_var_configuration.base_path); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - diff --git a/clients/src/apis/mod.rs b/clients/src/apis/mod.rs deleted file mode 100644 index 270df8fd..00000000 --- a/clients/src/apis/mod.rs +++ /dev/null @@ -1,97 +0,0 @@ -use std::error; -use std::fmt; - -#[derive(Debug, Clone)] -pub struct ResponseContent { - pub status: reqwest::StatusCode, - pub content: String, - pub entity: Option, -} - -#[derive(Debug)] -pub enum Error { - Reqwest(reqwest::Error), - Serde(serde_json::Error), - Io(std::io::Error), - ResponseError(ResponseContent), -} - -impl fmt::Display for Error { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - let (module, e) = match self { - Error::Reqwest(e) => ("reqwest", e.to_string()), - Error::Serde(e) => ("serde", e.to_string()), - Error::Io(e) => ("IO", e.to_string()), - Error::ResponseError(e) => ("response", format!("status code {}", e.status)), - }; - write!(f, "error in {}: {}", module, e) - } -} - -impl error::Error for Error { - fn source(&self) -> Option<&(dyn error::Error + 'static)> { - Some(match self { - Error::Reqwest(e) => e, - Error::Serde(e) => e, - Error::Io(e) => e, - Error::ResponseError(_) => return None, - }) - } -} - -impl From for Error { - fn from(e: reqwest::Error) -> Self { - Error::Reqwest(e) - } -} - -impl From for Error { - fn from(e: serde_json::Error) -> Self { - Error::Serde(e) - } -} - -impl From for Error { - fn from(e: std::io::Error) -> Self { - Error::Io(e) - } -} - -pub fn urlencode>(s: T) -> String { - ::url::form_urlencoded::byte_serialize(s.as_ref().as_bytes()).collect() -} - -pub fn parse_deep_object(prefix: &str, value: &serde_json::Value) -> Vec<(String, String)> { - if let serde_json::Value::Object(object) = value { - let mut params = vec![]; - - for (key, value) in object { - match value { - serde_json::Value::Object(_) => params.append(&mut parse_deep_object( - &format!("{}[{}]", prefix, key), - value, - )), - serde_json::Value::Array(array) => { - for (i, value) in array.iter().enumerate() { - params.append(&mut parse_deep_object( - &format!("{}[{}][{}]", prefix, key, i), - value, - )); - } - }, - serde_json::Value::String(s) => params.push((format!("{}[{}]", prefix, key), s.clone())), - _ => params.push((format!("{}[{}]", prefix, key), value.to_string())), - } - } - - return params; - } - - unimplemented!("Only objects are supported with style=deepObject") -} - -pub mod clients_api; -pub mod health_api; -pub mod roles_api; - -pub mod configuration; diff --git a/clients/src/apis/roles_api.rs b/clients/src/apis/roles_api.rs deleted file mode 100644 index 1686f2f0..00000000 --- a/clients/src/apis/roles_api.rs +++ /dev/null @@ -1,646 +0,0 @@ -/* - * SuperMQ Clients Service - * - * This is the Clients Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform clients. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - - -use reqwest; -use serde::{Deserialize, Serialize}; -use crate::{apis::ResponseContent, models}; -use super::{Error, configuration}; - - -/// struct for typed errors of method [`add_client_role_action`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AddClientRoleActionError { - Status400(), - Status401(), - Status403(), - Status404(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`add_client_role_member`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AddClientRoleMemberError { - Status400(), - Status401(), - Status403(), - Status404(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`create_client_role`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CreateClientRoleError { - Status400(), - Status401(), - Status403(), - Status404(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`delete_all_client_role_actions`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum DeleteAllClientRoleActionsError { - Status400(), - Status401(), - Status403(), - Status404(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`delete_all_client_role_members`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum DeleteAllClientRoleMembersError { - Status400(), - Status401(), - Status403(), - Status404(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`delete_client_role`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum DeleteClientRoleError { - Status400(), - Status401(), - Status403(), - Status404(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`delete_client_role_action`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum DeleteClientRoleActionError { - Status400(), - Status401(), - Status403(), - Status404(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`delete_client_role_members`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum DeleteClientRoleMembersError { - Status400(), - Status401(), - Status403(), - Status404(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`get_client_role`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum GetClientRoleError { - Status400(), - Status401(), - Status403(), - Status404(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`list_available_actions`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ListAvailableActionsError { - Status400(), - Status401(), - Status403(), - Status404(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`list_client_role_actions`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ListClientRoleActionsError { - Status400(), - Status401(), - Status403(), - Status404(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`list_client_role_members`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ListClientRoleMembersError { - Status400(), - Status401(), - Status403(), - Status404(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`list_client_roles`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ListClientRolesError { - Status400(), - Status401(), - Status403(), - Status404(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`update_client_role`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UpdateClientRoleError { - Status400(), - Status401(), - Status403(), - Status404(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - - -/// Adds a role action for a specific client role that is identified by the role name. -pub async fn add_client_role_action(configuration: &configuration::Configuration, domain_id: &str, client_id: &str, role_name: &str, role_actions_obj: models::RoleActionsObj) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/{domainID}/clients/{clientID}/roles/{roleName}/actions", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), clientID=crate::apis::urlencode(client_id), roleName=crate::apis::urlencode(role_name)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - local_var_req_builder = local_var_req_builder.json(&role_actions_obj); - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Adds a member to a specific client role that is identified by the role name. -pub async fn add_client_role_member(configuration: &configuration::Configuration, domain_id: &str, client_id: &str, role_name: &str, role_members_obj: models::RoleMembersObj) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/{domainID}/clients/{clientID}/roles/{roleName}/members", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), clientID=crate::apis::urlencode(client_id), roleName=crate::apis::urlencode(role_name)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - local_var_req_builder = local_var_req_builder.json(&role_members_obj); - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Creates a role for a specific client that is identified by the client ID. -pub async fn create_client_role(configuration: &configuration::Configuration, domain_id: &str, client_id: &str, create_role_obj: models::CreateRoleObj) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/{domainID}/clients/{clientID}/roles", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), clientID=crate::apis::urlencode(client_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - local_var_req_builder = local_var_req_builder.json(&create_role_obj); - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Deletes all role actions for a specific client role that is identified by the role name. -pub async fn delete_all_client_role_actions(configuration: &configuration::Configuration, domain_id: &str, client_id: &str, role_name: &str) -> Result<(), Error> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/{domainID}/clients/{clientID}/roles/{roleName}/actions/delete-all", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), clientID=crate::apis::urlencode(client_id), roleName=crate::apis::urlencode(role_name)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - Ok(()) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Deletes all members from a specific client role that is identified by the role name. -pub async fn delete_all_client_role_members(configuration: &configuration::Configuration, domain_id: &str, client_id: &str, role_name: &str) -> Result<(), Error> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/{domainID}/clients/{clientID}/roles/{roleName}/members/delete-all", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), clientID=crate::apis::urlencode(client_id), roleName=crate::apis::urlencode(role_name)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - Ok(()) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Deletes a specific client role that is identified by the role name. -pub async fn delete_client_role(configuration: &configuration::Configuration, domain_id: &str, client_id: &str, role_name: &str) -> Result<(), Error> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/{domainID}/clients/{clientID}/roles/{roleName}", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), clientID=crate::apis::urlencode(client_id), roleName=crate::apis::urlencode(role_name)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - Ok(()) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Deletes a role action for a specific client role that is identified by the role name. -pub async fn delete_client_role_action(configuration: &configuration::Configuration, domain_id: &str, client_id: &str, role_name: &str, role_actions_obj: models::RoleActionsObj) -> Result<(), Error> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/{domainID}/clients/{clientID}/roles/{roleName}/actions/delete", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), clientID=crate::apis::urlencode(client_id), roleName=crate::apis::urlencode(role_name)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - local_var_req_builder = local_var_req_builder.json(&role_actions_obj); - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - Ok(()) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Deletes a member from a specific client role that is identified by the role name. -pub async fn delete_client_role_members(configuration: &configuration::Configuration, domain_id: &str, client_id: &str, role_name: &str, role_members_obj: models::RoleMembersObj) -> Result<(), Error> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/{domainID}/clients/{clientID}/roles/{roleName}/members/delete", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), clientID=crate::apis::urlencode(client_id), roleName=crate::apis::urlencode(role_name)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - local_var_req_builder = local_var_req_builder.json(&role_members_obj); - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - Ok(()) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Retrieves a specific client role that is identified by the role name. -pub async fn get_client_role(configuration: &configuration::Configuration, domain_id: &str, client_id: &str, role_name: &str) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/{domainID}/clients/{clientID}/roles/{roleName}", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), clientID=crate::apis::urlencode(client_id), roleName=crate::apis::urlencode(role_name)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Retrieves a list of available actions. -pub async fn list_available_actions(configuration: &configuration::Configuration, domain_id: &str) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/{domainID}/clients/roles/available-actions", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Retrieves a list of client role actions. -pub async fn list_client_role_actions(configuration: &configuration::Configuration, domain_id: &str, client_id: &str, role_name: &str) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/{domainID}/clients/{clientID}/roles/{roleName}/actions", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), clientID=crate::apis::urlencode(client_id), roleName=crate::apis::urlencode(role_name)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Retrieves a list of client role members. -pub async fn list_client_role_members(configuration: &configuration::Configuration, domain_id: &str, client_id: &str, role_name: &str) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/{domainID}/clients/{clientID}/roles/{roleName}/members", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), clientID=crate::apis::urlencode(client_id), roleName=crate::apis::urlencode(role_name)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Retrieves a list of client roles. Due to performance concerns, data is retrieved in subsets. The API clients must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. -pub async fn list_client_roles(configuration: &configuration::Configuration, domain_id: &str, client_id: &str, limit: Option, offset: Option) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/{domainID}/clients/{clientID}/roles", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), clientID=crate::apis::urlencode(client_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); - - if let Some(ref local_var_str) = limit { - local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); - } - if let Some(ref local_var_str) = offset { - local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); - } - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Updates a specific client role that is identified by the role name. -pub async fn update_client_role(configuration: &configuration::Configuration, domain_id: &str, client_id: &str, role_name: &str, update_role_obj: models::UpdateRoleObj) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/{domainID}/clients/{clientID}/roles/{roleName}", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), clientID=crate::apis::urlencode(client_id), roleName=crate::apis::urlencode(role_name)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - local_var_req_builder = local_var_req_builder.json(&update_role_obj); - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - diff --git a/clients/src/lib.rs b/clients/src/lib.rs deleted file mode 100644 index e1520628..00000000 --- a/clients/src/lib.rs +++ /dev/null @@ -1,11 +0,0 @@ -#![allow(unused_imports)] -#![allow(clippy::too_many_arguments)] - -extern crate serde_repr; -extern crate serde; -extern crate serde_json; -extern crate url; -extern crate reqwest; - -pub mod apis; -pub mod models; diff --git a/clients/src/models/available_actions_obj.rs b/clients/src/models/available_actions_obj.rs deleted file mode 100644 index 43d4447e..00000000 --- a/clients/src/models/available_actions_obj.rs +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SuperMQ Clients Service - * - * This is the Clients Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform clients. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct AvailableActionsObj { - /// List of all available actions. - #[serde(rename = "available_actions", skip_serializing_if = "Option::is_none")] - pub available_actions: Option>, -} - -impl AvailableActionsObj { - pub fn new() -> AvailableActionsObj { - AvailableActionsObj { - available_actions: None, - } - } -} - diff --git a/clients/src/models/client_secret.rs b/clients/src/models/client_secret.rs deleted file mode 100644 index 0724d24d..00000000 --- a/clients/src/models/client_secret.rs +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SuperMQ Clients Service - * - * This is the Clients Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform clients. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ClientSecret { - /// New client secret. - #[serde(rename = "secret")] - pub secret: String, -} - -impl ClientSecret { - pub fn new(secret: String) -> ClientSecret { - ClientSecret { - secret, - } - } -} - diff --git a/clients/src/models/client_tags.rs b/clients/src/models/client_tags.rs deleted file mode 100644 index b0c41ab9..00000000 --- a/clients/src/models/client_tags.rs +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SuperMQ Clients Service - * - * This is the Clients Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform clients. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ClientTags { - /// Client tags. - #[serde(rename = "tags", skip_serializing_if = "Option::is_none")] - pub tags: Option>, -} - -impl ClientTags { - pub fn new() -> ClientTags { - ClientTags { - tags: None, - } - } -} - diff --git a/clients/src/models/create_role_obj.rs b/clients/src/models/create_role_obj.rs deleted file mode 100644 index 99d2164f..00000000 --- a/clients/src/models/create_role_obj.rs +++ /dev/null @@ -1,36 +0,0 @@ -/* - * SuperMQ Clients Service - * - * This is the Clients Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform clients. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct CreateRoleObj { - /// Role's name. - #[serde(rename = "role_name", skip_serializing_if = "Option::is_none")] - pub role_name: Option, - /// List of optional actions. - #[serde(rename = "optional_actions", skip_serializing_if = "Option::is_none")] - pub optional_actions: Option>, - /// List of optional members. - #[serde(rename = "optional_members", skip_serializing_if = "Option::is_none")] - pub optional_members: Option>, -} - -impl CreateRoleObj { - pub fn new() -> CreateRoleObj { - CreateRoleObj { - role_name: None, - optional_actions: None, - optional_members: None, - } - } -} - diff --git a/clients/src/models/error.rs b/clients/src/models/error.rs deleted file mode 100644 index e8929a08..00000000 --- a/clients/src/models/error.rs +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SuperMQ Clients Service - * - * This is the Clients Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform clients. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct Error { - /// Error message - #[serde(rename = "error", skip_serializing_if = "Option::is_none")] - pub error: Option, -} - -impl Error { - pub fn new() -> Error { - Error { - error: None, - } - } -} - diff --git a/clients/src/models/health_res.rs b/clients/src/models/health_res.rs deleted file mode 100644 index 11646d11..00000000 --- a/clients/src/models/health_res.rs +++ /dev/null @@ -1,56 +0,0 @@ -/* - * SuperMQ Clients Service - * - * This is the Clients Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform clients. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct HealthRes { - /// Service status. - #[serde(rename = "status", skip_serializing_if = "Option::is_none")] - pub status: Option, - /// Service version. - #[serde(rename = "version", skip_serializing_if = "Option::is_none")] - pub version: Option, - /// Service commit hash. - #[serde(rename = "commit", skip_serializing_if = "Option::is_none")] - pub commit: Option, - /// Service description. - #[serde(rename = "description", skip_serializing_if = "Option::is_none")] - pub description: Option, - /// Service build time. - #[serde(rename = "build_time", skip_serializing_if = "Option::is_none")] - pub build_time: Option, -} - -impl HealthRes { - pub fn new() -> HealthRes { - HealthRes { - status: None, - version: None, - commit: None, - description: None, - build_time: None, - } - } -} -/// Service status. -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum Status { - #[serde(rename = "pass")] - Pass, -} - -impl Default for Status { - fn default() -> Status { - Self::Pass - } -} - diff --git a/clients/src/models/mod.rs b/clients/src/models/mod.rs deleted file mode 100644 index 72ef2812..00000000 --- a/clients/src/models/mod.rs +++ /dev/null @@ -1,42 +0,0 @@ -pub mod available_actions_obj; -pub use self::available_actions_obj::AvailableActionsObj; -pub mod client; -pub use self::client::Client; -pub mod client_credentials; -pub use self::client_credentials::ClientCredentials; -pub mod client_req_obj; -pub use self::client_req_obj::ClientReqObj; -pub mod client_req_obj_credentials; -pub use self::client_req_obj_credentials::ClientReqObjCredentials; -pub mod client_secret; -pub use self::client_secret::ClientSecret; -pub mod client_tags; -pub use self::client_tags::ClientTags; -pub mod client_update; -pub use self::client_update::ClientUpdate; -pub mod client_with_empty_secret; -pub use self::client_with_empty_secret::ClientWithEmptySecret; -pub mod client_with_empty_secret_credentials; -pub use self::client_with_empty_secret_credentials::ClientWithEmptySecretCredentials; -pub mod clients_page; -pub use self::clients_page::ClientsPage; -pub mod create_role_obj; -pub use self::create_role_obj::CreateRoleObj; -pub mod error; -pub use self::error::Error; -pub mod health_res; -pub use self::health_res::HealthRes; -pub mod new_role; -pub use self::new_role::NewRole; -pub mod parent_group_req_obj; -pub use self::parent_group_req_obj::ParentGroupReqObj; -pub mod role; -pub use self::role::Role; -pub mod role_actions_obj; -pub use self::role_actions_obj::RoleActionsObj; -pub mod role_members_obj; -pub use self::role_members_obj::RoleMembersObj; -pub mod roles_page; -pub use self::roles_page::RolesPage; -pub mod update_role_obj; -pub use self::update_role_obj::UpdateRoleObj; diff --git a/clients/src/models/new_role.rs b/clients/src/models/new_role.rs deleted file mode 100644 index 70b9d423..00000000 --- a/clients/src/models/new_role.rs +++ /dev/null @@ -1,52 +0,0 @@ -/* - * SuperMQ Clients Service - * - * This is the Clients Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform clients. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct NewRole { - /// Role unique identifier. - #[serde(rename = "role_id", skip_serializing_if = "Option::is_none")] - pub role_id: Option, - /// Role's name. - #[serde(rename = "role_name", skip_serializing_if = "Option::is_none")] - pub role_name: Option, - /// Entity unique identifier. - #[serde(rename = "entity_id", skip_serializing_if = "Option::is_none")] - pub entity_id: Option, - /// Role creator unique identifier. - #[serde(rename = "created_by", skip_serializing_if = "Option::is_none")] - pub created_by: Option, - /// Time when the channel was created. - #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] - pub created_at: Option, - /// Role updater unique identifier. - #[serde(rename = "updated_by", skip_serializing_if = "Option::is_none")] - pub updated_by: Option, - /// Time when the channel was created. - #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")] - pub updated_at: Option, -} - -impl NewRole { - pub fn new() -> NewRole { - NewRole { - role_id: None, - role_name: None, - entity_id: None, - created_by: None, - created_at: None, - updated_by: None, - updated_at: None, - } - } -} - diff --git a/clients/src/models/role.rs b/clients/src/models/role.rs deleted file mode 100644 index 3bb1a30b..00000000 --- a/clients/src/models/role.rs +++ /dev/null @@ -1,52 +0,0 @@ -/* - * SuperMQ Clients Service - * - * This is the Clients Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform clients. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct Role { - /// Role unique identifier. - #[serde(rename = "role_id", skip_serializing_if = "Option::is_none")] - pub role_id: Option, - /// Role's name. - #[serde(rename = "role_name", skip_serializing_if = "Option::is_none")] - pub role_name: Option, - /// Entity unique identifier. - #[serde(rename = "entity_id", skip_serializing_if = "Option::is_none")] - pub entity_id: Option, - /// Role creator unique identifier. - #[serde(rename = "created_by", skip_serializing_if = "Option::is_none")] - pub created_by: Option, - /// Time when the channel was created. - #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] - pub created_at: Option, - /// Role updater unique identifier. - #[serde(rename = "updated_by", skip_serializing_if = "Option::is_none")] - pub updated_by: Option, - /// Time when the channel was created. - #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")] - pub updated_at: Option, -} - -impl Role { - pub fn new() -> Role { - Role { - role_id: None, - role_name: None, - entity_id: None, - created_by: None, - created_at: None, - updated_by: None, - updated_at: None, - } - } -} - diff --git a/clients/src/models/role_actions_obj.rs b/clients/src/models/role_actions_obj.rs deleted file mode 100644 index 64dacc72..00000000 --- a/clients/src/models/role_actions_obj.rs +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SuperMQ Clients Service - * - * This is the Clients Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform clients. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct RoleActionsObj { - /// List of actions to be added to a role. - #[serde(rename = "actions", skip_serializing_if = "Option::is_none")] - pub actions: Option>, -} - -impl RoleActionsObj { - pub fn new() -> RoleActionsObj { - RoleActionsObj { - actions: None, - } - } -} - diff --git a/clients/src/models/role_members_obj.rs b/clients/src/models/role_members_obj.rs deleted file mode 100644 index 73c3781d..00000000 --- a/clients/src/models/role_members_obj.rs +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SuperMQ Clients Service - * - * This is the Clients Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform clients. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct RoleMembersObj { - /// List of members to be added to a role. - #[serde(rename = "members", skip_serializing_if = "Option::is_none")] - pub members: Option>, -} - -impl RoleMembersObj { - pub fn new() -> RoleMembersObj { - RoleMembersObj { - members: None, - } - } -} - diff --git a/clients/src/models/roles_page.rs b/clients/src/models/roles_page.rs deleted file mode 100644 index 429198ca..00000000 --- a/clients/src/models/roles_page.rs +++ /dev/null @@ -1,40 +0,0 @@ -/* - * SuperMQ Clients Service - * - * This is the Clients Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform clients. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct RolesPage { - /// List of roles. - #[serde(rename = "roles", skip_serializing_if = "Option::is_none")] - pub roles: Option>, - /// Total number of roles. - #[serde(rename = "total", skip_serializing_if = "Option::is_none")] - pub total: Option, - /// Number of items to skip during retrieval. - #[serde(rename = "offset", skip_serializing_if = "Option::is_none")] - pub offset: Option, - /// Maximum number of items to return in one page. - #[serde(rename = "limit", skip_serializing_if = "Option::is_none")] - pub limit: Option, -} - -impl RolesPage { - pub fn new() -> RolesPage { - RolesPage { - roles: None, - total: None, - offset: None, - limit: None, - } - } -} - diff --git a/clients/src/models/update_role_obj.rs b/clients/src/models/update_role_obj.rs deleted file mode 100644 index b5c045f6..00000000 --- a/clients/src/models/update_role_obj.rs +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SuperMQ Clients Service - * - * This is the Clients Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform clients. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct UpdateRoleObj { - /// Role's name. - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, -} - -impl UpdateRoleObj { - pub fn new() -> UpdateRoleObj { - UpdateRoleObj { - name: None, - } - } -} - diff --git a/domains/.gitignore b/domains/.gitignore deleted file mode 100644 index 6aa10640..00000000 --- a/domains/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/target/ -**/*.rs.bk -Cargo.lock diff --git a/domains/.openapi-generator-ignore b/domains/.openapi-generator-ignore deleted file mode 100644 index 7484ee59..00000000 --- a/domains/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/domains/.openapi-generator/FILES b/domains/.openapi-generator/FILES deleted file mode 100644 index 7384a0b3..00000000 --- a/domains/.openapi-generator/FILES +++ /dev/null @@ -1,42 +0,0 @@ -.gitignore -.openapi-generator-ignore -.travis.yml -Cargo.toml -README.md -docs/AvailableActionsObj.md -docs/CreateRoleObj.md -docs/Domain.md -docs/DomainReqObj.md -docs/DomainUpdate.md -docs/DomainsApi.md -docs/DomainsPage.md -docs/HealthApi.md -docs/HealthInfo.md -docs/NewRole.md -docs/Role.md -docs/RoleActionsObj.md -docs/RoleMembersObj.md -docs/RolesApi.md -docs/RolesPage.md -docs/UpdateRoleObj.md -git_push.sh -src/apis/configuration.rs -src/apis/domains_api.rs -src/apis/health_api.rs -src/apis/mod.rs -src/apis/roles_api.rs -src/lib.rs -src/models/available_actions_obj.rs -src/models/create_role_obj.rs -src/models/domain.rs -src/models/domain_req_obj.rs -src/models/domain_update.rs -src/models/domains_page.rs -src/models/health_info.rs -src/models/mod.rs -src/models/new_role.rs -src/models/role.rs -src/models/role_actions_obj.rs -src/models/role_members_obj.rs -src/models/roles_page.rs -src/models/update_role_obj.rs diff --git a/domains/.openapi-generator/VERSION b/domains/.openapi-generator/VERSION deleted file mode 100644 index 758bb9c8..00000000 --- a/domains/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -7.10.0 diff --git a/domains/.travis.yml b/domains/.travis.yml deleted file mode 100644 index 22761ba7..00000000 --- a/domains/.travis.yml +++ /dev/null @@ -1 +0,0 @@ -language: rust diff --git a/domains/Cargo.toml b/domains/Cargo.toml deleted file mode 100644 index 3a0af67f..00000000 --- a/domains/Cargo.toml +++ /dev/null @@ -1,15 +0,0 @@ -[package] -name = "Domains" -version = "0.15.1" -authors = ["info@abstractmachines.fr"] -description = "This is the Domains Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform domains. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The Magistrala repository](https://github.com/absmach/magistrala) " -license = "Apache 2.0" -edition = "2021" - -[dependencies] -serde = { version = "^1.0", features = ["derive"] } -serde_json = "^1.0" -serde_repr = "^0.1" -url = "^2.5" -uuid = { version = "^1.8", features = ["serde", "v4"] } -reqwest = { version = "^0.12", features = ["json", "multipart"] } diff --git a/domains/README.md b/domains/README.md deleted file mode 100644 index edc6aa97..00000000 --- a/domains/README.md +++ /dev/null @@ -1,82 +0,0 @@ -# Rust API client for openapi - -This is the Domains Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform domains. You can now help us improve the API whether it's by making changes to the definition itself or to the code. -Some useful links: -- [The Magistrala repository](https://github.com/absmach/magistrala) - - - -## Overview - -This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://openapis.org) from a remote server, you can easily generate an API client. - -- API version: 0.15.1 -- Package version: 0.15.1 -- Generator version: 7.10.0 -- Build package: `org.openapitools.codegen.languages.RustClientCodegen` - -## Installation - -Put the package under your project folder in a directory named `openapi` and add the following to `Cargo.toml` under `[dependencies]`: - -``` -openapi = { path = "./openapi" } -``` - -## Documentation for API Endpoints - -All URIs are relative to *http://localhost:9003* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*DomainsApi* | [**domains_domain_id_disable_post**](docs/DomainsApi.md#domains_domain_id_disable_post) | **POST** /domains/{domainID}/disable | Disable a domain -*DomainsApi* | [**domains_domain_id_enable_post**](docs/DomainsApi.md#domains_domain_id_enable_post) | **POST** /domains/{domainID}/enable | Enables a domain -*DomainsApi* | [**domains_domain_id_freeze_post**](docs/DomainsApi.md#domains_domain_id_freeze_post) | **POST** /domains/{domainID}/freeze | Freeze a domain -*DomainsApi* | [**domains_domain_id_get**](docs/DomainsApi.md#domains_domain_id_get) | **GET** /domains/{domainID} | Retrieves domain information -*DomainsApi* | [**domains_domain_id_patch**](docs/DomainsApi.md#domains_domain_id_patch) | **PATCH** /domains/{domainID} | Updates name, metadata, tags and alias of the domain. -*DomainsApi* | [**domains_get**](docs/DomainsApi.md#domains_get) | **GET** /domains | Retrieves list of domains. -*DomainsApi* | [**domains_post**](docs/DomainsApi.md#domains_post) | **POST** /domains | Adds new domain -*HealthApi* | [**health_get**](docs/HealthApi.md#health_get) | **GET** /health | Retrieves service health check info. -*RolesApi* | [**add_domain_role_action**](docs/RolesApi.md#add_domain_role_action) | **POST** /domains/{domainID}/roles/{roleName}/actions | Adds a role action for a domain role. -*RolesApi* | [**add_domain_role_member**](docs/RolesApi.md#add_domain_role_member) | **POST** /domains/{domainID}/roles/{roleName}/members | Adds a member to a domain role. -*RolesApi* | [**create_domain_role**](docs/RolesApi.md#create_domain_role) | **POST** /domains/{domainID}/roles | Creates a role for a domain -*RolesApi* | [**delete_all_domain_role_actions**](docs/RolesApi.md#delete_all_domain_role_actions) | **POST** /domains/{domainID}/roles/{roleName}/actions/delete-all | Deletes all role actions for a domain role. -*RolesApi* | [**delete_all_domain_role_members**](docs/RolesApi.md#delete_all_domain_role_members) | **POST** /domains/{domainID}/roles/{roleName}/members/delete-all | Deletes all members from a domain role. -*RolesApi* | [**delete_domain_role**](docs/RolesApi.md#delete_domain_role) | **DELETE** /domains/{domainID}/roles/{roleName} | Deletes domain role. -*RolesApi* | [**delete_domain_role_action**](docs/RolesApi.md#delete_domain_role_action) | **POST** /domains/{domainID}/roles/{roleName}/actions/delete | Deletes role actions for a domain role. -*RolesApi* | [**delete_domain_role_members**](docs/RolesApi.md#delete_domain_role_members) | **POST** /domains/{domainID}/roles/{roleName}/members/delete | Deletes members from a domain role. -*RolesApi* | [**get_domain_role**](docs/RolesApi.md#get_domain_role) | **GET** /domains/{domainID}/roles/{roleName} | Retrieves domain role. -*RolesApi* | [**list_available_actions**](docs/RolesApi.md#list_available_actions) | **GET** /domains/roles/available-actions | Retrieves available actions. -*RolesApi* | [**list_domain_role_actions**](docs/RolesApi.md#list_domain_role_actions) | **GET** /domains/{domainID}/roles/{roleName}/actions | Lists domain role actions. -*RolesApi* | [**list_domain_role_members**](docs/RolesApi.md#list_domain_role_members) | **GET** /domains/{domainID}/roles/{roleName}/members | Lists domain role members. -*RolesApi* | [**list_domain_roles**](docs/RolesApi.md#list_domain_roles) | **GET** /domains/{domainID}/roles | Retrieves domains roles. -*RolesApi* | [**update_domain_role**](docs/RolesApi.md#update_domain_role) | **PUT** /domains/{domainID}/roles/{roleName} | Updates domain role. - - -## Documentation For Models - - - [AvailableActionsObj](docs/AvailableActionsObj.md) - - [CreateRoleObj](docs/CreateRoleObj.md) - - [Domain](docs/Domain.md) - - [DomainReqObj](docs/DomainReqObj.md) - - [DomainUpdate](docs/DomainUpdate.md) - - [DomainsPage](docs/DomainsPage.md) - - [HealthInfo](docs/HealthInfo.md) - - [NewRole](docs/NewRole.md) - - [Role](docs/Role.md) - - [RoleActionsObj](docs/RoleActionsObj.md) - - [RoleMembersObj](docs/RoleMembersObj.md) - - [RolesPage](docs/RolesPage.md) - - [UpdateRoleObj](docs/UpdateRoleObj.md) - - -To get access to the crate's generated documentation, use: - -``` -cargo doc --open -``` - -## Author - -info@abstractmachines.fr - diff --git a/domains/docs/AvailableActionsObj.md b/domains/docs/AvailableActionsObj.md deleted file mode 100644 index 07f6848c..00000000 --- a/domains/docs/AvailableActionsObj.md +++ /dev/null @@ -1,11 +0,0 @@ -# AvailableActionsObj - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**available_actions** | Option<**Vec**> | List of all available actions. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/domains/docs/CreateRoleObj.md b/domains/docs/CreateRoleObj.md deleted file mode 100644 index 59ac3f4f..00000000 --- a/domains/docs/CreateRoleObj.md +++ /dev/null @@ -1,13 +0,0 @@ -# CreateRoleObj - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**role_name** | Option<**String**> | Role's name. | [optional] -**optional_actions** | Option<**Vec**> | List of optional actions. | [optional] -**optional_members** | Option<**Vec**> | List of optional members. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/domains/docs/Domain.md b/domains/docs/Domain.md deleted file mode 100644 index d2ec9dcb..00000000 --- a/domains/docs/Domain.md +++ /dev/null @@ -1,20 +0,0 @@ -# Domain - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | Domain unique identified. | [optional] -**name** | Option<**String**> | Domain name. | [optional] -**tags** | Option<**Vec**> | domain tags. | [optional] -**metadata** | Option<[**serde_json::Value**](.md)> | Arbitrary, object-encoded domain's data. | [optional] -**alias** | Option<**String**> | Domain alias. | [optional] -**status** | Option<**String**> | Domain Status | [optional] -**created_by** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | User ID of the user who created the domain. | [optional] -**created_at** | Option<**String**> | Time when the domain was created. | [optional] -**updated_by** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | User ID of the user who last updated the domain. | [optional] -**updated_at** | Option<**String**> | Time when the domain was last updated. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/domains/docs/DomainReqObj.md b/domains/docs/DomainReqObj.md deleted file mode 100644 index 2d089a37..00000000 --- a/domains/docs/DomainReqObj.md +++ /dev/null @@ -1,14 +0,0 @@ -# DomainReqObj - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | Domain name. | -**tags** | Option<**Vec**> | domain tags. | [optional] -**metadata** | Option<[**serde_json::Value**](.md)> | Arbitrary, object-encoded domain's data. | [optional] -**alias** | **String** | Domain alias. | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/domains/docs/DomainUpdate.md b/domains/docs/DomainUpdate.md deleted file mode 100644 index 7feabf52..00000000 --- a/domains/docs/DomainUpdate.md +++ /dev/null @@ -1,14 +0,0 @@ -# DomainUpdate - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | Option<**String**> | Domain name. | [optional] -**tags** | Option<**Vec**> | domain tags. | [optional] -**metadata** | Option<[**serde_json::Value**](.md)> | Arbitrary, object-encoded domain's data. | [optional] -**alias** | Option<**String**> | Domain alias. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/domains/docs/DomainsApi.md b/domains/docs/DomainsApi.md deleted file mode 100644 index 42b7930c..00000000 --- a/domains/docs/DomainsApi.md +++ /dev/null @@ -1,231 +0,0 @@ -# \DomainsApi - -All URIs are relative to *http://localhost:9003* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**domains_domain_id_disable_post**](DomainsApi.md#domains_domain_id_disable_post) | **POST** /domains/{domainID}/disable | Disable a domain -[**domains_domain_id_enable_post**](DomainsApi.md#domains_domain_id_enable_post) | **POST** /domains/{domainID}/enable | Enables a domain -[**domains_domain_id_freeze_post**](DomainsApi.md#domains_domain_id_freeze_post) | **POST** /domains/{domainID}/freeze | Freeze a domain -[**domains_domain_id_get**](DomainsApi.md#domains_domain_id_get) | **GET** /domains/{domainID} | Retrieves domain information -[**domains_domain_id_patch**](DomainsApi.md#domains_domain_id_patch) | **PATCH** /domains/{domainID} | Updates name, metadata, tags and alias of the domain. -[**domains_get**](DomainsApi.md#domains_get) | **GET** /domains | Retrieves list of domains. -[**domains_post**](DomainsApi.md#domains_post) | **POST** /domains | Adds new domain - - - -## domains_domain_id_disable_post - -> domains_domain_id_disable_post(domain_id) -Disable a domain - -Disable a specific domain that is identified by the domain ID. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identified. | [required] | - -### Return type - - (empty response body) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## domains_domain_id_enable_post - -> domains_domain_id_enable_post(domain_id) -Enables a domain - -Enables a specific domain that is identified by the domain ID. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identified. | [required] | - -### Return type - - (empty response body) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## domains_domain_id_freeze_post - -> domains_domain_id_freeze_post(domain_id) -Freeze a domain - -Freeze a specific domain that is identified by the domain ID. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identified. | [required] | - -### Return type - - (empty response body) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## domains_domain_id_get - -> models::Domain domains_domain_id_get(domain_id) -Retrieves domain information - -Retrieves a specific domain that is identified by the domain ID. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identified. | [required] | - -### Return type - -[**models::Domain**](Domain.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## domains_domain_id_patch - -> models::Domain domains_domain_id_patch(domain_id, domain_update) -Updates name, metadata, tags and alias of the domain. - -Updates name, metadata, tags and alias of the domain. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identified. | [required] | -**domain_update** | [**DomainUpdate**](DomainUpdate.md) | JSON-formated document describing the name, alias, tags, and metadata of the domain to be updated | [required] | - -### Return type - -[**models::Domain**](Domain.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## domains_get - -> models::DomainsPage domains_get(limit, offset, metadata, status, name, permission) -Retrieves list of domains. - -Retrieves list of domains that the user have access. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**limit** | Option<**i32**> | Size of the subset to retrieve. | |[default to 10] -**offset** | Option<**i32**> | Number of items to skip during retrieval. | |[default to 0] -**metadata** | Option<[**std::collections::HashMap**](serde_json::Value.md)> | Metadata filter. Filtering is performed matching the parameter with metadata on top level. Parameter is json. | | -**status** | Option<**String**> | Domain status. | |[default to enabled] -**name** | Option<**String**> | Domain's name. | | -**permission** | Option<**String**> | permission. | | - -### Return type - -[**models::DomainsPage**](DomainsPage.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## domains_post - -> models::Domain domains_post(domain_req_obj) -Adds new domain - -Adds new domain. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_req_obj** | [**DomainReqObj**](DomainReqObj.md) | JSON-formatted document describing the new domain to be registered | [required] | - -### Return type - -[**models::Domain**](Domain.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/domains/docs/DomainsPage.md b/domains/docs/DomainsPage.md deleted file mode 100644 index eb4f79de..00000000 --- a/domains/docs/DomainsPage.md +++ /dev/null @@ -1,14 +0,0 @@ -# DomainsPage - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**domains** | [**Vec**](Domain.md) | | -**total** | **i32** | Total number of items. | -**offset** | **i32** | Number of items to skip during retrieval. | -**limit** | Option<**i32**> | Maximum number of items to return in one page. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/domains/docs/HealthApi.md b/domains/docs/HealthApi.md deleted file mode 100644 index 2114f4dd..00000000 --- a/domains/docs/HealthApi.md +++ /dev/null @@ -1,34 +0,0 @@ -# \HealthApi - -All URIs are relative to *http://localhost:9003* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**health_get**](HealthApi.md#health_get) | **GET** /health | Retrieves service health check info. - - - -## health_get - -> models::HealthInfo health_get() -Retrieves service health check info. - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -[**models::HealthInfo**](health_info.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/health+json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/domains/docs/HealthInfo.md b/domains/docs/HealthInfo.md deleted file mode 100644 index ee8f5c6b..00000000 --- a/domains/docs/HealthInfo.md +++ /dev/null @@ -1,16 +0,0 @@ -# HealthInfo - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | Option<**String**> | Service status. | [optional] -**version** | Option<**String**> | Service version. | [optional] -**commit** | Option<**String**> | Service commit hash. | [optional] -**description** | Option<**String**> | Service description. | [optional] -**build_time** | Option<**String**> | Service build time. | [optional] -**instance_id** | Option<**String**> | Service instance ID. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/domains/docs/NewRole.md b/domains/docs/NewRole.md deleted file mode 100644 index 8d232bc0..00000000 --- a/domains/docs/NewRole.md +++ /dev/null @@ -1,17 +0,0 @@ -# NewRole - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**role_id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | Role unique identifier. | [optional] -**role_name** | Option<**String**> | Role's name. | [optional] -**entity_id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | Entity unique identifier. | [optional] -**created_by** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | Role creator unique identifier. | [optional] -**created_at** | Option<**String**> | Time when the channel was created. | [optional] -**updated_by** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | Role updater unique identifier. | [optional] -**updated_at** | Option<**String**> | Time when the channel was created. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/domains/docs/Role.md b/domains/docs/Role.md deleted file mode 100644 index c7a4694f..00000000 --- a/domains/docs/Role.md +++ /dev/null @@ -1,17 +0,0 @@ -# Role - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**role_id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | Role unique identifier. | [optional] -**role_name** | Option<**String**> | Role's name. | [optional] -**entity_id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | Entity unique identifier. | [optional] -**created_by** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | Role creator unique identifier. | [optional] -**created_at** | Option<**String**> | Time when the channel was created. | [optional] -**updated_by** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | Role updater unique identifier. | [optional] -**updated_at** | Option<**String**> | Time when the channel was created. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/domains/docs/RoleActionsObj.md b/domains/docs/RoleActionsObj.md deleted file mode 100644 index b61a2345..00000000 --- a/domains/docs/RoleActionsObj.md +++ /dev/null @@ -1,11 +0,0 @@ -# RoleActionsObj - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**actions** | Option<**Vec**> | List of actions to be added to a role. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/domains/docs/RoleMembersObj.md b/domains/docs/RoleMembersObj.md deleted file mode 100644 index 1d9d997a..00000000 --- a/domains/docs/RoleMembersObj.md +++ /dev/null @@ -1,11 +0,0 @@ -# RoleMembersObj - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**members** | Option<**Vec**> | List of members to be added to a role. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/domains/docs/RolesApi.md b/domains/docs/RolesApi.md deleted file mode 100644 index f733a87b..00000000 --- a/domains/docs/RolesApi.md +++ /dev/null @@ -1,461 +0,0 @@ -# \RolesApi - -All URIs are relative to *http://localhost:9003* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**add_domain_role_action**](RolesApi.md#add_domain_role_action) | **POST** /domains/{domainID}/roles/{roleName}/actions | Adds a role action for a domain role. -[**add_domain_role_member**](RolesApi.md#add_domain_role_member) | **POST** /domains/{domainID}/roles/{roleName}/members | Adds a member to a domain role. -[**create_domain_role**](RolesApi.md#create_domain_role) | **POST** /domains/{domainID}/roles | Creates a role for a domain -[**delete_all_domain_role_actions**](RolesApi.md#delete_all_domain_role_actions) | **POST** /domains/{domainID}/roles/{roleName}/actions/delete-all | Deletes all role actions for a domain role. -[**delete_all_domain_role_members**](RolesApi.md#delete_all_domain_role_members) | **POST** /domains/{domainID}/roles/{roleName}/members/delete-all | Deletes all members from a domain role. -[**delete_domain_role**](RolesApi.md#delete_domain_role) | **DELETE** /domains/{domainID}/roles/{roleName} | Deletes domain role. -[**delete_domain_role_action**](RolesApi.md#delete_domain_role_action) | **POST** /domains/{domainID}/roles/{roleName}/actions/delete | Deletes role actions for a domain role. -[**delete_domain_role_members**](RolesApi.md#delete_domain_role_members) | **POST** /domains/{domainID}/roles/{roleName}/members/delete | Deletes members from a domain role. -[**get_domain_role**](RolesApi.md#get_domain_role) | **GET** /domains/{domainID}/roles/{roleName} | Retrieves domain role. -[**list_available_actions**](RolesApi.md#list_available_actions) | **GET** /domains/roles/available-actions | Retrieves available actions. -[**list_domain_role_actions**](RolesApi.md#list_domain_role_actions) | **GET** /domains/{domainID}/roles/{roleName}/actions | Lists domain role actions. -[**list_domain_role_members**](RolesApi.md#list_domain_role_members) | **GET** /domains/{domainID}/roles/{roleName}/members | Lists domain role members. -[**list_domain_roles**](RolesApi.md#list_domain_roles) | **GET** /domains/{domainID}/roles | Retrieves domains roles. -[**update_domain_role**](RolesApi.md#update_domain_role) | **PUT** /domains/{domainID}/roles/{roleName} | Updates domain role. - - - -## add_domain_role_action - -> models::RoleActionsObj add_domain_role_action(domain_id, role_name, role_actions_obj) -Adds a role action for a domain role. - -Adds a role action for a specific domain role that is identified by the role name. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identified. | [required] | -**role_name** | **String** | Role's name. | [required] | -**role_actions_obj** | [**RoleActionsObj**](RoleActionsObj.md) | JSON- formatted object decsribing an action to be added to a role. | [required] | - -### Return type - -[**models::RoleActionsObj**](RoleActionsObj.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## add_domain_role_member - -> models::RoleMembersObj add_domain_role_member(domain_id, role_name, role_members_obj) -Adds a member to a domain role. - -Adds a member to a specific domain role that is identified by the role name. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identified. | [required] | -**role_name** | **String** | Role's name. | [required] | -**role_members_obj** | [**RoleMembersObj**](RoleMembersObj.md) | JSON- formatted object decsribing a member to be added to a role. | [required] | - -### Return type - -[**models::RoleMembersObj**](RoleMembersObj.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## create_domain_role - -> models::NewRole create_domain_role(domain_id, create_role_obj) -Creates a role for a domain - -Creates a role for a specific domain that is identified by the domain ID. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identified. | [required] | -**create_role_obj** | [**CreateRoleObj**](CreateRoleObj.md) | JSON- formatted object decsribing a new role to be created. | [required] | - -### Return type - -[**models::NewRole**](NewRole.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## delete_all_domain_role_actions - -> delete_all_domain_role_actions(domain_id, role_name) -Deletes all role actions for a domain role. - -Deletes all role actions for a specific domain role that is identified by the role name. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identified. | [required] | -**role_name** | **String** | Role's name. | [required] | - -### Return type - - (empty response body) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## delete_all_domain_role_members - -> delete_all_domain_role_members(domain_id, role_name) -Deletes all members from a domain role. - -Deletes all members from a specific domain role that is identified by the role name. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identified. | [required] | -**role_name** | **String** | Role's name. | [required] | - -### Return type - - (empty response body) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## delete_domain_role - -> delete_domain_role(domain_id, role_name) -Deletes domain role. - -Deletes a specific domain role that is identified by the role name. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identified. | [required] | -**role_name** | **String** | Role's name. | [required] | - -### Return type - - (empty response body) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## delete_domain_role_action - -> delete_domain_role_action(domain_id, role_name, role_actions_obj) -Deletes role actions for a domain role. - -Deletes a role action for a specific domain role that is identified by the role name. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identified. | [required] | -**role_name** | **String** | Role's name. | [required] | -**role_actions_obj** | [**RoleActionsObj**](RoleActionsObj.md) | JSON- formatted object decsribing an action to be added to a role. | [required] | - -### Return type - - (empty response body) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## delete_domain_role_members - -> delete_domain_role_members(domain_id, role_name, role_members_obj) -Deletes members from a domain role. - -Deletes a member from a specific domain role that is identified by the role name. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identified. | [required] | -**role_name** | **String** | Role's name. | [required] | -**role_members_obj** | [**RoleMembersObj**](RoleMembersObj.md) | JSON- formatted object decsribing a member to be added to a role. | [required] | - -### Return type - - (empty response body) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## get_domain_role - -> models::Role get_domain_role(domain_id, role_name) -Retrieves domain role. - -Retrieves a specific domain role that is identified by the role name. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identified. | [required] | -**role_name** | **String** | Role's name. | [required] | - -### Return type - -[**models::Role**](Role.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## list_available_actions - -> models::AvailableActionsObj list_available_actions(domain_id) -Retrieves available actions. - -Retrieves a list of available actions. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identified. | [required] | - -### Return type - -[**models::AvailableActionsObj**](AvailableActionsObj.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## list_domain_role_actions - -> models::RoleActionsObj list_domain_role_actions(domain_id, role_name) -Lists domain role actions. - -Retrieves a list of domain role actions. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identified. | [required] | -**role_name** | **String** | Role's name. | [required] | - -### Return type - -[**models::RoleActionsObj**](RoleActionsObj.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## list_domain_role_members - -> models::RoleMembersObj list_domain_role_members(domain_id, role_name) -Lists domain role members. - -Retrieves a list of domain role members. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identified. | [required] | -**role_name** | **String** | Role's name. | [required] | - -### Return type - -[**models::RoleMembersObj**](RoleMembersObj.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## list_domain_roles - -> models::RolesPage list_domain_roles(domain_id, limit, offset) -Retrieves domains roles. - -Retrieves a list of domain roles. Due to performance concerns, data is retrieved in subsets. The API domains must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identified. | [required] | -**limit** | Option<**i32**> | Size of the subset to retrieve. | |[default to 10] -**offset** | Option<**i32**> | Number of items to skip during retrieval. | |[default to 0] - -### Return type - -[**models::RolesPage**](RolesPage.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## update_domain_role - -> models::Role update_domain_role(domain_id, role_name, update_role_obj) -Updates domain role. - -Updates a specific domain role that is identified by the role name. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identified. | [required] | -**role_name** | **String** | Role's name. | [required] | -**update_role_obj** | [**UpdateRoleObj**](UpdateRoleObj.md) | JSON- formatted object decsribing a role to be updated. | [required] | - -### Return type - -[**models::Role**](Role.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/domains/docs/RolesPage.md b/domains/docs/RolesPage.md deleted file mode 100644 index be544da3..00000000 --- a/domains/docs/RolesPage.md +++ /dev/null @@ -1,14 +0,0 @@ -# RolesPage - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**roles** | Option<[**Vec**](Role.md)> | List of roles. | [optional] -**total** | Option<**i32**> | Total number of roles. | [optional] -**offset** | Option<**i32**> | Number of items to skip during retrieval. | [optional] -**limit** | Option<**i32**> | Maximum number of items to return in one page. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/domains/docs/UpdateRoleObj.md b/domains/docs/UpdateRoleObj.md deleted file mode 100644 index 050c5b88..00000000 --- a/domains/docs/UpdateRoleObj.md +++ /dev/null @@ -1,11 +0,0 @@ -# UpdateRoleObj - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | Option<**String**> | Role's name. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/domains/git_push.sh b/domains/git_push.sh deleted file mode 100644 index f53a75d4..00000000 --- a/domains/git_push.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 -git_host=$4 - -if [ "$git_host" = "" ]; then - git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" -fi - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' diff --git a/domains/src/apis/configuration.rs b/domains/src/apis/configuration.rs deleted file mode 100644 index ddbee6af..00000000 --- a/domains/src/apis/configuration.rs +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Magistrala Domains Service - * - * This is the Domains Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform domains. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The Magistrala repository](https://github.com/absmach/magistrala) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - - - -#[derive(Debug, Clone)] -pub struct Configuration { - pub base_path: String, - pub user_agent: Option, - pub client: reqwest::Client, - pub basic_auth: Option, - pub oauth_access_token: Option, - pub bearer_access_token: Option, - pub api_key: Option, -} - -pub type BasicAuth = (String, Option); - -#[derive(Debug, Clone)] -pub struct ApiKey { - pub prefix: Option, - pub key: String, -} - - -impl Configuration { - pub fn new() -> Configuration { - Configuration::default() - } -} - -impl Default for Configuration { - fn default() -> Self { - Configuration { - base_path: "http://localhost:9003".to_owned(), - user_agent: Some("OpenAPI-Generator/0.15.1/rust".to_owned()), - client: reqwest::Client::new(), - basic_auth: None, - oauth_access_token: None, - bearer_access_token: None, - api_key: None, - } - } -} diff --git a/domains/src/apis/domains_api.rs b/domains/src/apis/domains_api.rs deleted file mode 100644 index 66acecdc..00000000 --- a/domains/src/apis/domains_api.rs +++ /dev/null @@ -1,350 +0,0 @@ -/* - * Magistrala Domains Service - * - * This is the Domains Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform domains. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The Magistrala repository](https://github.com/absmach/magistrala) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - - -use reqwest; -use serde::{Deserialize, Serialize}; -use crate::{apis::ResponseContent, models}; -use super::{Error, configuration}; - - -/// struct for typed errors of method [`domains_domain_id_disable_post`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum DomainsDomainIdDisablePostError { - Status400(), - Status401(), - Status403(), - Status404(), - Status422(), - Status500(), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`domains_domain_id_enable_post`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum DomainsDomainIdEnablePostError { - Status400(), - Status401(), - Status403(), - Status404(), - Status422(), - Status500(), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`domains_domain_id_freeze_post`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum DomainsDomainIdFreezePostError { - Status400(), - Status401(), - Status403(), - Status404(), - Status422(), - Status500(), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`domains_domain_id_get`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum DomainsDomainIdGetError { - Status400(), - Status401(), - Status403(), - Status404(), - Status422(), - Status500(), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`domains_domain_id_patch`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum DomainsDomainIdPatchError { - Status400(), - Status401(), - Status403(), - Status404(), - Status415(), - Status500(), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`domains_get`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum DomainsGetError { - Status400(), - Status401(), - Status404(), - Status422(), - Status500(), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`domains_post`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum DomainsPostError { - Status400(), - Status401(), - Status409(), - Status415(), - Status422(), - Status500(), - UnknownValue(serde_json::Value), -} - - -/// Disable a specific domain that is identified by the domain ID. -pub async fn domains_domain_id_disable_post(configuration: &configuration::Configuration, domain_id: &str) -> Result<(), Error> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/domains/{domainID}/disable", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - Ok(()) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Enables a specific domain that is identified by the domain ID. -pub async fn domains_domain_id_enable_post(configuration: &configuration::Configuration, domain_id: &str) -> Result<(), Error> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/domains/{domainID}/enable", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - Ok(()) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Freeze a specific domain that is identified by the domain ID. -pub async fn domains_domain_id_freeze_post(configuration: &configuration::Configuration, domain_id: &str) -> Result<(), Error> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/domains/{domainID}/freeze", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - Ok(()) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Retrieves a specific domain that is identified by the domain ID. -pub async fn domains_domain_id_get(configuration: &configuration::Configuration, domain_id: &str) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/domains/{domainID}", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Updates name, metadata, tags and alias of the domain. -pub async fn domains_domain_id_patch(configuration: &configuration::Configuration, domain_id: &str, domain_update: models::DomainUpdate) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/domains/{domainID}", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - local_var_req_builder = local_var_req_builder.json(&domain_update); - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Retrieves list of domains that the user have access. -pub async fn domains_get(configuration: &configuration::Configuration, limit: Option, offset: Option, metadata: Option>, status: Option<&str>, name: Option<&str>, permission: Option<&str>) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/domains", local_var_configuration.base_path); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); - - if let Some(ref local_var_str) = limit { - local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); - } - if let Some(ref local_var_str) = offset { - local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); - } - if let Some(ref local_var_metadata) = metadata { - // Serialize metadata (HashMap) to JSON string - let metadata_json = serde_json::to_string(local_var_metadata) - .map_err(|e| Error::Serde(e))?; // Map to Serde error instead of SerializationError - - // Add the serialized JSON string to the query parameters - local_var_req_builder = local_var_req_builder.query(&[("metadata", &metadata_json)]); - } - if let Some(ref local_var_str) = status { - local_var_req_builder = local_var_req_builder.query(&[("status", &local_var_str.to_string())]); - } - if let Some(ref local_var_str) = name { - local_var_req_builder = local_var_req_builder.query(&[("name", &local_var_str.to_string())]); - } - if let Some(ref local_var_str) = permission { - local_var_req_builder = local_var_req_builder.query(&[("permission", &local_var_str.to_string())]); - } - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Adds new domain. -pub async fn domains_post(configuration: &configuration::Configuration, domain_req_obj: models::DomainReqObj) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/domains", local_var_configuration.base_path); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - local_var_req_builder = local_var_req_builder.json(&domain_req_obj); - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - diff --git a/domains/src/apis/health_api.rs b/domains/src/apis/health_api.rs deleted file mode 100644 index fc380e64..00000000 --- a/domains/src/apis/health_api.rs +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Magistrala Domains Service - * - * This is the Domains Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform domains. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The Magistrala repository](https://github.com/absmach/magistrala) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - - -use reqwest; -use serde::{Deserialize, Serialize}; -use crate::{apis::ResponseContent, models}; -use super::{Error, configuration}; - - -/// struct for typed errors of method [`health_get`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum HealthGetError { - Status500(), - UnknownValue(serde_json::Value), -} - - -pub async fn health_get(configuration: &configuration::Configuration, ) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/health", local_var_configuration.base_path); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - diff --git a/domains/src/apis/mod.rs b/domains/src/apis/mod.rs deleted file mode 100644 index 76b597a8..00000000 --- a/domains/src/apis/mod.rs +++ /dev/null @@ -1,97 +0,0 @@ -use std::error; -use std::fmt; - -#[derive(Debug, Clone)] -pub struct ResponseContent { - pub status: reqwest::StatusCode, - pub content: String, - pub entity: Option, -} - -#[derive(Debug)] -pub enum Error { - Reqwest(reqwest::Error), - Serde(serde_json::Error), - Io(std::io::Error), - ResponseError(ResponseContent), -} - -impl fmt::Display for Error { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - let (module, e) = match self { - Error::Reqwest(e) => ("reqwest", e.to_string()), - Error::Serde(e) => ("serde", e.to_string()), - Error::Io(e) => ("IO", e.to_string()), - Error::ResponseError(e) => ("response", format!("status code {}", e.status)), - }; - write!(f, "error in {}: {}", module, e) - } -} - -impl error::Error for Error { - fn source(&self) -> Option<&(dyn error::Error + 'static)> { - Some(match self { - Error::Reqwest(e) => e, - Error::Serde(e) => e, - Error::Io(e) => e, - Error::ResponseError(_) => return None, - }) - } -} - -impl From for Error { - fn from(e: reqwest::Error) -> Self { - Error::Reqwest(e) - } -} - -impl From for Error { - fn from(e: serde_json::Error) -> Self { - Error::Serde(e) - } -} - -impl From for Error { - fn from(e: std::io::Error) -> Self { - Error::Io(e) - } -} - -pub fn urlencode>(s: T) -> String { - ::url::form_urlencoded::byte_serialize(s.as_ref().as_bytes()).collect() -} - -pub fn parse_deep_object(prefix: &str, value: &serde_json::Value) -> Vec<(String, String)> { - if let serde_json::Value::Object(object) = value { - let mut params = vec![]; - - for (key, value) in object { - match value { - serde_json::Value::Object(_) => params.append(&mut parse_deep_object( - &format!("{}[{}]", prefix, key), - value, - )), - serde_json::Value::Array(array) => { - for (i, value) in array.iter().enumerate() { - params.append(&mut parse_deep_object( - &format!("{}[{}][{}]", prefix, key, i), - value, - )); - } - }, - serde_json::Value::String(s) => params.push((format!("{}[{}]", prefix, key), s.clone())), - _ => params.push((format!("{}[{}]", prefix, key), value.to_string())), - } - } - - return params; - } - - unimplemented!("Only objects are supported with style=deepObject") -} - -pub mod domains_api; -pub mod health_api; -pub mod roles_api; - -pub mod configuration; diff --git a/domains/src/lib.rs b/domains/src/lib.rs deleted file mode 100644 index e1520628..00000000 --- a/domains/src/lib.rs +++ /dev/null @@ -1,11 +0,0 @@ -#![allow(unused_imports)] -#![allow(clippy::too_many_arguments)] - -extern crate serde_repr; -extern crate serde; -extern crate serde_json; -extern crate url; -extern crate reqwest; - -pub mod apis; -pub mod models; diff --git a/domains/src/models/available_actions_obj.rs b/domains/src/models/available_actions_obj.rs deleted file mode 100644 index 7eb85120..00000000 --- a/domains/src/models/available_actions_obj.rs +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Magistrala Domains Service - * - * This is the Domains Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform domains. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The Magistrala repository](https://github.com/absmach/magistrala) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct AvailableActionsObj { - /// List of all available actions. - #[serde(rename = "available_actions", skip_serializing_if = "Option::is_none")] - pub available_actions: Option>, -} - -impl AvailableActionsObj { - pub fn new() -> AvailableActionsObj { - AvailableActionsObj { - available_actions: None, - } - } -} - diff --git a/domains/src/models/create_role_obj.rs b/domains/src/models/create_role_obj.rs deleted file mode 100644 index 0d37ed8d..00000000 --- a/domains/src/models/create_role_obj.rs +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Magistrala Domains Service - * - * This is the Domains Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform domains. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The Magistrala repository](https://github.com/absmach/magistrala) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct CreateRoleObj { - /// Role's name. - #[serde(rename = "role_name", skip_serializing_if = "Option::is_none")] - pub role_name: Option, - /// List of optional actions. - #[serde(rename = "optional_actions", skip_serializing_if = "Option::is_none")] - pub optional_actions: Option>, - /// List of optional members. - #[serde(rename = "optional_members", skip_serializing_if = "Option::is_none")] - pub optional_members: Option>, -} - -impl CreateRoleObj { - pub fn new() -> CreateRoleObj { - CreateRoleObj { - role_name: None, - optional_actions: None, - optional_members: None, - } - } -} - diff --git a/domains/src/models/health_info.rs b/domains/src/models/health_info.rs deleted file mode 100644 index b2e56e44..00000000 --- a/domains/src/models/health_info.rs +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Magistrala Domains Service - * - * This is the Domains Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform domains. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The Magistrala repository](https://github.com/absmach/magistrala) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct HealthInfo { - /// Service status. - #[serde(rename = "status", skip_serializing_if = "Option::is_none")] - pub status: Option, - /// Service version. - #[serde(rename = "version", skip_serializing_if = "Option::is_none")] - pub version: Option, - /// Service commit hash. - #[serde(rename = "commit", skip_serializing_if = "Option::is_none")] - pub commit: Option, - /// Service description. - #[serde(rename = "description", skip_serializing_if = "Option::is_none")] - pub description: Option, - /// Service build time. - #[serde(rename = "build_time", skip_serializing_if = "Option::is_none")] - pub build_time: Option, - /// Service instance ID. - #[serde(rename = "instance_id", skip_serializing_if = "Option::is_none")] - pub instance_id: Option, -} - -impl HealthInfo { - pub fn new() -> HealthInfo { - HealthInfo { - status: None, - version: None, - commit: None, - description: None, - build_time: None, - instance_id: None, - } - } -} -/// Service status. -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum Status { - #[serde(rename = "pass")] - Pass, -} - -impl Default for Status { - fn default() -> Status { - Self::Pass - } -} - diff --git a/domains/src/models/mod.rs b/domains/src/models/mod.rs deleted file mode 100644 index 2ce6d60c..00000000 --- a/domains/src/models/mod.rs +++ /dev/null @@ -1,26 +0,0 @@ -pub mod available_actions_obj; -pub use self::available_actions_obj::AvailableActionsObj; -pub mod create_role_obj; -pub use self::create_role_obj::CreateRoleObj; -pub mod domain; -pub use self::domain::Domain; -pub mod domain_req_obj; -pub use self::domain_req_obj::DomainReqObj; -pub mod domain_update; -pub use self::domain_update::DomainUpdate; -pub mod domains_page; -pub use self::domains_page::DomainsPage; -pub mod health_info; -pub use self::health_info::HealthInfo; -pub mod new_role; -pub use self::new_role::NewRole; -pub mod role; -pub use self::role::Role; -pub mod role_actions_obj; -pub use self::role_actions_obj::RoleActionsObj; -pub mod role_members_obj; -pub use self::role_members_obj::RoleMembersObj; -pub mod roles_page; -pub use self::roles_page::RolesPage; -pub mod update_role_obj; -pub use self::update_role_obj::UpdateRoleObj; diff --git a/domains/src/models/new_role.rs b/domains/src/models/new_role.rs deleted file mode 100644 index f5efb41e..00000000 --- a/domains/src/models/new_role.rs +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Magistrala Domains Service - * - * This is the Domains Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform domains. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The Magistrala repository](https://github.com/absmach/magistrala) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct NewRole { - /// Role unique identifier. - #[serde(rename = "role_id", skip_serializing_if = "Option::is_none")] - pub role_id: Option, - /// Role's name. - #[serde(rename = "role_name", skip_serializing_if = "Option::is_none")] - pub role_name: Option, - /// Entity unique identifier. - #[serde(rename = "entity_id", skip_serializing_if = "Option::is_none")] - pub entity_id: Option, - /// Role creator unique identifier. - #[serde(rename = "created_by", skip_serializing_if = "Option::is_none")] - pub created_by: Option, - /// Time when the channel was created. - #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] - pub created_at: Option, - /// Role updater unique identifier. - #[serde(rename = "updated_by", skip_serializing_if = "Option::is_none")] - pub updated_by: Option, - /// Time when the channel was created. - #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")] - pub updated_at: Option, -} - -impl NewRole { - pub fn new() -> NewRole { - NewRole { - role_id: None, - role_name: None, - entity_id: None, - created_by: None, - created_at: None, - updated_by: None, - updated_at: None, - } - } -} - diff --git a/domains/src/models/role.rs b/domains/src/models/role.rs deleted file mode 100644 index 518b83d5..00000000 --- a/domains/src/models/role.rs +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Magistrala Domains Service - * - * This is the Domains Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform domains. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The Magistrala repository](https://github.com/absmach/magistrala) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct Role { - /// Role unique identifier. - #[serde(rename = "role_id", skip_serializing_if = "Option::is_none")] - pub role_id: Option, - /// Role's name. - #[serde(rename = "role_name", skip_serializing_if = "Option::is_none")] - pub role_name: Option, - /// Entity unique identifier. - #[serde(rename = "entity_id", skip_serializing_if = "Option::is_none")] - pub entity_id: Option, - /// Role creator unique identifier. - #[serde(rename = "created_by", skip_serializing_if = "Option::is_none")] - pub created_by: Option, - /// Time when the channel was created. - #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] - pub created_at: Option, - /// Role updater unique identifier. - #[serde(rename = "updated_by", skip_serializing_if = "Option::is_none")] - pub updated_by: Option, - /// Time when the channel was created. - #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")] - pub updated_at: Option, -} - -impl Role { - pub fn new() -> Role { - Role { - role_id: None, - role_name: None, - entity_id: None, - created_by: None, - created_at: None, - updated_by: None, - updated_at: None, - } - } -} - diff --git a/domains/src/models/role_actions_obj.rs b/domains/src/models/role_actions_obj.rs deleted file mode 100644 index 1f74a3c9..00000000 --- a/domains/src/models/role_actions_obj.rs +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Magistrala Domains Service - * - * This is the Domains Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform domains. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The Magistrala repository](https://github.com/absmach/magistrala) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct RoleActionsObj { - /// List of actions to be added to a role. - #[serde(rename = "actions", skip_serializing_if = "Option::is_none")] - pub actions: Option>, -} - -impl RoleActionsObj { - pub fn new() -> RoleActionsObj { - RoleActionsObj { - actions: None, - } - } -} - diff --git a/domains/src/models/role_members_obj.rs b/domains/src/models/role_members_obj.rs deleted file mode 100644 index 221130cb..00000000 --- a/domains/src/models/role_members_obj.rs +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Magistrala Domains Service - * - * This is the Domains Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform domains. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The Magistrala repository](https://github.com/absmach/magistrala) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct RoleMembersObj { - /// List of members to be added to a role. - #[serde(rename = "members", skip_serializing_if = "Option::is_none")] - pub members: Option>, -} - -impl RoleMembersObj { - pub fn new() -> RoleMembersObj { - RoleMembersObj { - members: None, - } - } -} - diff --git a/domains/src/models/roles_page.rs b/domains/src/models/roles_page.rs deleted file mode 100644 index 4ef0236a..00000000 --- a/domains/src/models/roles_page.rs +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Magistrala Domains Service - * - * This is the Domains Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform domains. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The Magistrala repository](https://github.com/absmach/magistrala) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct RolesPage { - /// List of roles. - #[serde(rename = "roles", skip_serializing_if = "Option::is_none")] - pub roles: Option>, - /// Total number of roles. - #[serde(rename = "total", skip_serializing_if = "Option::is_none")] - pub total: Option, - /// Number of items to skip during retrieval. - #[serde(rename = "offset", skip_serializing_if = "Option::is_none")] - pub offset: Option, - /// Maximum number of items to return in one page. - #[serde(rename = "limit", skip_serializing_if = "Option::is_none")] - pub limit: Option, -} - -impl RolesPage { - pub fn new() -> RolesPage { - RolesPage { - roles: None, - total: None, - offset: None, - limit: None, - } - } -} - diff --git a/domains/src/models/update_role_obj.rs b/domains/src/models/update_role_obj.rs deleted file mode 100644 index ff276bd0..00000000 --- a/domains/src/models/update_role_obj.rs +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Magistrala Domains Service - * - * This is the Domains Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform domains. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The Magistrala repository](https://github.com/absmach/magistrala) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct UpdateRoleObj { - /// Role's name. - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, -} - -impl UpdateRoleObj { - pub fn new() -> UpdateRoleObj { - UpdateRoleObj { - name: None, - } - } -} - diff --git a/examples/Cargo.toml b/examples/Cargo.toml deleted file mode 100644 index 9c6a9fb4..00000000 --- a/examples/Cargo.toml +++ /dev/null @@ -1,36 +0,0 @@ -[package] -name = "examples-openapi" -version = "0.15.1" -authors = ["info@abstractmachines.fr"] -description = "This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) " -license = "Apache 2.0" -edition = "2021" - -# Set the default binary to `examples-openapi` -default-run = "examples-openapi" - -[dependencies] -serde = { version = "^1.0", features = ["derive"] } -serde_json = "^1.0" -serde_repr = "^0.1" -url = "^2.5" -uuid = { version = "^1.8", features = ["serde", "v4"] } -reqwest = { version = "^0.12", features = ["json", "multipart"] } -tokio = { version = "1", features = ["full"] } -Auth = { path = "../auth" } -Bootstrap = { path = "../bootstrap" } -Certs = { path = "../certs" } -Channels = { path = "../channels" } -Clients = { path = "../clients" } -Domains = { path = "../domains" } -Groups = { path = "../groups" } -Http = { path = "../http" } -Invitations = { path = "../invitations" } -Journal = { path = "../journal" } -Notifiers = { path = "../notifiers" } -Provision = { path = "../provision" } -Readers = { path = "../readers" } -Twins = { path = "../twins" } -Users = { path = "../users" } - - diff --git a/examples/src/lib.rs b/examples/src/lib.rs deleted file mode 100644 index ca58e3af..00000000 --- a/examples/src/lib.rs +++ /dev/null @@ -1,9 +0,0 @@ -#![allow(unused_imports)] -#![allow(clippy::too_many_arguments)] - -extern crate serde_repr; -extern crate serde; -extern crate serde_json; -extern crate url; -extern crate reqwest; - diff --git a/groups/.gitignore b/groups/.gitignore deleted file mode 100644 index 6aa10640..00000000 --- a/groups/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/target/ -**/*.rs.bk -Cargo.lock diff --git a/groups/.openapi-generator-ignore b/groups/.openapi-generator-ignore deleted file mode 100644 index 7484ee59..00000000 --- a/groups/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/groups/.openapi-generator/FILES b/groups/.openapi-generator/FILES deleted file mode 100644 index 75683be7..00000000 --- a/groups/.openapi-generator/FILES +++ /dev/null @@ -1,56 +0,0 @@ -.gitignore -.openapi-generator-ignore -.travis.yml -Cargo.toml -README.md -docs/AvailableActionsObj.md -docs/ChildrenGroupReqObj.md -docs/CreateRoleObj.md -docs/Error.md -docs/Group.md -docs/GroupReqObj.md -docs/GroupUpdate.md -docs/GroupsApi.md -docs/GroupsHierarchyPage.md -docs/GroupsPage.md -docs/HealthApi.md -docs/HealthRes.md -docs/Members.md -docs/MembersCredentials.md -docs/MembersPage.md -docs/NewRole.md -docs/ParentGroupReqObj.md -docs/Role.md -docs/RoleActionsObj.md -docs/RoleMembersObj.md -docs/RolesApi.md -docs/RolesPage.md -docs/UpdateRoleObj.md -git_push.sh -src/apis/configuration.rs -src/apis/groups_api.rs -src/apis/health_api.rs -src/apis/mod.rs -src/apis/roles_api.rs -src/lib.rs -src/models/available_actions_obj.rs -src/models/children_group_req_obj.rs -src/models/create_role_obj.rs -src/models/error.rs -src/models/group.rs -src/models/group_req_obj.rs -src/models/group_update.rs -src/models/groups_hierarchy_page.rs -src/models/groups_page.rs -src/models/health_res.rs -src/models/members.rs -src/models/members_credentials.rs -src/models/members_page.rs -src/models/mod.rs -src/models/new_role.rs -src/models/parent_group_req_obj.rs -src/models/role.rs -src/models/role_actions_obj.rs -src/models/role_members_obj.rs -src/models/roles_page.rs -src/models/update_role_obj.rs diff --git a/groups/.openapi-generator/VERSION b/groups/.openapi-generator/VERSION deleted file mode 100644 index 758bb9c8..00000000 --- a/groups/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -7.10.0 diff --git a/groups/.travis.yml b/groups/.travis.yml deleted file mode 100644 index 22761ba7..00000000 --- a/groups/.travis.yml +++ /dev/null @@ -1 +0,0 @@ -language: rust diff --git a/groups/Cargo.toml b/groups/Cargo.toml deleted file mode 100644 index b8ce0118..00000000 --- a/groups/Cargo.toml +++ /dev/null @@ -1,15 +0,0 @@ -[package] -name = "Groups" -version = "0.15.1" -authors = ["info@abstractmachines.fr"] -description = "This is the Groups Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform groups. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) " -license = "Apache 2.0" -edition = "2021" - -[dependencies] -serde = { version = "^1.0", features = ["derive"] } -serde_json = "^1.0" -serde_repr = "^0.1" -url = "^2.5" -uuid = { version = "^1.8", features = ["serde", "v4"] } -reqwest = { version = "^0.12", features = ["json", "multipart"] } diff --git a/groups/README.md b/groups/README.md deleted file mode 100644 index 9d86d39c..00000000 --- a/groups/README.md +++ /dev/null @@ -1,96 +0,0 @@ -# Rust API client for openapi - -This is the Groups Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform groups. You can now help us improve the API whether it's by making changes to the definition itself or to the code. -Some useful links: -- [The SuperMQ repository](https://github.com/absmach/supermq) - - - -## Overview - -This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://openapis.org) from a remote server, you can easily generate an API client. - -- API version: 0.15.1 -- Package version: 0.15.1 -- Generator version: 7.10.0 -- Build package: `org.openapitools.codegen.languages.RustClientCodegen` - -## Installation - -Put the package under your project folder in a directory named `openapi` and add the following to `Cargo.toml` under `[dependencies]`: - -``` -openapi = { path = "./openapi" } -``` - -## Documentation for API Endpoints - -All URIs are relative to *http://localhost:9004* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*GroupsApi* | [**add_children_groups**](docs/GroupsApi.md#add_children_groups) | **POST** /{domainID}/groups/{groupID}/children | Add children groups. -*GroupsApi* | [**create_group**](docs/GroupsApi.md#create_group) | **POST** /{domainID}/groups | Creates new group -*GroupsApi* | [**disable_group**](docs/GroupsApi.md#disable_group) | **POST** /{domainID}/groups/{groupID}/disable | Disables a group -*GroupsApi* | [**domain_id_groups_group_id_delete**](docs/GroupsApi.md#domain_id_groups_group_id_delete) | **DELETE** /{domainID}/groups/{groupID} | Delete group for a group with the given id. -*GroupsApi* | [**enable_group**](docs/GroupsApi.md#enable_group) | **POST** /{domainID}/groups/{groupID}/enable | Enables a group -*GroupsApi* | [**get_group**](docs/GroupsApi.md#get_group) | **GET** /{domainID}/groups/{groupID} | Gets group info. -*GroupsApi* | [**list_children_groups**](docs/GroupsApi.md#list_children_groups) | **GET** /{domainID}/groups/{groupID}/children | List children of a certain group -*GroupsApi* | [**list_group_hierarchy**](docs/GroupsApi.md#list_group_hierarchy) | **GET** /{domainID}/groups/{groupID}/hierarchy | Lists groups hierarchy. -*GroupsApi* | [**list_groups**](docs/GroupsApi.md#list_groups) | **GET** /{domainID}/groups | Lists groups. -*GroupsApi* | [**remove_all_children_groups**](docs/GroupsApi.md#remove_all_children_groups) | **DELETE** /{domainID}/groups/{groupID}/children/all | Remove all children groups. -*GroupsApi* | [**remove_children_groups**](docs/GroupsApi.md#remove_children_groups) | **DELETE** /{domainID}/groups/{groupID}/children | Remove children groups. -*GroupsApi* | [**remove_group_parent_group**](docs/GroupsApi.md#remove_group_parent_group) | **DELETE** /{domainID}/groups/{groupID}/parent | Removes a parent group from a group. -*GroupsApi* | [**set_group_parent_group**](docs/GroupsApi.md#set_group_parent_group) | **POST** /{domainID}/groups/{groupID}/parent | Sets a parent group for a group. -*GroupsApi* | [**update_group**](docs/GroupsApi.md#update_group) | **PUT** /{domainID}/groups/{groupID} | Updates group data. -*HealthApi* | [**health**](docs/HealthApi.md#health) | **GET** /health | Retrieves service health check info. -*RolesApi* | [**add_group_role_action**](docs/RolesApi.md#add_group_role_action) | **POST** /{domainID}/groups/{groupID}/roles/{roleName}/actions | Adds a role action for a group role. -*RolesApi* | [**add_group_role_member**](docs/RolesApi.md#add_group_role_member) | **POST** /{domainID}/groups/{groupID}/roles/{roleName}/members | Adds a member to a group role. -*RolesApi* | [**create_group_role**](docs/RolesApi.md#create_group_role) | **POST** /{domainID}/groups/{groupID}/roles | Creates a role for a group -*RolesApi* | [**delete_all_group_role_actions**](docs/RolesApi.md#delete_all_group_role_actions) | **POST** /{domainID}/groups/{groupID}/roles/{roleName}/actions/delete-all | Deletes all role actions for a group role. -*RolesApi* | [**delete_all_group_role_members**](docs/RolesApi.md#delete_all_group_role_members) | **POST** /{domainID}/groups/{groupID}/roles/{roleName}/members/delete-all | Deletes all members from a group role. -*RolesApi* | [**delete_group_role**](docs/RolesApi.md#delete_group_role) | **DELETE** /{domainID}/groups/{groupID}/roles/{roleName} | Deletes group role. -*RolesApi* | [**delete_group_role_action**](docs/RolesApi.md#delete_group_role_action) | **POST** /{domainID}/groups/{groupID}/roles/{roleName}/actions/delete | Deletes role actions for a group role. -*RolesApi* | [**delete_group_role_members**](docs/RolesApi.md#delete_group_role_members) | **POST** /{domainID}/groups/{groupID}/roles/{roleName}/members/delete | Deletes members from a group role. -*RolesApi* | [**get_group_role**](docs/RolesApi.md#get_group_role) | **GET** /{domainID}/groups/{groupID}/roles/{roleName} | Retrieves group role. -*RolesApi* | [**list_available_actions**](docs/RolesApi.md#list_available_actions) | **GET** /{domainID}/groups/roles/available-actions | Retrieves available actions. -*RolesApi* | [**list_group_role_actions**](docs/RolesApi.md#list_group_role_actions) | **GET** /{domainID}/groups/{groupID}/roles/{roleName}/actions | Lists group role actions. -*RolesApi* | [**list_group_role_members**](docs/RolesApi.md#list_group_role_members) | **GET** /{domainID}/groups/{groupID}/roles/{roleName}/members | Lists group role members. -*RolesApi* | [**list_group_roles**](docs/RolesApi.md#list_group_roles) | **GET** /{domainID}/groups/{groupID}/roles | Retrieves groups roles. -*RolesApi* | [**update_group_role**](docs/RolesApi.md#update_group_role) | **PUT** /{domainID}/groups/{groupID}/roles/{roleName} | Updates group role. - - -## Documentation For Models - - - [AvailableActionsObj](docs/AvailableActionsObj.md) - - [ChildrenGroupReqObj](docs/ChildrenGroupReqObj.md) - - [CreateRoleObj](docs/CreateRoleObj.md) - - [Error](docs/Error.md) - - [Group](docs/Group.md) - - [GroupReqObj](docs/GroupReqObj.md) - - [GroupUpdate](docs/GroupUpdate.md) - - [GroupsHierarchyPage](docs/GroupsHierarchyPage.md) - - [GroupsPage](docs/GroupsPage.md) - - [HealthRes](docs/HealthRes.md) - - [Members](docs/Members.md) - - [MembersCredentials](docs/MembersCredentials.md) - - [MembersPage](docs/MembersPage.md) - - [NewRole](docs/NewRole.md) - - [ParentGroupReqObj](docs/ParentGroupReqObj.md) - - [Role](docs/Role.md) - - [RoleActionsObj](docs/RoleActionsObj.md) - - [RoleMembersObj](docs/RoleMembersObj.md) - - [RolesPage](docs/RolesPage.md) - - [UpdateRoleObj](docs/UpdateRoleObj.md) - - -To get access to the crate's generated documentation, use: - -``` -cargo doc --open -``` - -## Author - -info@abstractmachines.fr - diff --git a/groups/docs/AvailableActionsObj.md b/groups/docs/AvailableActionsObj.md deleted file mode 100644 index 07f6848c..00000000 --- a/groups/docs/AvailableActionsObj.md +++ /dev/null @@ -1,11 +0,0 @@ -# AvailableActionsObj - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**available_actions** | Option<**Vec**> | List of all available actions. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/groups/docs/ChildrenGroupReqObj.md b/groups/docs/ChildrenGroupReqObj.md deleted file mode 100644 index eddeee15..00000000 --- a/groups/docs/ChildrenGroupReqObj.md +++ /dev/null @@ -1,11 +0,0 @@ -# ChildrenGroupReqObj - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**groups** | [**Vec**](uuid::Uuid.md) | Children group IDs. | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/groups/docs/CreateRoleObj.md b/groups/docs/CreateRoleObj.md deleted file mode 100644 index 59ac3f4f..00000000 --- a/groups/docs/CreateRoleObj.md +++ /dev/null @@ -1,13 +0,0 @@ -# CreateRoleObj - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**role_name** | Option<**String**> | Role's name. | [optional] -**optional_actions** | Option<**Vec**> | List of optional actions. | [optional] -**optional_members** | Option<**Vec**> | List of optional members. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/groups/docs/Error.md b/groups/docs/Error.md deleted file mode 100644 index 8e78862d..00000000 --- a/groups/docs/Error.md +++ /dev/null @@ -1,11 +0,0 @@ -# Error - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**error** | Option<**String**> | Error message | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/groups/docs/Group.md b/groups/docs/Group.md deleted file mode 100644 index c3e986b2..00000000 --- a/groups/docs/Group.md +++ /dev/null @@ -1,21 +0,0 @@ -# Group - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | Unique group identifier generated by the service. | [optional] -**name** | Option<**String**> | Free-form group name. Group name is unique on the given hierarchy level. | [optional] -**domain_id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | ID of the domain to which the group belongs.. | [optional] -**parent_id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | Group parent identifier. | [optional] -**description** | Option<**String**> | Group description, free form text. | [optional] -**metadata** | Option<[**serde_json::Value**](.md)> | Arbitrary, object-encoded groups's data. | [optional] -**path** | Option<**String**> | Hierarchy path, concatenated ids of group ancestors. | [optional] -**level** | Option<**i32**> | Level in hierarchy, distance from the root group. | [optional] -**created_at** | Option<**String**> | Datetime when the group was created. | [optional] -**updated_at** | Option<**String**> | Datetime when the group was created. | [optional] -**status** | Option<**String**> | Group Status | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/groups/docs/GroupReqObj.md b/groups/docs/GroupReqObj.md deleted file mode 100644 index 399e4131..00000000 --- a/groups/docs/GroupReqObj.md +++ /dev/null @@ -1,15 +0,0 @@ -# GroupReqObj - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | Free-form group name. Group name is unique on the given hierarchy level. | -**description** | Option<**String**> | Group description, free form text. | [optional] -**parent_id** | Option<**String**> | Id of parent group, it must be existing group. | [optional] -**metadata** | Option<[**serde_json::Value**](.md)> | Arbitrary, object-encoded groups's data. | [optional] -**status** | Option<**String**> | Group Status | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/groups/docs/GroupUpdate.md b/groups/docs/GroupUpdate.md deleted file mode 100644 index 3f215c7e..00000000 --- a/groups/docs/GroupUpdate.md +++ /dev/null @@ -1,13 +0,0 @@ -# GroupUpdate - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | Free-form group name. Group name is unique on the given hierarchy level. | -**description** | **String** | Group description, free form text. | -**metadata** | [**serde_json::Value**](.md) | Arbitrary, object-encoded groups's data. | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/groups/docs/GroupsApi.md b/groups/docs/GroupsApi.md deleted file mode 100644 index 94498aef..00000000 --- a/groups/docs/GroupsApi.md +++ /dev/null @@ -1,477 +0,0 @@ -# \GroupsApi - -All URIs are relative to *http://localhost:9004* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**add_children_groups**](GroupsApi.md#add_children_groups) | **POST** /{domainID}/groups/{groupID}/children | Add children groups. -[**create_group**](GroupsApi.md#create_group) | **POST** /{domainID}/groups | Creates new group -[**disable_group**](GroupsApi.md#disable_group) | **POST** /{domainID}/groups/{groupID}/disable | Disables a group -[**domain_id_groups_group_id_delete**](GroupsApi.md#domain_id_groups_group_id_delete) | **DELETE** /{domainID}/groups/{groupID} | Delete group for a group with the given id. -[**enable_group**](GroupsApi.md#enable_group) | **POST** /{domainID}/groups/{groupID}/enable | Enables a group -[**get_group**](GroupsApi.md#get_group) | **GET** /{domainID}/groups/{groupID} | Gets group info. -[**list_children_groups**](GroupsApi.md#list_children_groups) | **GET** /{domainID}/groups/{groupID}/children | List children of a certain group -[**list_group_hierarchy**](GroupsApi.md#list_group_hierarchy) | **GET** /{domainID}/groups/{groupID}/hierarchy | Lists groups hierarchy. -[**list_groups**](GroupsApi.md#list_groups) | **GET** /{domainID}/groups | Lists groups. -[**remove_all_children_groups**](GroupsApi.md#remove_all_children_groups) | **DELETE** /{domainID}/groups/{groupID}/children/all | Remove all children groups. -[**remove_children_groups**](GroupsApi.md#remove_children_groups) | **DELETE** /{domainID}/groups/{groupID}/children | Remove children groups. -[**remove_group_parent_group**](GroupsApi.md#remove_group_parent_group) | **DELETE** /{domainID}/groups/{groupID}/parent | Removes a parent group from a group. -[**set_group_parent_group**](GroupsApi.md#set_group_parent_group) | **POST** /{domainID}/groups/{groupID}/parent | Sets a parent group for a group. -[**update_group**](GroupsApi.md#update_group) | **PUT** /{domainID}/groups/{groupID} | Updates group data. - - - -## add_children_groups - -> add_children_groups(domain_id, group_id, children_group_req_obj) -Add children groups. - -Adds children groups for a specific group that is identified by the group ID. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**group_id** | **uuid::Uuid** | Unique group identifier. | [required] | -**children_group_req_obj** | [**ChildrenGroupReqObj**](ChildrenGroupReqObj.md) | JSON-formated document describing the children groups to be added to a group. | [required] | - -### Return type - - (empty response body) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## create_group - -> models::Group create_group(domain_id, group_req_obj) -Creates new group - -Creates new group that can be used for grouping entities. New account will be uniquely identified by its identity. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**group_req_obj** | [**GroupReqObj**](GroupReqObj.md) | JSON-formatted document describing the new group to be registered | [required] | - -### Return type - -[**models::Group**](Group.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## disable_group - -> models::Group disable_group(domain_id, group_id) -Disables a group - -Disables a specific group that is identifier by the group ID. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**group_id** | **uuid::Uuid** | Unique group identifier. | [required] | - -### Return type - -[**models::Group**](Group.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## domain_id_groups_group_id_delete - -> domain_id_groups_group_id_delete(domain_id, group_id) -Delete group for a group with the given id. - -Delete group removes a group with the given id from repo and removes all the policies related to this group. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**group_id** | **uuid::Uuid** | Unique group identifier. | [required] | - -### Return type - - (empty response body) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## enable_group - -> models::Group enable_group(domain_id, group_id) -Enables a group - -Enables a specific group that is identifier by the group ID. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**group_id** | **uuid::Uuid** | Unique group identifier. | [required] | - -### Return type - -[**models::Group**](Group.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## get_group - -> models::Group get_group(domain_id, group_id) -Gets group info. - -Gets info on a group specified by id. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**group_id** | **uuid::Uuid** | Unique group identifier. | [required] | - -### Return type - -[**models::Group**](Group.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## list_children_groups - -> models::GroupsPage list_children_groups(domain_id, group_id, limit, offset, start_level, end_level, tree, metadata, name) -List children of a certain group - -Lists groups up to a max level of hierarchy that can be fetched in one request ( max level = 5). Result can be filtered by metadata. Groups will be returned as JSON array or JSON tree. Due to performance concerns, result is returned in subsets. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**group_id** | **uuid::Uuid** | Unique group identifier. | [required] | -**limit** | Option<**i32**> | Size of the subset to retrieve. | |[default to 10] -**offset** | Option<**i32**> | Number of items to skip during retrieval. | |[default to 0] -**start_level** | Option<**i32**> | Level of hierarchy from which to start retrieving groups from given group id. | | -**end_level** | Option<**i32**> | Level of hierarchy up to which to retrieve groups from given group id. | | -**tree** | Option<**bool**> | Specify type of response, JSON array or tree. | |[default to false] -**metadata** | Option<**String**> | Metadata filter. Filtering is performed matching the parameter with metadata on top level. Parameter is json. | | -**name** | Option<**String**> | Group's name. | | - -### Return type - -[**models::GroupsPage**](GroupsPage.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## list_group_hierarchy - -> models::GroupsHierarchyPage list_group_hierarchy(domain_id, group_id, level, tree, direction) -Lists groups hierarchy. - -Lists groups heirarchy up to a max level of hierarchy that can be fetched in one request ( max level = 5). Result can be filtered by metadata. Groups will be returned as JSON array or JSON tree. Due to performance concerns, result is returned in subsets. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**group_id** | **uuid::Uuid** | Unique group identifier. | [required] | -**level** | Option<**i32**> | Level of hierarchy up to which to retrieve groups from given group id. | | -**tree** | Option<**bool**> | Specify type of response, JSON array or tree. | |[default to false] -**direction** | Option<**i32**> | Direction of hierarchy traversal. | | - -### Return type - -[**models::GroupsHierarchyPage**](GroupsHierarchyPage.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## list_groups - -> models::GroupsPage list_groups(domain_id, limit, offset, level, tree, metadata, name, parent_id) -Lists groups. - -Lists groups up to a max level of hierarchy that can be fetched in one request ( max level = 5). Result can be filtered by metadata. Groups will be returned as JSON array or JSON tree. Due to performance concerns, result is returned in subsets. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**limit** | Option<**i32**> | Size of the subset to retrieve. | |[default to 10] -**offset** | Option<**i32**> | Number of items to skip during retrieval. | |[default to 0] -**level** | Option<**i32**> | Level of hierarchy up to which to retrieve groups from given group id. | | -**tree** | Option<**bool**> | Specify type of response, JSON array or tree. | |[default to false] -**metadata** | Option<**String**> | Metadata filter. Filtering is performed matching the parameter with metadata on top level. Parameter is json. | | -**name** | Option<**String**> | Group's name. | | -**parent_id** | Option<**uuid::Uuid**> | Unique parent identifier for a group. | | - -### Return type - -[**models::GroupsPage**](GroupsPage.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## remove_all_children_groups - -> remove_all_children_groups(domain_id, group_id) -Remove all children groups. - -Removes all children groups for a specific group that is identified by the group ID. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**group_id** | **uuid::Uuid** | Unique group identifier. | [required] | - -### Return type - - (empty response body) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## remove_children_groups - -> remove_children_groups(domain_id, group_id, children_group_req_obj) -Remove children groups. - -Removes children groups for a specific group that is identified by the group ID. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**group_id** | **uuid::Uuid** | Unique group identifier. | [required] | -**children_group_req_obj** | [**ChildrenGroupReqObj**](ChildrenGroupReqObj.md) | JSON-formated document describing the children groups to be added to a group. | [required] | - -### Return type - - (empty response body) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## remove_group_parent_group - -> remove_group_parent_group(domain_id, group_id, parent_group_req_obj) -Removes a parent group from a group. - -Removes a parent group from a specific group that is identified by the group ID. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**group_id** | **uuid::Uuid** | Unique group identifier. | [required] | -**parent_group_req_obj** | [**ParentGroupReqObj**](ParentGroupReqObj.md) | JSON-formated document describing the parent group to be set to or removed from a group. | [required] | - -### Return type - - (empty response body) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## set_group_parent_group - -> set_group_parent_group(domain_id, group_id, parent_group_req_obj) -Sets a parent group for a group. - -Sets a parent group for a specific group that is identified by the group ID. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**group_id** | **uuid::Uuid** | Unique group identifier. | [required] | -**parent_group_req_obj** | [**ParentGroupReqObj**](ParentGroupReqObj.md) | JSON-formated document describing the parent group to be set to or removed from a group. | [required] | - -### Return type - - (empty response body) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## update_group - -> models::Group update_group(domain_id, group_id, group_update) -Updates group data. - -Updates Name, Description or Metadata of a group. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**group_id** | **uuid::Uuid** | Unique group identifier. | [required] | -**group_update** | [**GroupUpdate**](GroupUpdate.md) | JSON-formated document describing the metadata and name of group to be update | [required] | - -### Return type - -[**models::Group**](Group.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/groups/docs/GroupsHierarchyPage.md b/groups/docs/GroupsHierarchyPage.md deleted file mode 100644 index 82d89aaa..00000000 --- a/groups/docs/GroupsHierarchyPage.md +++ /dev/null @@ -1,13 +0,0 @@ -# GroupsHierarchyPage - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**level** | Option<**i32**> | Level of hierarchy. | [optional] -**direction** | Option<**i32**> | Direction of hierarchy traversal. | [optional] -**groups** | Option<[**Vec**](Group.md)> | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/groups/docs/GroupsPage.md b/groups/docs/GroupsPage.md deleted file mode 100644 index fff04c3b..00000000 --- a/groups/docs/GroupsPage.md +++ /dev/null @@ -1,14 +0,0 @@ -# GroupsPage - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**groups** | [**Vec**](Group.md) | | -**total** | **i32** | Total number of items. | -**offset** | **i32** | Number of items to skip during retrieval. | -**limit** | Option<**i32**> | Maximum number of items to return in one page. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/groups/docs/HealthApi.md b/groups/docs/HealthApi.md deleted file mode 100644 index c0b3629d..00000000 --- a/groups/docs/HealthApi.md +++ /dev/null @@ -1,34 +0,0 @@ -# \HealthApi - -All URIs are relative to *http://localhost:9004* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**health**](HealthApi.md#health) | **GET** /health | Retrieves service health check info. - - - -## health - -> models::HealthRes health() -Retrieves service health check info. - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -[**models::HealthRes**](HealthRes.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/health+json, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/groups/docs/HealthRes.md b/groups/docs/HealthRes.md deleted file mode 100644 index 319b16fb..00000000 --- a/groups/docs/HealthRes.md +++ /dev/null @@ -1,15 +0,0 @@ -# HealthRes - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | Option<**String**> | Service status. | [optional] -**version** | Option<**String**> | Service version. | [optional] -**commit** | Option<**String**> | Service commit hash. | [optional] -**description** | Option<**String**> | Service description. | [optional] -**build_time** | Option<**String**> | Service build time. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/groups/docs/Members.md b/groups/docs/Members.md deleted file mode 100644 index a5d7e31b..00000000 --- a/groups/docs/Members.md +++ /dev/null @@ -1,20 +0,0 @@ -# Members - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | User unique identifier. | [optional] -**first_name** | Option<**String**> | User's first name. | [optional] -**last_name** | Option<**String**> | User's last name. | [optional] -**email** | Option<**String**> | User's email address. | [optional] -**tags** | Option<**Vec**> | User tags. | [optional] -**credentials** | Option<[**models::MembersCredentials**](Members_credentials.md)> | | [optional] -**metadata** | Option<[**serde_json::Value**](.md)> | Arbitrary, object-encoded user's data. | [optional] -**status** | Option<**String**> | User Status | [optional] -**created_at** | Option<**String**> | Time when the group was created. | [optional] -**updated_at** | Option<**String**> | Time when the group was created. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/groups/docs/MembersCredentials.md b/groups/docs/MembersCredentials.md deleted file mode 100644 index e3669de6..00000000 --- a/groups/docs/MembersCredentials.md +++ /dev/null @@ -1,12 +0,0 @@ -# MembersCredentials - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**username** | Option<**String**> | User's username. | [optional] -**secret** | Option<**String**> | User secret password. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/groups/docs/MembersPage.md b/groups/docs/MembersPage.md deleted file mode 100644 index 66f13666..00000000 --- a/groups/docs/MembersPage.md +++ /dev/null @@ -1,14 +0,0 @@ -# MembersPage - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**members** | [**Vec**](Members.md) | | -**total** | **i32** | Total number of items. | -**offset** | Option<**i32**> | Number of items to skip during retrieval. | [optional] -**limit** | Option<**i32**> | Maximum number of items to return in one page. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/groups/docs/NewRole.md b/groups/docs/NewRole.md deleted file mode 100644 index 8d232bc0..00000000 --- a/groups/docs/NewRole.md +++ /dev/null @@ -1,17 +0,0 @@ -# NewRole - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**role_id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | Role unique identifier. | [optional] -**role_name** | Option<**String**> | Role's name. | [optional] -**entity_id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | Entity unique identifier. | [optional] -**created_by** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | Role creator unique identifier. | [optional] -**created_at** | Option<**String**> | Time when the channel was created. | [optional] -**updated_by** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | Role updater unique identifier. | [optional] -**updated_at** | Option<**String**> | Time when the channel was created. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/groups/docs/ParentGroupReqObj.md b/groups/docs/ParentGroupReqObj.md deleted file mode 100644 index fef42f7a..00000000 --- a/groups/docs/ParentGroupReqObj.md +++ /dev/null @@ -1,11 +0,0 @@ -# ParentGroupReqObj - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**group_id** | [**uuid::Uuid**](uuid::Uuid.md) | Parent group unique identifier. | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/groups/docs/Role.md b/groups/docs/Role.md deleted file mode 100644 index c7a4694f..00000000 --- a/groups/docs/Role.md +++ /dev/null @@ -1,17 +0,0 @@ -# Role - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**role_id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | Role unique identifier. | [optional] -**role_name** | Option<**String**> | Role's name. | [optional] -**entity_id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | Entity unique identifier. | [optional] -**created_by** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | Role creator unique identifier. | [optional] -**created_at** | Option<**String**> | Time when the channel was created. | [optional] -**updated_by** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | Role updater unique identifier. | [optional] -**updated_at** | Option<**String**> | Time when the channel was created. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/groups/docs/RoleActionsObj.md b/groups/docs/RoleActionsObj.md deleted file mode 100644 index b61a2345..00000000 --- a/groups/docs/RoleActionsObj.md +++ /dev/null @@ -1,11 +0,0 @@ -# RoleActionsObj - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**actions** | Option<**Vec**> | List of actions to be added to a role. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/groups/docs/RoleMembersObj.md b/groups/docs/RoleMembersObj.md deleted file mode 100644 index 1d9d997a..00000000 --- a/groups/docs/RoleMembersObj.md +++ /dev/null @@ -1,11 +0,0 @@ -# RoleMembersObj - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**members** | Option<**Vec**> | List of members to be added to a role. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/groups/docs/RolesApi.md b/groups/docs/RolesApi.md deleted file mode 100644 index eed8e188..00000000 --- a/groups/docs/RolesApi.md +++ /dev/null @@ -1,474 +0,0 @@ -# \RolesApi - -All URIs are relative to *http://localhost:9004* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**add_group_role_action**](RolesApi.md#add_group_role_action) | **POST** /{domainID}/groups/{groupID}/roles/{roleName}/actions | Adds a role action for a group role. -[**add_group_role_member**](RolesApi.md#add_group_role_member) | **POST** /{domainID}/groups/{groupID}/roles/{roleName}/members | Adds a member to a group role. -[**create_group_role**](RolesApi.md#create_group_role) | **POST** /{domainID}/groups/{groupID}/roles | Creates a role for a group -[**delete_all_group_role_actions**](RolesApi.md#delete_all_group_role_actions) | **POST** /{domainID}/groups/{groupID}/roles/{roleName}/actions/delete-all | Deletes all role actions for a group role. -[**delete_all_group_role_members**](RolesApi.md#delete_all_group_role_members) | **POST** /{domainID}/groups/{groupID}/roles/{roleName}/members/delete-all | Deletes all members from a group role. -[**delete_group_role**](RolesApi.md#delete_group_role) | **DELETE** /{domainID}/groups/{groupID}/roles/{roleName} | Deletes group role. -[**delete_group_role_action**](RolesApi.md#delete_group_role_action) | **POST** /{domainID}/groups/{groupID}/roles/{roleName}/actions/delete | Deletes role actions for a group role. -[**delete_group_role_members**](RolesApi.md#delete_group_role_members) | **POST** /{domainID}/groups/{groupID}/roles/{roleName}/members/delete | Deletes members from a group role. -[**get_group_role**](RolesApi.md#get_group_role) | **GET** /{domainID}/groups/{groupID}/roles/{roleName} | Retrieves group role. -[**list_available_actions**](RolesApi.md#list_available_actions) | **GET** /{domainID}/groups/roles/available-actions | Retrieves available actions. -[**list_group_role_actions**](RolesApi.md#list_group_role_actions) | **GET** /{domainID}/groups/{groupID}/roles/{roleName}/actions | Lists group role actions. -[**list_group_role_members**](RolesApi.md#list_group_role_members) | **GET** /{domainID}/groups/{groupID}/roles/{roleName}/members | Lists group role members. -[**list_group_roles**](RolesApi.md#list_group_roles) | **GET** /{domainID}/groups/{groupID}/roles | Retrieves groups roles. -[**update_group_role**](RolesApi.md#update_group_role) | **PUT** /{domainID}/groups/{groupID}/roles/{roleName} | Updates group role. - - - -## add_group_role_action - -> models::RoleActionsObj add_group_role_action(domain_id, group_id, role_name, role_actions_obj) -Adds a role action for a group role. - -Adds a role action for a specific group role that is identified by the role name. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**group_id** | **uuid::Uuid** | Unique group identifier. | [required] | -**role_name** | **String** | Role's name. | [required] | -**role_actions_obj** | [**RoleActionsObj**](RoleActionsObj.md) | JSON- formatted object decsribing an action to be added to a role. | [required] | - -### Return type - -[**models::RoleActionsObj**](RoleActionsObj.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## add_group_role_member - -> models::RoleMembersObj add_group_role_member(domain_id, group_id, role_name, role_members_obj) -Adds a member to a group role. - -Adds a member to a specific group role that is identified by the role name. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**group_id** | **uuid::Uuid** | Unique group identifier. | [required] | -**role_name** | **String** | Role's name. | [required] | -**role_members_obj** | [**RoleMembersObj**](RoleMembersObj.md) | JSON- formatted object decsribing a member to be added to a role. | [required] | - -### Return type - -[**models::RoleMembersObj**](RoleMembersObj.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## create_group_role - -> models::NewRole create_group_role(domain_id, group_id, create_role_obj) -Creates a role for a group - -Creates a role for a specific group that is identified by the group ID. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**group_id** | **uuid::Uuid** | Unique group identifier. | [required] | -**create_role_obj** | [**CreateRoleObj**](CreateRoleObj.md) | JSON- formatted object decsribing a new role to be created. | [required] | - -### Return type - -[**models::NewRole**](NewRole.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## delete_all_group_role_actions - -> delete_all_group_role_actions(domain_id, group_id, role_name) -Deletes all role actions for a group role. - -Deletes all role actions for a specific group role that is identified by the role name. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**group_id** | **uuid::Uuid** | Unique group identifier. | [required] | -**role_name** | **String** | Role's name. | [required] | - -### Return type - - (empty response body) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## delete_all_group_role_members - -> delete_all_group_role_members(domain_id, group_id, role_name) -Deletes all members from a group role. - -Deletes all members from a specific group role that is identified by the role name. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**group_id** | **uuid::Uuid** | Unique group identifier. | [required] | -**role_name** | **String** | Role's name. | [required] | - -### Return type - - (empty response body) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## delete_group_role - -> delete_group_role(domain_id, group_id, role_name) -Deletes group role. - -Deletes a specific group role that is identifier by the role name. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**group_id** | **uuid::Uuid** | Unique group identifier. | [required] | -**role_name** | **String** | Role's name. | [required] | - -### Return type - - (empty response body) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## delete_group_role_action - -> delete_group_role_action(domain_id, group_id, role_name, role_actions_obj) -Deletes role actions for a group role. - -Deletes a role action for a specific group role that is identified by the role name. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**group_id** | **uuid::Uuid** | Unique group identifier. | [required] | -**role_name** | **String** | Role's name. | [required] | -**role_actions_obj** | [**RoleActionsObj**](RoleActionsObj.md) | JSON- formatted object decsribing an action to be added to a role. | [required] | - -### Return type - - (empty response body) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## delete_group_role_members - -> delete_group_role_members(domain_id, group_id, role_name, role_members_obj) -Deletes members from a group role. - -Deletes a member from a specific group role that is identified by the role name. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**group_id** | **uuid::Uuid** | Unique group identifier. | [required] | -**role_name** | **String** | Role's name. | [required] | -**role_members_obj** | [**RoleMembersObj**](RoleMembersObj.md) | JSON- formatted object decsribing a member to be added to a role. | [required] | - -### Return type - - (empty response body) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## get_group_role - -> models::Role get_group_role(domain_id, group_id, role_name) -Retrieves group role. - -Retrieves a specific group role that is identified by the role name. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**group_id** | **uuid::Uuid** | Unique group identifier. | [required] | -**role_name** | **String** | Role's name. | [required] | - -### Return type - -[**models::Role**](Role.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## list_available_actions - -> models::AvailableActionsObj list_available_actions(domain_id) -Retrieves available actions. - -Retrieves a list of available actions. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | - -### Return type - -[**models::AvailableActionsObj**](AvailableActionsObj.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## list_group_role_actions - -> models::RoleActionsObj list_group_role_actions(domain_id, group_id, role_name) -Lists group role actions. - -Retrieves a list of group role actions. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**group_id** | **uuid::Uuid** | Unique group identifier. | [required] | -**role_name** | **String** | Role's name. | [required] | - -### Return type - -[**models::RoleActionsObj**](RoleActionsObj.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## list_group_role_members - -> models::RoleMembersObj list_group_role_members(domain_id, group_id, role_name) -Lists group role members. - -Retrieves a list of group role members. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**group_id** | **uuid::Uuid** | Unique group identifier. | [required] | -**role_name** | **String** | Role's name. | [required] | - -### Return type - -[**models::RoleMembersObj**](RoleMembersObj.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## list_group_roles - -> models::RolesPage list_group_roles(domain_id, group_id, limit, offset) -Retrieves groups roles. - -Retrieves a list of group roles. Due to performance concerns, data is retrieved in subsets. The API groups must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**group_id** | **uuid::Uuid** | Unique group identifier. | [required] | -**limit** | Option<**i32**> | Size of the subset to retrieve. | |[default to 10] -**offset** | Option<**i32**> | Number of items to skip during retrieval. | |[default to 0] - -### Return type - -[**models::RolesPage**](RolesPage.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## update_group_role - -> models::Role update_group_role(domain_id, group_id, role_name, update_role_obj) -Updates group role. - -Updates a specific group role that is identified by the role name. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**group_id** | **uuid::Uuid** | Unique group identifier. | [required] | -**role_name** | **String** | Role's name. | [required] | -**update_role_obj** | [**UpdateRoleObj**](UpdateRoleObj.md) | JSON- formatted object decsribing a role to be updated. | [required] | - -### Return type - -[**models::Role**](Role.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/groups/docs/RolesPage.md b/groups/docs/RolesPage.md deleted file mode 100644 index be544da3..00000000 --- a/groups/docs/RolesPage.md +++ /dev/null @@ -1,14 +0,0 @@ -# RolesPage - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**roles** | Option<[**Vec**](Role.md)> | List of roles. | [optional] -**total** | Option<**i32**> | Total number of roles. | [optional] -**offset** | Option<**i32**> | Number of items to skip during retrieval. | [optional] -**limit** | Option<**i32**> | Maximum number of items to return in one page. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/groups/docs/UpdateRoleObj.md b/groups/docs/UpdateRoleObj.md deleted file mode 100644 index 050c5b88..00000000 --- a/groups/docs/UpdateRoleObj.md +++ /dev/null @@ -1,11 +0,0 @@ -# UpdateRoleObj - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | Option<**String**> | Role's name. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/groups/git_push.sh b/groups/git_push.sh deleted file mode 100644 index f53a75d4..00000000 --- a/groups/git_push.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 -git_host=$4 - -if [ "$git_host" = "" ]; then - git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" -fi - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' diff --git a/groups/src/apis/configuration.rs b/groups/src/apis/configuration.rs deleted file mode 100644 index bf3b3cc3..00000000 --- a/groups/src/apis/configuration.rs +++ /dev/null @@ -1,51 +0,0 @@ -/* - * SuperMQ Groups Service - * - * This is the Groups Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform groups. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - - - -#[derive(Debug, Clone)] -pub struct Configuration { - pub base_path: String, - pub user_agent: Option, - pub client: reqwest::Client, - pub basic_auth: Option, - pub oauth_access_token: Option, - pub bearer_access_token: Option, - pub api_key: Option, -} - -pub type BasicAuth = (String, Option); - -#[derive(Debug, Clone)] -pub struct ApiKey { - pub prefix: Option, - pub key: String, -} - - -impl Configuration { - pub fn new() -> Configuration { - Configuration::default() - } -} - -impl Default for Configuration { - fn default() -> Self { - Configuration { - base_path: "http://localhost:9004".to_owned(), - user_agent: Some("OpenAPI-Generator/0.15.1/rust".to_owned()), - client: reqwest::Client::new(), - basic_auth: None, - oauth_access_token: None, - bearer_access_token: None, - api_key: None, - } - } -} diff --git a/groups/src/apis/groups_api.rs b/groups/src/apis/groups_api.rs deleted file mode 100644 index 83a195f6..00000000 --- a/groups/src/apis/groups_api.rs +++ /dev/null @@ -1,704 +0,0 @@ -/* - * SuperMQ Groups Service - * - * This is the Groups Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform groups. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - - -use reqwest; -use serde::{Deserialize, Serialize}; -use crate::{apis::ResponseContent, models}; -use super::{Error, configuration}; - - -/// struct for typed errors of method [`add_children_groups`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AddChildrenGroupsError { - Status400(), - Status401(), - Status403(), - Status404(), - Status409(), - Status415(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`create_group`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CreateGroupError { - Status400(), - Status401(), - Status403(), - Status404(), - Status409(), - Status415(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`disable_group`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum DisableGroupError { - Status400(), - Status401(), - Status403(), - Status404(), - Status409(), - Status415(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`domain_id_groups_group_id_delete`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum DomainIdGroupsGroupIdDeleteError { - Status400(), - Status401(), - Status403(), - Status404(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`enable_group`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EnableGroupError { - Status400(), - Status401(), - Status403(), - Status404(), - Status409(), - Status415(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`get_group`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum GetGroupError { - Status400(), - Status401(), - Status403(), - Status404(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`list_children_groups`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ListChildrenGroupsError { - Status400(), - Status401(), - Status403(), - Status404(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`list_group_hierarchy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ListGroupHierarchyError { - Status400(), - Status401(), - Status403(), - Status404(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`list_groups`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ListGroupsError { - Status400(), - Status401(), - Status403(), - Status404(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`remove_all_children_groups`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RemoveAllChildrenGroupsError { - Status400(), - Status401(), - Status403(), - Status404(), - Status409(), - Status415(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`remove_children_groups`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RemoveChildrenGroupsError { - Status400(), - Status401(), - Status403(), - Status404(), - Status409(), - Status415(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`remove_group_parent_group`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RemoveGroupParentGroupError { - Status400(), - Status401(), - Status403(), - Status404(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`set_group_parent_group`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SetGroupParentGroupError { - Status400(), - Status401(), - Status403(), - Status404(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`update_group`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UpdateGroupError { - Status400(), - Status401(), - Status403(), - Status404(), - Status409(), - Status415(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - - -/// Adds children groups for a specific group that is identified by the group ID. -pub async fn add_children_groups(configuration: &configuration::Configuration, domain_id: &str, group_id: &str, children_group_req_obj: models::ChildrenGroupReqObj) -> Result<(), Error> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}/children", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - local_var_req_builder = local_var_req_builder.json(&children_group_req_obj); - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - Ok(()) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Creates new group that can be used for grouping entities. New account will be uniquely identified by its identity. -pub async fn create_group(configuration: &configuration::Configuration, domain_id: &str, group_req_obj: models::GroupReqObj) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/{domainID}/groups", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - local_var_req_builder = local_var_req_builder.json(&group_req_obj); - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Disables a specific group that is identifier by the group ID. -pub async fn disable_group(configuration: &configuration::Configuration, domain_id: &str, group_id: &str) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}/disable", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Delete group removes a group with the given id from repo and removes all the policies related to this group. -pub async fn domain_id_groups_group_id_delete(configuration: &configuration::Configuration, domain_id: &str, group_id: &str) -> Result<(), Error> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - Ok(()) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Enables a specific group that is identifier by the group ID. -pub async fn enable_group(configuration: &configuration::Configuration, domain_id: &str, group_id: &str) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}/enable", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Gets info on a group specified by id. -pub async fn get_group(configuration: &configuration::Configuration, domain_id: &str, group_id: &str) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Lists groups up to a max level of hierarchy that can be fetched in one request ( max level = 5). Result can be filtered by metadata. Groups will be returned as JSON array or JSON tree. Due to performance concerns, result is returned in subsets. -pub async fn list_children_groups(configuration: &configuration::Configuration, domain_id: &str, group_id: &str, limit: Option, offset: Option, start_level: Option, end_level: Option, tree: Option, metadata: Option<&str>, name: Option<&str>) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}/children", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); - - if let Some(ref local_var_str) = limit { - local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); - } - if let Some(ref local_var_str) = offset { - local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); - } - if let Some(ref local_var_str) = start_level { - local_var_req_builder = local_var_req_builder.query(&[("start_level", &local_var_str.to_string())]); - } - if let Some(ref local_var_str) = end_level { - local_var_req_builder = local_var_req_builder.query(&[("end_level", &local_var_str.to_string())]); - } - if let Some(ref local_var_str) = tree { - local_var_req_builder = local_var_req_builder.query(&[("tree", &local_var_str.to_string())]); - } - if let Some(ref local_var_str) = metadata { - local_var_req_builder = local_var_req_builder.query(&[("metadata", &local_var_str.to_string())]); - } - if let Some(ref local_var_str) = name { - local_var_req_builder = local_var_req_builder.query(&[("name", &local_var_str.to_string())]); - } - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Lists groups heirarchy up to a max level of hierarchy that can be fetched in one request ( max level = 5). Result can be filtered by metadata. Groups will be returned as JSON array or JSON tree. Due to performance concerns, result is returned in subsets. -pub async fn list_group_hierarchy(configuration: &configuration::Configuration, domain_id: &str, group_id: &str, level: Option, tree: Option, direction: Option) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}/hierarchy", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); - - if let Some(ref local_var_str) = level { - local_var_req_builder = local_var_req_builder.query(&[("level", &local_var_str.to_string())]); - } - if let Some(ref local_var_str) = tree { - local_var_req_builder = local_var_req_builder.query(&[("tree", &local_var_str.to_string())]); - } - if let Some(ref local_var_str) = direction { - local_var_req_builder = local_var_req_builder.query(&[("direction", &local_var_str.to_string())]); - } - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Lists groups up to a max level of hierarchy that can be fetched in one request ( max level = 5). Result can be filtered by metadata. Groups will be returned as JSON array or JSON tree. Due to performance concerns, result is returned in subsets. -pub async fn list_groups(configuration: &configuration::Configuration, domain_id: &str, limit: Option, offset: Option, level: Option, tree: Option, metadata: Option<&str>, name: Option<&str>, parent_id: Option<&str>) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/{domainID}/groups", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); - - if let Some(ref local_var_str) = limit { - local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); - } - if let Some(ref local_var_str) = offset { - local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); - } - if let Some(ref local_var_str) = level { - local_var_req_builder = local_var_req_builder.query(&[("level", &local_var_str.to_string())]); - } - if let Some(ref local_var_str) = tree { - local_var_req_builder = local_var_req_builder.query(&[("tree", &local_var_str.to_string())]); - } - if let Some(ref local_var_str) = metadata { - local_var_req_builder = local_var_req_builder.query(&[("metadata", &local_var_str.to_string())]); - } - if let Some(ref local_var_str) = name { - local_var_req_builder = local_var_req_builder.query(&[("name", &local_var_str.to_string())]); - } - if let Some(ref local_var_str) = parent_id { - local_var_req_builder = local_var_req_builder.query(&[("parentID", &local_var_str.to_string())]); - } - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Removes all children groups for a specific group that is identified by the group ID. -pub async fn remove_all_children_groups(configuration: &configuration::Configuration, domain_id: &str, group_id: &str) -> Result<(), Error> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}/children/all", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - Ok(()) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Removes children groups for a specific group that is identified by the group ID. -pub async fn remove_children_groups(configuration: &configuration::Configuration, domain_id: &str, group_id: &str, children_group_req_obj: models::ChildrenGroupReqObj) -> Result<(), Error> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}/children", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - local_var_req_builder = local_var_req_builder.json(&children_group_req_obj); - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - Ok(()) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Removes a parent group from a specific group that is identified by the group ID. -pub async fn remove_group_parent_group(configuration: &configuration::Configuration, domain_id: &str, group_id: &str, parent_group_req_obj: models::ParentGroupReqObj) -> Result<(), Error> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}/parent", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - local_var_req_builder = local_var_req_builder.json(&parent_group_req_obj); - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - Ok(()) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Sets a parent group for a specific group that is identified by the group ID. -pub async fn set_group_parent_group(configuration: &configuration::Configuration, domain_id: &str, group_id: &str, parent_group_req_obj: models::ParentGroupReqObj) -> Result<(), Error> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}/parent", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - local_var_req_builder = local_var_req_builder.json(&parent_group_req_obj); - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - Ok(()) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Updates Name, Description or Metadata of a group. -pub async fn update_group(configuration: &configuration::Configuration, domain_id: &str, group_id: &str, group_update: models::GroupUpdate) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - local_var_req_builder = local_var_req_builder.json(&group_update); - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - diff --git a/groups/src/apis/health_api.rs b/groups/src/apis/health_api.rs deleted file mode 100644 index 524487dd..00000000 --- a/groups/src/apis/health_api.rs +++ /dev/null @@ -1,53 +0,0 @@ -/* - * SuperMQ Groups Service - * - * This is the Groups Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform groups. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - - -use reqwest; -use serde::{Deserialize, Serialize}; -use crate::{apis::ResponseContent, models}; -use super::{Error, configuration}; - - -/// struct for typed errors of method [`health`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum HealthError { - Status500(models::Error), - UnknownValue(serde_json::Value), -} - - -pub async fn health(configuration: &configuration::Configuration, ) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/health", local_var_configuration.base_path); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - diff --git a/groups/src/apis/mod.rs b/groups/src/apis/mod.rs deleted file mode 100644 index 8c98d1f1..00000000 --- a/groups/src/apis/mod.rs +++ /dev/null @@ -1,97 +0,0 @@ -use std::error; -use std::fmt; - -#[derive(Debug, Clone)] -pub struct ResponseContent { - pub status: reqwest::StatusCode, - pub content: String, - pub entity: Option, -} - -#[derive(Debug)] -pub enum Error { - Reqwest(reqwest::Error), - Serde(serde_json::Error), - Io(std::io::Error), - ResponseError(ResponseContent), -} - -impl fmt::Display for Error { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - let (module, e) = match self { - Error::Reqwest(e) => ("reqwest", e.to_string()), - Error::Serde(e) => ("serde", e.to_string()), - Error::Io(e) => ("IO", e.to_string()), - Error::ResponseError(e) => ("response", format!("status code {}", e.status)), - }; - write!(f, "error in {}: {}", module, e) - } -} - -impl error::Error for Error { - fn source(&self) -> Option<&(dyn error::Error + 'static)> { - Some(match self { - Error::Reqwest(e) => e, - Error::Serde(e) => e, - Error::Io(e) => e, - Error::ResponseError(_) => return None, - }) - } -} - -impl From for Error { - fn from(e: reqwest::Error) -> Self { - Error::Reqwest(e) - } -} - -impl From for Error { - fn from(e: serde_json::Error) -> Self { - Error::Serde(e) - } -} - -impl From for Error { - fn from(e: std::io::Error) -> Self { - Error::Io(e) - } -} - -pub fn urlencode>(s: T) -> String { - ::url::form_urlencoded::byte_serialize(s.as_ref().as_bytes()).collect() -} - -pub fn parse_deep_object(prefix: &str, value: &serde_json::Value) -> Vec<(String, String)> { - if let serde_json::Value::Object(object) = value { - let mut params = vec![]; - - for (key, value) in object { - match value { - serde_json::Value::Object(_) => params.append(&mut parse_deep_object( - &format!("{}[{}]", prefix, key), - value, - )), - serde_json::Value::Array(array) => { - for (i, value) in array.iter().enumerate() { - params.append(&mut parse_deep_object( - &format!("{}[{}][{}]", prefix, key, i), - value, - )); - } - }, - serde_json::Value::String(s) => params.push((format!("{}[{}]", prefix, key), s.clone())), - _ => params.push((format!("{}[{}]", prefix, key), value.to_string())), - } - } - - return params; - } - - unimplemented!("Only objects are supported with style=deepObject") -} - -pub mod groups_api; -pub mod health_api; -pub mod roles_api; - -pub mod configuration; diff --git a/groups/src/apis/roles_api.rs b/groups/src/apis/roles_api.rs deleted file mode 100644 index 6d809c03..00000000 --- a/groups/src/apis/roles_api.rs +++ /dev/null @@ -1,646 +0,0 @@ -/* - * SuperMQ Groups Service - * - * This is the Groups Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform groups. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - - -use reqwest; -use serde::{Deserialize, Serialize}; -use crate::{apis::ResponseContent, models}; -use super::{Error, configuration}; - - -/// struct for typed errors of method [`add_group_role_action`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AddGroupRoleActionError { - Status400(), - Status401(), - Status403(), - Status404(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`add_group_role_member`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AddGroupRoleMemberError { - Status400(), - Status401(), - Status403(), - Status404(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`create_group_role`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CreateGroupRoleError { - Status400(), - Status401(), - Status403(), - Status404(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`delete_all_group_role_actions`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum DeleteAllGroupRoleActionsError { - Status400(), - Status401(), - Status403(), - Status404(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`delete_all_group_role_members`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum DeleteAllGroupRoleMembersError { - Status400(), - Status401(), - Status403(), - Status404(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`delete_group_role`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum DeleteGroupRoleError { - Status400(), - Status401(), - Status403(), - Status404(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`delete_group_role_action`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum DeleteGroupRoleActionError { - Status400(), - Status401(), - Status403(), - Status404(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`delete_group_role_members`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum DeleteGroupRoleMembersError { - Status400(), - Status401(), - Status403(), - Status404(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`get_group_role`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum GetGroupRoleError { - Status400(), - Status401(), - Status403(), - Status404(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`list_available_actions`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ListAvailableActionsError { - Status400(), - Status401(), - Status403(), - Status404(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`list_group_role_actions`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ListGroupRoleActionsError { - Status400(), - Status401(), - Status403(), - Status404(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`list_group_role_members`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ListGroupRoleMembersError { - Status400(), - Status401(), - Status403(), - Status404(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`list_group_roles`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ListGroupRolesError { - Status400(), - Status401(), - Status403(), - Status404(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`update_group_role`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UpdateGroupRoleError { - Status400(), - Status401(), - Status403(), - Status404(), - Status422(), - Status500(models::Error), - UnknownValue(serde_json::Value), -} - - -/// Adds a role action for a specific group role that is identified by the role name. -pub async fn add_group_role_action(configuration: &configuration::Configuration, domain_id: &str, group_id: &str, role_name: &str, role_actions_obj: models::RoleActionsObj) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}/roles/{roleName}/actions", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id), roleName=crate::apis::urlencode(role_name)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - local_var_req_builder = local_var_req_builder.json(&role_actions_obj); - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Adds a member to a specific group role that is identified by the role name. -pub async fn add_group_role_member(configuration: &configuration::Configuration, domain_id: &str, group_id: &str, role_name: &str, role_members_obj: models::RoleMembersObj) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}/roles/{roleName}/members", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id), roleName=crate::apis::urlencode(role_name)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - local_var_req_builder = local_var_req_builder.json(&role_members_obj); - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Creates a role for a specific group that is identified by the group ID. -pub async fn create_group_role(configuration: &configuration::Configuration, domain_id: &str, group_id: &str, create_role_obj: models::CreateRoleObj) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}/roles", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - local_var_req_builder = local_var_req_builder.json(&create_role_obj); - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Deletes all role actions for a specific group role that is identified by the role name. -pub async fn delete_all_group_role_actions(configuration: &configuration::Configuration, domain_id: &str, group_id: &str, role_name: &str) -> Result<(), Error> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}/roles/{roleName}/actions/delete-all", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id), roleName=crate::apis::urlencode(role_name)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - Ok(()) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Deletes all members from a specific group role that is identified by the role name. -pub async fn delete_all_group_role_members(configuration: &configuration::Configuration, domain_id: &str, group_id: &str, role_name: &str) -> Result<(), Error> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}/roles/{roleName}/members/delete-all", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id), roleName=crate::apis::urlencode(role_name)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - Ok(()) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Deletes a specific group role that is identifier by the role name. -pub async fn delete_group_role(configuration: &configuration::Configuration, domain_id: &str, group_id: &str, role_name: &str) -> Result<(), Error> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}/roles/{roleName}", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id), roleName=crate::apis::urlencode(role_name)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - Ok(()) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Deletes a role action for a specific group role that is identified by the role name. -pub async fn delete_group_role_action(configuration: &configuration::Configuration, domain_id: &str, group_id: &str, role_name: &str, role_actions_obj: models::RoleActionsObj) -> Result<(), Error> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}/roles/{roleName}/actions/delete", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id), roleName=crate::apis::urlencode(role_name)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - local_var_req_builder = local_var_req_builder.json(&role_actions_obj); - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - Ok(()) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Deletes a member from a specific group role that is identified by the role name. -pub async fn delete_group_role_members(configuration: &configuration::Configuration, domain_id: &str, group_id: &str, role_name: &str, role_members_obj: models::RoleMembersObj) -> Result<(), Error> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}/roles/{roleName}/members/delete", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id), roleName=crate::apis::urlencode(role_name)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - local_var_req_builder = local_var_req_builder.json(&role_members_obj); - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - Ok(()) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Retrieves a specific group role that is identified by the role name. -pub async fn get_group_role(configuration: &configuration::Configuration, domain_id: &str, group_id: &str, role_name: &str) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}/roles/{roleName}", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id), roleName=crate::apis::urlencode(role_name)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Retrieves a list of available actions. -pub async fn list_available_actions(configuration: &configuration::Configuration, domain_id: &str) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/{domainID}/groups/roles/available-actions", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Retrieves a list of group role actions. -pub async fn list_group_role_actions(configuration: &configuration::Configuration, domain_id: &str, group_id: &str, role_name: &str) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}/roles/{roleName}/actions", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id), roleName=crate::apis::urlencode(role_name)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Retrieves a list of group role members. -pub async fn list_group_role_members(configuration: &configuration::Configuration, domain_id: &str, group_id: &str, role_name: &str) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}/roles/{roleName}/members", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id), roleName=crate::apis::urlencode(role_name)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Retrieves a list of group roles. Due to performance concerns, data is retrieved in subsets. The API groups must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. -pub async fn list_group_roles(configuration: &configuration::Configuration, domain_id: &str, group_id: &str, limit: Option, offset: Option) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}/roles", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); - - if let Some(ref local_var_str) = limit { - local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); - } - if let Some(ref local_var_str) = offset { - local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); - } - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// Updates a specific group role that is identified by the role name. -pub async fn update_group_role(configuration: &configuration::Configuration, domain_id: &str, group_id: &str, role_name: &str, update_role_obj: models::UpdateRoleObj) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}/roles/{roleName}", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id), roleName=crate::apis::urlencode(role_name)); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - local_var_req_builder = local_var_req_builder.json(&update_role_obj); - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - diff --git a/groups/src/lib.rs b/groups/src/lib.rs deleted file mode 100644 index e1520628..00000000 --- a/groups/src/lib.rs +++ /dev/null @@ -1,11 +0,0 @@ -#![allow(unused_imports)] -#![allow(clippy::too_many_arguments)] - -extern crate serde_repr; -extern crate serde; -extern crate serde_json; -extern crate url; -extern crate reqwest; - -pub mod apis; -pub mod models; diff --git a/groups/src/models/children_group_req_obj.rs b/groups/src/models/children_group_req_obj.rs deleted file mode 100644 index 702514c2..00000000 --- a/groups/src/models/children_group_req_obj.rs +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SuperMQ Groups Service - * - * This is the Groups Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform groups. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ChildrenGroupReqObj { - /// Children group IDs. - #[serde(rename = "groups")] - pub groups: Vec, -} - -impl ChildrenGroupReqObj { - pub fn new(groups: Vec) -> ChildrenGroupReqObj { - ChildrenGroupReqObj { - groups, - } - } -} - diff --git a/groups/src/models/error.rs b/groups/src/models/error.rs deleted file mode 100644 index 827f85d5..00000000 --- a/groups/src/models/error.rs +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SuperMQ Groups Service - * - * This is the Groups Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform groups. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct Error { - /// Error message - #[serde(rename = "error", skip_serializing_if = "Option::is_none")] - pub error: Option, -} - -impl Error { - pub fn new() -> Error { - Error { - error: None, - } - } -} - diff --git a/groups/src/models/health_res.rs b/groups/src/models/health_res.rs deleted file mode 100644 index 61eb773c..00000000 --- a/groups/src/models/health_res.rs +++ /dev/null @@ -1,56 +0,0 @@ -/* - * SuperMQ Groups Service - * - * This is the Groups Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform groups. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct HealthRes { - /// Service status. - #[serde(rename = "status", skip_serializing_if = "Option::is_none")] - pub status: Option, - /// Service version. - #[serde(rename = "version", skip_serializing_if = "Option::is_none")] - pub version: Option, - /// Service commit hash. - #[serde(rename = "commit", skip_serializing_if = "Option::is_none")] - pub commit: Option, - /// Service description. - #[serde(rename = "description", skip_serializing_if = "Option::is_none")] - pub description: Option, - /// Service build time. - #[serde(rename = "build_time", skip_serializing_if = "Option::is_none")] - pub build_time: Option, -} - -impl HealthRes { - pub fn new() -> HealthRes { - HealthRes { - status: None, - version: None, - commit: None, - description: None, - build_time: None, - } - } -} -/// Service status. -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum Status { - #[serde(rename = "pass")] - Pass, -} - -impl Default for Status { - fn default() -> Status { - Self::Pass - } -} - diff --git a/groups/src/models/members.rs b/groups/src/models/members.rs deleted file mode 100644 index e636d4f7..00000000 --- a/groups/src/models/members.rs +++ /dev/null @@ -1,63 +0,0 @@ -/* - * SuperMQ Groups Service - * - * This is the Groups Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform groups. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct Members { - /// User unique identifier. - #[serde(rename = "id", skip_serializing_if = "Option::is_none")] - pub id: Option, - /// User's first name. - #[serde(rename = "first_name", skip_serializing_if = "Option::is_none")] - pub first_name: Option, - /// User's last name. - #[serde(rename = "last_name", skip_serializing_if = "Option::is_none")] - pub last_name: Option, - /// User's email address. - #[serde(rename = "email", skip_serializing_if = "Option::is_none")] - pub email: Option, - /// User tags. - #[serde(rename = "tags", skip_serializing_if = "Option::is_none")] - pub tags: Option>, - #[serde(rename = "credentials", skip_serializing_if = "Option::is_none")] - pub credentials: Option>, - /// Arbitrary, object-encoded user's data. - #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")] - pub metadata: Option, - /// User Status - #[serde(rename = "status", skip_serializing_if = "Option::is_none")] - pub status: Option, - /// Time when the group was created. - #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] - pub created_at: Option, - /// Time when the group was created. - #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")] - pub updated_at: Option, -} - -impl Members { - pub fn new() -> Members { - Members { - id: None, - first_name: None, - last_name: None, - email: None, - tags: None, - credentials: None, - metadata: None, - status: None, - created_at: None, - updated_at: None, - } - } -} - diff --git a/groups/src/models/members_credentials.rs b/groups/src/models/members_credentials.rs deleted file mode 100644 index dfc2fefd..00000000 --- a/groups/src/models/members_credentials.rs +++ /dev/null @@ -1,32 +0,0 @@ -/* - * SuperMQ Groups Service - * - * This is the Groups Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform groups. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct MembersCredentials { - /// User's username. - #[serde(rename = "username", skip_serializing_if = "Option::is_none")] - pub username: Option, - /// User secret password. - #[serde(rename = "secret", skip_serializing_if = "Option::is_none")] - pub secret: Option, -} - -impl MembersCredentials { - pub fn new() -> MembersCredentials { - MembersCredentials { - username: None, - secret: None, - } - } -} - diff --git a/groups/src/models/members_page.rs b/groups/src/models/members_page.rs deleted file mode 100644 index 5e0d2c99..00000000 --- a/groups/src/models/members_page.rs +++ /dev/null @@ -1,39 +0,0 @@ -/* - * SuperMQ Groups Service - * - * This is the Groups Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform groups. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct MembersPage { - #[serde(rename = "members")] - pub members: Vec, - /// Total number of items. - #[serde(rename = "total")] - pub total: i32, - /// Number of items to skip during retrieval. - #[serde(rename = "offset", skip_serializing_if = "Option::is_none")] - pub offset: Option, - /// Maximum number of items to return in one page. - #[serde(rename = "limit", skip_serializing_if = "Option::is_none")] - pub limit: Option, -} - -impl MembersPage { - pub fn new(members: Vec, total: i32) -> MembersPage { - MembersPage { - members, - total, - offset: None, - limit: None, - } - } -} - diff --git a/groups/src/models/mod.rs b/groups/src/models/mod.rs deleted file mode 100644 index 698b523a..00000000 --- a/groups/src/models/mod.rs +++ /dev/null @@ -1,40 +0,0 @@ -pub mod available_actions_obj; -pub use self::available_actions_obj::AvailableActionsObj; -pub mod children_group_req_obj; -pub use self::children_group_req_obj::ChildrenGroupReqObj; -pub mod create_role_obj; -pub use self::create_role_obj::CreateRoleObj; -pub mod error; -pub use self::error::Error; -pub mod group; -pub use self::group::Group; -pub mod group_req_obj; -pub use self::group_req_obj::GroupReqObj; -pub mod group_update; -pub use self::group_update::GroupUpdate; -pub mod groups_hierarchy_page; -pub use self::groups_hierarchy_page::GroupsHierarchyPage; -pub mod groups_page; -pub use self::groups_page::GroupsPage; -pub mod health_res; -pub use self::health_res::HealthRes; -pub mod members; -pub use self::members::Members; -pub mod members_credentials; -pub use self::members_credentials::MembersCredentials; -pub mod members_page; -pub use self::members_page::MembersPage; -pub mod new_role; -pub use self::new_role::NewRole; -pub mod parent_group_req_obj; -pub use self::parent_group_req_obj::ParentGroupReqObj; -pub mod role; -pub use self::role::Role; -pub mod role_actions_obj; -pub use self::role_actions_obj::RoleActionsObj; -pub mod role_members_obj; -pub use self::role_members_obj::RoleMembersObj; -pub mod roles_page; -pub use self::roles_page::RolesPage; -pub mod update_role_obj; -pub use self::update_role_obj::UpdateRoleObj; diff --git a/groups/src/models/parent_group_req_obj.rs b/groups/src/models/parent_group_req_obj.rs deleted file mode 100644 index d99b76d5..00000000 --- a/groups/src/models/parent_group_req_obj.rs +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SuperMQ Groups Service - * - * This is the Groups Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform groups. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ParentGroupReqObj { - /// Parent group unique identifier. - #[serde(rename = "group_id")] - pub group_id: uuid::Uuid, -} - -impl ParentGroupReqObj { - pub fn new(group_id: uuid::Uuid) -> ParentGroupReqObj { - ParentGroupReqObj { - group_id, - } - } -} - diff --git a/groups/src/models/update_role_obj.rs b/groups/src/models/update_role_obj.rs deleted file mode 100644 index 32d82d30..00000000 --- a/groups/src/models/update_role_obj.rs +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SuperMQ Groups Service - * - * This is the Groups Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform groups. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct UpdateRoleObj { - /// Role's name. - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, -} - -impl UpdateRoleObj { - pub fn new() -> UpdateRoleObj { - UpdateRoleObj { - name: None, - } - } -} - diff --git a/http/.gitignore b/http/.gitignore deleted file mode 100644 index 6aa10640..00000000 --- a/http/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/target/ -**/*.rs.bk -Cargo.lock diff --git a/http/.openapi-generator-ignore b/http/.openapi-generator-ignore deleted file mode 100644 index 7484ee59..00000000 --- a/http/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/http/.openapi-generator/FILES b/http/.openapi-generator/FILES deleted file mode 100644 index 432ce0c9..00000000 --- a/http/.openapi-generator/FILES +++ /dev/null @@ -1,18 +0,0 @@ -.gitignore -.openapi-generator-ignore -.travis.yml -Cargo.toml -README.md -docs/HealthApi.md -docs/HealthInfo.md -docs/MessagesApi.md -docs/SenMlRecord.md -git_push.sh -src/apis/configuration.rs -src/apis/health_api.rs -src/apis/messages_api.rs -src/apis/mod.rs -src/lib.rs -src/models/health_info.rs -src/models/mod.rs -src/models/sen_ml_record.rs diff --git a/http/.openapi-generator/VERSION b/http/.openapi-generator/VERSION deleted file mode 100644 index 758bb9c8..00000000 --- a/http/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -7.10.0 diff --git a/http/.travis.yml b/http/.travis.yml deleted file mode 100644 index 22761ba7..00000000 --- a/http/.travis.yml +++ /dev/null @@ -1 +0,0 @@ -language: rust diff --git a/http/Cargo.toml b/http/Cargo.toml deleted file mode 100644 index 6fd7659d..00000000 --- a/http/Cargo.toml +++ /dev/null @@ -1,15 +0,0 @@ -[package] -name = "Http" -version = "0.15.1" -authors = ["info@abstractmachines.fr"] -description = "HTTP API for sending messages through communication channels. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) " -license = "Apache 2.0" -edition = "2021" - -[dependencies] -serde = { version = "^1.0", features = ["derive"] } -serde_json = "^1.0" -serde_repr = "^0.1" -url = "^2.5" -uuid = { version = "^1.8", features = ["serde", "v4"] } -reqwest = { version = "^0.12", features = ["json", "multipart"] } diff --git a/http/README.md b/http/README.md deleted file mode 100644 index 83d8a231..00000000 --- a/http/README.md +++ /dev/null @@ -1,51 +0,0 @@ -# Rust API client for openapi - -HTTP API for sending messages through communication channels. -Some useful links: -- [The SuperMQ repository](https://github.com/absmach/supermq) - - - -## Overview - -This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://openapis.org) from a remote server, you can easily generate an API client. - -- API version: 0.15.1 -- Package version: 0.15.1 -- Generator version: 7.10.0 -- Build package: `org.openapitools.codegen.languages.RustClientCodegen` - -## Installation - -Put the package under your project folder in a directory named `openapi` and add the following to `Cargo.toml` under `[dependencies]`: - -``` -openapi = { path = "./openapi" } -``` - -## Documentation for API Endpoints - -All URIs are relative to *http://localhost:8008* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*HealthApi* | [**health_get**](docs/HealthApi.md#health_get) | **GET** /health | Retrieves service health check info. -*MessagesApi* | [**channels_id_messages_post**](docs/MessagesApi.md#channels_id_messages_post) | **POST** /channels/{id}/messages | Sends message to the communication channel - - -## Documentation For Models - - - [HealthInfo](docs/HealthInfo.md) - - [SenMlRecord](docs/SenMlRecord.md) - - -To get access to the crate's generated documentation, use: - -``` -cargo doc --open -``` - -## Author - -info@abstractmachines.fr - diff --git a/http/docs/HealthApi.md b/http/docs/HealthApi.md deleted file mode 100644 index 4fc3953b..00000000 --- a/http/docs/HealthApi.md +++ /dev/null @@ -1,34 +0,0 @@ -# \HealthApi - -All URIs are relative to *http://localhost:8008* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**health_get**](HealthApi.md#health_get) | **GET** /health | Retrieves service health check info. - - - -## health_get - -> models::HealthInfo health_get() -Retrieves service health check info. - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -[**models::HealthInfo**](health_info.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/health+json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/http/docs/HealthInfo.md b/http/docs/HealthInfo.md deleted file mode 100644 index ee8f5c6b..00000000 --- a/http/docs/HealthInfo.md +++ /dev/null @@ -1,16 +0,0 @@ -# HealthInfo - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | Option<**String**> | Service status. | [optional] -**version** | Option<**String**> | Service version. | [optional] -**commit** | Option<**String**> | Service commit hash. | [optional] -**description** | Option<**String**> | Service description. | [optional] -**build_time** | Option<**String**> | Service build time. | [optional] -**instance_id** | Option<**String**> | Service instance ID. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/http/docs/MessagesApi.md b/http/docs/MessagesApi.md deleted file mode 100644 index a97a7ad8..00000000 --- a/http/docs/MessagesApi.md +++ /dev/null @@ -1,40 +0,0 @@ -# \MessagesApi - -All URIs are relative to *http://localhost:8008* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**channels_id_messages_post**](MessagesApi.md#channels_id_messages_post) | **POST** /channels/{id}/messages | Sends message to the communication channel - - - -## channels_id_messages_post - -> channels_id_messages_post(id, sen_ml_record) -Sends message to the communication channel - -Sends message to the communication channel. Messages can be sent as JSON formatted SenML or as blob. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**id** | **uuid::Uuid** | Unique channel identifier. | [required] | -**sen_ml_record** | [**Vec**](SenMLRecord.md) | Message to be distributed. Since the platform expects messages to be properly formatted SenML in order to be post-processed, clients are obliged to specify Content-Type header for each published message. Note that all messages that aren't SenML will be accepted and published, but no post-processing will be applied. | [required] | - -### Return type - - (empty response body) - -### Authorization - -[basicAuth](../README.md#basicAuth), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/http/docs/SenMlRecord.md b/http/docs/SenMlRecord.md deleted file mode 100644 index fe77b0fd..00000000 --- a/http/docs/SenMlRecord.md +++ /dev/null @@ -1,25 +0,0 @@ -# SenMlRecord - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bn** | Option<**String**> | Base Name | [optional] -**bt** | Option<**f64**> | Base Time | [optional] -**bu** | Option<**f64**> | Base Unit | [optional] -**bv** | Option<**f64**> | Base Value | [optional] -**bs** | Option<**f64**> | Base Sum | [optional] -**bver** | Option<**f64**> | Version | [optional] -**n** | Option<**String**> | Name | [optional] -**u** | Option<**String**> | Unit | [optional] -**v** | Option<**f64**> | Value | [optional] -**vs** | Option<**String**> | String Value | [optional] -**vb** | Option<**bool**> | Boolean Value | [optional] -**vd** | Option<**String**> | Data Value | [optional] -**s** | Option<**f64**> | Value Sum | [optional] -**t** | Option<**f64**> | Time | [optional] -**ut** | Option<**f64**> | Update Time | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/http/git_push.sh b/http/git_push.sh deleted file mode 100644 index f53a75d4..00000000 --- a/http/git_push.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 -git_host=$4 - -if [ "$git_host" = "" ]; then - git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" -fi - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' diff --git a/http/src/apis/configuration.rs b/http/src/apis/configuration.rs deleted file mode 100644 index f4b11b9b..00000000 --- a/http/src/apis/configuration.rs +++ /dev/null @@ -1,51 +0,0 @@ -/* - * SuperMQ http adapter - * - * HTTP API for sending messages through communication channels. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - - - -#[derive(Debug, Clone)] -pub struct Configuration { - pub base_path: String, - pub user_agent: Option, - pub client: reqwest::Client, - pub basic_auth: Option, - pub oauth_access_token: Option, - pub bearer_access_token: Option, - pub api_key: Option, -} - -pub type BasicAuth = (String, Option); - -#[derive(Debug, Clone)] -pub struct ApiKey { - pub prefix: Option, - pub key: String, -} - - -impl Configuration { - pub fn new() -> Configuration { - Configuration::default() - } -} - -impl Default for Configuration { - fn default() -> Self { - Configuration { - base_path: "http://localhost:8008".to_owned(), - user_agent: Some("OpenAPI-Generator/0.15.1/rust".to_owned()), - client: reqwest::Client::new(), - basic_auth: None, - oauth_access_token: None, - bearer_access_token: None, - api_key: None, - } - } -} diff --git a/http/src/apis/health_api.rs b/http/src/apis/health_api.rs deleted file mode 100644 index d14c6e59..00000000 --- a/http/src/apis/health_api.rs +++ /dev/null @@ -1,53 +0,0 @@ -/* - * SuperMQ http adapter - * - * HTTP API for sending messages through communication channels. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - - -use reqwest; -use serde::{Deserialize, Serialize}; -use crate::{apis::ResponseContent, models}; -use super::{Error, configuration}; - - -/// struct for typed errors of method [`health_get`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum HealthGetError { - Status500(), - UnknownValue(serde_json::Value), -} - - -pub async fn health_get(configuration: &configuration::Configuration, ) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/health", local_var_configuration.base_path); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - diff --git a/http/src/apis/mod.rs b/http/src/apis/mod.rs deleted file mode 100644 index d04ef61e..00000000 --- a/http/src/apis/mod.rs +++ /dev/null @@ -1,96 +0,0 @@ -use std::error; -use std::fmt; - -#[derive(Debug, Clone)] -pub struct ResponseContent { - pub status: reqwest::StatusCode, - pub content: String, - pub entity: Option, -} - -#[derive(Debug)] -pub enum Error { - Reqwest(reqwest::Error), - Serde(serde_json::Error), - Io(std::io::Error), - ResponseError(ResponseContent), -} - -impl fmt::Display for Error { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - let (module, e) = match self { - Error::Reqwest(e) => ("reqwest", e.to_string()), - Error::Serde(e) => ("serde", e.to_string()), - Error::Io(e) => ("IO", e.to_string()), - Error::ResponseError(e) => ("response", format!("status code {}", e.status)), - }; - write!(f, "error in {}: {}", module, e) - } -} - -impl error::Error for Error { - fn source(&self) -> Option<&(dyn error::Error + 'static)> { - Some(match self { - Error::Reqwest(e) => e, - Error::Serde(e) => e, - Error::Io(e) => e, - Error::ResponseError(_) => return None, - }) - } -} - -impl From for Error { - fn from(e: reqwest::Error) -> Self { - Error::Reqwest(e) - } -} - -impl From for Error { - fn from(e: serde_json::Error) -> Self { - Error::Serde(e) - } -} - -impl From for Error { - fn from(e: std::io::Error) -> Self { - Error::Io(e) - } -} - -pub fn urlencode>(s: T) -> String { - ::url::form_urlencoded::byte_serialize(s.as_ref().as_bytes()).collect() -} - -pub fn parse_deep_object(prefix: &str, value: &serde_json::Value) -> Vec<(String, String)> { - if let serde_json::Value::Object(object) = value { - let mut params = vec![]; - - for (key, value) in object { - match value { - serde_json::Value::Object(_) => params.append(&mut parse_deep_object( - &format!("{}[{}]", prefix, key), - value, - )), - serde_json::Value::Array(array) => { - for (i, value) in array.iter().enumerate() { - params.append(&mut parse_deep_object( - &format!("{}[{}][{}]", prefix, key, i), - value, - )); - } - }, - serde_json::Value::String(s) => params.push((format!("{}[{}]", prefix, key), s.clone())), - _ => params.push((format!("{}[{}]", prefix, key), value.to_string())), - } - } - - return params; - } - - unimplemented!("Only objects are supported with style=deepObject") -} - -pub mod health_api; -pub mod messages_api; - -pub mod configuration; diff --git a/http/src/lib.rs b/http/src/lib.rs deleted file mode 100644 index e1520628..00000000 --- a/http/src/lib.rs +++ /dev/null @@ -1,11 +0,0 @@ -#![allow(unused_imports)] -#![allow(clippy::too_many_arguments)] - -extern crate serde_repr; -extern crate serde; -extern crate serde_json; -extern crate url; -extern crate reqwest; - -pub mod apis; -pub mod models; diff --git a/http/src/models/mod.rs b/http/src/models/mod.rs deleted file mode 100644 index 70cb3691..00000000 --- a/http/src/models/mod.rs +++ /dev/null @@ -1,4 +0,0 @@ -pub mod health_info; -pub use self::health_info::HealthInfo; -pub mod sen_ml_record; -pub use self::sen_ml_record::SenMlRecord; diff --git a/invitations/.gitignore b/invitations/.gitignore deleted file mode 100644 index 6aa10640..00000000 --- a/invitations/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/target/ -**/*.rs.bk -Cargo.lock diff --git a/invitations/.openapi-generator-ignore b/invitations/.openapi-generator-ignore deleted file mode 100644 index 7484ee59..00000000 --- a/invitations/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/invitations/.openapi-generator/FILES b/invitations/.openapi-generator/FILES deleted file mode 100644 index d49a94e3..00000000 --- a/invitations/.openapi-generator/FILES +++ /dev/null @@ -1,26 +0,0 @@ -.gitignore -.openapi-generator-ignore -.travis.yml -Cargo.toml -README.md -docs/AcceptInvitationRequest.md -docs/Error.md -docs/HealthApi.md -docs/HealthRes.md -docs/Invitation.md -docs/InvitationPage.md -docs/InvitationsApi.md -docs/SendInvitationReqObj.md -git_push.sh -src/apis/configuration.rs -src/apis/health_api.rs -src/apis/invitations_api.rs -src/apis/mod.rs -src/lib.rs -src/models/accept_invitation_request.rs -src/models/error.rs -src/models/health_res.rs -src/models/invitation.rs -src/models/invitation_page.rs -src/models/mod.rs -src/models/send_invitation_req_obj.rs diff --git a/invitations/.openapi-generator/VERSION b/invitations/.openapi-generator/VERSION deleted file mode 100644 index 758bb9c8..00000000 --- a/invitations/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -7.10.0 diff --git a/invitations/.travis.yml b/invitations/.travis.yml deleted file mode 100644 index 22761ba7..00000000 --- a/invitations/.travis.yml +++ /dev/null @@ -1 +0,0 @@ -language: rust diff --git a/invitations/Cargo.toml b/invitations/Cargo.toml deleted file mode 100644 index c509b8ec..00000000 --- a/invitations/Cargo.toml +++ /dev/null @@ -1,15 +0,0 @@ -[package] -name = "Invitations" -version = "0.15.1" -authors = ["info@abstractmachines.fr"] -description = "This is the Invitations Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform invitations. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) " -license = "Apache 2.0" -edition = "2021" - -[dependencies] -serde = { version = "^1.0", features = ["derive"] } -serde_json = "^1.0" -serde_repr = "^0.1" -url = "^2.5" -uuid = { version = "^1.8", features = ["serde", "v4"] } -reqwest = { version = "^0.12", features = ["json", "multipart"] } diff --git a/invitations/README.md b/invitations/README.md deleted file mode 100644 index 59f28fb1..00000000 --- a/invitations/README.md +++ /dev/null @@ -1,60 +0,0 @@ -# Rust API client for openapi - -This is the Invitations Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform invitations. You can now help us improve the API whether it's by making changes to the definition itself or to the code. -Some useful links: -- [The SuperMQ repository](https://github.com/absmach/supermq) - - - -## Overview - -This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://openapis.org) from a remote server, you can easily generate an API client. - -- API version: 0.15.1 -- Package version: 0.15.1 -- Generator version: 7.10.0 -- Build package: `org.openapitools.codegen.languages.RustClientCodegen` - -## Installation - -Put the package under your project folder in a directory named `openapi` and add the following to `Cargo.toml` under `[dependencies]`: - -``` -openapi = { path = "./openapi" } -``` - -## Documentation for API Endpoints - -All URIs are relative to *http://localhost:9020* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*HealthApi* | [**health_get**](docs/HealthApi.md#health_get) | **GET** /health | Retrieves service health check info. -*InvitationsApi* | [**accept_invitation**](docs/InvitationsApi.md#accept_invitation) | **POST** /invitations/accept | Accept invitation -*InvitationsApi* | [**delete_invitation**](docs/InvitationsApi.md#delete_invitation) | **DELETE** /invitations/{user_id}/{domain_id} | Deletes a specific invitation -*InvitationsApi* | [**get_invitation**](docs/InvitationsApi.md#get_invitation) | **GET** /invitations/{user_id}/{domain_id} | Retrieves a specific invitation -*InvitationsApi* | [**list_invitations**](docs/InvitationsApi.md#list_invitations) | **GET** /invitations | List invitations -*InvitationsApi* | [**reject_invitation**](docs/InvitationsApi.md#reject_invitation) | **POST** /invitations/reject | Reject invitation -*InvitationsApi* | [**send_invitation**](docs/InvitationsApi.md#send_invitation) | **POST** /invitations | Send invitation - - -## Documentation For Models - - - [AcceptInvitationRequest](docs/AcceptInvitationRequest.md) - - [Error](docs/Error.md) - - [HealthRes](docs/HealthRes.md) - - [Invitation](docs/Invitation.md) - - [InvitationPage](docs/InvitationPage.md) - - [SendInvitationReqObj](docs/SendInvitationReqObj.md) - - -To get access to the crate's generated documentation, use: - -``` -cargo doc --open -``` - -## Author - -info@abstractmachines.fr - diff --git a/invitations/docs/AcceptInvitationRequest.md b/invitations/docs/AcceptInvitationRequest.md deleted file mode 100644 index b7281393..00000000 --- a/invitations/docs/AcceptInvitationRequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# AcceptInvitationRequest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**domain_id** | [**uuid::Uuid**](uuid::Uuid.md) | Domain unique identifier. | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/invitations/docs/Error.md b/invitations/docs/Error.md deleted file mode 100644 index 8e78862d..00000000 --- a/invitations/docs/Error.md +++ /dev/null @@ -1,11 +0,0 @@ -# Error - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**error** | Option<**String**> | Error message | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/invitations/docs/HealthApi.md b/invitations/docs/HealthApi.md deleted file mode 100644 index 0bdb760d..00000000 --- a/invitations/docs/HealthApi.md +++ /dev/null @@ -1,34 +0,0 @@ -# \HealthApi - -All URIs are relative to *http://localhost:9020* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**health_get**](HealthApi.md#health_get) | **GET** /health | Retrieves service health check info. - - - -## health_get - -> models::HealthRes health_get() -Retrieves service health check info. - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -[**models::HealthRes**](HealthRes.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/health+json, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/invitations/docs/HealthRes.md b/invitations/docs/HealthRes.md deleted file mode 100644 index 319b16fb..00000000 --- a/invitations/docs/HealthRes.md +++ /dev/null @@ -1,15 +0,0 @@ -# HealthRes - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | Option<**String**> | Service status. | [optional] -**version** | Option<**String**> | Service version. | [optional] -**commit** | Option<**String**> | Service commit hash. | [optional] -**description** | Option<**String**> | Service description. | [optional] -**build_time** | Option<**String**> | Service build time. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/invitations/docs/Invitation.md b/invitations/docs/Invitation.md deleted file mode 100644 index cc061547..00000000 --- a/invitations/docs/Invitation.md +++ /dev/null @@ -1,17 +0,0 @@ -# Invitation - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**invited_by** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | User unique identifier. | [optional] -**user_id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | User unique identifier. | [optional] -**domain_id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | Domain unique identifier. | [optional] -**relation** | Option<**String**> | Relation between user and domain. | [optional] -**created_at** | Option<**String**> | Time when the group was created. | [optional] -**updated_at** | Option<**String**> | Time when the group was created. | [optional] -**confirmed_at** | Option<**String**> | Time when the group was created. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/invitations/docs/InvitationPage.md b/invitations/docs/InvitationPage.md deleted file mode 100644 index 39d14548..00000000 --- a/invitations/docs/InvitationPage.md +++ /dev/null @@ -1,14 +0,0 @@ -# InvitationPage - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**invitations** | [**Vec**](Invitation.md) | | -**total** | **i32** | Total number of items. | -**offset** | **i32** | Number of items to skip during retrieval. | -**limit** | Option<**i32**> | Maximum number of items to return in one page. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/invitations/docs/InvitationsApi.md b/invitations/docs/InvitationsApi.md deleted file mode 100644 index d8bd316b..00000000 --- a/invitations/docs/InvitationsApi.md +++ /dev/null @@ -1,202 +0,0 @@ -# \InvitationsApi - -All URIs are relative to *http://localhost:9020* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**accept_invitation**](InvitationsApi.md#accept_invitation) | **POST** /invitations/accept | Accept invitation -[**delete_invitation**](InvitationsApi.md#delete_invitation) | **DELETE** /invitations/{user_id}/{domain_id} | Deletes a specific invitation -[**get_invitation**](InvitationsApi.md#get_invitation) | **GET** /invitations/{user_id}/{domain_id} | Retrieves a specific invitation -[**list_invitations**](InvitationsApi.md#list_invitations) | **GET** /invitations | List invitations -[**reject_invitation**](InvitationsApi.md#reject_invitation) | **POST** /invitations/reject | Reject invitation -[**send_invitation**](InvitationsApi.md#send_invitation) | **POST** /invitations | Send invitation - - - -## accept_invitation - -> accept_invitation(accept_invitation_request) -Accept invitation - -Current logged in user accepts invitation to join domain. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**accept_invitation_request** | [**AcceptInvitationRequest**](AcceptInvitationRequest.md) | JSON-formatted document describing request for accepting invitation | [required] | - -### Return type - - (empty response body) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## delete_invitation - -> delete_invitation(user_id, domain_id) -Deletes a specific invitation - -Deletes a specific invitation that is identifier by the user ID and domain ID. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**user_id** | **uuid::Uuid** | Unique user identifier. | [required] | -**domain_id** | **uuid::Uuid** | Unique identifier for a domain. | [required] | - -### Return type - - (empty response body) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## get_invitation - -> models::Invitation get_invitation(user_id, domain_id) -Retrieves a specific invitation - -Retrieves a specific invitation that is identifier by the user ID and domain ID. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**user_id** | **uuid::Uuid** | Unique user identifier. | [required] | -**domain_id** | **uuid::Uuid** | Unique identifier for a domain. | [required] | - -### Return type - -[**models::Invitation**](Invitation.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## list_invitations - -> models::InvitationPage list_invitations(user_id, limit, offset, invited_by, domain_id, relation, state) -List invitations - -Retrieves a list of invitations. Due to performance concerns, data is retrieved in subsets. The API must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**user_id** | **uuid::Uuid** | Unique user identifier. | [required] | -**limit** | Option<**i32**> | Size of the subset to retrieve. | |[default to 10] -**offset** | Option<**i32**> | Number of items to skip during retrieval. | |[default to 0] -**invited_by** | Option<**uuid::Uuid**> | Unique identifier for a user that invited the user. | | -**domain_id** | Option<**uuid::Uuid**> | Unique identifier for a domain. | | -**relation** | Option<**String**> | Relation between user and domain. | | -**state** | Option<**String**> | Invitation state. | | - -### Return type - -[**models::InvitationPage**](InvitationPage.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## reject_invitation - -> reject_invitation(accept_invitation_request) -Reject invitation - -Current logged in user rejects invitation to join domain. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**accept_invitation_request** | [**AcceptInvitationRequest**](AcceptInvitationRequest.md) | JSON-formatted document describing request for accepting invitation | [required] | - -### Return type - - (empty response body) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## send_invitation - -> send_invitation(send_invitation_req_obj) -Send invitation - -Send invitation to user to join domain. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**send_invitation_req_obj** | [**SendInvitationReqObj**](SendInvitationReqObj.md) | JSON-formatted document describing request for sending invitation | [required] | - -### Return type - - (empty response body) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/invitations/docs/SendInvitationReqObj.md b/invitations/docs/SendInvitationReqObj.md deleted file mode 100644 index d22a9efc..00000000 --- a/invitations/docs/SendInvitationReqObj.md +++ /dev/null @@ -1,14 +0,0 @@ -# SendInvitationReqObj - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**user_id** | [**uuid::Uuid**](uuid::Uuid.md) | User unique identifier. | -**domain_id** | [**uuid::Uuid**](uuid::Uuid.md) | Domain unique identifier. | -**relation** | **String** | Relation between user and domain. | -**resend** | Option<**bool**> | Resend invitation. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/invitations/git_push.sh b/invitations/git_push.sh deleted file mode 100644 index f53a75d4..00000000 --- a/invitations/git_push.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 -git_host=$4 - -if [ "$git_host" = "" ]; then - git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" -fi - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' diff --git a/invitations/src/apis/configuration.rs b/invitations/src/apis/configuration.rs deleted file mode 100644 index 5bbc1b35..00000000 --- a/invitations/src/apis/configuration.rs +++ /dev/null @@ -1,51 +0,0 @@ -/* - * SuperMQ Invitations Service - * - * This is the Invitations Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform invitations. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - - - -#[derive(Debug, Clone)] -pub struct Configuration { - pub base_path: String, - pub user_agent: Option, - pub client: reqwest::Client, - pub basic_auth: Option, - pub oauth_access_token: Option, - pub bearer_access_token: Option, - pub api_key: Option, -} - -pub type BasicAuth = (String, Option); - -#[derive(Debug, Clone)] -pub struct ApiKey { - pub prefix: Option, - pub key: String, -} - - -impl Configuration { - pub fn new() -> Configuration { - Configuration::default() - } -} - -impl Default for Configuration { - fn default() -> Self { - Configuration { - base_path: "http://localhost:9020".to_owned(), - user_agent: Some("OpenAPI-Generator/0.15.1/rust".to_owned()), - client: reqwest::Client::new(), - basic_auth: None, - oauth_access_token: None, - bearer_access_token: None, - api_key: None, - } - } -} diff --git a/invitations/src/apis/health_api.rs b/invitations/src/apis/health_api.rs deleted file mode 100644 index 06e960c2..00000000 --- a/invitations/src/apis/health_api.rs +++ /dev/null @@ -1,53 +0,0 @@ -/* - * SuperMQ Invitations Service - * - * This is the Invitations Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform invitations. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - - -use reqwest; -use serde::{Deserialize, Serialize}; -use crate::{apis::ResponseContent, models}; -use super::{Error, configuration}; - - -/// struct for typed errors of method [`health_get`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum HealthGetError { - Status500(models::Error), - UnknownValue(serde_json::Value), -} - - -pub async fn health_get(configuration: &configuration::Configuration, ) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/health", local_var_configuration.base_path); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - diff --git a/invitations/src/apis/mod.rs b/invitations/src/apis/mod.rs deleted file mode 100644 index 9053d793..00000000 --- a/invitations/src/apis/mod.rs +++ /dev/null @@ -1,96 +0,0 @@ -use std::error; -use std::fmt; - -#[derive(Debug, Clone)] -pub struct ResponseContent { - pub status: reqwest::StatusCode, - pub content: String, - pub entity: Option, -} - -#[derive(Debug)] -pub enum Error { - Reqwest(reqwest::Error), - Serde(serde_json::Error), - Io(std::io::Error), - ResponseError(ResponseContent), -} - -impl fmt::Display for Error { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - let (module, e) = match self { - Error::Reqwest(e) => ("reqwest", e.to_string()), - Error::Serde(e) => ("serde", e.to_string()), - Error::Io(e) => ("IO", e.to_string()), - Error::ResponseError(e) => ("response", format!("status code {}", e.status)), - }; - write!(f, "error in {}: {}", module, e) - } -} - -impl error::Error for Error { - fn source(&self) -> Option<&(dyn error::Error + 'static)> { - Some(match self { - Error::Reqwest(e) => e, - Error::Serde(e) => e, - Error::Io(e) => e, - Error::ResponseError(_) => return None, - }) - } -} - -impl From for Error { - fn from(e: reqwest::Error) -> Self { - Error::Reqwest(e) - } -} - -impl From for Error { - fn from(e: serde_json::Error) -> Self { - Error::Serde(e) - } -} - -impl From for Error { - fn from(e: std::io::Error) -> Self { - Error::Io(e) - } -} - -pub fn urlencode>(s: T) -> String { - ::url::form_urlencoded::byte_serialize(s.as_ref().as_bytes()).collect() -} - -pub fn parse_deep_object(prefix: &str, value: &serde_json::Value) -> Vec<(String, String)> { - if let serde_json::Value::Object(object) = value { - let mut params = vec![]; - - for (key, value) in object { - match value { - serde_json::Value::Object(_) => params.append(&mut parse_deep_object( - &format!("{}[{}]", prefix, key), - value, - )), - serde_json::Value::Array(array) => { - for (i, value) in array.iter().enumerate() { - params.append(&mut parse_deep_object( - &format!("{}[{}][{}]", prefix, key, i), - value, - )); - } - }, - serde_json::Value::String(s) => params.push((format!("{}[{}]", prefix, key), s.clone())), - _ => params.push((format!("{}[{}]", prefix, key), value.to_string())), - } - } - - return params; - } - - unimplemented!("Only objects are supported with style=deepObject") -} - -pub mod health_api; -pub mod invitations_api; - -pub mod configuration; diff --git a/invitations/src/lib.rs b/invitations/src/lib.rs deleted file mode 100644 index e1520628..00000000 --- a/invitations/src/lib.rs +++ /dev/null @@ -1,11 +0,0 @@ -#![allow(unused_imports)] -#![allow(clippy::too_many_arguments)] - -extern crate serde_repr; -extern crate serde; -extern crate serde_json; -extern crate url; -extern crate reqwest; - -pub mod apis; -pub mod models; diff --git a/invitations/src/models/accept_invitation_request.rs b/invitations/src/models/accept_invitation_request.rs deleted file mode 100644 index 66f62a0f..00000000 --- a/invitations/src/models/accept_invitation_request.rs +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SuperMQ Invitations Service - * - * This is the Invitations Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform invitations. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct AcceptInvitationRequest { - /// Domain unique identifier. - #[serde(rename = "domain_id")] - pub domain_id: uuid::Uuid, -} - -impl AcceptInvitationRequest { - pub fn new(domain_id: uuid::Uuid) -> AcceptInvitationRequest { - AcceptInvitationRequest { - domain_id, - } - } -} - diff --git a/invitations/src/models/error.rs b/invitations/src/models/error.rs deleted file mode 100644 index 05e8c4b2..00000000 --- a/invitations/src/models/error.rs +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SuperMQ Invitations Service - * - * This is the Invitations Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform invitations. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct Error { - /// Error message - #[serde(rename = "error", skip_serializing_if = "Option::is_none")] - pub error: Option, -} - -impl Error { - pub fn new() -> Error { - Error { - error: None, - } - } -} - diff --git a/invitations/src/models/health_res.rs b/invitations/src/models/health_res.rs deleted file mode 100644 index 5313d5fb..00000000 --- a/invitations/src/models/health_res.rs +++ /dev/null @@ -1,56 +0,0 @@ -/* - * SuperMQ Invitations Service - * - * This is the Invitations Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform invitations. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct HealthRes { - /// Service status. - #[serde(rename = "status", skip_serializing_if = "Option::is_none")] - pub status: Option, - /// Service version. - #[serde(rename = "version", skip_serializing_if = "Option::is_none")] - pub version: Option, - /// Service commit hash. - #[serde(rename = "commit", skip_serializing_if = "Option::is_none")] - pub commit: Option, - /// Service description. - #[serde(rename = "description", skip_serializing_if = "Option::is_none")] - pub description: Option, - /// Service build time. - #[serde(rename = "build_time", skip_serializing_if = "Option::is_none")] - pub build_time: Option, -} - -impl HealthRes { - pub fn new() -> HealthRes { - HealthRes { - status: None, - version: None, - commit: None, - description: None, - build_time: None, - } - } -} -/// Service status. -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum Status { - #[serde(rename = "pass")] - Pass, -} - -impl Default for Status { - fn default() -> Status { - Self::Pass - } -} - diff --git a/invitations/src/models/mod.rs b/invitations/src/models/mod.rs deleted file mode 100644 index ef485402..00000000 --- a/invitations/src/models/mod.rs +++ /dev/null @@ -1,12 +0,0 @@ -pub mod accept_invitation_request; -pub use self::accept_invitation_request::AcceptInvitationRequest; -pub mod error; -pub use self::error::Error; -pub mod health_res; -pub use self::health_res::HealthRes; -pub mod invitation; -pub use self::invitation::Invitation; -pub mod invitation_page; -pub use self::invitation_page::InvitationPage; -pub mod send_invitation_req_obj; -pub use self::send_invitation_req_obj::SendInvitationReqObj; diff --git a/journal/.gitignore b/journal/.gitignore deleted file mode 100644 index 6aa10640..00000000 --- a/journal/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/target/ -**/*.rs.bk -Cargo.lock diff --git a/journal/.openapi-generator-ignore b/journal/.openapi-generator-ignore deleted file mode 100644 index 7484ee59..00000000 --- a/journal/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/journal/.openapi-generator/FILES b/journal/.openapi-generator/FILES deleted file mode 100644 index 636088a4..00000000 --- a/journal/.openapi-generator/FILES +++ /dev/null @@ -1,22 +0,0 @@ -.gitignore -.openapi-generator-ignore -.travis.yml -Cargo.toml -README.md -docs/Error.md -docs/HealthApi.md -docs/HealthInfo.md -docs/Journal.md -docs/JournalLogApi.md -docs/JournalPage.md -git_push.sh -src/apis/configuration.rs -src/apis/health_api.rs -src/apis/journal_log_api.rs -src/apis/mod.rs -src/lib.rs -src/models/error.rs -src/models/health_info.rs -src/models/journal.rs -src/models/journal_page.rs -src/models/mod.rs diff --git a/journal/.openapi-generator/VERSION b/journal/.openapi-generator/VERSION deleted file mode 100644 index 758bb9c8..00000000 --- a/journal/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -7.10.0 diff --git a/journal/.travis.yml b/journal/.travis.yml deleted file mode 100644 index 22761ba7..00000000 --- a/journal/.travis.yml +++ /dev/null @@ -1 +0,0 @@ -language: rust diff --git a/journal/Cargo.toml b/journal/Cargo.toml deleted file mode 100644 index 203ec72c..00000000 --- a/journal/Cargo.toml +++ /dev/null @@ -1,15 +0,0 @@ -[package] -name = "Journal" -version = "0.15.1" -authors = ["info@mainflux.com"] -description = "This is the Journal Log Server based on the OpenAPI 3.0 specification. It is the HTTP API for viewing journal log history. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) " -license = "Apache 2.0" -edition = "2021" - -[dependencies] -serde = { version = "^1.0", features = ["derive"] } -serde_json = "^1.0" -serde_repr = "^0.1" -url = "^2.5" -uuid = { version = "^1.8", features = ["serde", "v4"] } -reqwest = { version = "^0.12", features = ["json", "multipart"] } diff --git a/journal/README.md b/journal/README.md deleted file mode 100644 index 514303a3..00000000 --- a/journal/README.md +++ /dev/null @@ -1,54 +0,0 @@ -# Rust API client for openapi - -This is the Journal Log Server based on the OpenAPI 3.0 specification. It is the HTTP API for viewing journal log history. You can now help us improve the API whether it's by making changes to the definition itself or to the code. -Some useful links: -- [The SuperMQ repository](https://github.com/absmach/supermq) - - - -## Overview - -This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://openapis.org) from a remote server, you can easily generate an API client. - -- API version: 0.15.1 -- Package version: 0.15.1 -- Generator version: 7.10.0 -- Build package: `org.openapitools.codegen.languages.RustClientCodegen` - -## Installation - -Put the package under your project folder in a directory named `openapi` and add the following to `Cargo.toml` under `[dependencies]`: - -``` -openapi = { path = "./openapi" } -``` - -## Documentation for API Endpoints - -All URIs are relative to *http://localhost:9021* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*HealthApi* | [**health_get**](docs/HealthApi.md#health_get) | **GET** /health | Retrieves service health check info. -*JournalLogApi* | [**domain_id_journal_entity_type_id_get**](docs/JournalLogApi.md#domain_id_journal_entity_type_id_get) | **GET** /{domainID}/journal/{entityType}/{id} | List entity journal log -*JournalLogApi* | [**journal_user_user_id_get**](docs/JournalLogApi.md#journal_user_user_id_get) | **GET** /journal/user/{userID} | List user journal log - - -## Documentation For Models - - - [Error](docs/Error.md) - - [HealthInfo](docs/HealthInfo.md) - - [Journal](docs/Journal.md) - - [JournalPage](docs/JournalPage.md) - - -To get access to the crate's generated documentation, use: - -``` -cargo doc --open -``` - -## Author - -info@mainflux.com - diff --git a/journal/docs/Error.md b/journal/docs/Error.md deleted file mode 100644 index 8e78862d..00000000 --- a/journal/docs/Error.md +++ /dev/null @@ -1,11 +0,0 @@ -# Error - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**error** | Option<**String**> | Error message | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/journal/docs/HealthApi.md b/journal/docs/HealthApi.md deleted file mode 100644 index 6d4507a5..00000000 --- a/journal/docs/HealthApi.md +++ /dev/null @@ -1,34 +0,0 @@ -# \HealthApi - -All URIs are relative to *http://localhost:9021* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**health_get**](HealthApi.md#health_get) | **GET** /health | Retrieves service health check info. - - - -## health_get - -> models::HealthInfo health_get() -Retrieves service health check info. - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -[**models::HealthInfo**](health_info.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/health+json, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/journal/docs/HealthInfo.md b/journal/docs/HealthInfo.md deleted file mode 100644 index ee8f5c6b..00000000 --- a/journal/docs/HealthInfo.md +++ /dev/null @@ -1,16 +0,0 @@ -# HealthInfo - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | Option<**String**> | Service status. | [optional] -**version** | Option<**String**> | Service version. | [optional] -**commit** | Option<**String**> | Service commit hash. | [optional] -**description** | Option<**String**> | Service description. | [optional] -**build_time** | Option<**String**> | Service build time. | [optional] -**instance_id** | Option<**String**> | Service instance ID. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/journal/docs/Journal.md b/journal/docs/Journal.md deleted file mode 100644 index 02b6a011..00000000 --- a/journal/docs/Journal.md +++ /dev/null @@ -1,14 +0,0 @@ -# Journal - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**operation** | Option<**String**> | Journal operation. | [optional] -**occurred_at** | Option<**String**> | Time when the journal occurred. | [optional] -**attributes** | Option<[**serde_json::Value**](.md)> | Journal attributes. | [optional] -**metadata** | Option<[**serde_json::Value**](.md)> | Journal payload. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/journal/docs/JournalLogApi.md b/journal/docs/JournalLogApi.md deleted file mode 100644 index bcce44e0..00000000 --- a/journal/docs/JournalLogApi.md +++ /dev/null @@ -1,88 +0,0 @@ -# \JournalLogApi - -All URIs are relative to *http://localhost:9021* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**domain_id_journal_entity_type_id_get**](JournalLogApi.md#domain_id_journal_entity_type_id_get) | **GET** /{domainID}/journal/{entityType}/{id} | List entity journal log -[**journal_user_user_id_get**](JournalLogApi.md#journal_user_user_id_get) | **GET** /journal/user/{userID} | List user journal log - - - -## domain_id_journal_entity_type_id_get - -> models::JournalPage domain_id_journal_entity_type_id_get(domain_id, entity_type, id, offset, limit, operation, with_attributes, with_metadata, from, to, dir) -List entity journal log - -Retrieves a list of journal. Due to performance concerns, data is retrieved in subsets. The API must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique identifier for a domain. | [required] | -**entity_type** | **String** | Type of entity, e.g. user, group, client, etc.entityType | [required] | -**id** | **uuid::Uuid** | Unique identifier for an entity, e.g. group, channel or thing. Used together with entity_type. | [required] | -**offset** | Option<**i32**> | Number of items to skip during retrieval. | |[default to 0] -**limit** | Option<**i32**> | Size of the subset to retrieve. | |[default to 10] -**operation** | Option<**String**> | Journal operation. | | -**with_attributes** | Option<**bool**> | Include journal attributes. | | -**with_metadata** | Option<**bool**> | Include journal metadata. | | -**from** | Option<**String**> | Start date in unix time. | | -**to** | Option<**String**> | End date in unix time. | | -**dir** | Option<**String**> | Sort direction. | | - -### Return type - -[**models::JournalPage**](JournalPage.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## journal_user_user_id_get - -> models::JournalPage journal_user_user_id_get(user_id, offset, limit, operation, with_attributes, with_metadata, from, to, dir) -List user journal log - -Retrieves a list of journal. Due to performance concerns, data is retrieved in subsets. The API must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**user_id** | **uuid::Uuid** | Unique identifier for a user. | [required] | -**offset** | Option<**i32**> | Number of items to skip during retrieval. | |[default to 0] -**limit** | Option<**i32**> | Size of the subset to retrieve. | |[default to 10] -**operation** | Option<**String**> | Journal operation. | | -**with_attributes** | Option<**bool**> | Include journal attributes. | | -**with_metadata** | Option<**bool**> | Include journal metadata. | | -**from** | Option<**String**> | Start date in unix time. | | -**to** | Option<**String**> | End date in unix time. | | -**dir** | Option<**String**> | Sort direction. | | - -### Return type - -[**models::JournalPage**](JournalPage.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/journal/docs/JournalPage.md b/journal/docs/JournalPage.md deleted file mode 100644 index 18597b4b..00000000 --- a/journal/docs/JournalPage.md +++ /dev/null @@ -1,14 +0,0 @@ -# JournalPage - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**journals** | [**Vec**](Journal.md) | | -**total** | **i32** | Total number of items. | -**offset** | **i32** | Number of items to skip during retrieval. | -**limit** | Option<**i32**> | Maximum number of items to return in one page. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/journal/git_push.sh b/journal/git_push.sh deleted file mode 100644 index f53a75d4..00000000 --- a/journal/git_push.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 -git_host=$4 - -if [ "$git_host" = "" ]; then - git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" -fi - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' diff --git a/journal/src/apis/configuration.rs b/journal/src/apis/configuration.rs deleted file mode 100644 index d4857ba2..00000000 --- a/journal/src/apis/configuration.rs +++ /dev/null @@ -1,51 +0,0 @@ -/* - * SuperMQ Journal Log Service - * - * This is the Journal Log Server based on the OpenAPI 3.0 specification. It is the HTTP API for viewing journal log history. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@mainflux.com - * Generated by: https://openapi-generator.tech - */ - - - -#[derive(Debug, Clone)] -pub struct Configuration { - pub base_path: String, - pub user_agent: Option, - pub client: reqwest::Client, - pub basic_auth: Option, - pub oauth_access_token: Option, - pub bearer_access_token: Option, - pub api_key: Option, -} - -pub type BasicAuth = (String, Option); - -#[derive(Debug, Clone)] -pub struct ApiKey { - pub prefix: Option, - pub key: String, -} - - -impl Configuration { - pub fn new() -> Configuration { - Configuration::default() - } -} - -impl Default for Configuration { - fn default() -> Self { - Configuration { - base_path: "http://localhost:9021".to_owned(), - user_agent: Some("OpenAPI-Generator/0.15.1/rust".to_owned()), - client: reqwest::Client::new(), - basic_auth: None, - oauth_access_token: None, - bearer_access_token: None, - api_key: None, - } - } -} diff --git a/journal/src/apis/health_api.rs b/journal/src/apis/health_api.rs deleted file mode 100644 index 8ae1db94..00000000 --- a/journal/src/apis/health_api.rs +++ /dev/null @@ -1,53 +0,0 @@ -/* - * SuperMQ Journal Log Service - * - * This is the Journal Log Server based on the OpenAPI 3.0 specification. It is the HTTP API for viewing journal log history. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@mainflux.com - * Generated by: https://openapi-generator.tech - */ - - -use reqwest; -use serde::{Deserialize, Serialize}; -use crate::{apis::ResponseContent, models}; -use super::{Error, configuration}; - - -/// struct for typed errors of method [`health_get`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum HealthGetError { - Status500(models::Error), - UnknownValue(serde_json::Value), -} - - -pub async fn health_get(configuration: &configuration::Configuration, ) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/health", local_var_configuration.base_path); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - diff --git a/journal/src/apis/mod.rs b/journal/src/apis/mod.rs deleted file mode 100644 index 9210e296..00000000 --- a/journal/src/apis/mod.rs +++ /dev/null @@ -1,96 +0,0 @@ -use std::error; -use std::fmt; - -#[derive(Debug, Clone)] -pub struct ResponseContent { - pub status: reqwest::StatusCode, - pub content: String, - pub entity: Option, -} - -#[derive(Debug)] -pub enum Error { - Reqwest(reqwest::Error), - Serde(serde_json::Error), - Io(std::io::Error), - ResponseError(ResponseContent), -} - -impl fmt::Display for Error { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - let (module, e) = match self { - Error::Reqwest(e) => ("reqwest", e.to_string()), - Error::Serde(e) => ("serde", e.to_string()), - Error::Io(e) => ("IO", e.to_string()), - Error::ResponseError(e) => ("response", format!("status code {}", e.status)), - }; - write!(f, "error in {}: {}", module, e) - } -} - -impl error::Error for Error { - fn source(&self) -> Option<&(dyn error::Error + 'static)> { - Some(match self { - Error::Reqwest(e) => e, - Error::Serde(e) => e, - Error::Io(e) => e, - Error::ResponseError(_) => return None, - }) - } -} - -impl From for Error { - fn from(e: reqwest::Error) -> Self { - Error::Reqwest(e) - } -} - -impl From for Error { - fn from(e: serde_json::Error) -> Self { - Error::Serde(e) - } -} - -impl From for Error { - fn from(e: std::io::Error) -> Self { - Error::Io(e) - } -} - -pub fn urlencode>(s: T) -> String { - ::url::form_urlencoded::byte_serialize(s.as_ref().as_bytes()).collect() -} - -pub fn parse_deep_object(prefix: &str, value: &serde_json::Value) -> Vec<(String, String)> { - if let serde_json::Value::Object(object) = value { - let mut params = vec![]; - - for (key, value) in object { - match value { - serde_json::Value::Object(_) => params.append(&mut parse_deep_object( - &format!("{}[{}]", prefix, key), - value, - )), - serde_json::Value::Array(array) => { - for (i, value) in array.iter().enumerate() { - params.append(&mut parse_deep_object( - &format!("{}[{}][{}]", prefix, key, i), - value, - )); - } - }, - serde_json::Value::String(s) => params.push((format!("{}[{}]", prefix, key), s.clone())), - _ => params.push((format!("{}[{}]", prefix, key), value.to_string())), - } - } - - return params; - } - - unimplemented!("Only objects are supported with style=deepObject") -} - -pub mod health_api; -pub mod journal_log_api; - -pub mod configuration; diff --git a/journal/src/lib.rs b/journal/src/lib.rs deleted file mode 100644 index e1520628..00000000 --- a/journal/src/lib.rs +++ /dev/null @@ -1,11 +0,0 @@ -#![allow(unused_imports)] -#![allow(clippy::too_many_arguments)] - -extern crate serde_repr; -extern crate serde; -extern crate serde_json; -extern crate url; -extern crate reqwest; - -pub mod apis; -pub mod models; diff --git a/journal/src/models/error.rs b/journal/src/models/error.rs deleted file mode 100644 index 5015f517..00000000 --- a/journal/src/models/error.rs +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SuperMQ Journal Log Service - * - * This is the Journal Log Server based on the OpenAPI 3.0 specification. It is the HTTP API for viewing journal log history. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@mainflux.com - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct Error { - /// Error message - #[serde(rename = "error", skip_serializing_if = "Option::is_none")] - pub error: Option, -} - -impl Error { - pub fn new() -> Error { - Error { - error: None, - } - } -} - diff --git a/journal/src/models/health_info.rs b/journal/src/models/health_info.rs deleted file mode 100644 index 2f479314..00000000 --- a/journal/src/models/health_info.rs +++ /dev/null @@ -1,60 +0,0 @@ -/* - * SuperMQ Journal Log Service - * - * This is the Journal Log Server based on the OpenAPI 3.0 specification. It is the HTTP API for viewing journal log history. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@mainflux.com - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct HealthInfo { - /// Service status. - #[serde(rename = "status", skip_serializing_if = "Option::is_none")] - pub status: Option, - /// Service version. - #[serde(rename = "version", skip_serializing_if = "Option::is_none")] - pub version: Option, - /// Service commit hash. - #[serde(rename = "commit", skip_serializing_if = "Option::is_none")] - pub commit: Option, - /// Service description. - #[serde(rename = "description", skip_serializing_if = "Option::is_none")] - pub description: Option, - /// Service build time. - #[serde(rename = "build_time", skip_serializing_if = "Option::is_none")] - pub build_time: Option, - /// Service instance ID. - #[serde(rename = "instance_id", skip_serializing_if = "Option::is_none")] - pub instance_id: Option, -} - -impl HealthInfo { - pub fn new() -> HealthInfo { - HealthInfo { - status: None, - version: None, - commit: None, - description: None, - build_time: None, - instance_id: None, - } - } -} -/// Service status. -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum Status { - #[serde(rename = "pass")] - Pass, -} - -impl Default for Status { - fn default() -> Status { - Self::Pass - } -} - diff --git a/journal/src/models/mod.rs b/journal/src/models/mod.rs deleted file mode 100644 index a170978c..00000000 --- a/journal/src/models/mod.rs +++ /dev/null @@ -1,8 +0,0 @@ -pub mod error; -pub use self::error::Error; -pub mod health_info; -pub use self::health_info::HealthInfo; -pub mod journal; -pub use self::journal::Journal; -pub mod journal_page; -pub use self::journal_page::JournalPage; diff --git a/notifiers/.gitignore b/notifiers/.gitignore deleted file mode 100644 index 6aa10640..00000000 --- a/notifiers/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/target/ -**/*.rs.bk -Cargo.lock diff --git a/notifiers/.openapi-generator-ignore b/notifiers/.openapi-generator-ignore deleted file mode 100644 index 7484ee59..00000000 --- a/notifiers/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/notifiers/.openapi-generator/FILES b/notifiers/.openapi-generator/FILES deleted file mode 100644 index 27334be2..00000000 --- a/notifiers/.openapi-generator/FILES +++ /dev/null @@ -1,22 +0,0 @@ -.gitignore -.openapi-generator-ignore -.travis.yml -Cargo.toml -README.md -docs/CreateSubscription.md -docs/HealthApi.md -docs/HealthInfo.md -docs/NotifiersApi.md -docs/Page.md -docs/Subscription.md -git_push.sh -src/apis/configuration.rs -src/apis/health_api.rs -src/apis/mod.rs -src/apis/notifiers_api.rs -src/lib.rs -src/models/create_subscription.rs -src/models/health_info.rs -src/models/mod.rs -src/models/page.rs -src/models/subscription.rs diff --git a/notifiers/.openapi-generator/VERSION b/notifiers/.openapi-generator/VERSION deleted file mode 100644 index 758bb9c8..00000000 --- a/notifiers/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -7.10.0 diff --git a/notifiers/.travis.yml b/notifiers/.travis.yml deleted file mode 100644 index 22761ba7..00000000 --- a/notifiers/.travis.yml +++ /dev/null @@ -1 +0,0 @@ -language: rust diff --git a/notifiers/Cargo.toml b/notifiers/Cargo.toml deleted file mode 100644 index fbe2af48..00000000 --- a/notifiers/Cargo.toml +++ /dev/null @@ -1,15 +0,0 @@ -[package] -name = "Notifiers" -version = "0.15.1" -authors = ["info@abstractmachines.fr"] -description = "HTTP API for Notifiers service. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) " -license = "Apache 2.0" -edition = "2021" - -[dependencies] -serde = { version = "^1.0", features = ["derive"] } -serde_json = "^1.0" -serde_repr = "^0.1" -url = "^2.5" -uuid = { version = "^1.8", features = ["serde", "v4"] } -reqwest = { version = "^0.12", features = ["json", "multipart"] } diff --git a/notifiers/README.md b/notifiers/README.md deleted file mode 100644 index 8eb9650f..00000000 --- a/notifiers/README.md +++ /dev/null @@ -1,56 +0,0 @@ -# Rust API client for openapi - -HTTP API for Notifiers service. -Some useful links: -- [The SuperMQ repository](https://github.com/absmach/supermq) - - - -## Overview - -This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://openapis.org) from a remote server, you can easily generate an API client. - -- API version: 0.15.1 -- Package version: 0.15.1 -- Generator version: 7.10.0 -- Build package: `org.openapitools.codegen.languages.RustClientCodegen` - -## Installation - -Put the package under your project folder in a directory named `openapi` and add the following to `Cargo.toml` under `[dependencies]`: - -``` -openapi = { path = "./openapi" } -``` - -## Documentation for API Endpoints - -All URIs are relative to *http://localhost:9014* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*HealthApi* | [**health_get**](docs/HealthApi.md#health_get) | **GET** /health | Retrieves service health check info. -*NotifiersApi* | [**create_subscription**](docs/NotifiersApi.md#create_subscription) | **POST** /subscriptions | Create subscription -*NotifiersApi* | [**list_subscriptions**](docs/NotifiersApi.md#list_subscriptions) | **GET** /subscriptions | List subscriptions -*NotifiersApi* | [**remove_subscription**](docs/NotifiersApi.md#remove_subscription) | **DELETE** /subscriptions/{id} | Delete subscription with the provided id -*NotifiersApi* | [**view_subscription**](docs/NotifiersApi.md#view_subscription) | **GET** /subscriptions/{id} | Get subscription with the provided id - - -## Documentation For Models - - - [CreateSubscription](docs/CreateSubscription.md) - - [HealthInfo](docs/HealthInfo.md) - - [Page](docs/Page.md) - - [Subscription](docs/Subscription.md) - - -To get access to the crate's generated documentation, use: - -``` -cargo doc --open -``` - -## Author - -info@abstractmachines.fr - diff --git a/notifiers/docs/CreateSubscription.md b/notifiers/docs/CreateSubscription.md deleted file mode 100644 index 349da073..00000000 --- a/notifiers/docs/CreateSubscription.md +++ /dev/null @@ -1,12 +0,0 @@ -# CreateSubscription - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**topic** | Option<**String**> | Topic to which the user subscribes. | [optional] -**contact** | Option<**String**> | The contact of the user to which the notification will be sent. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/notifiers/docs/HealthApi.md b/notifiers/docs/HealthApi.md deleted file mode 100644 index b4f3cf64..00000000 --- a/notifiers/docs/HealthApi.md +++ /dev/null @@ -1,34 +0,0 @@ -# \HealthApi - -All URIs are relative to *http://localhost:9014* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**health_get**](HealthApi.md#health_get) | **GET** /health | Retrieves service health check info. - - - -## health_get - -> models::HealthInfo health_get() -Retrieves service health check info. - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -[**models::HealthInfo**](health_info.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/health+json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/notifiers/docs/HealthInfo.md b/notifiers/docs/HealthInfo.md deleted file mode 100644 index ee8f5c6b..00000000 --- a/notifiers/docs/HealthInfo.md +++ /dev/null @@ -1,16 +0,0 @@ -# HealthInfo - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | Option<**String**> | Service status. | [optional] -**version** | Option<**String**> | Service version. | [optional] -**commit** | Option<**String**> | Service commit hash. | [optional] -**description** | Option<**String**> | Service description. | [optional] -**build_time** | Option<**String**> | Service build time. | [optional] -**instance_id** | Option<**String**> | Service instance ID. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/notifiers/docs/NotifiersApi.md b/notifiers/docs/NotifiersApi.md deleted file mode 100644 index 26e5f60e..00000000 --- a/notifiers/docs/NotifiersApi.md +++ /dev/null @@ -1,135 +0,0 @@ -# \NotifiersApi - -All URIs are relative to *http://localhost:9014* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**create_subscription**](NotifiersApi.md#create_subscription) | **POST** /subscriptions | Create subscription -[**list_subscriptions**](NotifiersApi.md#list_subscriptions) | **GET** /subscriptions | List subscriptions -[**remove_subscription**](NotifiersApi.md#remove_subscription) | **DELETE** /subscriptions/{id} | Delete subscription with the provided id -[**view_subscription**](NotifiersApi.md#view_subscription) | **GET** /subscriptions/{id} | Get subscription with the provided id - - - -## create_subscription - -> create_subscription(create_subscription) -Create subscription - -Creates a new subscription give a topic and contact. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**create_subscription** | [**CreateSubscription**](CreateSubscription.md) | JSON-formatted document describing the new subscription to be created | [required] | - -### Return type - - (empty response body) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## list_subscriptions - -> models::Page list_subscriptions(topic, contact, offset, limit) -List subscriptions - -List subscriptions given list parameters. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**topic** | Option<**String**> | Topic name. | | -**contact** | Option<**String**> | Subscription contact. | | -**offset** | Option<**i32**> | Number of items to skip during retrieval. | |[default to 0] -**limit** | Option<**i32**> | Size of the subset to retrieve. | |[default to 10] - -### Return type - -[**models::Page**](Page.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## remove_subscription - -> remove_subscription(id) -Delete subscription with the provided id - -Removes a subscription with the provided id. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**id** | **String** | Unique identifier. | [required] | - -### Return type - - (empty response body) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## view_subscription - -> models::Subscription view_subscription(id) -Get subscription with the provided id - -Retrieves a subscription with the provided id. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**id** | **String** | Unique identifier. | [required] | - -### Return type - -[**models::Subscription**](Subscription.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/notifiers/docs/Page.md b/notifiers/docs/Page.md deleted file mode 100644 index e5ffa53c..00000000 --- a/notifiers/docs/Page.md +++ /dev/null @@ -1,14 +0,0 @@ -# Page - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**subscriptions** | Option<[**Vec**](Subscription.md)> | | [optional] -**total** | Option<**i32**> | Total number of items. | [optional] -**offset** | Option<**i32**> | Number of items to skip during retrieval. | [optional] -**limit** | Option<**i32**> | Maximum number of items to return in one page. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/notifiers/docs/Subscription.md b/notifiers/docs/Subscription.md deleted file mode 100644 index 479fcb68..00000000 --- a/notifiers/docs/Subscription.md +++ /dev/null @@ -1,14 +0,0 @@ -# Subscription - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | Option<**String**> | ULID id of the subscription. | [optional] -**owner_id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | An id of the owner who created subscription. | [optional] -**topic** | Option<**String**> | Topic to which the user subscribes. | [optional] -**contact** | Option<**String**> | The contact of the user to which the notification will be sent. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/notifiers/git_push.sh b/notifiers/git_push.sh deleted file mode 100644 index f53a75d4..00000000 --- a/notifiers/git_push.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 -git_host=$4 - -if [ "$git_host" = "" ]; then - git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" -fi - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' diff --git a/notifiers/src/apis/configuration.rs b/notifiers/src/apis/configuration.rs deleted file mode 100644 index c3fde6b3..00000000 --- a/notifiers/src/apis/configuration.rs +++ /dev/null @@ -1,51 +0,0 @@ -/* - * SuperMQ Notifiers service - * - * HTTP API for Notifiers service. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - - - -#[derive(Debug, Clone)] -pub struct Configuration { - pub base_path: String, - pub user_agent: Option, - pub client: reqwest::Client, - pub basic_auth: Option, - pub oauth_access_token: Option, - pub bearer_access_token: Option, - pub api_key: Option, -} - -pub type BasicAuth = (String, Option); - -#[derive(Debug, Clone)] -pub struct ApiKey { - pub prefix: Option, - pub key: String, -} - - -impl Configuration { - pub fn new() -> Configuration { - Configuration::default() - } -} - -impl Default for Configuration { - fn default() -> Self { - Configuration { - base_path: "http://localhost:9014".to_owned(), - user_agent: Some("OpenAPI-Generator/0.15.1/rust".to_owned()), - client: reqwest::Client::new(), - basic_auth: None, - oauth_access_token: None, - bearer_access_token: None, - api_key: None, - } - } -} diff --git a/notifiers/src/apis/health_api.rs b/notifiers/src/apis/health_api.rs deleted file mode 100644 index 6856123e..00000000 --- a/notifiers/src/apis/health_api.rs +++ /dev/null @@ -1,53 +0,0 @@ -/* - * SuperMQ Notifiers service - * - * HTTP API for Notifiers service. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - - -use reqwest; -use serde::{Deserialize, Serialize}; -use crate::{apis::ResponseContent, models}; -use super::{Error, configuration}; - - -/// struct for typed errors of method [`health_get`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum HealthGetError { - Status500(), - UnknownValue(serde_json::Value), -} - - -pub async fn health_get(configuration: &configuration::Configuration, ) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/health", local_var_configuration.base_path); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - diff --git a/notifiers/src/apis/mod.rs b/notifiers/src/apis/mod.rs deleted file mode 100644 index 99ceea9a..00000000 --- a/notifiers/src/apis/mod.rs +++ /dev/null @@ -1,96 +0,0 @@ -use std::error; -use std::fmt; - -#[derive(Debug, Clone)] -pub struct ResponseContent { - pub status: reqwest::StatusCode, - pub content: String, - pub entity: Option, -} - -#[derive(Debug)] -pub enum Error { - Reqwest(reqwest::Error), - Serde(serde_json::Error), - Io(std::io::Error), - ResponseError(ResponseContent), -} - -impl fmt::Display for Error { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - let (module, e) = match self { - Error::Reqwest(e) => ("reqwest", e.to_string()), - Error::Serde(e) => ("serde", e.to_string()), - Error::Io(e) => ("IO", e.to_string()), - Error::ResponseError(e) => ("response", format!("status code {}", e.status)), - }; - write!(f, "error in {}: {}", module, e) - } -} - -impl error::Error for Error { - fn source(&self) -> Option<&(dyn error::Error + 'static)> { - Some(match self { - Error::Reqwest(e) => e, - Error::Serde(e) => e, - Error::Io(e) => e, - Error::ResponseError(_) => return None, - }) - } -} - -impl From for Error { - fn from(e: reqwest::Error) -> Self { - Error::Reqwest(e) - } -} - -impl From for Error { - fn from(e: serde_json::Error) -> Self { - Error::Serde(e) - } -} - -impl From for Error { - fn from(e: std::io::Error) -> Self { - Error::Io(e) - } -} - -pub fn urlencode>(s: T) -> String { - ::url::form_urlencoded::byte_serialize(s.as_ref().as_bytes()).collect() -} - -pub fn parse_deep_object(prefix: &str, value: &serde_json::Value) -> Vec<(String, String)> { - if let serde_json::Value::Object(object) = value { - let mut params = vec![]; - - for (key, value) in object { - match value { - serde_json::Value::Object(_) => params.append(&mut parse_deep_object( - &format!("{}[{}]", prefix, key), - value, - )), - serde_json::Value::Array(array) => { - for (i, value) in array.iter().enumerate() { - params.append(&mut parse_deep_object( - &format!("{}[{}][{}]", prefix, key, i), - value, - )); - } - }, - serde_json::Value::String(s) => params.push((format!("{}[{}]", prefix, key), s.clone())), - _ => params.push((format!("{}[{}]", prefix, key), value.to_string())), - } - } - - return params; - } - - unimplemented!("Only objects are supported with style=deepObject") -} - -pub mod health_api; -pub mod notifiers_api; - -pub mod configuration; diff --git a/notifiers/src/lib.rs b/notifiers/src/lib.rs deleted file mode 100644 index e1520628..00000000 --- a/notifiers/src/lib.rs +++ /dev/null @@ -1,11 +0,0 @@ -#![allow(unused_imports)] -#![allow(clippy::too_many_arguments)] - -extern crate serde_repr; -extern crate serde; -extern crate serde_json; -extern crate url; -extern crate reqwest; - -pub mod apis; -pub mod models; diff --git a/notifiers/src/models/health_info.rs b/notifiers/src/models/health_info.rs deleted file mode 100644 index d852d72e..00000000 --- a/notifiers/src/models/health_info.rs +++ /dev/null @@ -1,60 +0,0 @@ -/* - * SuperMQ Notifiers service - * - * HTTP API for Notifiers service. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct HealthInfo { - /// Service status. - #[serde(rename = "status", skip_serializing_if = "Option::is_none")] - pub status: Option, - /// Service version. - #[serde(rename = "version", skip_serializing_if = "Option::is_none")] - pub version: Option, - /// Service commit hash. - #[serde(rename = "commit", skip_serializing_if = "Option::is_none")] - pub commit: Option, - /// Service description. - #[serde(rename = "description", skip_serializing_if = "Option::is_none")] - pub description: Option, - /// Service build time. - #[serde(rename = "build_time", skip_serializing_if = "Option::is_none")] - pub build_time: Option, - /// Service instance ID. - #[serde(rename = "instance_id", skip_serializing_if = "Option::is_none")] - pub instance_id: Option, -} - -impl HealthInfo { - pub fn new() -> HealthInfo { - HealthInfo { - status: None, - version: None, - commit: None, - description: None, - build_time: None, - instance_id: None, - } - } -} -/// Service status. -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum Status { - #[serde(rename = "pass")] - Pass, -} - -impl Default for Status { - fn default() -> Status { - Self::Pass - } -} - diff --git a/notifiers/src/models/mod.rs b/notifiers/src/models/mod.rs deleted file mode 100644 index 472ad3e6..00000000 --- a/notifiers/src/models/mod.rs +++ /dev/null @@ -1,8 +0,0 @@ -pub mod create_subscription; -pub use self::create_subscription::CreateSubscription; -pub mod health_info; -pub use self::health_info::HealthInfo; -pub mod page; -pub use self::page::Page; -pub mod subscription; -pub use self::subscription::Subscription; diff --git a/provision/.gitignore b/provision/.gitignore deleted file mode 100644 index 6aa10640..00000000 --- a/provision/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/target/ -**/*.rs.bk -Cargo.lock diff --git a/provision/.openapi-generator-ignore b/provision/.openapi-generator-ignore deleted file mode 100644 index 7484ee59..00000000 --- a/provision/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/provision/.openapi-generator/FILES b/provision/.openapi-generator/FILES deleted file mode 100644 index 36a29ce0..00000000 --- a/provision/.openapi-generator/FILES +++ /dev/null @@ -1,18 +0,0 @@ -.gitignore -.openapi-generator-ignore -.travis.yml -Cargo.toml -README.md -docs/DomainIdMappingPostRequest.md -docs/HealthApi.md -docs/HealthInfo.md -docs/ProvisionApi.md -git_push.sh -src/apis/configuration.rs -src/apis/health_api.rs -src/apis/mod.rs -src/apis/provision_api.rs -src/lib.rs -src/models/__domain_id__mapping_post_request.rs -src/models/health_info.rs -src/models/mod.rs diff --git a/provision/.openapi-generator/VERSION b/provision/.openapi-generator/VERSION deleted file mode 100644 index 758bb9c8..00000000 --- a/provision/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -7.10.0 diff --git a/provision/.travis.yml b/provision/.travis.yml deleted file mode 100644 index 22761ba7..00000000 --- a/provision/.travis.yml +++ /dev/null @@ -1 +0,0 @@ -language: rust diff --git a/provision/Cargo.toml b/provision/Cargo.toml deleted file mode 100644 index 5417f635..00000000 --- a/provision/Cargo.toml +++ /dev/null @@ -1,15 +0,0 @@ -[package] -name = "Provision" -version = "0.15.1" -authors = ["info@abstracmachines.fr"] -description = "HTTP API for Provision service Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) " -license = "Apache 2.0" -edition = "2021" - -[dependencies] -serde = { version = "^1.0", features = ["derive"] } -serde_json = "^1.0" -serde_repr = "^0.1" -url = "^2.5" -uuid = { version = "^1.8", features = ["serde", "v4"] } -reqwest = { version = "^0.12", features = ["json", "multipart"] } diff --git a/provision/README.md b/provision/README.md deleted file mode 100644 index 98116e97..00000000 --- a/provision/README.md +++ /dev/null @@ -1,52 +0,0 @@ -# Rust API client for openapi - -HTTP API for Provision service -Some useful links: -- [The SuperMQ repository](https://github.com/absmach/supermq) - - - -## Overview - -This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://openapis.org) from a remote server, you can easily generate an API client. - -- API version: 0.15.1 -- Package version: 0.15.1 -- Generator version: 7.10.0 -- Build package: `org.openapitools.codegen.languages.RustClientCodegen` - -## Installation - -Put the package under your project folder in a directory named `openapi` and add the following to `Cargo.toml` under `[dependencies]`: - -``` -openapi = { path = "./openapi" } -``` - -## Documentation for API Endpoints - -All URIs are relative to *http://localhost:9016* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*HealthApi* | [**health_get**](docs/HealthApi.md#health_get) | **GET** /health | Retrieves service health check info. -*ProvisionApi* | [**domain_id_mapping_get**](docs/ProvisionApi.md#domain_id_mapping_get) | **GET** /{domainID}/mapping | Gets current mapping. -*ProvisionApi* | [**domain_id_mapping_post**](docs/ProvisionApi.md#domain_id_mapping_post) | **POST** /{domainID}/mapping | Adds new device to proxy - - -## Documentation For Models - - - [DomainIdMappingPostRequest](docs/DomainIdMappingPostRequest.md) - - [HealthInfo](docs/HealthInfo.md) - - -To get access to the crate's generated documentation, use: - -``` -cargo doc --open -``` - -## Author - -info@abstracmachines.fr - diff --git a/provision/docs/DomainIdMappingPostRequest.md b/provision/docs/DomainIdMappingPostRequest.md deleted file mode 100644 index 371cfbcf..00000000 --- a/provision/docs/DomainIdMappingPostRequest.md +++ /dev/null @@ -1,13 +0,0 @@ -# DomainIdMappingPostRequest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**external_id** | **String** | | -**external_key** | **String** | | -**name** | Option<**String**> | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/provision/docs/HealthApi.md b/provision/docs/HealthApi.md deleted file mode 100644 index 7ddea58f..00000000 --- a/provision/docs/HealthApi.md +++ /dev/null @@ -1,34 +0,0 @@ -# \HealthApi - -All URIs are relative to *http://localhost:9016* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**health_get**](HealthApi.md#health_get) | **GET** /health | Retrieves service health check info. - - - -## health_get - -> models::HealthInfo health_get() -Retrieves service health check info. - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -[**models::HealthInfo**](health_info.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/health+json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/provision/docs/HealthInfo.md b/provision/docs/HealthInfo.md deleted file mode 100644 index ee8f5c6b..00000000 --- a/provision/docs/HealthInfo.md +++ /dev/null @@ -1,16 +0,0 @@ -# HealthInfo - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | Option<**String**> | Service status. | [optional] -**version** | Option<**String**> | Service version. | [optional] -**commit** | Option<**String**> | Service commit hash. | [optional] -**description** | Option<**String**> | Service description. | [optional] -**build_time** | Option<**String**> | Service build time. | [optional] -**instance_id** | Option<**String**> | Service instance ID. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/provision/docs/ProvisionApi.md b/provision/docs/ProvisionApi.md deleted file mode 100644 index 542e854a..00000000 --- a/provision/docs/ProvisionApi.md +++ /dev/null @@ -1,71 +0,0 @@ -# \ProvisionApi - -All URIs are relative to *http://localhost:9016* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**domain_id_mapping_get**](ProvisionApi.md#domain_id_mapping_get) | **GET** /{domainID}/mapping | Gets current mapping. -[**domain_id_mapping_post**](ProvisionApi.md#domain_id_mapping_post) | **POST** /{domainID}/mapping | Adds new device to proxy - - - -## domain_id_mapping_get - -> serde_json::Value domain_id_mapping_get(domain_id) -Gets current mapping. - -Gets current mapping. This can be used in UI so that when bootstrap config is created from UI matches configuration created with provision service. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | - -### Return type - -[**serde_json::Value**](serde_json::Value.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## domain_id_mapping_post - -> domain_id_mapping_post(domain_id, domain_id_mapping_post_request) -Adds new device to proxy - -Adds new device to proxy - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**domain_id_mapping_post_request** | Option<[**DomainIdMappingPostRequest**](DomainIdMappingPostRequest.md)> | MAC address of device or other identifier | | - -### Return type - - (empty response body) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/provision/git_push.sh b/provision/git_push.sh deleted file mode 100644 index f53a75d4..00000000 --- a/provision/git_push.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 -git_host=$4 - -if [ "$git_host" = "" ]; then - git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" -fi - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' diff --git a/provision/src/apis/configuration.rs b/provision/src/apis/configuration.rs deleted file mode 100644 index 58fa91ec..00000000 --- a/provision/src/apis/configuration.rs +++ /dev/null @@ -1,51 +0,0 @@ -/* - * SuperMQ Provision service - * - * HTTP API for Provision service Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstracmachines.fr - * Generated by: https://openapi-generator.tech - */ - - - -#[derive(Debug, Clone)] -pub struct Configuration { - pub base_path: String, - pub user_agent: Option, - pub client: reqwest::Client, - pub basic_auth: Option, - pub oauth_access_token: Option, - pub bearer_access_token: Option, - pub api_key: Option, -} - -pub type BasicAuth = (String, Option); - -#[derive(Debug, Clone)] -pub struct ApiKey { - pub prefix: Option, - pub key: String, -} - - -impl Configuration { - pub fn new() -> Configuration { - Configuration::default() - } -} - -impl Default for Configuration { - fn default() -> Self { - Configuration { - base_path: "http://localhost:9016".to_owned(), - user_agent: Some("OpenAPI-Generator/0.15.1/rust".to_owned()), - client: reqwest::Client::new(), - basic_auth: None, - oauth_access_token: None, - bearer_access_token: None, - api_key: None, - } - } -} diff --git a/provision/src/apis/health_api.rs b/provision/src/apis/health_api.rs deleted file mode 100644 index 856055db..00000000 --- a/provision/src/apis/health_api.rs +++ /dev/null @@ -1,53 +0,0 @@ -/* - * SuperMQ Provision service - * - * HTTP API for Provision service Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstracmachines.fr - * Generated by: https://openapi-generator.tech - */ - - -use reqwest; -use serde::{Deserialize, Serialize}; -use crate::{apis::ResponseContent, models}; -use super::{Error, configuration}; - - -/// struct for typed errors of method [`health_get`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum HealthGetError { - Status500(), - UnknownValue(serde_json::Value), -} - - -pub async fn health_get(configuration: &configuration::Configuration, ) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/health", local_var_configuration.base_path); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - diff --git a/provision/src/apis/mod.rs b/provision/src/apis/mod.rs deleted file mode 100644 index aae57a13..00000000 --- a/provision/src/apis/mod.rs +++ /dev/null @@ -1,96 +0,0 @@ -use std::error; -use std::fmt; - -#[derive(Debug, Clone)] -pub struct ResponseContent { - pub status: reqwest::StatusCode, - pub content: String, - pub entity: Option, -} - -#[derive(Debug)] -pub enum Error { - Reqwest(reqwest::Error), - Serde(serde_json::Error), - Io(std::io::Error), - ResponseError(ResponseContent), -} - -impl fmt::Display for Error { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - let (module, e) = match self { - Error::Reqwest(e) => ("reqwest", e.to_string()), - Error::Serde(e) => ("serde", e.to_string()), - Error::Io(e) => ("IO", e.to_string()), - Error::ResponseError(e) => ("response", format!("status code {}", e.status)), - }; - write!(f, "error in {}: {}", module, e) - } -} - -impl error::Error for Error { - fn source(&self) -> Option<&(dyn error::Error + 'static)> { - Some(match self { - Error::Reqwest(e) => e, - Error::Serde(e) => e, - Error::Io(e) => e, - Error::ResponseError(_) => return None, - }) - } -} - -impl From for Error { - fn from(e: reqwest::Error) -> Self { - Error::Reqwest(e) - } -} - -impl From for Error { - fn from(e: serde_json::Error) -> Self { - Error::Serde(e) - } -} - -impl From for Error { - fn from(e: std::io::Error) -> Self { - Error::Io(e) - } -} - -pub fn urlencode>(s: T) -> String { - ::url::form_urlencoded::byte_serialize(s.as_ref().as_bytes()).collect() -} - -pub fn parse_deep_object(prefix: &str, value: &serde_json::Value) -> Vec<(String, String)> { - if let serde_json::Value::Object(object) = value { - let mut params = vec![]; - - for (key, value) in object { - match value { - serde_json::Value::Object(_) => params.append(&mut parse_deep_object( - &format!("{}[{}]", prefix, key), - value, - )), - serde_json::Value::Array(array) => { - for (i, value) in array.iter().enumerate() { - params.append(&mut parse_deep_object( - &format!("{}[{}][{}]", prefix, key, i), - value, - )); - } - }, - serde_json::Value::String(s) => params.push((format!("{}[{}]", prefix, key), s.clone())), - _ => params.push((format!("{}[{}]", prefix, key), value.to_string())), - } - } - - return params; - } - - unimplemented!("Only objects are supported with style=deepObject") -} - -pub mod health_api; -pub mod provision_api; - -pub mod configuration; diff --git a/provision/src/lib.rs b/provision/src/lib.rs deleted file mode 100644 index e1520628..00000000 --- a/provision/src/lib.rs +++ /dev/null @@ -1,11 +0,0 @@ -#![allow(unused_imports)] -#![allow(clippy::too_many_arguments)] - -extern crate serde_repr; -extern crate serde; -extern crate serde_json; -extern crate url; -extern crate reqwest; - -pub mod apis; -pub mod models; diff --git a/provision/src/models/health_info.rs b/provision/src/models/health_info.rs deleted file mode 100644 index 5f4696f8..00000000 --- a/provision/src/models/health_info.rs +++ /dev/null @@ -1,60 +0,0 @@ -/* - * SuperMQ Provision service - * - * HTTP API for Provision service Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstracmachines.fr - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct HealthInfo { - /// Service status. - #[serde(rename = "status", skip_serializing_if = "Option::is_none")] - pub status: Option, - /// Service version. - #[serde(rename = "version", skip_serializing_if = "Option::is_none")] - pub version: Option, - /// Service commit hash. - #[serde(rename = "commit", skip_serializing_if = "Option::is_none")] - pub commit: Option, - /// Service description. - #[serde(rename = "description", skip_serializing_if = "Option::is_none")] - pub description: Option, - /// Service build time. - #[serde(rename = "build_time", skip_serializing_if = "Option::is_none")] - pub build_time: Option, - /// Service instance ID. - #[serde(rename = "instance_id", skip_serializing_if = "Option::is_none")] - pub instance_id: Option, -} - -impl HealthInfo { - pub fn new() -> HealthInfo { - HealthInfo { - status: None, - version: None, - commit: None, - description: None, - build_time: None, - instance_id: None, - } - } -} -/// Service status. -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum Status { - #[serde(rename = "pass")] - Pass, -} - -impl Default for Status { - fn default() -> Status { - Self::Pass - } -} - diff --git a/provision/src/models/mod.rs b/provision/src/models/mod.rs deleted file mode 100644 index 35ca68ba..00000000 --- a/provision/src/models/mod.rs +++ /dev/null @@ -1,4 +0,0 @@ -pub mod __domain_id__mapping_post_request; -pub use self::__domain_id__mapping_post_request::DomainIdMappingPostRequest; -pub mod health_info; -pub use self::health_info::HealthInfo; diff --git a/readers/.gitignore b/readers/.gitignore deleted file mode 100644 index 6aa10640..00000000 --- a/readers/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/target/ -**/*.rs.bk -Cargo.lock diff --git a/readers/.openapi-generator-ignore b/readers/.openapi-generator-ignore deleted file mode 100644 index 7484ee59..00000000 --- a/readers/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/readers/.openapi-generator/FILES b/readers/.openapi-generator/FILES deleted file mode 100644 index f7dee6cc..00000000 --- a/readers/.openapi-generator/FILES +++ /dev/null @@ -1,20 +0,0 @@ -.gitignore -.openapi-generator-ignore -.travis.yml -Cargo.toml -README.md -docs/HealthApi.md -docs/HealthInfo.md -docs/MessagesPage.md -docs/MessagesPageMessagesInner.md -docs/ReadersApi.md -git_push.sh -src/apis/configuration.rs -src/apis/health_api.rs -src/apis/mod.rs -src/apis/readers_api.rs -src/lib.rs -src/models/health_info.rs -src/models/messages_page.rs -src/models/messages_page_messages_inner.rs -src/models/mod.rs diff --git a/readers/.openapi-generator/VERSION b/readers/.openapi-generator/VERSION deleted file mode 100644 index 758bb9c8..00000000 --- a/readers/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -7.10.0 diff --git a/readers/.travis.yml b/readers/.travis.yml deleted file mode 100644 index 22761ba7..00000000 --- a/readers/.travis.yml +++ /dev/null @@ -1 +0,0 @@ -language: rust diff --git a/readers/Cargo.toml b/readers/Cargo.toml deleted file mode 100644 index d16f9f4a..00000000 --- a/readers/Cargo.toml +++ /dev/null @@ -1,15 +0,0 @@ -[package] -name = "Readers" -version = "0.15.1" -authors = ["info@abstractmachines.fr"] -description = "HTTP API for reading messages. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) " -license = "Apache 2.0" -edition = "2021" - -[dependencies] -serde = { version = "^1.0", features = ["derive"] } -serde_json = "^1.0" -serde_repr = "^0.1" -url = "^2.5" -uuid = { version = "^1.8", features = ["serde", "v4"] } -reqwest = { version = "^0.12", features = ["json", "multipart"] } diff --git a/readers/README.md b/readers/README.md deleted file mode 100644 index f80dd1b8..00000000 --- a/readers/README.md +++ /dev/null @@ -1,52 +0,0 @@ -# Rust API client for openapi - -HTTP API for reading messages. -Some useful links: -- [The SuperMQ repository](https://github.com/absmach/supermq) - - - -## Overview - -This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://openapis.org) from a remote server, you can easily generate an API client. - -- API version: 0.15.1 -- Package version: 0.15.1 -- Generator version: 7.10.0 -- Build package: `org.openapitools.codegen.languages.RustClientCodegen` - -## Installation - -Put the package under your project folder in a directory named `openapi` and add the following to `Cargo.toml` under `[dependencies]`: - -``` -openapi = { path = "./openapi" } -``` - -## Documentation for API Endpoints - -All URIs are relative to *http://localhost:9003* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*HealthApi* | [**health**](docs/HealthApi.md#health) | **GET** /health | Retrieves service health check info. -*ReadersApi* | [**get_messages**](docs/ReadersApi.md#get_messages) | **GET** /channels/{chanId}/messages | Retrieves messages sent to single channel - - -## Documentation For Models - - - [HealthInfo](docs/HealthInfo.md) - - [MessagesPage](docs/MessagesPage.md) - - [MessagesPageMessagesInner](docs/MessagesPageMessagesInner.md) - - -To get access to the crate's generated documentation, use: - -``` -cargo doc --open -``` - -## Author - -info@abstractmachines.fr - diff --git a/readers/docs/HealthApi.md b/readers/docs/HealthApi.md deleted file mode 100644 index cc4f54de..00000000 --- a/readers/docs/HealthApi.md +++ /dev/null @@ -1,34 +0,0 @@ -# \HealthApi - -All URIs are relative to *http://localhost:9003* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**health**](HealthApi.md#health) | **GET** /health | Retrieves service health check info. - - - -## health - -> models::HealthInfo health() -Retrieves service health check info. - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -[**models::HealthInfo**](health_info.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/health+json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/readers/docs/HealthInfo.md b/readers/docs/HealthInfo.md deleted file mode 100644 index ee8f5c6b..00000000 --- a/readers/docs/HealthInfo.md +++ /dev/null @@ -1,16 +0,0 @@ -# HealthInfo - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | Option<**String**> | Service status. | [optional] -**version** | Option<**String**> | Service version. | [optional] -**commit** | Option<**String**> | Service commit hash. | [optional] -**description** | Option<**String**> | Service description. | [optional] -**build_time** | Option<**String**> | Service build time. | [optional] -**instance_id** | Option<**String**> | Service instance ID. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/readers/docs/MessagesPage.md b/readers/docs/MessagesPage.md deleted file mode 100644 index fce2bbd8..00000000 --- a/readers/docs/MessagesPage.md +++ /dev/null @@ -1,14 +0,0 @@ -# MessagesPage - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**total** | Option<**f64**> | Total number of items that are present on the system. | [optional] -**offset** | Option<**f64**> | Number of items that were skipped during retrieval. | [optional] -**limit** | Option<**f64**> | Size of the subset that was retrieved. | [optional] -**messages** | Option<[**Vec**](MessagesPage_messages_inner.md)> | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/readers/docs/MessagesPageMessagesInner.md b/readers/docs/MessagesPageMessagesInner.md deleted file mode 100644 index 586ed1f7..00000000 --- a/readers/docs/MessagesPageMessagesInner.md +++ /dev/null @@ -1,22 +0,0 @@ -# MessagesPageMessagesInner - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**channel** | Option<**i32**> | Unique channel id. | [optional] -**publisher** | Option<**i32**> | Unique publisher id. | [optional] -**protocol** | Option<**String**> | Protocol name. | [optional] -**name** | Option<**String**> | Measured parameter name. | [optional] -**unit** | Option<**String**> | Value unit. | [optional] -**value** | Option<**f64**> | Measured value in number. | [optional] -**string_value** | Option<**String**> | Measured value in string format. | [optional] -**bool_value** | Option<**bool**> | Measured value in boolean format. | [optional] -**data_value** | Option<**String**> | Measured value in binary format. | [optional] -**value_sum** | Option<**f64**> | Sum value. | [optional] -**time** | Option<**f64**> | Time of measurement. | [optional] -**update_time** | Option<**f64**> | Time of updating measurement. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/readers/docs/ReadersApi.md b/readers/docs/ReadersApi.md deleted file mode 100644 index a1f7e7f4..00000000 --- a/readers/docs/ReadersApi.md +++ /dev/null @@ -1,51 +0,0 @@ -# \ReadersApi - -All URIs are relative to *http://localhost:9003* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**get_messages**](ReadersApi.md#get_messages) | **GET** /channels/{chanId}/messages | Retrieves messages sent to single channel - - - -## get_messages - -> models::MessagesPage get_messages(chan_id, limit, offset, publisher, name, v, vb, vs, vd, from, to, aggregation, interval) -Retrieves messages sent to single channel - -Retrieves a list of messages sent to specific channel. Due to performance concerns, data is retrieved in subsets. The API readers must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**chan_id** | **uuid::Uuid** | Unique channel identifier. | [required] | -**limit** | Option<**i32**> | Size of the subset to retrieve. | |[default to 10] -**offset** | Option<**i32**> | Number of items to skip during retrieval. | |[default to 0] -**publisher** | Option<**uuid::Uuid**> | Unique client identifier. | | -**name** | Option<**String**> | SenML message name. | | -**v** | Option<**String**> | SenML message value. | | -**vb** | Option<**bool**> | SenML message bool value. | | -**vs** | Option<**String**> | SenML message string value. | | -**vd** | Option<**String**> | SenML message data value. | | -**from** | Option<**f64**> | SenML message time in nanoseconds (integer part represents seconds). | | -**to** | Option<**f64**> | SenML message time in nanoseconds (integer part represents seconds). | | -**aggregation** | Option<**String**> | Aggregation function. | | -**interval** | Option<**String**> | Aggregation interval. | | - -### Return type - -[**models::MessagesPage**](MessagesPage.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth), [clientAuth](../README.md#clientAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/readers/git_push.sh b/readers/git_push.sh deleted file mode 100644 index f53a75d4..00000000 --- a/readers/git_push.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 -git_host=$4 - -if [ "$git_host" = "" ]; then - git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" -fi - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' diff --git a/readers/src/apis/configuration.rs b/readers/src/apis/configuration.rs deleted file mode 100644 index 2f4ee109..00000000 --- a/readers/src/apis/configuration.rs +++ /dev/null @@ -1,51 +0,0 @@ -/* - * SuperMQ reader service - * - * HTTP API for reading messages. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - - - -#[derive(Debug, Clone)] -pub struct Configuration { - pub base_path: String, - pub user_agent: Option, - pub client: reqwest::Client, - pub basic_auth: Option, - pub oauth_access_token: Option, - pub bearer_access_token: Option, - pub api_key: Option, -} - -pub type BasicAuth = (String, Option); - -#[derive(Debug, Clone)] -pub struct ApiKey { - pub prefix: Option, - pub key: String, -} - - -impl Configuration { - pub fn new() -> Configuration { - Configuration::default() - } -} - -impl Default for Configuration { - fn default() -> Self { - Configuration { - base_path: "http://localhost:9003".to_owned(), - user_agent: Some("OpenAPI-Generator/0.15.1/rust".to_owned()), - client: reqwest::Client::new(), - basic_auth: None, - oauth_access_token: None, - bearer_access_token: None, - api_key: None, - } - } -} diff --git a/readers/src/apis/health_api.rs b/readers/src/apis/health_api.rs deleted file mode 100644 index b087ca74..00000000 --- a/readers/src/apis/health_api.rs +++ /dev/null @@ -1,53 +0,0 @@ -/* - * SuperMQ reader service - * - * HTTP API for reading messages. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - - -use reqwest; -use serde::{Deserialize, Serialize}; -use crate::{apis::ResponseContent, models}; -use super::{Error, configuration}; - - -/// struct for typed errors of method [`health`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum HealthError { - Status500(), - UnknownValue(serde_json::Value), -} - - -pub async fn health(configuration: &configuration::Configuration, ) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/health", local_var_configuration.base_path); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - diff --git a/readers/src/apis/mod.rs b/readers/src/apis/mod.rs deleted file mode 100644 index 46a1b23b..00000000 --- a/readers/src/apis/mod.rs +++ /dev/null @@ -1,96 +0,0 @@ -use std::error; -use std::fmt; - -#[derive(Debug, Clone)] -pub struct ResponseContent { - pub status: reqwest::StatusCode, - pub content: String, - pub entity: Option, -} - -#[derive(Debug)] -pub enum Error { - Reqwest(reqwest::Error), - Serde(serde_json::Error), - Io(std::io::Error), - ResponseError(ResponseContent), -} - -impl fmt::Display for Error { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - let (module, e) = match self { - Error::Reqwest(e) => ("reqwest", e.to_string()), - Error::Serde(e) => ("serde", e.to_string()), - Error::Io(e) => ("IO", e.to_string()), - Error::ResponseError(e) => ("response", format!("status code {}", e.status)), - }; - write!(f, "error in {}: {}", module, e) - } -} - -impl error::Error for Error { - fn source(&self) -> Option<&(dyn error::Error + 'static)> { - Some(match self { - Error::Reqwest(e) => e, - Error::Serde(e) => e, - Error::Io(e) => e, - Error::ResponseError(_) => return None, - }) - } -} - -impl From for Error { - fn from(e: reqwest::Error) -> Self { - Error::Reqwest(e) - } -} - -impl From for Error { - fn from(e: serde_json::Error) -> Self { - Error::Serde(e) - } -} - -impl From for Error { - fn from(e: std::io::Error) -> Self { - Error::Io(e) - } -} - -pub fn urlencode>(s: T) -> String { - ::url::form_urlencoded::byte_serialize(s.as_ref().as_bytes()).collect() -} - -pub fn parse_deep_object(prefix: &str, value: &serde_json::Value) -> Vec<(String, String)> { - if let serde_json::Value::Object(object) = value { - let mut params = vec![]; - - for (key, value) in object { - match value { - serde_json::Value::Object(_) => params.append(&mut parse_deep_object( - &format!("{}[{}]", prefix, key), - value, - )), - serde_json::Value::Array(array) => { - for (i, value) in array.iter().enumerate() { - params.append(&mut parse_deep_object( - &format!("{}[{}][{}]", prefix, key, i), - value, - )); - } - }, - serde_json::Value::String(s) => params.push((format!("{}[{}]", prefix, key), s.clone())), - _ => params.push((format!("{}[{}]", prefix, key), value.to_string())), - } - } - - return params; - } - - unimplemented!("Only objects are supported with style=deepObject") -} - -pub mod health_api; -pub mod readers_api; - -pub mod configuration; diff --git a/readers/src/lib.rs b/readers/src/lib.rs deleted file mode 100644 index e1520628..00000000 --- a/readers/src/lib.rs +++ /dev/null @@ -1,11 +0,0 @@ -#![allow(unused_imports)] -#![allow(clippy::too_many_arguments)] - -extern crate serde_repr; -extern crate serde; -extern crate serde_json; -extern crate url; -extern crate reqwest; - -pub mod apis; -pub mod models; diff --git a/readers/src/models/health_info.rs b/readers/src/models/health_info.rs deleted file mode 100644 index 82d29f72..00000000 --- a/readers/src/models/health_info.rs +++ /dev/null @@ -1,60 +0,0 @@ -/* - * SuperMQ reader service - * - * HTTP API for reading messages. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct HealthInfo { - /// Service status. - #[serde(rename = "status", skip_serializing_if = "Option::is_none")] - pub status: Option, - /// Service version. - #[serde(rename = "version", skip_serializing_if = "Option::is_none")] - pub version: Option, - /// Service commit hash. - #[serde(rename = "commit", skip_serializing_if = "Option::is_none")] - pub commit: Option, - /// Service description. - #[serde(rename = "description", skip_serializing_if = "Option::is_none")] - pub description: Option, - /// Service build time. - #[serde(rename = "build_time", skip_serializing_if = "Option::is_none")] - pub build_time: Option, - /// Service instance ID. - #[serde(rename = "instance_id", skip_serializing_if = "Option::is_none")] - pub instance_id: Option, -} - -impl HealthInfo { - pub fn new() -> HealthInfo { - HealthInfo { - status: None, - version: None, - commit: None, - description: None, - build_time: None, - instance_id: None, - } - } -} -/// Service status. -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum Status { - #[serde(rename = "pass")] - Pass, -} - -impl Default for Status { - fn default() -> Status { - Self::Pass - } -} - diff --git a/readers/src/models/mod.rs b/readers/src/models/mod.rs deleted file mode 100644 index cf7bb986..00000000 --- a/readers/src/models/mod.rs +++ /dev/null @@ -1,6 +0,0 @@ -pub mod health_info; -pub use self::health_info::HealthInfo; -pub mod messages_page; -pub use self::messages_page::MessagesPage; -pub mod messages_page_messages_inner; -pub use self::messages_page_messages_inner::MessagesPageMessagesInner; diff --git a/certs/src/apis/certs_api.rs b/src/apis/certs_api.rs similarity index 61% rename from certs/src/apis/certs_api.rs rename to src/apis/certs_api.rs index bddd4701..25383fce 100644 --- a/certs/src/apis/certs_api.rs +++ b/src/apis/certs_api.rs @@ -1,7 +1,7 @@ /* - * SuperMQ Certs service + * SuperMQ Combined Service * - * HTTP API for Certs service Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr @@ -10,8 +10,8 @@ use reqwest; -use serde::{Deserialize, Serialize}; -use crate::{apis::ResponseContent, models}; + +use crate::apis::ResponseContent; use super::{Error, configuration}; @@ -24,7 +24,7 @@ pub enum CreateCertError { Status403(), Status415(), Status422(), - Status500(), + Status500(crate::models::Error), UnknownValue(serde_json::Value), } @@ -37,7 +37,7 @@ pub enum GetCertError { Status403(), Status404(), Status422(), - Status500(), + Status500(crate::models::Error), UnknownValue(serde_json::Value), } @@ -50,7 +50,15 @@ pub enum GetSerialsError { Status403(), Status404(), Status422(), - Status500(), + Status500(crate::models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`health_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum HealthGetError { + Status500(crate::models::Error), UnknownValue(serde_json::Value), } @@ -63,13 +71,13 @@ pub enum RevokeCertError { Status403(), Status404(), Status422(), - Status500(), + Status500(crate::models::Error), UnknownValue(serde_json::Value), } /// Creates a certificate for client -pub async fn create_cert(configuration: &configuration::Configuration, domain_id: &str, create_cert_request: Option) -> Result<(), Error> { +pub async fn create_cert(configuration: &configuration::Configuration, domain_id: &str, create_cert_request: Option) -> Result<(), Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -83,6 +91,15 @@ pub async fn create_cert(configuration: &configuration::Configuration, domain_id if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; local_var_req_builder = local_var_req_builder.json(&create_cert_request); let local_var_req = local_var_req_builder.build()?; @@ -101,7 +118,7 @@ pub async fn create_cert(configuration: &configuration::Configuration, domain_id } /// Retrieves a certificate for a given cert ID. -pub async fn get_cert(configuration: &configuration::Configuration, domain_id: &str, cert_id: &str) -> Result> { +pub async fn get_cert(configuration: &configuration::Configuration, domain_id: &str, cert_id: &str) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -115,6 +132,15 @@ pub async fn get_cert(configuration: &configuration::Configuration, domain_id: & if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; let local_var_req = local_var_req_builder.build()?; let local_var_resp = local_var_client.execute(local_var_req).await?; @@ -132,7 +158,7 @@ pub async fn get_cert(configuration: &configuration::Configuration, domain_id: & } /// Retrieves a list of certificates' serial IDs for a given client ID. -pub async fn get_serials(configuration: &configuration::Configuration, domain_id: &str, client_id: &str) -> Result> { +pub async fn get_serials(configuration: &configuration::Configuration, domain_id: &str, client_id: &str) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -146,6 +172,15 @@ pub async fn get_serials(configuration: &configuration::Configuration, domain_id if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; let local_var_req = local_var_req_builder.build()?; let local_var_resp = local_var_client.execute(local_var_req).await?; @@ -162,8 +197,35 @@ pub async fn get_serials(configuration: &configuration::Configuration, domain_id } } +pub async fn health_get(configuration: &configuration::Configuration, ) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/health", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + /// Revokes a certificate for a given cert ID. -pub async fn revoke_cert(configuration: &configuration::Configuration, domain_id: &str, cert_id: &str) -> Result> { +pub async fn revoke_cert(configuration: &configuration::Configuration, domain_id: &str, cert_id: &str) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -177,6 +239,15 @@ pub async fn revoke_cert(configuration: &configuration::Configuration, domain_id if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; let local_var_req = local_var_req_builder.build()?; let local_var_resp = local_var_client.execute(local_var_req).await?; diff --git a/channels/src/apis/channels_api.rs b/src/apis/channels_api.rs similarity index 63% rename from channels/src/apis/channels_api.rs rename to src/apis/channels_api.rs index fe176d3a..9ffc1699 100644 --- a/channels/src/apis/channels_api.rs +++ b/src/apis/channels_api.rs @@ -1,7 +1,7 @@ /* - * SuperMQ Channels Service + * SuperMQ Combined Service * - * This is the Channels Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform channels. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr @@ -10,11 +10,39 @@ use reqwest; -use serde::{Deserialize, Serialize}; -use crate::{apis::ResponseContent, models}; + +use crate::apis::ResponseContent; use super::{Error, configuration}; +/// struct for typed errors of method [`connect_clients_and_channels`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ConnectClientsAndChannelsError { + Status400(), + Status401(), + Status403(), + Status404(), + Status409(), + Status415(), + Status422(), + Status500(crate::models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`connect_clients_to_channel`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ConnectClientsToChannelError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(crate::models::Error), + UnknownValue(serde_json::Value), +} + /// struct for typed errors of method [`create_channel`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -26,7 +54,7 @@ pub enum CreateChannelError { Status409(), Status415(), Status422(), - Status500(models::Error), + Status500(crate::models::Error), UnknownValue(serde_json::Value), } @@ -41,7 +69,7 @@ pub enum CreateChannelsError { Status409(), Status415(), Status422(), - Status500(models::Error), + Status500(crate::models::Error), UnknownValue(serde_json::Value), } @@ -55,7 +83,35 @@ pub enum DisableChannelError { Status404(), Status409(), Status422(), - Status500(models::Error), + Status500(crate::models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`disconnect_clients_and_channels`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DisconnectClientsAndChannelsError { + Status400(), + Status401(), + Status403(), + Status404(), + Status409(), + Status415(), + Status422(), + Status500(crate::models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`disconnect_clients_from_channel`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DisconnectClientsFromChannelError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(crate::models::Error), UnknownValue(serde_json::Value), } @@ -67,7 +123,7 @@ pub enum DomainIdChannelsChanIdDeleteError { Status401(), Status403(), Status404(), - Status500(models::Error), + Status500(crate::models::Error), UnknownValue(serde_json::Value), } @@ -81,7 +137,7 @@ pub enum EnableChannelError { Status404(), Status409(), Status422(), - Status500(models::Error), + Status500(crate::models::Error), UnknownValue(serde_json::Value), } @@ -94,7 +150,7 @@ pub enum GetChannelError { Status403(), Status404(), Status422(), - Status500(models::Error), + Status500(crate::models::Error), UnknownValue(serde_json::Value), } @@ -107,7 +163,7 @@ pub enum ListChannelsError { Status403(), Status404(), Status422(), - Status500(models::Error), + Status500(crate::models::Error), UnknownValue(serde_json::Value), } @@ -120,7 +176,7 @@ pub enum RemoveChannelParentGroupError { Status403(), Status404(), Status422(), - Status500(models::Error), + Status500(crate::models::Error), UnknownValue(serde_json::Value), } @@ -133,7 +189,7 @@ pub enum SetChannelParentGroupError { Status403(), Status404(), Status422(), - Status500(models::Error), + Status500(crate::models::Error), UnknownValue(serde_json::Value), } @@ -148,7 +204,7 @@ pub enum UpdateChannelError { Status409(), Status415(), Status422(), - Status500(models::Error), + Status500(crate::models::Error), UnknownValue(serde_json::Value), } @@ -163,13 +219,95 @@ pub enum UpdateChannelTagsError { Status409(), Status415(), Status422(), - Status500(models::Error), + Status500(crate::models::Error), UnknownValue(serde_json::Value), } +/// Connect clients specified by IDs to channels specified by IDs. Channel and client are owned by user identified using the provided access token. +pub async fn connect_clients_and_channels(configuration: &configuration::Configuration, domain_id: &str, connection_req_schema: crate::models::ConnectionReqSchema) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/channels/connect", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&connection_req_schema); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Connects clients to a channel that is identified by the channel ID. +pub async fn connect_clients_to_channel(configuration: &configuration::Configuration, domain_id: &str, chan_id: &str, channel_connection_req_schema: crate::models::ChannelConnectionReqSchema) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/channels/{chanID}/connect", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), chanID=crate::apis::urlencode(chan_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&channel_connection_req_schema); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + /// Creates new channel in domain. -pub async fn create_channel(configuration: &configuration::Configuration, domain_id: &str, channel_req_obj: models::ChannelReqObj) -> Result> { +pub async fn create_channel(configuration: &configuration::Configuration, domain_id: &str, channel_req_obj: crate::models::ChannelReqObj) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -201,7 +339,7 @@ pub async fn create_channel(configuration: &configuration::Configuration, domain } /// Creates new channels in domain. -pub async fn create_channels(configuration: &configuration::Configuration, domain_id: &str, channel_req_obj: Vec) -> Result, Error> { +pub async fn create_channels(configuration: &configuration::Configuration, domain_id: &str, channel_req_obj: Vec) -> Result, Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -233,7 +371,7 @@ pub async fn create_channels(configuration: &configuration::Configuration, domai } /// Disables a specific channel that is identified by the channel ID. -pub async fn disable_channel(configuration: &configuration::Configuration, domain_id: &str, chan_id: &str) -> Result> { +pub async fn disable_channel(configuration: &configuration::Configuration, domain_id: &str, chan_id: &str) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -263,6 +401,88 @@ pub async fn disable_channel(configuration: &configuration::Configuration, domai } } +/// Disconnect clients specified by IDs from channels specified by IDs. Channel and client are owned by user identified using the provided access token. +pub async fn disconnect_clients_and_channels(configuration: &configuration::Configuration, domain_id: &str, connection_req_schema: crate::models::ConnectionReqSchema) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/channels/disconnect", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&connection_req_schema); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Disconnects clients to a channel that is identified by the channel ID. +pub async fn disconnect_clients_from_channel(configuration: &configuration::Configuration, domain_id: &str, chan_id: &str, channel_connection_req_schema: crate::models::ChannelConnectionReqSchema) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/channels/{chanID}/disconnect", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), chanID=crate::apis::urlencode(chan_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&channel_connection_req_schema); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + /// Delete channel remove given channel id from repo and removes all the policies related to channel. pub async fn domain_id_channels_chan_id_delete(configuration: &configuration::Configuration, domain_id: &str, chan_id: &str) -> Result<(), Error> { let local_var_configuration = configuration; @@ -295,7 +515,7 @@ pub async fn domain_id_channels_chan_id_delete(configuration: &configuration::Co } /// Enables a specific channel that is identified by the channel ID. -pub async fn enable_channel(configuration: &configuration::Configuration, domain_id: &str, chan_id: &str) -> Result> { +pub async fn enable_channel(configuration: &configuration::Configuration, domain_id: &str, chan_id: &str) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -326,7 +546,7 @@ pub async fn enable_channel(configuration: &configuration::Configuration, domain } /// Gets info on a channel specified by id. -pub async fn get_channel(configuration: &configuration::Configuration, domain_id: &str, chan_id: &str) -> Result> { +pub async fn get_channel(configuration: &configuration::Configuration, domain_id: &str, chan_id: &str) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -357,7 +577,7 @@ pub async fn get_channel(configuration: &configuration::Configuration, domain_id } /// Retrieves a list of channels. Due to performance concerns, data is retrieved in subsets. The API clients must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. -pub async fn list_channels(configuration: &configuration::Configuration, domain_id: &str, limit: Option, offset: Option, metadata: Option<&str>, name: Option<&str>) -> Result> { +pub async fn list_channels(configuration: &configuration::Configuration, domain_id: &str, limit: Option, offset: Option, metadata: Option<&str>, name: Option<&str>) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -400,7 +620,7 @@ pub async fn list_channels(configuration: &configuration::Configuration, domain_ } /// Removes a parent group from a specific channel that is identified by the channel ID. -pub async fn remove_channel_parent_group(configuration: &configuration::Configuration, domain_id: &str, chan_id: &str, parent_group_req_obj: models::ParentGroupReqObj) -> Result<(), Error> { +pub async fn remove_channel_parent_group(configuration: &configuration::Configuration, domain_id: &str, chan_id: &str, parent_group_req_obj: crate::models::ParentGroupReqObj) -> Result<(), Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -432,7 +652,7 @@ pub async fn remove_channel_parent_group(configuration: &configuration::Configur } /// Sets a parent group for a specific channel that is identified by the channel ID. -pub async fn set_channel_parent_group(configuration: &configuration::Configuration, domain_id: &str, chan_id: &str, parent_group_req_obj: models::ParentGroupReqObj) -> Result<(), Error> { +pub async fn set_channel_parent_group(configuration: &configuration::Configuration, domain_id: &str, chan_id: &str, parent_group_req_obj: crate::models::ParentGroupReqObj) -> Result<(), Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -464,7 +684,7 @@ pub async fn set_channel_parent_group(configuration: &configuration::Configurati } /// Update is performed by replacing the current resource data with values provided in a request payload. Note that the channel's ID will not be affected. -pub async fn update_channel(configuration: &configuration::Configuration, domain_id: &str, chan_id: &str, channel_update: models::ChannelUpdate) -> Result> { +pub async fn update_channel(configuration: &configuration::Configuration, domain_id: &str, chan_id: &str, channel_update: crate::models::ChannelUpdate) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -496,7 +716,7 @@ pub async fn update_channel(configuration: &configuration::Configuration, domain } /// Update is performed by replacing the current resource data with values provided in a request payload. Note that the channel's ID will not be affected. -pub async fn update_channel_tags(configuration: &configuration::Configuration, domain_id: &str, chan_id: &str, channel_update: models::ChannelUpdate) -> Result> { +pub async fn update_channel_tags(configuration: &configuration::Configuration, domain_id: &str, chan_id: &str, channel_update: crate::models::ChannelUpdate) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; diff --git a/src/apis/clients_api.rs b/src/apis/clients_api.rs new file mode 100644 index 00000000..f455bb12 --- /dev/null +++ b/src/apis/clients_api.rs @@ -0,0 +1,1293 @@ +/* + * SuperMQ Combined Service + * + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; + +use crate::apis::ResponseContent; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`add_client_role_action`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AddClientRoleActionError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(crate::models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`add_client_role_member`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AddClientRoleMemberError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(crate::models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`bulk_create_clients`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum BulkCreateClientsError { + Status400(), + Status401(), + Status403(), + Status404(), + Status415(), + Status422(), + Status500(crate::models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`create_client`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CreateClientError { + Status400(), + Status401(), + Status403(), + Status404(), + Status409(), + Status415(), + Status422(), + Status500(crate::models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`create_client_role`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CreateClientRoleError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(crate::models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`delete_all_client_role_actions`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DeleteAllClientRoleActionsError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(crate::models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`delete_all_client_role_members`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DeleteAllClientRoleMembersError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(crate::models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`delete_client_role`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DeleteClientRoleError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(crate::models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`delete_client_role_action`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DeleteClientRoleActionError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(crate::models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`delete_client_role_members`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DeleteClientRoleMembersError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(crate::models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`disable_client`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DisableClientError { + Status400(), + Status401(), + Status403(), + Status404(), + Status409(), + Status422(), + Status500(crate::models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`domain_id_clients_client_id_delete`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DomainIdClientsClientIdDeleteError { + Status400(), + Status401(), + Status403(), + Status404(), + Status500(crate::models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`enable_client`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EnableClientError { + Status400(), + Status401(), + Status403(), + Status404(), + Status409(), + Status422(), + Status500(crate::models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_client`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetClientError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(crate::models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_client_role`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetClientRoleError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(crate::models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_available_actions`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListAvailableActionsError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(crate::models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_client_role_actions`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListClientRoleActionsError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(crate::models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_client_role_members`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListClientRoleMembersError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(crate::models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_client_roles`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListClientRolesError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(crate::models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_clients`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListClientsError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(crate::models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_user_clients`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListUserClientsError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(crate::models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`remove_client_parent_group`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RemoveClientParentGroupError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(crate::models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`set_client_parent_group`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SetClientParentGroupError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(crate::models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`update_client`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UpdateClientError { + Status400(), + Status401(), + Status403(), + Status404(), + Status409(), + Status415(), + Status422(), + Status500(crate::models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`update_client_role`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UpdateClientRoleError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(crate::models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`update_client_secret`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UpdateClientSecretError { + Status400(), + Status401(), + Status403(), + Status404(), + Status409(), + Status415(), + Status422(), + Status500(crate::models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`update_client_tags`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UpdateClientTagsError { + Status400(), + Status403(), + Status404(), + Status401(), + Status422(), + Status500(crate::models::Error), + UnknownValue(serde_json::Value), +} + + +/// Adds a role action for a specific client role that is identified by the role name. +pub async fn add_client_role_action(configuration: &configuration::Configuration, domain_id: &str, client_id: &str, role_name: &str, role_actions_obj: crate::models::RoleActionsObj) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/clients/{clientID}/roles/{roleName}/actions", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), clientID=crate::apis::urlencode(client_id), roleName=crate::apis::urlencode(role_name)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&role_actions_obj); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Adds a member to a specific client role that is identified by the role name. +pub async fn add_client_role_member(configuration: &configuration::Configuration, domain_id: &str, client_id: &str, role_name: &str, role_members_obj: crate::models::RoleMembersObj) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/clients/{clientID}/roles/{roleName}/members", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), clientID=crate::apis::urlencode(client_id), roleName=crate::apis::urlencode(role_name)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&role_members_obj); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Adds a list of new clients to the list of clients owned by user identified using the provided access token. +pub async fn bulk_create_clients(configuration: &configuration::Configuration, domain_id: &str, client_req_obj: Vec) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/clients/bulk", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&client_req_obj); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Adds new client to the list of clients owned by user identified using the provided access token. +pub async fn create_client(configuration: &configuration::Configuration, domain_id: &str, client_req_obj: crate::models::ClientReqObj) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/clients", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&client_req_obj); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Creates a role for a specific client that is identified by the client ID. +pub async fn create_client_role(configuration: &configuration::Configuration, domain_id: &str, client_id: &str, create_role_obj: crate::models::CreateRoleObj) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/clients/{clientID}/roles", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), clientID=crate::apis::urlencode(client_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&create_role_obj); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Deletes all role actions for a specific client role that is identified by the role name. +pub async fn delete_all_client_role_actions(configuration: &configuration::Configuration, domain_id: &str, client_id: &str, role_name: &str) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/clients/{clientID}/roles/{roleName}/actions/delete-all", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), clientID=crate::apis::urlencode(client_id), roleName=crate::apis::urlencode(role_name)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Deletes all members from a specific client role that is identified by the role name. +pub async fn delete_all_client_role_members(configuration: &configuration::Configuration, domain_id: &str, client_id: &str, role_name: &str) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/clients/{clientID}/roles/{roleName}/members/delete-all", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), clientID=crate::apis::urlencode(client_id), roleName=crate::apis::urlencode(role_name)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Deletes a specific client role that is identified by the role name. +pub async fn delete_client_role(configuration: &configuration::Configuration, domain_id: &str, client_id: &str, role_name: &str) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/clients/{clientID}/roles/{roleName}", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), clientID=crate::apis::urlencode(client_id), roleName=crate::apis::urlencode(role_name)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Deletes a role action for a specific client role that is identified by the role name. +pub async fn delete_client_role_action(configuration: &configuration::Configuration, domain_id: &str, client_id: &str, role_name: &str, role_actions_obj: crate::models::RoleActionsObj) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/clients/{clientID}/roles/{roleName}/actions/delete", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), clientID=crate::apis::urlencode(client_id), roleName=crate::apis::urlencode(role_name)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&role_actions_obj); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Deletes a member from a specific client role that is identified by the role name. +pub async fn delete_client_role_members(configuration: &configuration::Configuration, domain_id: &str, client_id: &str, role_name: &str, role_members_obj: crate::models::RoleMembersObj) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/clients/{clientID}/roles/{roleName}/members/delete", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), clientID=crate::apis::urlencode(client_id), roleName=crate::apis::urlencode(role_name)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&role_members_obj); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Disables a specific client that is identified by the client ID. +pub async fn disable_client(configuration: &configuration::Configuration, domain_id: &str, client_id: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/clients/{clientID}/disable", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), clientID=crate::apis::urlencode(client_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Delete client removes a client with the given id from repo and removes all the policies related to this client. +pub async fn domain_id_clients_client_id_delete(configuration: &configuration::Configuration, domain_id: &str, client_id: &str) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/clients/{clientID}", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), clientID=crate::apis::urlencode(client_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Enables a specific client that is identified by the client ID. +pub async fn enable_client(configuration: &configuration::Configuration, domain_id: &str, client_id: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/clients/{clientID}/enable", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), clientID=crate::apis::urlencode(client_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Retrieves a specific client that is identified by the client ID. +pub async fn get_client(configuration: &configuration::Configuration, domain_id: &str, client_id: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/clients/{clientID}", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), clientID=crate::apis::urlencode(client_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Retrieves a specific client role that is identified by the role name. +pub async fn get_client_role(configuration: &configuration::Configuration, domain_id: &str, client_id: &str, role_name: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/clients/{clientID}/roles/{roleName}", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), clientID=crate::apis::urlencode(client_id), roleName=crate::apis::urlencode(role_name)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Retrieves a list of available actions. +pub async fn list_available_actions(configuration: &configuration::Configuration, domain_id: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/clients/roles/available-actions", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Retrieves a list of client role actions. +pub async fn list_client_role_actions(configuration: &configuration::Configuration, domain_id: &str, client_id: &str, role_name: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/clients/{clientID}/roles/{roleName}/actions", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), clientID=crate::apis::urlencode(client_id), roleName=crate::apis::urlencode(role_name)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Retrieves a list of client role members. +pub async fn list_client_role_members(configuration: &configuration::Configuration, domain_id: &str, client_id: &str, role_name: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/clients/{clientID}/roles/{roleName}/members", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), clientID=crate::apis::urlencode(client_id), roleName=crate::apis::urlencode(role_name)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Retrieves a list of client roles. Due to performance concerns, data is retrieved in subsets. The API clients must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. +pub async fn list_client_roles(configuration: &configuration::Configuration, domain_id: &str, client_id: &str, limit: Option, offset: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/clients/{clientID}/roles", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), clientID=crate::apis::urlencode(client_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = offset { + local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Retrieves a list of clients. Due to performance concerns, data is retrieved in subsets. The API clients must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. +pub async fn list_clients(configuration: &configuration::Configuration, domain_id: &str, limit: Option, offset: Option, metadata: Option<&str>, status: Option<&str>, name: Option<&str>, tags: Option>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/clients", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = offset { + local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = metadata { + local_var_req_builder = local_var_req_builder.query(&[("metadata", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = status { + local_var_req_builder = local_var_req_builder.query(&[("status", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = name { + local_var_req_builder = local_var_req_builder.query(&[("name", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = tags { + local_var_req_builder = match "multi" { + "multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("tags".to_owned(), p.to_string())).collect::>()), + _ => local_var_req_builder.query(&[("tags", &local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), + }; + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Lists clients associated with a user identified by the user ID. +pub async fn list_user_clients(configuration: &configuration::Configuration, domain_id: &str, user_id: &str, limit: Option, offset: Option, metadata: Option<&str>, status: Option<&str>, name: Option<&str>, tags: Option>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/users/{userID}/clients", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), userID=crate::apis::urlencode(user_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = offset { + local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = metadata { + local_var_req_builder = local_var_req_builder.query(&[("metadata", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = status { + local_var_req_builder = local_var_req_builder.query(&[("status", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = name { + local_var_req_builder = local_var_req_builder.query(&[("name", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = tags { + local_var_req_builder = match "multi" { + "multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("tags".to_owned(), p.to_string())).collect::>()), + _ => local_var_req_builder.query(&[("tags", &local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), + }; + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Removes a parent group from a specific client that is identified by the client ID. +pub async fn remove_client_parent_group(configuration: &configuration::Configuration, domain_id: &str, client_id: &str, parent_group_req_obj: crate::models::ParentGroupReqObj) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/clients/{clientID}/parent", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), clientID=crate::apis::urlencode(client_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&parent_group_req_obj); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Sets a parent group for a specific client that is identified by the client ID. +pub async fn set_client_parent_group(configuration: &configuration::Configuration, domain_id: &str, client_id: &str, parent_group_req_obj: crate::models::ParentGroupReqObj) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/clients/{clientID}/parent", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), clientID=crate::apis::urlencode(client_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&parent_group_req_obj); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Update is performed by replacing the current resource data with values provided in a request payload. Note that the client's type and ID cannot be changed. +pub async fn update_client(configuration: &configuration::Configuration, domain_id: &str, client_id: &str, client_update: crate::models::ClientUpdate) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/clients/{clientID}", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), clientID=crate::apis::urlencode(client_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&client_update); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Updates a specific client role that is identified by the role name. +pub async fn update_client_role(configuration: &configuration::Configuration, domain_id: &str, client_id: &str, role_name: &str, update_role_obj: crate::models::UpdateRoleObj) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/clients/{clientID}/roles/{roleName}", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), clientID=crate::apis::urlencode(client_id), roleName=crate::apis::urlencode(role_name)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&update_role_obj); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Updates secret of the identified in client. Secret is updated using authorization token and the new received info. Update is performed by replacing current key with a new one. +pub async fn update_client_secret(configuration: &configuration::Configuration, domain_id: &str, client_id: &str, client_secret: crate::models::ClientSecret) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/clients/{clientID}/secret", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), clientID=crate::apis::urlencode(client_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&client_secret); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Updates tags of the client with provided ID. Tags is updated using authorization token and the new tags received in request. +pub async fn update_client_tags(configuration: &configuration::Configuration, domain_id: &str, client_id: &str, client_tags: crate::models::ClientTags) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/clients/{clientID}/tags", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), clientID=crate::apis::urlencode(client_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&client_tags); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/auth/src/apis/configuration.rs b/src/apis/configuration.rs similarity index 73% rename from auth/src/apis/configuration.rs rename to src/apis/configuration.rs index 2f545195..80d4c699 100644 --- a/auth/src/apis/configuration.rs +++ b/src/apis/configuration.rs @@ -1,7 +1,7 @@ /* - * SuperMQ Auth Service + * SuperMQ Combined Service * - * This is the Auth Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr @@ -19,6 +19,7 @@ pub struct Configuration { pub oauth_access_token: Option, pub bearer_access_token: Option, pub api_key: Option, + // TODO: take an oauth2 token source, similar to the go one } pub type BasicAuth = (String, Option); @@ -46,6 +47,7 @@ impl Default for Configuration { oauth_access_token: None, bearer_access_token: None, api_key: None, + } } } diff --git a/domains/src/apis/roles_api.rs b/src/apis/domains_api.rs similarity index 61% rename from domains/src/apis/roles_api.rs rename to src/apis/domains_api.rs index bf9c4f54..b972ac97 100644 --- a/domains/src/apis/roles_api.rs +++ b/src/apis/domains_api.rs @@ -1,7 +1,7 @@ /* - * Magistrala Domains Service + * SuperMQ Combined Service * - * This is the Domains Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform domains. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The Magistrala repository](https://github.com/absmach/magistrala) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr @@ -10,8 +10,8 @@ use reqwest; -use serde::{Deserialize, Serialize}; -use crate::{apis::ResponseContent, models}; + +use crate::apis::ResponseContent; use super::{Error, configuration}; @@ -24,7 +24,7 @@ pub enum AddDomainRoleActionError { Status403(), Status404(), Status422(), - Status500(), + Status500(crate::models::Error), UnknownValue(serde_json::Value), } @@ -37,7 +37,7 @@ pub enum AddDomainRoleMemberError { Status403(), Status404(), Status422(), - Status500(), + Status500(crate::models::Error), UnknownValue(serde_json::Value), } @@ -50,7 +50,7 @@ pub enum CreateDomainRoleError { Status403(), Status404(), Status422(), - Status500(), + Status500(crate::models::Error), UnknownValue(serde_json::Value), } @@ -63,7 +63,7 @@ pub enum DeleteAllDomainRoleActionsError { Status403(), Status404(), Status422(), - Status500(), + Status500(crate::models::Error), UnknownValue(serde_json::Value), } @@ -76,7 +76,7 @@ pub enum DeleteAllDomainRoleMembersError { Status403(), Status404(), Status422(), - Status500(), + Status500(crate::models::Error), UnknownValue(serde_json::Value), } @@ -89,7 +89,7 @@ pub enum DeleteDomainRoleError { Status403(), Status404(), Status422(), - Status500(), + Status500(crate::models::Error), UnknownValue(serde_json::Value), } @@ -102,7 +102,7 @@ pub enum DeleteDomainRoleActionError { Status403(), Status404(), Status422(), - Status500(), + Status500(crate::models::Error), UnknownValue(serde_json::Value), } @@ -115,7 +115,97 @@ pub enum DeleteDomainRoleMembersError { Status403(), Status404(), Status422(), - Status500(), + Status500(crate::models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`domains_domain_id_disable_post`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DomainsDomainIdDisablePostError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(crate::models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`domains_domain_id_enable_post`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DomainsDomainIdEnablePostError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(crate::models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`domains_domain_id_freeze_post`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DomainsDomainIdFreezePostError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(crate::models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`domains_domain_id_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DomainsDomainIdGetError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(crate::models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`domains_domain_id_patch`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DomainsDomainIdPatchError { + Status400(), + Status401(), + Status403(), + Status404(), + Status415(), + Status500(crate::models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`domains_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DomainsGetError { + Status400(), + Status401(), + Status404(), + Status422(), + Status500(crate::models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`domains_post`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DomainsPostError { + Status400(), + Status401(), + Status409(), + Status415(), + Status422(), + Status500(crate::models::Error), UnknownValue(serde_json::Value), } @@ -128,20 +218,20 @@ pub enum GetDomainRoleError { Status403(), Status404(), Status422(), - Status500(), + Status500(crate::models::Error), UnknownValue(serde_json::Value), } -/// struct for typed errors of method [`list_available_actions`] +/// struct for typed errors of method [`list_available_domain_actions`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -pub enum ListAvailableActionsError { +pub enum ListAvailableDomainActionsError { Status400(), Status401(), Status403(), Status404(), Status422(), - Status500(), + Status500(crate::models::Error), UnknownValue(serde_json::Value), } @@ -154,7 +244,7 @@ pub enum ListDomainRoleActionsError { Status403(), Status404(), Status422(), - Status500(), + Status500(crate::models::Error), UnknownValue(serde_json::Value), } @@ -167,7 +257,7 @@ pub enum ListDomainRoleMembersError { Status403(), Status404(), Status422(), - Status500(), + Status500(crate::models::Error), UnknownValue(serde_json::Value), } @@ -180,7 +270,7 @@ pub enum ListDomainRolesError { Status403(), Status404(), Status422(), - Status500(), + Status500(crate::models::Error), UnknownValue(serde_json::Value), } @@ -193,13 +283,13 @@ pub enum UpdateDomainRoleError { Status403(), Status404(), Status422(), - Status500(), + Status500(crate::models::Error), UnknownValue(serde_json::Value), } /// Adds a role action for a specific domain role that is identified by the role name. -pub async fn add_domain_role_action(configuration: &configuration::Configuration, domain_id: &str, role_name: &str, role_actions_obj: models::RoleActionsObj) -> Result> { +pub async fn add_domain_role_action(configuration: &configuration::Configuration, domain_id: &str, role_name: &str, role_actions_obj: crate::models::RoleActionsObj) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -231,7 +321,7 @@ pub async fn add_domain_role_action(configuration: &configuration::Configuration } /// Adds a member to a specific domain role that is identified by the role name. -pub async fn add_domain_role_member(configuration: &configuration::Configuration, domain_id: &str, role_name: &str, role_members_obj: models::RoleMembersObj) -> Result> { +pub async fn add_domain_role_member(configuration: &configuration::Configuration, domain_id: &str, role_name: &str, role_members_obj: crate::models::RoleMembersObj) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -263,7 +353,7 @@ pub async fn add_domain_role_member(configuration: &configuration::Configuration } /// Creates a role for a specific domain that is identified by the domain ID. -pub async fn create_domain_role(configuration: &configuration::Configuration, domain_id: &str, create_role_obj: models::CreateRoleObj) -> Result> { +pub async fn create_domain_role(configuration: &configuration::Configuration, domain_id: &str, create_role_obj: crate::models::CreateRoleObj) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -388,7 +478,7 @@ pub async fn delete_domain_role(configuration: &configuration::Configuration, do } /// Deletes a role action for a specific domain role that is identified by the role name. -pub async fn delete_domain_role_action(configuration: &configuration::Configuration, domain_id: &str, role_name: &str, role_actions_obj: models::RoleActionsObj) -> Result<(), Error> { +pub async fn delete_domain_role_action(configuration: &configuration::Configuration, domain_id: &str, role_name: &str, role_actions_obj: crate::models::RoleActionsObj) -> Result<(), Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -420,7 +510,7 @@ pub async fn delete_domain_role_action(configuration: &configuration::Configurat } /// Deletes a member from a specific domain role that is identified by the role name. -pub async fn delete_domain_role_members(configuration: &configuration::Configuration, domain_id: &str, role_name: &str, role_members_obj: models::RoleMembersObj) -> Result<(), Error> { +pub async fn delete_domain_role_members(configuration: &configuration::Configuration, domain_id: &str, role_name: &str, role_members_obj: crate::models::RoleMembersObj) -> Result<(), Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -451,8 +541,254 @@ pub async fn delete_domain_role_members(configuration: &configuration::Configura } } +/// Disable a specific domain that is identified by the domain ID. +pub async fn domains_domain_id_disable_post(configuration: &configuration::Configuration, domain_id: &str) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/domains/{domainID}/disable", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Enables a specific domain that is identified by the domain ID. +pub async fn domains_domain_id_enable_post(configuration: &configuration::Configuration, domain_id: &str) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/domains/{domainID}/enable", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Freeze a specific domain that is identified by the domain ID. +pub async fn domains_domain_id_freeze_post(configuration: &configuration::Configuration, domain_id: &str) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/domains/{domainID}/freeze", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Retrieves a specific domain that is identified by the domain ID. +pub async fn domains_domain_id_get(configuration: &configuration::Configuration, domain_id: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/domains/{domainID}", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Updates name, metadata, tags and alias of the domain. +pub async fn domains_domain_id_patch(configuration: &configuration::Configuration, domain_id: &str, domain_update: crate::models::DomainUpdate) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/domains/{domainID}", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&domain_update); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Retrieves list of domains that the user have access. +pub async fn domains_get(configuration: &configuration::Configuration, limit: Option, offset: Option, metadata: Option<&str>, status: Option<&str>, name: Option<&str>, permission: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/domains", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = offset { + local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = metadata { + local_var_req_builder = local_var_req_builder.query(&[("metadata", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = status { + local_var_req_builder = local_var_req_builder.query(&[("status", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = name { + local_var_req_builder = local_var_req_builder.query(&[("name", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = permission { + local_var_req_builder = local_var_req_builder.query(&[("permission", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Adds new domain. +pub async fn domains_post(configuration: &configuration::Configuration, domain_req_obj: crate::models::DomainReqObj) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/domains", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&domain_req_obj); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + /// Retrieves a specific domain role that is identified by the role name. -pub async fn get_domain_role(configuration: &configuration::Configuration, domain_id: &str, role_name: &str) -> Result> { +pub async fn get_domain_role(configuration: &configuration::Configuration, domain_id: &str, role_name: &str) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -483,7 +819,7 @@ pub async fn get_domain_role(configuration: &configuration::Configuration, domai } /// Retrieves a list of available actions. -pub async fn list_available_actions(configuration: &configuration::Configuration, domain_id: &str) -> Result> { +pub async fn list_available_domain_actions(configuration: &configuration::Configuration, domain_id: &str) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -507,14 +843,14 @@ pub async fn list_available_actions(configuration: &configuration::Configuration if !local_var_status.is_client_error() && !local_var_status.is_server_error() { serde_json::from_str(&local_var_content).map_err(Error::from) } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) } } /// Retrieves a list of domain role actions. -pub async fn list_domain_role_actions(configuration: &configuration::Configuration, domain_id: &str, role_name: &str) -> Result> { +pub async fn list_domain_role_actions(configuration: &configuration::Configuration, domain_id: &str, role_name: &str) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -545,7 +881,7 @@ pub async fn list_domain_role_actions(configuration: &configuration::Configurati } /// Retrieves a list of domain role members. -pub async fn list_domain_role_members(configuration: &configuration::Configuration, domain_id: &str, role_name: &str) -> Result> { +pub async fn list_domain_role_members(configuration: &configuration::Configuration, domain_id: &str, role_name: &str) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -576,7 +912,7 @@ pub async fn list_domain_role_members(configuration: &configuration::Configurati } /// Retrieves a list of domain roles. Due to performance concerns, data is retrieved in subsets. The API domains must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. -pub async fn list_domain_roles(configuration: &configuration::Configuration, domain_id: &str, limit: Option, offset: Option) -> Result> { +pub async fn list_domain_roles(configuration: &configuration::Configuration, domain_id: &str, limit: Option, offset: Option) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -613,7 +949,7 @@ pub async fn list_domain_roles(configuration: &configuration::Configuration, dom } /// Updates a specific domain role that is identified by the role name. -pub async fn update_domain_role(configuration: &configuration::Configuration, domain_id: &str, role_name: &str, update_role_obj: models::UpdateRoleObj) -> Result> { +pub async fn update_domain_role(configuration: &configuration::Configuration, domain_id: &str, role_name: &str, update_role_obj: crate::models::UpdateRoleObj) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; diff --git a/examples/src/main.rs b/src/apis/examples.rs similarity index 90% rename from examples/src/main.rs rename to src/apis/examples.rs index def9bbf0..1554d58e 100644 --- a/examples/src/main.rs +++ b/src/apis/examples.rs @@ -1,84 +1,78 @@ -/* This is a sample document to show how to implement the SDK. */ - -use Users::models::*; - -use Users::apis::*; -use serde_json::json; - -use crate::configuration::Configuration; -use crate::users_api::*; - -// Replace with the actual path to your configuration - -#[tokio::main] -async fn main() { - // Construct the configuration with the actual API base URL and authorization token - let mut config = Configuration::new(); - config.base_path = "http://localhost:9002".to_string(); - config.bearer_access_token = Some("Put your bearer token here".to_string()); - - // Create the credentials, wrapping each field inside Some - let credentials = Box::new(UserReqObjCredentials { - username: Some("admin".to_string()), // Wrap in Some() - secret: Some("password".to_string()), // Wrap in Some() - }); - - let metadata = Some(json!({ - "domain": "example.com", - })); - let cloned_credentials = credentials.clone(); - - // Create the user request object - let user_req_obj = UserReqObj { - first_name: Some("Njeri".to_string()), - last_name: Some("Doe".to_string()), - email: Some("Njeri@example.com".to_string()), - tags: Some(vec!["tag1".to_string(), "tag2".to_string()]), - credentials: credentials, // Boxed credentials - metadata: metadata, - profile_picture: Some("https://example.com/profile.jpg".to_string()), - status: Some("enabled".to_string()), - }; - let token_request = IssueToken::new( - cloned_credentials.username.as_ref().unwrap_or(&"".to_string()).clone(), - cloned_credentials.secret.as_ref().unwrap_or(&"".to_string()).clone(), - ); - - // Call the `create_user` function - match create_user(&config, user_req_obj).await { - Ok(user) => { - // Success: The user has been created, and `user` contains the response data - println!("User created successfully: {:?}", user); - } - Err(err) => { - // Handle the error (e.g., logging, retrying, etc.) - eprintln!("Error creating user: {:?}", err); - } - } - - // //Obtain token - // match issue_token(&config, token_request).await { - // Ok(user) => { - // // Success: The user has been created, and `user` contains the response data - // println!("Token generated successfully: {:?}", user); - // } - // Err(err) => { - // // Handle the error (e.g., logging, retrying, etc.) - // eprintln!("Error generating token: {:?}", err); - // } - // } - - //Get user - // let user_response: User = match get_profile(&config).await { - // Ok(user) => { - // // Success: The user has been created, and `user` contains the response data - // return user; - // } - // Err(err) => { - // // Handle the error (e.g., logging, retrying, etc.) - // eprintln!("Error obtaining: {:?}", err); - // } - // } - -} - +/* This is a sample document to show how to implement the SDK. */ + +use crate::models::*; +use serde_json::json; + +use crate::apis::users_api::*; + +async fn run_example() { + // Construct the configuration with the actual API base URL and authorization token + let mut config = Configuration::new(); + config.base_path = "http://localhost:9002".to_string(); + config.bearer_access_token = Some("Put your bearer token here".to_string()); + + // Create the credentials, wrapping each field inside Some + let credentials = Box::new(UserReqObjCredentials { + username: Some("admin".to_string()), // Wrap in Some() + secret: Some("password".to_string()), // Wrap in Some() + }); + + let metadata = Some(json!({ + "domain": "example.com", + })); + let cloned_credentials = credentials.clone(); + + // Create the user request object + let user_req_obj = UserReqObj { + first_name: Some("Njeri".to_string()), + last_name: Some("Doe".to_string()), + email: Some("Njeri@example.com".to_string()), + tags: Some(vec!["tag1".to_string(), "tag2".to_string()]), + credentials: credentials, // Boxed credentials + metadata: metadata, + profile_picture: Some("https://example.com/profile.jpg".to_string()), + status: Some("enabled".to_string()), + }; + let token_request = IssueToken::new( + cloned_credentials.username.as_ref().unwrap_or(&"".to_string()).clone(), + cloned_credentials.secret.as_ref().unwrap_or(&"".to_string()).clone(), + ); + + // Call the `create_user` function + match create_user(&config, user_req_obj).await { + Ok(user) => { + // Success: The user has been created, and `user` contains the response data + println!("User created successfully: {:?}", user); + } + Err(err) => { + // Handle the error (e.g., logging, retrying, etc.) + eprintln!("Error creating user: {:?}", err); + } + } + + // //Obtain token + // match issue_token(&config, token_request).await { + // Ok(user) => { + // // Success: The user has been created, and `user` contains the response data + // println!("Token generated successfully: {:?}", user); + // } + // Err(err) => { + // // Handle the error (e.g., logging, retrying, etc.) + // eprintln!("Error generating token: {:?}", err); + // } + // } + + //Get user + // let user_response: User = match get_profile(&config).await { + // Ok(user) => { + // // Success: The user has been created, and `user` contains the response data + // return user; + // } + // Err(err) => { + // // Handle the error (e.g., logging, retrying, etc.) + // eprintln!("Error obtaining: {:?}", err); + // } + // } + +} + diff --git a/src/apis/groups_api.rs b/src/apis/groups_api.rs new file mode 100644 index 00000000..fa4f5fba --- /dev/null +++ b/src/apis/groups_api.rs @@ -0,0 +1,1332 @@ +/* + * SuperMQ Combined Service + * + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; + +use crate::apis::ResponseContent; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`add_children_groups`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AddChildrenGroupsError { + Status400(), + Status401(), + Status403(), + Status404(), + Status409(), + Status415(), + Status422(), + Status500(crate::models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`add_group_role_action`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AddGroupRoleActionError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(crate::models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`add_group_role_member`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AddGroupRoleMemberError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(crate::models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`create_group`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CreateGroupError { + Status400(), + Status401(), + Status403(), + Status404(), + Status409(), + Status415(), + Status422(), + Status500(crate::models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`create_group_role`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CreateGroupRoleError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(crate::models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`delete_all_group_role_actions`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DeleteAllGroupRoleActionsError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(crate::models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`delete_all_group_role_members`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DeleteAllGroupRoleMembersError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(crate::models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`delete_group_role`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DeleteGroupRoleError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(crate::models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`delete_group_role_action`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DeleteGroupRoleActionError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(crate::models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`delete_group_role_members`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DeleteGroupRoleMembersError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(crate::models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`disable_group`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DisableGroupError { + Status400(), + Status401(), + Status403(), + Status404(), + Status409(), + Status415(), + Status422(), + Status500(crate::models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`domain_id_groups_group_id_delete`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DomainIdGroupsGroupIdDeleteError { + Status400(), + Status401(), + Status403(), + Status404(), + Status500(crate::models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`enable_group`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EnableGroupError { + Status400(), + Status401(), + Status403(), + Status404(), + Status409(), + Status415(), + Status422(), + Status500(crate::models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_group`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetGroupError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(crate::models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_group_role`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetGroupRoleError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(crate::models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_available_group_actions`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListAvailableGroupActionsError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(crate::models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_children_groups`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListChildrenGroupsError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(crate::models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_group_hierarchy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListGroupHierarchyError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(crate::models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_group_role_actions`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListGroupRoleActionsError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(crate::models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_group_role_members`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListGroupRoleMembersError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(crate::models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_group_roles`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListGroupRolesError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(crate::models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_groups`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListGroupsError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(crate::models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`remove_all_children_groups`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RemoveAllChildrenGroupsError { + Status400(), + Status401(), + Status403(), + Status404(), + Status409(), + Status415(), + Status422(), + Status500(crate::models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`remove_children_groups`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RemoveChildrenGroupsError { + Status400(), + Status401(), + Status403(), + Status404(), + Status409(), + Status415(), + Status422(), + Status500(crate::models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`remove_group_parent_group`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RemoveGroupParentGroupError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(crate::models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`set_group_parent_group`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SetGroupParentGroupError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(crate::models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`update_group`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UpdateGroupError { + Status400(), + Status401(), + Status403(), + Status404(), + Status409(), + Status415(), + Status422(), + Status500(crate::models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`update_group_role`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UpdateGroupRoleError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(crate::models::Error), + UnknownValue(serde_json::Value), +} + + +/// Adds children groups for a specific group that is identified by the group ID. +pub async fn add_children_groups(configuration: &configuration::Configuration, domain_id: &str, group_id: &str, children_group_req_obj: crate::models::ChildrenGroupReqObj) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}/children", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&children_group_req_obj); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Adds a role action for a specific group role that is identified by the role name. +pub async fn add_group_role_action(configuration: &configuration::Configuration, domain_id: &str, group_id: &str, role_name: &str, role_actions_obj: crate::models::RoleActionsObj) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}/roles/{roleName}/actions", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id), roleName=crate::apis::urlencode(role_name)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&role_actions_obj); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Adds a member to a specific group role that is identified by the role name. +pub async fn add_group_role_member(configuration: &configuration::Configuration, domain_id: &str, group_id: &str, role_name: &str, role_members_obj: crate::models::RoleMembersObj) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}/roles/{roleName}/members", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id), roleName=crate::apis::urlencode(role_name)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&role_members_obj); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Creates new group that can be used for grouping entities. New account will be uniquely identified by its identity. +pub async fn create_group(configuration: &configuration::Configuration, domain_id: &str, group_req_obj: crate::models::GroupReqObj) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/groups", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&group_req_obj); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Creates a role for a specific group that is identified by the group ID. +pub async fn create_group_role(configuration: &configuration::Configuration, domain_id: &str, group_id: &str, create_role_obj: crate::models::CreateRoleObj) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}/roles", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&create_role_obj); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Deletes all role actions for a specific group role that is identified by the role name. +pub async fn delete_all_group_role_actions(configuration: &configuration::Configuration, domain_id: &str, group_id: &str, role_name: &str) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}/roles/{roleName}/actions/delete-all", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id), roleName=crate::apis::urlencode(role_name)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Deletes all members from a specific group role that is identified by the role name. +pub async fn delete_all_group_role_members(configuration: &configuration::Configuration, domain_id: &str, group_id: &str, role_name: &str) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}/roles/{roleName}/members/delete-all", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id), roleName=crate::apis::urlencode(role_name)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Deletes a specific group role that is identifier by the role name. +pub async fn delete_group_role(configuration: &configuration::Configuration, domain_id: &str, group_id: &str, role_name: &str) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}/roles/{roleName}", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id), roleName=crate::apis::urlencode(role_name)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Deletes a role action for a specific group role that is identified by the role name. +pub async fn delete_group_role_action(configuration: &configuration::Configuration, domain_id: &str, group_id: &str, role_name: &str, role_actions_obj: crate::models::RoleActionsObj) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}/roles/{roleName}/actions/delete", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id), roleName=crate::apis::urlencode(role_name)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&role_actions_obj); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Deletes a member from a specific group role that is identified by the role name. +pub async fn delete_group_role_members(configuration: &configuration::Configuration, domain_id: &str, group_id: &str, role_name: &str, role_members_obj: crate::models::RoleMembersObj) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}/roles/{roleName}/members/delete", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id), roleName=crate::apis::urlencode(role_name)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&role_members_obj); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Disables a specific group that is identifier by the group ID. +pub async fn disable_group(configuration: &configuration::Configuration, domain_id: &str, group_id: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}/disable", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Delete group removes a group with the given id from repo and removes all the policies related to this group. +pub async fn domain_id_groups_group_id_delete(configuration: &configuration::Configuration, domain_id: &str, group_id: &str) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Enables a specific group that is identifier by the group ID. +pub async fn enable_group(configuration: &configuration::Configuration, domain_id: &str, group_id: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}/enable", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Gets info on a group specified by id. +pub async fn get_group(configuration: &configuration::Configuration, domain_id: &str, group_id: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Retrieves a specific group role that is identified by the role name. +pub async fn get_group_role(configuration: &configuration::Configuration, domain_id: &str, group_id: &str, role_name: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}/roles/{roleName}", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id), roleName=crate::apis::urlencode(role_name)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Retrieves a list of available actions. +pub async fn list_available_group_actions(configuration: &configuration::Configuration, domain_id: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/groups/roles/available-actions", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Lists groups up to a max level of hierarchy that can be fetched in one request ( max level = 5). Result can be filtered by metadata. Groups will be returned as JSON array or JSON tree. Due to performance concerns, result is returned in subsets. +pub async fn list_children_groups(configuration: &configuration::Configuration, domain_id: &str, group_id: &str, limit: Option, offset: Option, start_level: Option, end_level: Option, tree: Option, metadata: Option<&str>, name: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}/children", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = offset { + local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = start_level { + local_var_req_builder = local_var_req_builder.query(&[("start_level", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = end_level { + local_var_req_builder = local_var_req_builder.query(&[("end_level", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = tree { + local_var_req_builder = local_var_req_builder.query(&[("tree", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = metadata { + local_var_req_builder = local_var_req_builder.query(&[("metadata", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = name { + local_var_req_builder = local_var_req_builder.query(&[("name", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Lists groups heirarchy up to a max level of hierarchy that can be fetched in one request ( max level = 5). Result can be filtered by metadata. Groups will be returned as JSON array or JSON tree. Due to performance concerns, result is returned in subsets. +pub async fn list_group_hierarchy(configuration: &configuration::Configuration, domain_id: &str, group_id: &str, level: Option, tree: Option, direction: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}/hierarchy", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = level { + local_var_req_builder = local_var_req_builder.query(&[("level", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = tree { + local_var_req_builder = local_var_req_builder.query(&[("tree", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = direction { + local_var_req_builder = local_var_req_builder.query(&[("direction", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Retrieves a list of group role actions. +pub async fn list_group_role_actions(configuration: &configuration::Configuration, domain_id: &str, group_id: &str, role_name: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}/roles/{roleName}/actions", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id), roleName=crate::apis::urlencode(role_name)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Retrieves a list of group role members. +pub async fn list_group_role_members(configuration: &configuration::Configuration, domain_id: &str, group_id: &str, role_name: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}/roles/{roleName}/members", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id), roleName=crate::apis::urlencode(role_name)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Retrieves a list of group roles. Due to performance concerns, data is retrieved in subsets. The API groups must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. +pub async fn list_group_roles(configuration: &configuration::Configuration, domain_id: &str, group_id: &str, limit: Option, offset: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}/roles", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = offset { + local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Lists groups up to a max level of hierarchy that can be fetched in one request ( max level = 5). Result can be filtered by metadata. Groups will be returned as JSON array or JSON tree. Due to performance concerns, result is returned in subsets. +pub async fn list_groups(configuration: &configuration::Configuration, domain_id: &str, limit: Option, offset: Option, level: Option, tree: Option, metadata: Option<&str>, name: Option<&str>, parent_id: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/groups", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = offset { + local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = level { + local_var_req_builder = local_var_req_builder.query(&[("level", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = tree { + local_var_req_builder = local_var_req_builder.query(&[("tree", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = metadata { + local_var_req_builder = local_var_req_builder.query(&[("metadata", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = name { + local_var_req_builder = local_var_req_builder.query(&[("name", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = parent_id { + local_var_req_builder = local_var_req_builder.query(&[("parentID", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Removes all children groups for a specific group that is identified by the group ID. +pub async fn remove_all_children_groups(configuration: &configuration::Configuration, domain_id: &str, group_id: &str) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}/children/all", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Removes children groups for a specific group that is identified by the group ID. +pub async fn remove_children_groups(configuration: &configuration::Configuration, domain_id: &str, group_id: &str, children_group_req_obj: crate::models::ChildrenGroupReqObj) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}/children", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&children_group_req_obj); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Removes a parent group from a specific group that is identified by the group ID. +pub async fn remove_group_parent_group(configuration: &configuration::Configuration, domain_id: &str, group_id: &str, parent_group_req_obj2: crate::models::ParentGroupReqObj2) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}/parent", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&parent_group_req_obj2); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Sets a parent group for a specific group that is identified by the group ID. +pub async fn set_group_parent_group(configuration: &configuration::Configuration, domain_id: &str, group_id: &str, parent_group_req_obj2: crate::models::ParentGroupReqObj2) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}/parent", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&parent_group_req_obj2); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Updates Name, Description or Metadata of a group. +pub async fn update_group(configuration: &configuration::Configuration, domain_id: &str, group_id: &str, group_update: crate::models::GroupUpdate) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&group_update); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Updates a specific group role that is identified by the role name. +pub async fn update_group_role(configuration: &configuration::Configuration, domain_id: &str, group_id: &str, role_name: &str, update_role_obj: crate::models::UpdateRoleObj) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/{domainID}/groups/{groupID}/roles/{roleName}", local_var_configuration.base_path, domainID=crate::apis::urlencode(domain_id), groupID=crate::apis::urlencode(group_id), roleName=crate::apis::urlencode(role_name)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&update_role_obj); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/invitations/src/apis/invitations_api.rs b/src/apis/invitations_api.rs similarity index 89% rename from invitations/src/apis/invitations_api.rs rename to src/apis/invitations_api.rs index 5656c740..4f6bc5da 100644 --- a/invitations/src/apis/invitations_api.rs +++ b/src/apis/invitations_api.rs @@ -1,7 +1,7 @@ /* - * SuperMQ Invitations Service + * SuperMQ Combined Service * - * This is the Invitations Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform invitations. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr @@ -10,8 +10,8 @@ use reqwest; -use serde::{Deserialize, Serialize}; -use crate::{apis::ResponseContent, models}; + +use crate::apis::ResponseContent; use super::{Error, configuration}; @@ -22,7 +22,7 @@ pub enum AcceptInvitationError { Status400(), Status401(), Status404(), - Status500(models::Error), + Status500(crate::models::Error), UnknownValue(serde_json::Value), } @@ -34,7 +34,7 @@ pub enum DeleteInvitationError { Status403(), Status404(), Status401(), - Status500(models::Error), + Status500(crate::models::Error), UnknownValue(serde_json::Value), } @@ -47,7 +47,7 @@ pub enum GetInvitationError { Status403(), Status404(), Status422(), - Status500(models::Error), + Status500(crate::models::Error), UnknownValue(serde_json::Value), } @@ -60,7 +60,7 @@ pub enum ListInvitationsError { Status403(), Status404(), Status422(), - Status500(models::Error), + Status500(crate::models::Error), UnknownValue(serde_json::Value), } @@ -71,7 +71,7 @@ pub enum RejectInvitationError { Status400(), Status401(), Status404(), - Status500(models::Error), + Status500(crate::models::Error), UnknownValue(serde_json::Value), } @@ -85,13 +85,13 @@ pub enum SendInvitationError { Status404(), Status409(), Status415(), - Status500(models::Error), + Status500(crate::models::Error), UnknownValue(serde_json::Value), } /// Current logged in user accepts invitation to join domain. -pub async fn accept_invitation(configuration: &configuration::Configuration, accept_invitation_request: models::AcceptInvitationRequest) -> Result<(), Error> { +pub async fn accept_invitation(configuration: &configuration::Configuration, accept_invitation_request: crate::models::AcceptInvitationRequest) -> Result<(), Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -154,7 +154,7 @@ pub async fn delete_invitation(configuration: &configuration::Configuration, use } /// Retrieves a specific invitation that is identifier by the user ID and domain ID. -pub async fn get_invitation(configuration: &configuration::Configuration, user_id: &str, domain_id: &str) -> Result> { +pub async fn get_invitation(configuration: &configuration::Configuration, user_id: &str, domain_id: &str) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -185,7 +185,7 @@ pub async fn get_invitation(configuration: &configuration::Configuration, user_i } /// Retrieves a list of invitations. Due to performance concerns, data is retrieved in subsets. The API must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. -pub async fn list_invitations(configuration: &configuration::Configuration, user_id: &str, limit: Option, offset: Option, invited_by: Option<&str>, domain_id: Option<&str>, relation: Option<&str>, state: Option<&str>) -> Result> { +pub async fn list_invitations(configuration: &configuration::Configuration, user_id: &str, domain_id: &str, limit: Option, offset: Option, invited_by: Option<&str>, relation: Option<&str>, state: Option<&str>) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -203,9 +203,6 @@ pub async fn list_invitations(configuration: &configuration::Configuration, user if let Some(ref local_var_str) = invited_by { local_var_req_builder = local_var_req_builder.query(&[("invited_by", &local_var_str.to_string())]); } - if let Some(ref local_var_str) = domain_id { - local_var_req_builder = local_var_req_builder.query(&[("domain_id", &local_var_str.to_string())]); - } if let Some(ref local_var_str) = relation { local_var_req_builder = local_var_req_builder.query(&[("relation", &local_var_str.to_string())]); } @@ -235,7 +232,7 @@ pub async fn list_invitations(configuration: &configuration::Configuration, user } /// Current logged in user rejects invitation to join domain. -pub async fn reject_invitation(configuration: &configuration::Configuration, accept_invitation_request: models::AcceptInvitationRequest) -> Result<(), Error> { +pub async fn reject_invitation(configuration: &configuration::Configuration, accept_invitation_request: crate::models::AcceptInvitationRequest) -> Result<(), Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -267,7 +264,7 @@ pub async fn reject_invitation(configuration: &configuration::Configuration, acc } /// Send invitation to user to join domain. -pub async fn send_invitation(configuration: &configuration::Configuration, send_invitation_req_obj: models::SendInvitationReqObj) -> Result<(), Error> { +pub async fn send_invitation(configuration: &configuration::Configuration, send_invitation_req_obj: crate::models::SendInvitationReqObj) -> Result<(), Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; diff --git a/journal/src/apis/journal_log_api.rs b/src/apis/journal_log_api.rs similarity index 91% rename from journal/src/apis/journal_log_api.rs rename to src/apis/journal_log_api.rs index 2922b29f..3c253c7e 100644 --- a/journal/src/apis/journal_log_api.rs +++ b/src/apis/journal_log_api.rs @@ -1,17 +1,17 @@ /* - * SuperMQ Journal Log Service + * SuperMQ Combined Service * - * This is the Journal Log Server based on the OpenAPI 3.0 specification. It is the HTTP API for viewing journal log history. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 - * Contact: info@mainflux.com + * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ use reqwest; -use serde::{Deserialize, Serialize}; -use crate::{apis::ResponseContent, models}; + +use crate::apis::ResponseContent; use super::{Error, configuration}; @@ -24,7 +24,7 @@ pub enum DomainIdJournalEntityTypeIdGetError { Status403(), Status404(), Status422(), - Status500(models::Error), + Status500(crate::models::Error), UnknownValue(serde_json::Value), } @@ -37,13 +37,13 @@ pub enum JournalUserUserIdGetError { Status403(), Status404(), Status422(), - Status500(models::Error), + Status500(crate::models::Error), UnknownValue(serde_json::Value), } /// Retrieves a list of journal. Due to performance concerns, data is retrieved in subsets. The API must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. -pub async fn domain_id_journal_entity_type_id_get(configuration: &configuration::Configuration, domain_id: &str, entity_type: &str, id: &str, offset: Option, limit: Option, operation: Option<&str>, with_attributes: Option, with_metadata: Option, from: Option<&str>, to: Option<&str>, dir: Option<&str>) -> Result> { +pub async fn domain_id_journal_entity_type_id_get(configuration: &configuration::Configuration, domain_id: &str, entity_type: &str, id: &str, offset: Option, limit: Option, operation: Option<&str>, with_attributes: Option, with_metadata: Option, from: Option<&str>, to: Option<&str>, dir: Option<&str>) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -98,7 +98,7 @@ pub async fn domain_id_journal_entity_type_id_get(configuration: &configuration: } /// Retrieves a list of journal. Due to performance concerns, data is retrieved in subsets. The API must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. -pub async fn journal_user_user_id_get(configuration: &configuration::Configuration, user_id: &str, offset: Option, limit: Option, operation: Option<&str>, with_attributes: Option, with_metadata: Option, from: Option<&str>, to: Option<&str>, dir: Option<&str>) -> Result> { +pub async fn journal_user_user_id_get(configuration: &configuration::Configuration, user_id: &str, offset: Option, limit: Option, operation: Option<&str>, with_attributes: Option, with_metadata: Option, from: Option<&str>, to: Option<&str>, dir: Option<&str>) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; diff --git a/auth/src/apis/keys_api.rs b/src/apis/keys_api.rs similarity index 69% rename from auth/src/apis/keys_api.rs rename to src/apis/keys_api.rs index 7023d210..bf9889df 100644 --- a/auth/src/apis/keys_api.rs +++ b/src/apis/keys_api.rs @@ -1,7 +1,7 @@ /* - * SuperMQ Auth Service + * SuperMQ Combined Service * - * This is the Auth Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr @@ -10,8 +10,8 @@ use reqwest; -use serde::{Deserialize, Serialize}; -use crate::{apis::ResponseContent, models}; + +use crate::apis::ResponseContent; use super::{Error, configuration}; @@ -22,7 +22,7 @@ pub enum GetKeyError { Status400(), Status401(), Status404(), - Status500(), + Status500(crate::models::Error), UnknownValue(serde_json::Value), } @@ -34,7 +34,7 @@ pub enum IssueKeyError { Status401(), Status409(), Status415(), - Status500(), + Status500(crate::models::Error), UnknownValue(serde_json::Value), } @@ -44,13 +44,13 @@ pub enum IssueKeyError { pub enum RevokeKeyError { Status401(), Status404(), - Status500(), + Status500(crate::models::Error), UnknownValue(serde_json::Value), } /// Gets API key details for the given key. -pub async fn get_key(configuration: &configuration::Configuration, key_id: &str) -> Result> { +pub async fn get_key(configuration: &configuration::Configuration, key_id: &str) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -64,6 +64,15 @@ pub async fn get_key(configuration: &configuration::Configuration, key_id: &str) if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; let local_var_req = local_var_req_builder.build()?; let local_var_resp = local_var_client.execute(local_var_req).await?; @@ -81,7 +90,7 @@ pub async fn get_key(configuration: &configuration::Configuration, key_id: &str) } /// Generates a new API key. Thew new API key will be uniquely identified by its ID. -pub async fn issue_key(configuration: &configuration::Configuration, issue_key_request: models::IssueKeyRequest) -> Result<(), Error> { +pub async fn issue_key(configuration: &configuration::Configuration, issue_key_request: crate::models::IssueKeyRequest) -> Result<(), Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -95,6 +104,15 @@ pub async fn issue_key(configuration: &configuration::Configuration, issue_key_r if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; local_var_req_builder = local_var_req_builder.json(&issue_key_request); let local_var_req = local_var_req_builder.build()?; @@ -127,6 +145,15 @@ pub async fn revoke_key(configuration: &configuration::Configuration, key_id: &s if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; let local_var_req = local_var_req_builder.build()?; let local_var_resp = local_var_client.execute(local_var_req).await?; diff --git a/http/src/apis/messages_api.rs b/src/apis/messages_api.rs similarity index 71% rename from http/src/apis/messages_api.rs rename to src/apis/messages_api.rs index 2c251166..dbd83aaa 100644 --- a/http/src/apis/messages_api.rs +++ b/src/apis/messages_api.rs @@ -1,7 +1,7 @@ /* - * SuperMQ http adapter + * SuperMQ Combined Service * - * HTTP API for sending messages through communication channels. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr @@ -10,8 +10,8 @@ use reqwest; -use serde::{Deserialize, Serialize}; -use crate::{apis::ResponseContent, models}; + +use crate::apis::ResponseContent; use super::{Error, configuration}; @@ -23,13 +23,13 @@ pub enum ChannelsIdMessagesPostError { Status401(), Status404(), Status415(), - Status500(), + Status500(crate::models::Error), UnknownValue(serde_json::Value), } /// Sends message to the communication channel. Messages can be sent as JSON formatted SenML or as blob. -pub async fn channels_id_messages_post(configuration: &configuration::Configuration, id: &str, sen_ml_record: Vec) -> Result<(), Error> { +pub async fn channels_id_messages_post(configuration: &configuration::Configuration, id: &str, sen_ml_record: Vec) -> Result<(), Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -40,12 +40,18 @@ pub async fn channels_id_messages_post(configuration: &configuration::Configurat if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); }; if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; local_var_req_builder = local_var_req_builder.json(&sen_ml_record); let local_var_req = local_var_req_builder.build()?; diff --git a/twins/src/apis/mod.rs b/src/apis/mod.rs similarity index 90% rename from twins/src/apis/mod.rs rename to src/apis/mod.rs index a6b9209b..24b4ad30 100644 --- a/twins/src/apis/mod.rs +++ b/src/apis/mod.rs @@ -90,8 +90,21 @@ pub fn parse_deep_object(prefix: &str, value: &serde_json::Value) -> Vec<(String unimplemented!("Only objects are supported with style=deepObject") } -pub mod health_api; +pub mod certs_api; +pub mod channels_api; +pub mod clients_api; +pub mod domains_api; +pub mod groups_api; +pub mod invitations_api; +pub mod journal_log_api; +pub mod keys_api; +pub mod messages_api; +pub mod notifiers_api; +pub mod provision_api; +pub mod readers_api; pub mod states_api; pub mod twins_api; - +pub mod users_api; pub mod configuration; +pub mod examples; + diff --git a/notifiers/src/apis/notifiers_api.rs b/src/apis/notifiers_api.rs similarity index 72% rename from notifiers/src/apis/notifiers_api.rs rename to src/apis/notifiers_api.rs index 3874414d..cdc914a4 100644 --- a/notifiers/src/apis/notifiers_api.rs +++ b/src/apis/notifiers_api.rs @@ -1,7 +1,7 @@ /* - * SuperMQ Notifiers service + * SuperMQ Combined Service * - * HTTP API for Notifiers service. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr @@ -10,8 +10,8 @@ use reqwest; -use serde::{Deserialize, Serialize}; -use crate::{apis::ResponseContent, models}; + +use crate::apis::ResponseContent; use super::{Error, configuration}; @@ -25,7 +25,7 @@ pub enum CreateSubscriptionError { Status409(), Status415(), Status422(), - Status500(), + Status500(crate::models::Error), UnknownValue(serde_json::Value), } @@ -38,7 +38,7 @@ pub enum ListSubscriptionsError { Status403(), Status404(), Status422(), - Status500(), + Status500(crate::models::Error), UnknownValue(serde_json::Value), } @@ -50,7 +50,7 @@ pub enum RemoveSubscriptionError { Status403(), Status404(), Status422(), - Status500(), + Status500(crate::models::Error), UnknownValue(serde_json::Value), } @@ -63,13 +63,13 @@ pub enum ViewSubscriptionError { Status403(), Status404(), Status422(), - Status500(), + Status500(crate::models::Error), UnknownValue(serde_json::Value), } /// Creates a new subscription give a topic and contact. -pub async fn create_subscription(configuration: &configuration::Configuration, create_subscription: models::CreateSubscription) -> Result<(), Error> { +pub async fn create_subscription(configuration: &configuration::Configuration, create_subscription: crate::models::CreateSubscription) -> Result<(), Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -83,6 +83,15 @@ pub async fn create_subscription(configuration: &configuration::Configuration, c if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; local_var_req_builder = local_var_req_builder.json(&create_subscription); let local_var_req = local_var_req_builder.build()?; @@ -101,7 +110,7 @@ pub async fn create_subscription(configuration: &configuration::Configuration, c } /// List subscriptions given list parameters. -pub async fn list_subscriptions(configuration: &configuration::Configuration, topic: Option<&str>, contact: Option<&str>, offset: Option, limit: Option) -> Result> { +pub async fn list_subscriptions(configuration: &configuration::Configuration, topic: Option<&str>, contact: Option<&str>, offset: Option, limit: Option) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -127,6 +136,15 @@ pub async fn list_subscriptions(configuration: &configuration::Configuration, to if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; let local_var_req = local_var_req_builder.build()?; let local_var_resp = local_var_client.execute(local_var_req).await?; @@ -158,6 +176,15 @@ pub async fn remove_subscription(configuration: &configuration::Configuration, i if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; let local_var_req = local_var_req_builder.build()?; let local_var_resp = local_var_client.execute(local_var_req).await?; @@ -175,7 +202,7 @@ pub async fn remove_subscription(configuration: &configuration::Configuration, i } /// Retrieves a subscription with the provided id. -pub async fn view_subscription(configuration: &configuration::Configuration, id: &str) -> Result> { +pub async fn view_subscription(configuration: &configuration::Configuration, id: &str) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -189,6 +216,15 @@ pub async fn view_subscription(configuration: &configuration::Configuration, id: if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; let local_var_req = local_var_req_builder.build()?; let local_var_resp = local_var_client.execute(local_var_req).await?; diff --git a/provision/src/apis/provision_api.rs b/src/apis/provision_api.rs similarity index 70% rename from provision/src/apis/provision_api.rs rename to src/apis/provision_api.rs index 6b674cc7..de4c1e77 100644 --- a/provision/src/apis/provision_api.rs +++ b/src/apis/provision_api.rs @@ -1,17 +1,17 @@ /* - * SuperMQ Provision service + * SuperMQ Combined Service * - * HTTP API for Provision service Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstracmachines.fr + * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ use reqwest; -use serde::{Deserialize, Serialize}; -use crate::{apis::ResponseContent, models}; + +use crate::apis::ResponseContent; use super::{Error, configuration}; @@ -23,7 +23,7 @@ pub enum DomainIdMappingGetError { Status403(), Status415(), Status422(), - Status500(), + Status500(crate::models::Error), UnknownValue(serde_json::Value), } @@ -36,7 +36,7 @@ pub enum DomainIdMappingPostError { Status403(), Status415(), Status422(), - Status500(), + Status500(crate::models::Error), UnknownValue(serde_json::Value), } @@ -56,6 +56,15 @@ pub async fn domain_id_mapping_get(configuration: &configuration::Configuration, if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; let local_var_req = local_var_req_builder.build()?; let local_var_resp = local_var_client.execute(local_var_req).await?; @@ -73,7 +82,7 @@ pub async fn domain_id_mapping_get(configuration: &configuration::Configuration, } /// Adds new device to proxy -pub async fn domain_id_mapping_post(configuration: &configuration::Configuration, domain_id: &str, domain_id_mapping_post_request: Option) -> Result<(), Error> { +pub async fn domain_id_mapping_post(configuration: &configuration::Configuration, domain_id: &str, domain_id_mapping_post_request: Option) -> Result<(), Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -87,6 +96,15 @@ pub async fn domain_id_mapping_post(configuration: &configuration::Configuration if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; local_var_req_builder = local_var_req_builder.json(&domain_id_mapping_post_request); let local_var_req = local_var_req_builder.build()?; diff --git a/readers/src/apis/readers_api.rs b/src/apis/readers_api.rs similarity index 82% rename from readers/src/apis/readers_api.rs rename to src/apis/readers_api.rs index 3592c63b..d96abfbc 100644 --- a/readers/src/apis/readers_api.rs +++ b/src/apis/readers_api.rs @@ -1,7 +1,7 @@ /* - * SuperMQ reader service + * SuperMQ Combined Service * - * HTTP API for reading messages. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr @@ -10,8 +10,8 @@ use reqwest; -use serde::{Deserialize, Serialize}; -use crate::{apis::ResponseContent, models}; + +use crate::apis::ResponseContent; use super::{Error, configuration}; @@ -21,13 +21,13 @@ use super::{Error, configuration}; pub enum GetMessagesError { Status400(), Status401(), - Status500(), + Status500(crate::models::Error), UnknownValue(serde_json::Value), } /// Retrieves a list of messages sent to specific channel. Due to performance concerns, data is retrieved in subsets. The API readers must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. -pub async fn get_messages(configuration: &configuration::Configuration, chan_id: &str, limit: Option, offset: Option, publisher: Option<&str>, name: Option<&str>, v: Option<&str>, vb: Option, vs: Option<&str>, vd: Option<&str>, from: Option, to: Option, aggregation: Option<&str>, interval: Option<&str>) -> Result> { +pub async fn get_messages(configuration: &configuration::Configuration, chan_id: &str, limit: Option, offset: Option, publisher: Option<&str>, name: Option<&str>, v: Option<&str>, vb: Option, vs: Option<&str>, vd: Option<&str>, from: Option, to: Option, aggregation: Option<&str>, interval: Option<&str>) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -77,6 +77,12 @@ pub async fn get_messages(configuration: &configuration::Configuration, chan_id: if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); }; diff --git a/twins/src/apis/states_api.rs b/src/apis/states_api.rs similarity index 69% rename from twins/src/apis/states_api.rs rename to src/apis/states_api.rs index 23460789..ab5b20ee 100644 --- a/twins/src/apis/states_api.rs +++ b/src/apis/states_api.rs @@ -1,7 +1,7 @@ /* - * SuperMQ twins service + * SuperMQ Combined Service * - * HTTP API for managing digital twins and their states. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr @@ -10,8 +10,8 @@ use reqwest; -use serde::{Deserialize, Serialize}; -use crate::{apis::ResponseContent, models}; + +use crate::apis::ResponseContent; use super::{Error, configuration}; @@ -23,13 +23,13 @@ pub enum GetStatesError { Status401(), Status404(), Status422(), - Status500(), + Status500(crate::models::Error), UnknownValue(serde_json::Value), } /// Retrieves a list of states. Due to performance concerns, data is retrieved in subsets. -pub async fn get_states(configuration: &configuration::Configuration, twin_id: &str, limit: Option, offset: Option) -> Result> { +pub async fn get_states(configuration: &configuration::Configuration, twin_id: &str, limit: Option, offset: Option) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -49,6 +49,15 @@ pub async fn get_states(configuration: &configuration::Configuration, twin_id: & if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; let local_var_req = local_var_req_builder.build()?; let local_var_resp = local_var_client.execute(local_var_req).await?; diff --git a/twins/src/apis/twins_api.rs b/src/apis/twins_api.rs similarity index 72% rename from twins/src/apis/twins_api.rs rename to src/apis/twins_api.rs index 35e58de2..8a48cb9b 100644 --- a/twins/src/apis/twins_api.rs +++ b/src/apis/twins_api.rs @@ -1,7 +1,7 @@ /* - * SuperMQ twins service + * SuperMQ Combined Service * - * HTTP API for managing digital twins and their states. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr @@ -10,8 +10,8 @@ use reqwest; -use serde::{Deserialize, Serialize}; -use crate::{apis::ResponseContent, models}; + +use crate::apis::ResponseContent; use super::{Error, configuration}; @@ -23,7 +23,7 @@ pub enum CreateTwinError { Status401(), Status415(), Status422(), - Status500(), + Status500(crate::models::Error), UnknownValue(serde_json::Value), } @@ -35,7 +35,7 @@ pub enum GetTwinError { Status401(), Status404(), Status422(), - Status500(), + Status500(crate::models::Error), UnknownValue(serde_json::Value), } @@ -46,7 +46,7 @@ pub enum GetTwinsError { Status400(), Status401(), Status422(), - Status500(), + Status500(crate::models::Error), UnknownValue(serde_json::Value), } @@ -59,7 +59,7 @@ pub enum RemoveTwinError { Status404(), Status415(), Status422(), - Status500(), + Status500(crate::models::Error), UnknownValue(serde_json::Value), } @@ -72,13 +72,13 @@ pub enum UpdateTwinError { Status404(), Status415(), Status422(), - Status500(), + Status500(crate::models::Error), UnknownValue(serde_json::Value), } /// Adds new twin to the list of twins owned by user identified using the provided access token. -pub async fn create_twin(configuration: &configuration::Configuration, twin_req_obj: models::TwinReqObj) -> Result<(), Error> { +pub async fn create_twin(configuration: &configuration::Configuration, twin_req_obj: crate::models::TwinReqObj) -> Result<(), Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -92,6 +92,15 @@ pub async fn create_twin(configuration: &configuration::Configuration, twin_req_ if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; local_var_req_builder = local_var_req_builder.json(&twin_req_obj); let local_var_req = local_var_req_builder.build()?; @@ -109,7 +118,7 @@ pub async fn create_twin(configuration: &configuration::Configuration, twin_req_ } } -pub async fn get_twin(configuration: &configuration::Configuration, twin_id: &str) -> Result> { +pub async fn get_twin(configuration: &configuration::Configuration, twin_id: &str) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -123,6 +132,15 @@ pub async fn get_twin(configuration: &configuration::Configuration, twin_id: &st if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; let local_var_req = local_var_req_builder.build()?; let local_var_resp = local_var_client.execute(local_var_req).await?; @@ -140,7 +158,7 @@ pub async fn get_twin(configuration: &configuration::Configuration, twin_id: &st } /// Retrieves a list of twins. Due to performance concerns, data is retrieved in subsets. -pub async fn get_twins(configuration: &configuration::Configuration, limit: Option, offset: Option, name: Option<&str>, metadata: Option<&str>) -> Result> { +pub async fn get_twins(configuration: &configuration::Configuration, limit: Option, offset: Option, name: Option<&str>, metadata: Option<&str>) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -166,6 +184,15 @@ pub async fn get_twins(configuration: &configuration::Configuration, limit: Opti if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; let local_var_req = local_var_req_builder.build()?; let local_var_resp = local_var_client.execute(local_var_req).await?; @@ -197,6 +224,15 @@ pub async fn remove_twin(configuration: &configuration::Configuration, twin_id: if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; let local_var_req = local_var_req_builder.build()?; let local_var_resp = local_var_client.execute(local_var_req).await?; @@ -214,7 +250,7 @@ pub async fn remove_twin(configuration: &configuration::Configuration, twin_id: } /// Update is performed by replacing the current resource data with values provided in a request payload. Note that the twin's ID cannot be changed. -pub async fn update_twin(configuration: &configuration::Configuration, twin_id: &str, twin_req_obj: models::TwinReqObj) -> Result<(), Error> { +pub async fn update_twin(configuration: &configuration::Configuration, twin_id: &str, twin_req_obj: crate::models::TwinReqObj) -> Result<(), Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -228,6 +264,15 @@ pub async fn update_twin(configuration: &configuration::Configuration, twin_id: if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; local_var_req_builder = local_var_req_builder.json(&twin_req_obj); let local_var_req = local_var_req_builder.build()?; diff --git a/users/src/apis/users_api.rs b/src/apis/users_api.rs similarity index 89% rename from users/src/apis/users_api.rs rename to src/apis/users_api.rs index 803ddaa7..67eea9af 100644 --- a/users/src/apis/users_api.rs +++ b/src/apis/users_api.rs @@ -1,7 +1,7 @@ /* - * SuperMQ Users Service + * SuperMQ Combined Service * - * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr @@ -10,8 +10,8 @@ use reqwest; -use serde::{Deserialize, Serialize}; -use crate::{apis::ResponseContent, models}; + +use crate::apis::ResponseContent; use super::{Error, configuration}; @@ -25,7 +25,7 @@ pub enum CreateUserError { Status409(), Status415(), Status422(), - Status500(models::Error), + Status500(crate::models::Error), UnknownValue(serde_json::Value), } @@ -40,7 +40,7 @@ pub enum DisableUserError { Status409(), Status415(), Status422(), - Status500(models::Error), + Status500(crate::models::Error), UnknownValue(serde_json::Value), } @@ -53,7 +53,7 @@ pub enum DomainIdUsersGetError { Status403(), Status404(), Status422(), - Status500(models::Error), + Status500(crate::models::Error), UnknownValue(serde_json::Value), } @@ -68,7 +68,7 @@ pub enum EnableUserError { Status409(), Status415(), Status422(), - Status500(models::Error), + Status500(crate::models::Error), UnknownValue(serde_json::Value), } @@ -78,7 +78,7 @@ pub enum EnableUserError { pub enum GetProfileError { Status400(), Status401(), - Status500(models::Error), + Status500(crate::models::Error), UnknownValue(serde_json::Value), } @@ -90,7 +90,7 @@ pub enum GetUserError { Status401(), Status404(), Status422(), - Status500(models::Error), + Status500(crate::models::Error), UnknownValue(serde_json::Value), } @@ -103,7 +103,7 @@ pub enum IssueTokenError { Status404(), Status415(), Status422(), - Status500(models::Error), + Status500(crate::models::Error), UnknownValue(serde_json::Value), } @@ -115,7 +115,7 @@ pub enum ListUsersError { Status401(), Status404(), Status422(), - Status500(models::Error), + Status500(crate::models::Error), UnknownValue(serde_json::Value), } @@ -128,7 +128,7 @@ pub enum ListUsersInChannelError { Status403(), Status404(), Status422(), - Status500(models::Error), + Status500(crate::models::Error), UnknownValue(serde_json::Value), } @@ -141,7 +141,7 @@ pub enum ListUsersInClientError { Status403(), Status404(), Status422(), - Status500(models::Error), + Status500(crate::models::Error), UnknownValue(serde_json::Value), } @@ -154,7 +154,7 @@ pub enum ListUsersInGroupError { Status403(), Status404(), Status422(), - Status500(models::Error), + Status500(crate::models::Error), UnknownValue(serde_json::Value), } @@ -167,7 +167,7 @@ pub enum RefreshTokenError { Status404(), Status415(), Status422(), - Status500(models::Error), + Status500(crate::models::Error), UnknownValue(serde_json::Value), } @@ -179,7 +179,7 @@ pub enum RequestPasswordResetError { Status404(), Status415(), Status422(), - Status500(models::Error), + Status500(crate::models::Error), UnknownValue(serde_json::Value), } @@ -192,7 +192,7 @@ pub enum ResetPasswordError { Status404(), Status415(), Status422(), - Status500(models::Error), + Status500(crate::models::Error), UnknownValue(serde_json::Value), } @@ -202,7 +202,7 @@ pub enum ResetPasswordError { pub enum SearchUsersError { Status400(), Status401(), - Status500(models::Error), + Status500(crate::models::Error), UnknownValue(serde_json::Value), } @@ -217,7 +217,7 @@ pub enum UpdateEmailError { Status409(), Status415(), Status422(), - Status500(models::Error), + Status500(crate::models::Error), UnknownValue(serde_json::Value), } @@ -231,7 +231,7 @@ pub enum UpdateProfilePictureError { Status401(), Status415(), Status422(), - Status500(models::Error), + Status500(crate::models::Error), UnknownValue(serde_json::Value), } @@ -245,7 +245,7 @@ pub enum UpdateRoleError { Status401(), Status415(), Status422(), - Status500(models::Error), + Status500(crate::models::Error), UnknownValue(serde_json::Value), } @@ -258,7 +258,7 @@ pub enum UpdateSecretError { Status404(), Status415(), Status422(), - Status500(models::Error), + Status500(crate::models::Error), UnknownValue(serde_json::Value), } @@ -272,7 +272,7 @@ pub enum UpdateTagsError { Status401(), Status415(), Status422(), - Status500(models::Error), + Status500(crate::models::Error), UnknownValue(serde_json::Value), } @@ -287,7 +287,7 @@ pub enum UpdateUserError { Status409(), Status415(), Status422(), - Status500(models::Error), + Status500(crate::models::Error), UnknownValue(serde_json::Value), } @@ -302,7 +302,7 @@ pub enum UpdateUsernameError { Status409(), Status415(), Status422(), - Status500(models::Error), + Status500(crate::models::Error), UnknownValue(serde_json::Value), } @@ -315,13 +315,13 @@ pub enum UsersUserIdDeleteError { Status404(), Status405(), Status422(), - Status500(models::Error), + Status500(crate::models::Error), UnknownValue(serde_json::Value), } /// Registers new user account given email and password. New account will be uniquely identified by its email address. -pub async fn create_user(configuration: &configuration::Configuration, user_req_obj: models::UserReqObj) -> Result> { +pub async fn create_user(configuration: &configuration::Configuration, user_req_obj: crate::models::UserReqObj) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -335,6 +335,12 @@ pub async fn create_user(configuration: &configuration::Configuration, user_req_ if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); }; @@ -356,7 +362,7 @@ pub async fn create_user(configuration: &configuration::Configuration, user_req_ } /// Disables a specific user that is identifier by the user ID. -pub async fn disable_user(configuration: &configuration::Configuration, user_id: &str) -> Result> { +pub async fn disable_user(configuration: &configuration::Configuration, user_id: &str) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -387,7 +393,7 @@ pub async fn disable_user(configuration: &configuration::Configuration, user_id: } /// List users assigned to domain that is identified by the domain ID. -pub async fn domain_id_users_get(configuration: &configuration::Configuration, domain_id: &str, limit: Option, offset: Option, metadata: Option<&str>, status: Option<&str>) -> Result> { +pub async fn domain_id_users_get(configuration: &configuration::Configuration, domain_id: &str, limit: Option, offset: Option, metadata: Option<&str>, status: Option<&str>) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -430,7 +436,7 @@ pub async fn domain_id_users_get(configuration: &configuration::Configuration, d } /// Enables a specific user that is identifier by the user ID. -pub async fn enable_user(configuration: &configuration::Configuration, user_id: &str) -> Result> { +pub async fn enable_user(configuration: &configuration::Configuration, user_id: &str) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -461,7 +467,7 @@ pub async fn enable_user(configuration: &configuration::Configuration, user_id: } /// Gets info on currently logged in user. Info is obtained using authorization token -pub async fn get_profile(configuration: &configuration::Configuration, ) -> Result> { +pub async fn get_profile(configuration: &configuration::Configuration, ) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -492,7 +498,7 @@ pub async fn get_profile(configuration: &configuration::Configuration, ) -> Resu } /// Retrieves a specific user that is identifier by the user ID. -pub async fn get_user(configuration: &configuration::Configuration, user_id: &str) -> Result> { +pub async fn get_user(configuration: &configuration::Configuration, user_id: &str) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -523,7 +529,7 @@ pub async fn get_user(configuration: &configuration::Configuration, user_id: &st } /// Issue Access and Refresh Token used for authenticating into the system. -pub async fn issue_token(configuration: &configuration::Configuration, issue_token: models::IssueToken) -> Result> { +pub async fn issue_token(configuration: &configuration::Configuration, issue_token: crate::models::IssueToken) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -537,6 +543,12 @@ pub async fn issue_token(configuration: &configuration::Configuration, issue_tok if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); }; @@ -558,7 +570,7 @@ pub async fn issue_token(configuration: &configuration::Configuration, issue_tok } /// Retrieves a list of users. Due to performance concerns, data is retrieved in subsets. The API must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. -pub async fn list_users(configuration: &configuration::Configuration, limit: Option, offset: Option, metadata: Option<&str>, status: Option<&str>, first_name: Option<&str>, last_name: Option<&str>, username: Option<&str>, email: Option<&str>, tags: Option>) -> Result> { +pub async fn list_users(configuration: &configuration::Configuration, limit: Option, offset: Option, metadata: Option<&str>, status: Option<&str>, first_name: Option<&str>, last_name: Option<&str>, username: Option<&str>, email: Option<&str>, tags: Option>) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -619,7 +631,7 @@ pub async fn list_users(configuration: &configuration::Configuration, limit: Opt } /// Retrieves a list of users in a channel. Due to performance concerns, data is retrieved in subsets. The API must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. -pub async fn list_users_in_channel(configuration: &configuration::Configuration, domain_id: &str, channel_id: &str, limit: Option, offset: Option, level: Option, tree: Option, metadata: Option<&str>, name: Option<&str>, parent_id: Option<&str>) -> Result> { +pub async fn list_users_in_channel(configuration: &configuration::Configuration, domain_id: &str, channel_id: &str, limit: Option, offset: Option, level: Option, tree: Option, metadata: Option<&str>, name: Option<&str>, parent_id: Option<&str>) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -654,6 +666,12 @@ pub async fn list_users_in_channel(configuration: &configuration::Configuration, if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); }; @@ -674,7 +692,7 @@ pub async fn list_users_in_channel(configuration: &configuration::Configuration, } /// Retrieves a list of users associated with a client. Due to performance concerns, data is retrieved in subsets. The API must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. -pub async fn list_users_in_client(configuration: &configuration::Configuration, domain_id: &str, client_id: &str, limit: Option, offset: Option, level: Option, tree: Option, metadata: Option<&str>, name: Option<&str>, parent_id: Option<&str>) -> Result> { +pub async fn list_users_in_client(configuration: &configuration::Configuration, domain_id: &str, client_id: &str, limit: Option, offset: Option, level: Option, tree: Option, metadata: Option<&str>, name: Option<&str>, parent_id: Option<&str>) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -709,6 +727,12 @@ pub async fn list_users_in_client(configuration: &configuration::Configuration, if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); }; @@ -729,7 +753,7 @@ pub async fn list_users_in_client(configuration: &configuration::Configuration, } /// Retrieves a list of users in a group. Due to performance concerns, data is retrieved in subsets. The API must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. -pub async fn list_users_in_group(configuration: &configuration::Configuration, domain_id: &str, group_id: &str, limit: Option, offset: Option, level: Option, tree: Option, metadata: Option<&str>, name: Option<&str>, parent_id: Option<&str>) -> Result> { +pub async fn list_users_in_group(configuration: &configuration::Configuration, domain_id: &str, group_id: &str, limit: Option, offset: Option, level: Option, tree: Option, metadata: Option<&str>, name: Option<&str>, parent_id: Option<&str>) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -764,6 +788,12 @@ pub async fn list_users_in_group(configuration: &configuration::Configuration, d if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); }; @@ -784,7 +814,7 @@ pub async fn list_users_in_group(configuration: &configuration::Configuration, d } /// Refreshes Access and Refresh Token used for authenticating into the system. -pub async fn refresh_token(configuration: &configuration::Configuration, ) -> Result> { +pub async fn refresh_token(configuration: &configuration::Configuration, ) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -815,7 +845,7 @@ pub async fn refresh_token(configuration: &configuration::Configuration, ) -> Re } /// Generates a reset token and sends and email with link for resetting password. -pub async fn request_password_reset(configuration: &configuration::Configuration, referer: &str, request_password_reset_request: models::RequestPasswordResetRequest) -> Result<(), Error> { +pub async fn request_password_reset(configuration: &configuration::Configuration, referer: &str, request_password_reset_request: crate::models::RequestPasswordResetRequest) -> Result<(), Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -830,6 +860,12 @@ pub async fn request_password_reset(configuration: &configuration::Configuration if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); }; @@ -851,7 +887,7 @@ pub async fn request_password_reset(configuration: &configuration::Configuration } /// When user gets reset token, after he submitted email to `/password/reset-request`, posting a new password along to this endpoint will change password. -pub async fn reset_password(configuration: &configuration::Configuration, reset_password_request: Option) -> Result<(), Error> { +pub async fn reset_password(configuration: &configuration::Configuration, reset_password_request: Option) -> Result<(), Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -865,6 +901,12 @@ pub async fn reset_password(configuration: &configuration::Configuration, reset_ if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); }; @@ -886,7 +928,7 @@ pub async fn reset_password(configuration: &configuration::Configuration, reset_ } /// Search users by name and identity. -pub async fn search_users(configuration: &configuration::Configuration, user_id: &str, limit: Option, offset: Option, username: Option<&str>, first_name: Option<&str>, last_name: Option<&str>, email: Option<&str>) -> Result> { +pub async fn search_users(configuration: &configuration::Configuration, user_id: &str, limit: Option, offset: Option, username: Option<&str>, first_name: Option<&str>, last_name: Option<&str>, email: Option<&str>) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -894,10 +936,6 @@ pub async fn search_users(configuration: &configuration::Configuration, user_id: let local_var_uri_str = format!("{}/users/search", local_var_configuration.base_path); let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); - - if let Some(ref local_var_str) = limit { - local_var_req_builder = local_var_req_builder.query(&[("userID", &user_id.to_string())]); - } if let Some(ref local_var_str) = limit { local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); } @@ -939,7 +977,7 @@ pub async fn search_users(configuration: &configuration::Configuration, user_id: } /// Updates email of the user with provided ID. Email is updated using authorization token and the new received email. -pub async fn update_email(configuration: &configuration::Configuration, user_id: &str, email: models::Email) -> Result> { +pub async fn update_email(configuration: &configuration::Configuration, user_id: &str, email: crate::models::Email) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -971,7 +1009,7 @@ pub async fn update_email(configuration: &configuration::Configuration, user_id: } /// Updates the user's profile picture with provided ID. Profile picture is updated using authorization token and the new received picture. -pub async fn update_profile_picture(configuration: &configuration::Configuration, user_id: &str, user_profile_picture: models::UserProfilePicture) -> Result> { +pub async fn update_profile_picture(configuration: &configuration::Configuration, user_id: &str, user_profile_picture: crate::models::UserProfilePicture) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -1003,7 +1041,7 @@ pub async fn update_profile_picture(configuration: &configuration::Configuration } /// Updates role for the user with provided ID. -pub async fn update_role(configuration: &configuration::Configuration, user_id: &str, user_role: models::UserRole) -> Result> { +pub async fn update_role(configuration: &configuration::Configuration, user_id: &str, user_role: crate::models::UserRole) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -1035,7 +1073,7 @@ pub async fn update_role(configuration: &configuration::Configuration, user_id: } /// Updates secret of currently logged in user. Secret is updated using authorization token and the new received info. -pub async fn update_secret(configuration: &configuration::Configuration, user_secret: models::UserSecret) -> Result> { +pub async fn update_secret(configuration: &configuration::Configuration, user_secret: crate::models::UserSecret) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -1067,7 +1105,7 @@ pub async fn update_secret(configuration: &configuration::Configuration, user_se } /// Updates tags of the user with provided ID. Tags is updated using authorization token and the new tags received in request. -pub async fn update_tags(configuration: &configuration::Configuration, user_id: &str, user_tags: models::UserTags) -> Result> { +pub async fn update_tags(configuration: &configuration::Configuration, user_id: &str, user_tags: crate::models::UserTags) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -1099,7 +1137,7 @@ pub async fn update_tags(configuration: &configuration::Configuration, user_id: } /// Updates name and metadata of the user with provided ID. Name and metadata is updated using authorization token and the new received info. -pub async fn update_user(configuration: &configuration::Configuration, user_id: &str, user_update: models::UserUpdate) -> Result> { +pub async fn update_user(configuration: &configuration::Configuration, user_id: &str, user_update: crate::models::UserUpdate) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -1131,7 +1169,7 @@ pub async fn update_user(configuration: &configuration::Configuration, user_id: } /// Updates username of the user with provided ID. Username is updated using authorization token and the new received username. -pub async fn update_username(configuration: &configuration::Configuration, user_id: &str, username: models::Username) -> Result> { +pub async fn update_username(configuration: &configuration::Configuration, user_id: &str, username: crate::models::Username) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; diff --git a/auth/src/lib.rs b/src/lib.rs similarity index 56% rename from auth/src/lib.rs rename to src/lib.rs index e1520628..c1dd666f 100644 --- a/auth/src/lib.rs +++ b/src/lib.rs @@ -1,7 +1,6 @@ -#![allow(unused_imports)] -#![allow(clippy::too_many_arguments)] +#[macro_use] +extern crate serde_derive; -extern crate serde_repr; extern crate serde; extern crate serde_json; extern crate url; diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 00000000..e2b849c2 --- /dev/null +++ b/src/main.rs @@ -0,0 +1,12 @@ +// src/main.rs + +mod apis { // Define the api module + pub mod examples; + pub mod configuration; // Include the examples.rs file from the api directory +} + +#[tokio::main] +async fn main() { + // Call the function from examples module + api::examples::run_example(); +} diff --git a/provision/src/models/__domain_id__mapping_post_request.rs b/src/models/__domain_id__mapping_post_request.rs similarity index 59% rename from provision/src/models/__domain_id__mapping_post_request.rs rename to src/models/__domain_id__mapping_post_request.rs index 65789c11..9b1a8c8c 100644 --- a/provision/src/models/__domain_id__mapping_post_request.rs +++ b/src/models/__domain_id__mapping_post_request.rs @@ -1,17 +1,17 @@ /* - * SuperMQ Provision service + * SuperMQ Combined Service * - * HTTP API for Provision service Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstracmachines.fr + * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ -use crate::models; -use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct DomainIdMappingPostRequest { #[serde(rename = "external_id")] pub external_id: String, @@ -31,3 +31,4 @@ impl DomainIdMappingPostRequest { } } + diff --git a/src/models/accept_invitation_request.rs b/src/models/accept_invitation_request.rs new file mode 100644 index 00000000..7754637c --- /dev/null +++ b/src/models/accept_invitation_request.rs @@ -0,0 +1,29 @@ +/* + * SuperMQ Combined Service + * + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct AcceptInvitationRequest { + /// Domain unique identifier. + #[serde(rename = "domain_id")] + pub domain_id: uuid::Uuid, +} + +impl AcceptInvitationRequest { + pub fn new(domain_id: uuid::Uuid) -> AcceptInvitationRequest { + AcceptInvitationRequest { + domain_id, + } + } +} + + diff --git a/users/src/models/assign_req_obj.rs b/src/models/assign_req_obj.rs similarity index 59% rename from users/src/models/assign_req_obj.rs rename to src/models/assign_req_obj.rs index 518bcf58..87a21e01 100644 --- a/users/src/models/assign_req_obj.rs +++ b/src/models/assign_req_obj.rs @@ -1,17 +1,17 @@ /* - * SuperMQ Users Service + * SuperMQ Combined Service * - * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ -use crate::models; -use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct AssignReqObj { /// Members IDs #[serde(rename = "members")] @@ -34,3 +34,4 @@ impl AssignReqObj { } } + diff --git a/users/src/models/assign_user_req_obj.rs b/src/models/assign_user_req_obj.rs similarity index 54% rename from users/src/models/assign_user_req_obj.rs rename to src/models/assign_user_req_obj.rs index 35a6e0f9..e5cff574 100644 --- a/users/src/models/assign_user_req_obj.rs +++ b/src/models/assign_user_req_obj.rs @@ -1,17 +1,17 @@ /* - * SuperMQ Users Service + * SuperMQ Combined Service * - * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ -use crate::models; -use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct AssignUserReqObj { /// User IDs #[serde(rename = "user_ids")] @@ -30,3 +30,4 @@ impl AssignUserReqObj { } } + diff --git a/twins/src/models/attribute.rs b/src/models/attribute.rs similarity index 70% rename from twins/src/models/attribute.rs rename to src/models/attribute.rs index ab840986..a73bfc3c 100644 --- a/twins/src/models/attribute.rs +++ b/src/models/attribute.rs @@ -1,17 +1,17 @@ /* - * SuperMQ twins service + * SuperMQ Combined Service * - * HTTP API for managing digital twins and their states. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ -use crate::models; -use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct Attribute { /// Name of the attribute. #[serde(rename = "name", skip_serializing_if = "Option::is_none")] @@ -38,3 +38,4 @@ impl Attribute { } } + diff --git a/groups/src/models/available_actions_obj.rs b/src/models/available_actions_obj.rs similarity index 52% rename from groups/src/models/available_actions_obj.rs rename to src/models/available_actions_obj.rs index c6b9434b..0a218200 100644 --- a/groups/src/models/available_actions_obj.rs +++ b/src/models/available_actions_obj.rs @@ -1,17 +1,17 @@ /* - * SuperMQ Groups Service + * SuperMQ Combined Service * - * This is the Groups Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform groups. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ -use crate::models; -use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct AvailableActionsObj { /// List of all available actions. #[serde(rename = "available_actions", skip_serializing_if = "Option::is_none")] @@ -26,3 +26,4 @@ impl AvailableActionsObj { } } + diff --git a/certs/src/models/cert.rs b/src/models/cert.rs similarity index 76% rename from certs/src/models/cert.rs rename to src/models/cert.rs index 67d27cdc..1678b5b1 100644 --- a/certs/src/models/cert.rs +++ b/src/models/cert.rs @@ -1,17 +1,17 @@ /* - * SuperMQ Certs service + * SuperMQ Combined Service * - * HTTP API for Certs service Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ -use crate::models; -use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct Cert { /// Corresponding SuperMQ Client ID. #[serde(rename = "client_id", skip_serializing_if = "Option::is_none")] @@ -46,3 +46,4 @@ impl Cert { } } + diff --git a/certs/src/models/certs_page.rs b/src/models/certs_page.rs similarity index 65% rename from certs/src/models/certs_page.rs rename to src/models/certs_page.rs index 070a03d6..af8c54c0 100644 --- a/certs/src/models/certs_page.rs +++ b/src/models/certs_page.rs @@ -1,20 +1,20 @@ /* - * SuperMQ Certs service + * SuperMQ Combined Service * - * HTTP API for Certs service Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ -use crate::models; -use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct CertsPage { #[serde(rename = "certs", skip_serializing_if = "Option::is_none")] - pub certs: Option>, + pub certs: Option>, /// Total number of items. #[serde(rename = "total", skip_serializing_if = "Option::is_none")] pub total: Option, @@ -37,3 +37,4 @@ impl CertsPage { } } + diff --git a/channels/src/models/channel.rs b/src/models/channel.rs similarity index 83% rename from channels/src/models/channel.rs rename to src/models/channel.rs index 9f6cacfb..06c16db0 100644 --- a/channels/src/models/channel.rs +++ b/src/models/channel.rs @@ -1,17 +1,17 @@ /* - * SuperMQ Channels Service + * SuperMQ Combined Service * - * This is the Channels Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform channels. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ -use crate::models; -use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct Channel { /// Unique channel identifier generated by the service. #[serde(rename = "id", skip_serializing_if = "Option::is_none")] @@ -66,3 +66,4 @@ impl Channel { } } + diff --git a/channels/src/models/channel_connection_req_schema.rs b/src/models/channel_connection_req_schema.rs similarity index 59% rename from channels/src/models/channel_connection_req_schema.rs rename to src/models/channel_connection_req_schema.rs index 254382a0..741571ad 100644 --- a/channels/src/models/channel_connection_req_schema.rs +++ b/src/models/channel_connection_req_schema.rs @@ -1,17 +1,17 @@ /* - * SuperMQ Channels Service + * SuperMQ Combined Service * - * This is the Channels Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform channels. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ -use crate::models; -use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct ChannelConnectionReqSchema { /// Client IDs #[serde(rename = "client_ids", skip_serializing_if = "Option::is_none")] @@ -30,3 +30,4 @@ impl ChannelConnectionReqSchema { } } + diff --git a/channels/src/models/channel_req_obj.rs b/src/models/channel_req_obj.rs similarity index 72% rename from channels/src/models/channel_req_obj.rs rename to src/models/channel_req_obj.rs index 0e527723..256558fc 100644 --- a/channels/src/models/channel_req_obj.rs +++ b/src/models/channel_req_obj.rs @@ -1,17 +1,17 @@ /* - * SuperMQ Channels Service + * SuperMQ Combined Service * - * This is the Channels Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform channels. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ -use crate::models; -use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct ChannelReqObj { /// Free-form channel name. Channel name is unique on the given hierarchy level. #[serde(rename = "name")] @@ -42,3 +42,4 @@ impl ChannelReqObj { } } + diff --git a/channels/src/models/channel_update.rs b/src/models/channel_update.rs similarity index 62% rename from channels/src/models/channel_update.rs rename to src/models/channel_update.rs index a1abd567..dea40b4d 100644 --- a/channels/src/models/channel_update.rs +++ b/src/models/channel_update.rs @@ -1,17 +1,17 @@ /* - * SuperMQ Channels Service + * SuperMQ Combined Service * - * This is the Channels Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform channels. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ -use crate::models; -use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct ChannelUpdate { /// Free-form channel name. Channel name is unique on the given hierarchy level. #[serde(rename = "name")] @@ -34,3 +34,4 @@ impl ChannelUpdate { } } + diff --git a/src/models/channel_update_tags.rs b/src/models/channel_update_tags.rs new file mode 100644 index 00000000..80a606de --- /dev/null +++ b/src/models/channel_update_tags.rs @@ -0,0 +1,29 @@ +/* + * SuperMQ Combined Service + * + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct ChannelUpdateTags { + /// Channel tags. + #[serde(rename = "tags")] + pub tags: Vec, +} + +impl ChannelUpdateTags { + pub fn new(tags: Vec) -> ChannelUpdateTags { + ChannelUpdateTags { + tags, + } + } +} + + diff --git a/channels/src/models/channels_page.rs b/src/models/channels_page.rs similarity index 54% rename from channels/src/models/channels_page.rs rename to src/models/channels_page.rs index 1103baaf..0b7a78b2 100644 --- a/channels/src/models/channels_page.rs +++ b/src/models/channels_page.rs @@ -1,20 +1,20 @@ /* - * SuperMQ Channels Service + * SuperMQ Combined Service * - * This is the Channels Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform channels. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ -use crate::models; -use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct ChannelsPage { #[serde(rename = "channels")] - pub channels: Vec, + pub channels: Vec, /// Total number of items. #[serde(rename = "total")] pub total: i32, @@ -27,7 +27,7 @@ pub struct ChannelsPage { } impl ChannelsPage { - pub fn new(channels: Vec, total: i32, offset: i32) -> ChannelsPage { + pub fn new(channels: Vec, total: i32, offset: i32) -> ChannelsPage { ChannelsPage { channels, total, @@ -37,3 +37,4 @@ impl ChannelsPage { } } + diff --git a/src/models/children_group_req_obj.rs b/src/models/children_group_req_obj.rs new file mode 100644 index 00000000..22318084 --- /dev/null +++ b/src/models/children_group_req_obj.rs @@ -0,0 +1,29 @@ +/* + * SuperMQ Combined Service + * + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct ChildrenGroupReqObj { + /// Children group IDs. + #[serde(rename = "groups")] + pub groups: Vec, +} + +impl ChildrenGroupReqObj { + pub fn new(groups: Vec) -> ChildrenGroupReqObj { + ChildrenGroupReqObj { + groups, + } + } +} + + diff --git a/clients/src/models/client.rs b/src/models/client.rs similarity index 76% rename from clients/src/models/client.rs rename to src/models/client.rs index 22da8075..98d61da5 100644 --- a/clients/src/models/client.rs +++ b/src/models/client.rs @@ -1,17 +1,17 @@ /* - * SuperMQ Clients Service + * SuperMQ Combined Service * - * This is the Clients Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform clients. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ -use crate::models; -use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct Client { /// Client unique identifier. #[serde(rename = "id", skip_serializing_if = "Option::is_none")] @@ -26,7 +26,7 @@ pub struct Client { #[serde(rename = "domain_id", skip_serializing_if = "Option::is_none")] pub domain_id: Option, #[serde(rename = "credentials", skip_serializing_if = "Option::is_none")] - pub credentials: Option>, + pub credentials: Option>, /// Arbitrary, object-encoded client's data. #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")] pub metadata: Option, @@ -57,3 +57,4 @@ impl Client { } } + diff --git a/clients/src/models/client_credentials.rs b/src/models/client_credentials.rs similarity index 58% rename from clients/src/models/client_credentials.rs rename to src/models/client_credentials.rs index 42018d6e..83fc3f99 100644 --- a/clients/src/models/client_credentials.rs +++ b/src/models/client_credentials.rs @@ -1,17 +1,17 @@ /* - * SuperMQ Clients Service + * SuperMQ Combined Service * - * This is the Clients Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform clients. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ -use crate::models; -use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct ClientCredentials { /// Client Identity for example email address. #[serde(rename = "identity", skip_serializing_if = "Option::is_none")] @@ -30,3 +30,4 @@ impl ClientCredentials { } } + diff --git a/clients/src/models/client_req_obj.rs b/src/models/client_req_obj.rs similarity index 61% rename from clients/src/models/client_req_obj.rs rename to src/models/client_req_obj.rs index 29ac0fd5..eeaf3187 100644 --- a/clients/src/models/client_req_obj.rs +++ b/src/models/client_req_obj.rs @@ -1,17 +1,17 @@ /* - * SuperMQ Clients Service + * SuperMQ Combined Service * - * This is the Clients Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform clients. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ -use crate::models; -use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct ClientReqObj { /// Client name. #[serde(rename = "name", skip_serializing_if = "Option::is_none")] @@ -20,7 +20,7 @@ pub struct ClientReqObj { #[serde(rename = "tags", skip_serializing_if = "Option::is_none")] pub tags: Option>, #[serde(rename = "credentials")] - pub credentials: Box, + pub credentials: Box, /// Arbitrary, object-encoded client's data. #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")] pub metadata: Option, @@ -30,7 +30,7 @@ pub struct ClientReqObj { } impl ClientReqObj { - pub fn new(credentials: models::ClientReqObjCredentials) -> ClientReqObj { + pub fn new(credentials: crate::models::ClientReqObjCredentials) -> ClientReqObj { ClientReqObj { name: None, tags: None, @@ -41,3 +41,4 @@ impl ClientReqObj { } } + diff --git a/clients/src/models/client_req_obj_credentials.rs b/src/models/client_req_obj_credentials.rs similarity index 61% rename from clients/src/models/client_req_obj_credentials.rs rename to src/models/client_req_obj_credentials.rs index 72ef3f17..2daef10e 100644 --- a/clients/src/models/client_req_obj_credentials.rs +++ b/src/models/client_req_obj_credentials.rs @@ -1,17 +1,17 @@ /* - * SuperMQ Clients Service + * SuperMQ Combined Service * - * This is the Clients Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform clients. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ -use crate::models; -use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct ClientReqObjCredentials { /// Client's identity will be used as its unique identifier #[serde(rename = "identity", skip_serializing_if = "Option::is_none")] @@ -30,3 +30,4 @@ impl ClientReqObjCredentials { } } + diff --git a/src/models/client_secret.rs b/src/models/client_secret.rs new file mode 100644 index 00000000..930e1347 --- /dev/null +++ b/src/models/client_secret.rs @@ -0,0 +1,29 @@ +/* + * SuperMQ Combined Service + * + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct ClientSecret { + /// New client secret. + #[serde(rename = "secret")] + pub secret: String, +} + +impl ClientSecret { + pub fn new(secret: String) -> ClientSecret { + ClientSecret { + secret, + } + } +} + + diff --git a/src/models/client_tags.rs b/src/models/client_tags.rs new file mode 100644 index 00000000..608cc1a9 --- /dev/null +++ b/src/models/client_tags.rs @@ -0,0 +1,29 @@ +/* + * SuperMQ Combined Service + * + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct ClientTags { + /// Client tags. + #[serde(rename = "tags", skip_serializing_if = "Option::is_none")] + pub tags: Option>, +} + +impl ClientTags { + pub fn new() -> ClientTags { + ClientTags { + tags: None, + } + } +} + + diff --git a/clients/src/models/client_update.rs b/src/models/client_update.rs similarity index 54% rename from clients/src/models/client_update.rs rename to src/models/client_update.rs index 3b45325b..4855fb2e 100644 --- a/clients/src/models/client_update.rs +++ b/src/models/client_update.rs @@ -1,17 +1,17 @@ /* - * SuperMQ Clients Service + * SuperMQ Combined Service * - * This is the Clients Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform clients. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ -use crate::models; -use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct ClientUpdate { /// Client name. #[serde(rename = "name")] @@ -30,3 +30,4 @@ impl ClientUpdate { } } + diff --git a/clients/src/models/client_with_empty_secret.rs b/src/models/client_with_empty_secret.rs similarity index 77% rename from clients/src/models/client_with_empty_secret.rs rename to src/models/client_with_empty_secret.rs index b53a24fd..536d2e79 100644 --- a/clients/src/models/client_with_empty_secret.rs +++ b/src/models/client_with_empty_secret.rs @@ -1,17 +1,17 @@ /* - * SuperMQ Clients Service + * SuperMQ Combined Service * - * This is the Clients Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform clients. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ -use crate::models; -use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct ClientWithEmptySecret { /// Client unique identifier. #[serde(rename = "id", skip_serializing_if = "Option::is_none")] @@ -26,7 +26,7 @@ pub struct ClientWithEmptySecret { #[serde(rename = "domain_id", skip_serializing_if = "Option::is_none")] pub domain_id: Option, #[serde(rename = "credentials", skip_serializing_if = "Option::is_none")] - pub credentials: Option>, + pub credentials: Option>, /// Arbitrary, object-encoded client's data. #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")] pub metadata: Option, @@ -57,3 +57,4 @@ impl ClientWithEmptySecret { } } + diff --git a/clients/src/models/client_with_empty_secret_credentials.rs b/src/models/client_with_empty_secret_credentials.rs similarity index 60% rename from clients/src/models/client_with_empty_secret_credentials.rs rename to src/models/client_with_empty_secret_credentials.rs index 0a8ac490..8016c22d 100644 --- a/clients/src/models/client_with_empty_secret_credentials.rs +++ b/src/models/client_with_empty_secret_credentials.rs @@ -1,17 +1,17 @@ /* - * SuperMQ Clients Service + * SuperMQ Combined Service * - * This is the Clients Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform clients. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ -use crate::models; -use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct ClientWithEmptySecretCredentials { /// Client Identity for example email address. #[serde(rename = "identity", skip_serializing_if = "Option::is_none")] @@ -30,3 +30,4 @@ impl ClientWithEmptySecretCredentials { } } + diff --git a/clients/src/models/clients_page.rs b/src/models/clients_page.rs similarity index 53% rename from clients/src/models/clients_page.rs rename to src/models/clients_page.rs index 8fd2c2c1..25566e55 100644 --- a/clients/src/models/clients_page.rs +++ b/src/models/clients_page.rs @@ -1,20 +1,20 @@ /* - * SuperMQ Clients Service + * SuperMQ Combined Service * - * This is the Clients Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform clients. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ -use crate::models; -use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct ClientsPage { #[serde(rename = "clients")] - pub clients: Vec, + pub clients: Vec, /// Total number of items. #[serde(rename = "total")] pub total: i32, @@ -27,7 +27,7 @@ pub struct ClientsPage { } impl ClientsPage { - pub fn new(clients: Vec, total: i32, offset: i32) -> ClientsPage { + pub fn new(clients: Vec, total: i32, offset: i32) -> ClientsPage { ClientsPage { clients, total, @@ -37,3 +37,4 @@ impl ClientsPage { } } + diff --git a/bootstrap/src/models/config_channels_inner.rs b/src/models/config_channels_inner.rs similarity index 66% rename from bootstrap/src/models/config_channels_inner.rs rename to src/models/config_channels_inner.rs index a62a12f3..30f2acae 100644 --- a/bootstrap/src/models/config_channels_inner.rs +++ b/src/models/config_channels_inner.rs @@ -1,17 +1,17 @@ /* - * SuperMQ Bootstrap service + * SuperMQ Combined Service * - * HTTP API for managing platform clients configuration. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ -use crate::models; -use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct ConfigChannelsInner { /// Channel unique identifier. #[serde(rename = "id", skip_serializing_if = "Option::is_none")] @@ -34,3 +34,4 @@ impl ConfigChannelsInner { } } + diff --git a/channels/src/models/connection_req_schema.rs b/src/models/connection_req_schema.rs similarity index 64% rename from channels/src/models/connection_req_schema.rs rename to src/models/connection_req_schema.rs index 7a29d4f5..894356f6 100644 --- a/channels/src/models/connection_req_schema.rs +++ b/src/models/connection_req_schema.rs @@ -1,17 +1,17 @@ /* - * SuperMQ Channels Service + * SuperMQ Combined Service * - * This is the Channels Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform channels. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ -use crate::models; -use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct ConnectionReqSchema { /// Channel IDs. #[serde(rename = "channel_ids", skip_serializing_if = "Option::is_none")] @@ -34,3 +34,4 @@ impl ConnectionReqSchema { } } + diff --git a/certs/src/models/create_cert_request.rs b/src/models/create_cert_request.rs similarity index 54% rename from certs/src/models/create_cert_request.rs rename to src/models/create_cert_request.rs index 176da43a..9c3f5b6f 100644 --- a/certs/src/models/create_cert_request.rs +++ b/src/models/create_cert_request.rs @@ -1,17 +1,17 @@ /* - * SuperMQ Certs service + * SuperMQ Combined Service * - * HTTP API for Certs service Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ -use crate::models; -use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct CreateCertRequest { #[serde(rename = "client_id")] pub client_id: uuid::Uuid, @@ -28,3 +28,4 @@ impl CreateCertRequest { } } + diff --git a/bootstrap/src/models/create_config_request.rs b/src/models/create_config_request.rs similarity index 80% rename from bootstrap/src/models/create_config_request.rs rename to src/models/create_config_request.rs index 3b49f5e3..d346ae42 100644 --- a/bootstrap/src/models/create_config_request.rs +++ b/src/models/create_config_request.rs @@ -1,17 +1,17 @@ /* - * SuperMQ Bootstrap service + * SuperMQ Combined Service * - * HTTP API for managing platform clients configuration. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ -use crate::models; -use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct CreateConfigRequest { /// External ID (MAC address or some unique identifier). #[serde(rename = "external_id")] @@ -54,3 +54,4 @@ impl CreateConfigRequest { } } + diff --git a/groups/src/models/create_role_obj.rs b/src/models/create_role_obj.rs similarity index 64% rename from groups/src/models/create_role_obj.rs rename to src/models/create_role_obj.rs index fba68081..e06b9d9e 100644 --- a/groups/src/models/create_role_obj.rs +++ b/src/models/create_role_obj.rs @@ -1,17 +1,17 @@ /* - * SuperMQ Groups Service + * SuperMQ Combined Service * - * This is the Groups Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform groups. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ -use crate::models; -use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct CreateRoleObj { /// Role's name. #[serde(rename = "role_name", skip_serializing_if = "Option::is_none")] @@ -34,3 +34,4 @@ impl CreateRoleObj { } } + diff --git a/notifiers/src/models/create_subscription.rs b/src/models/create_subscription.rs similarity index 62% rename from notifiers/src/models/create_subscription.rs rename to src/models/create_subscription.rs index 6e0c508a..fe0112cd 100644 --- a/notifiers/src/models/create_subscription.rs +++ b/src/models/create_subscription.rs @@ -1,17 +1,17 @@ /* - * SuperMQ Notifiers service + * SuperMQ Combined Service * - * HTTP API for Notifiers service. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ -use crate::models; -use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct CreateSubscription { /// Topic to which the user subscribes. #[serde(rename = "topic", skip_serializing_if = "Option::is_none")] @@ -30,3 +30,4 @@ impl CreateSubscription { } } + diff --git a/twins/src/models/definition.rs b/src/models/definition.rs similarity index 51% rename from twins/src/models/definition.rs rename to src/models/definition.rs index 543d2465..1d411fb7 100644 --- a/twins/src/models/definition.rs +++ b/src/models/definition.rs @@ -1,23 +1,23 @@ /* - * SuperMQ twins service + * SuperMQ Combined Service * - * HTTP API for managing digital twins and their states. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ -use crate::models; -use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct Definition { /// Minimal time delay before new state creation. #[serde(rename = "delta", skip_serializing_if = "Option::is_none")] - pub delta: Option, + pub delta: Option, #[serde(rename = "attributes", skip_serializing_if = "Option::is_none")] - pub attributes: Option>, + pub attributes: Option>, } impl Definition { @@ -29,3 +29,4 @@ impl Definition { } } + diff --git a/domains/src/models/domain.rs b/src/models/domain.rs similarity index 80% rename from domains/src/models/domain.rs rename to src/models/domain.rs index c2bf39c7..98d74015 100644 --- a/domains/src/models/domain.rs +++ b/src/models/domain.rs @@ -1,17 +1,17 @@ /* - * Magistrala Domains Service + * SuperMQ Combined Service * - * This is the Domains Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform domains. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The Magistrala repository](https://github.com/absmach/magistrala) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ -use crate::models; -use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct Domain { /// Domain unique identified. #[serde(rename = "id", skip_serializing_if = "Option::is_none")] @@ -62,3 +62,4 @@ impl Domain { } } + diff --git a/domains/src/models/domain_req_obj.rs b/src/models/domain_req_obj.rs similarity index 64% rename from domains/src/models/domain_req_obj.rs rename to src/models/domain_req_obj.rs index 829c54d8..45e4a237 100644 --- a/domains/src/models/domain_req_obj.rs +++ b/src/models/domain_req_obj.rs @@ -1,17 +1,17 @@ /* - * Magistrala Domains Service + * SuperMQ Combined Service * - * This is the Domains Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform domains. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The Magistrala repository](https://github.com/absmach/magistrala) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ -use crate::models; -use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct DomainReqObj { /// Domain name. #[serde(rename = "name")] @@ -38,3 +38,4 @@ impl DomainReqObj { } } + diff --git a/domains/src/models/domain_update.rs b/src/models/domain_update.rs similarity index 66% rename from domains/src/models/domain_update.rs rename to src/models/domain_update.rs index a384fec0..981d9fac 100644 --- a/domains/src/models/domain_update.rs +++ b/src/models/domain_update.rs @@ -1,17 +1,17 @@ /* - * Magistrala Domains Service + * SuperMQ Combined Service * - * This is the Domains Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform domains. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The Magistrala repository](https://github.com/absmach/magistrala) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ -use crate::models; -use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct DomainUpdate { /// Domain name. #[serde(rename = "name", skip_serializing_if = "Option::is_none")] @@ -38,3 +38,4 @@ impl DomainUpdate { } } + diff --git a/domains/src/models/domains_page.rs b/src/models/domains_page.rs similarity index 54% rename from domains/src/models/domains_page.rs rename to src/models/domains_page.rs index 82284aa6..7e511f91 100644 --- a/domains/src/models/domains_page.rs +++ b/src/models/domains_page.rs @@ -1,20 +1,20 @@ /* - * Magistrala Domains Service + * SuperMQ Combined Service * - * This is the Domains Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform domains. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The Magistrala repository](https://github.com/absmach/magistrala) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ -use crate::models; -use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct DomainsPage { #[serde(rename = "domains")] - pub domains: Vec, + pub domains: Vec, /// Total number of items. #[serde(rename = "total")] pub total: i32, @@ -27,7 +27,7 @@ pub struct DomainsPage { } impl DomainsPage { - pub fn new(domains: Vec, total: i32, offset: i32) -> DomainsPage { + pub fn new(domains: Vec, total: i32, offset: i32) -> DomainsPage { DomainsPage { domains, total, @@ -37,3 +37,4 @@ impl DomainsPage { } } + diff --git a/src/models/email.rs b/src/models/email.rs new file mode 100644 index 00000000..64b93272 --- /dev/null +++ b/src/models/email.rs @@ -0,0 +1,29 @@ +/* + * SuperMQ Combined Service + * + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct Email { + /// User email address. + #[serde(rename = "email")] + pub email: String, +} + +impl Email { + pub fn new(email: String) -> Email { + Email { + email, + } + } +} + + diff --git a/src/models/error.rs b/src/models/error.rs new file mode 100644 index 00000000..43153718 --- /dev/null +++ b/src/models/error.rs @@ -0,0 +1,29 @@ +/* + * SuperMQ Combined Service + * + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct Error { + /// Error message + #[serde(rename = "error", skip_serializing_if = "Option::is_none")] + pub error: Option, +} + +impl Error { + pub fn new() -> Error { + Error { + error: None, + } + } +} + + diff --git a/groups/src/models/group.rs b/src/models/group.rs similarity index 83% rename from groups/src/models/group.rs rename to src/models/group.rs index 06e13076..b8dc0b59 100644 --- a/groups/src/models/group.rs +++ b/src/models/group.rs @@ -1,17 +1,17 @@ /* - * SuperMQ Groups Service + * SuperMQ Combined Service * - * This is the Groups Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform groups. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ -use crate::models; -use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct Group { /// Unique group identifier generated by the service. #[serde(rename = "id", skip_serializing_if = "Option::is_none")] @@ -66,3 +66,4 @@ impl Group { } } + diff --git a/groups/src/models/group_req_obj.rs b/src/models/group_req_obj.rs similarity index 71% rename from groups/src/models/group_req_obj.rs rename to src/models/group_req_obj.rs index 19fd825d..b0d7838e 100644 --- a/groups/src/models/group_req_obj.rs +++ b/src/models/group_req_obj.rs @@ -1,17 +1,17 @@ /* - * SuperMQ Groups Service + * SuperMQ Combined Service * - * This is the Groups Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform groups. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ -use crate::models; -use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct GroupReqObj { /// Free-form group name. Group name is unique on the given hierarchy level. #[serde(rename = "name")] @@ -42,3 +42,4 @@ impl GroupReqObj { } } + diff --git a/groups/src/models/group_update.rs b/src/models/group_update.rs similarity index 62% rename from groups/src/models/group_update.rs rename to src/models/group_update.rs index 5d009c7b..d94f28a4 100644 --- a/groups/src/models/group_update.rs +++ b/src/models/group_update.rs @@ -1,17 +1,17 @@ /* - * SuperMQ Groups Service + * SuperMQ Combined Service * - * This is the Groups Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform groups. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ -use crate::models; -use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct GroupUpdate { /// Free-form group name. Group name is unique on the given hierarchy level. #[serde(rename = "name")] @@ -34,3 +34,4 @@ impl GroupUpdate { } } + diff --git a/groups/src/models/groups_hierarchy_page.rs b/src/models/groups_hierarchy_page.rs similarity index 59% rename from groups/src/models/groups_hierarchy_page.rs rename to src/models/groups_hierarchy_page.rs index 5906c415..0e3c9a9c 100644 --- a/groups/src/models/groups_hierarchy_page.rs +++ b/src/models/groups_hierarchy_page.rs @@ -1,17 +1,17 @@ /* - * SuperMQ Groups Service + * SuperMQ Combined Service * - * This is the Groups Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform groups. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ -use crate::models; -use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct GroupsHierarchyPage { /// Level of hierarchy. #[serde(rename = "level", skip_serializing_if = "Option::is_none")] @@ -20,7 +20,7 @@ pub struct GroupsHierarchyPage { #[serde(rename = "direction", skip_serializing_if = "Option::is_none")] pub direction: Option, #[serde(rename = "groups", skip_serializing_if = "Option::is_none")] - pub groups: Option>, + pub groups: Option>, } impl GroupsHierarchyPage { @@ -33,3 +33,4 @@ impl GroupsHierarchyPage { } } + diff --git a/groups/src/models/groups_page.rs b/src/models/groups_page.rs similarity index 54% rename from groups/src/models/groups_page.rs rename to src/models/groups_page.rs index 30be5d9a..3f9e5e80 100644 --- a/groups/src/models/groups_page.rs +++ b/src/models/groups_page.rs @@ -1,20 +1,20 @@ /* - * SuperMQ Groups Service + * SuperMQ Combined Service * - * This is the Groups Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform groups. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ -use crate::models; -use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct GroupsPage { #[serde(rename = "groups")] - pub groups: Vec, + pub groups: Vec, /// Total number of items. #[serde(rename = "total")] pub total: i32, @@ -27,7 +27,7 @@ pub struct GroupsPage { } impl GroupsPage { - pub fn new(groups: Vec, total: i32, offset: i32) -> GroupsPage { + pub fn new(groups: Vec, total: i32, offset: i32) -> GroupsPage { GroupsPage { groups, total, @@ -37,3 +37,4 @@ impl GroupsPage { } } + diff --git a/http/src/models/health_info.rs b/src/models/health_info.rs similarity index 78% rename from http/src/models/health_info.rs rename to src/models/health_info.rs index 209edbe3..324c6e3e 100644 --- a/http/src/models/health_info.rs +++ b/src/models/health_info.rs @@ -1,17 +1,17 @@ /* - * SuperMQ http adapter + * SuperMQ Combined Service * - * HTTP API for sending messages through communication channels. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ -use crate::models; -use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct HealthInfo { /// Service status. #[serde(rename = "status", skip_serializing_if = "Option::is_none")] @@ -45,6 +45,7 @@ impl HealthInfo { } } } + /// Service status. #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] pub enum Status { diff --git a/users/src/models/health_res.rs b/src/models/health_res.rs similarity index 74% rename from users/src/models/health_res.rs rename to src/models/health_res.rs index f2b66d58..4dc367bb 100644 --- a/users/src/models/health_res.rs +++ b/src/models/health_res.rs @@ -1,17 +1,17 @@ /* - * SuperMQ Users Service + * SuperMQ Combined Service * - * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ -use crate::models; -use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct HealthRes { /// Service status. #[serde(rename = "status", skip_serializing_if = "Option::is_none")] @@ -41,6 +41,7 @@ impl HealthRes { } } } + /// Service status. #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] pub enum Status { diff --git a/invitations/src/models/invitation.rs b/src/models/invitation.rs similarity index 82% rename from invitations/src/models/invitation.rs rename to src/models/invitation.rs index 5fdbea44..7ece77d0 100644 --- a/invitations/src/models/invitation.rs +++ b/src/models/invitation.rs @@ -1,17 +1,17 @@ /* - * SuperMQ Invitations Service + * SuperMQ Combined Service * - * This is the Invitations Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform invitations. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ -use crate::models; -use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct Invitation { /// User unique identifier. #[serde(rename = "invited_by", skip_serializing_if = "Option::is_none")] @@ -49,6 +49,7 @@ impl Invitation { } } } + /// Relation between user and domain. #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] pub enum Relation { diff --git a/invitations/src/models/invitation_page.rs b/src/models/invitation_page.rs similarity index 53% rename from invitations/src/models/invitation_page.rs rename to src/models/invitation_page.rs index 9d94601e..976e1db3 100644 --- a/invitations/src/models/invitation_page.rs +++ b/src/models/invitation_page.rs @@ -1,20 +1,20 @@ /* - * SuperMQ Invitations Service + * SuperMQ Combined Service * - * This is the Invitations Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform invitations. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ -use crate::models; -use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct InvitationPage { #[serde(rename = "invitations")] - pub invitations: Vec, + pub invitations: Vec, /// Total number of items. #[serde(rename = "total")] pub total: i32, @@ -27,7 +27,7 @@ pub struct InvitationPage { } impl InvitationPage { - pub fn new(invitations: Vec, total: i32, offset: i32) -> InvitationPage { + pub fn new(invitations: Vec, total: i32, offset: i32) -> InvitationPage { InvitationPage { invitations, total, @@ -37,3 +37,4 @@ impl InvitationPage { } } + diff --git a/auth/src/models/issue_key_request.rs b/src/models/issue_key_request.rs similarity index 57% rename from auth/src/models/issue_key_request.rs rename to src/models/issue_key_request.rs index 9175420f..0eedb9db 100644 --- a/auth/src/models/issue_key_request.rs +++ b/src/models/issue_key_request.rs @@ -1,24 +1,24 @@ /* - * SuperMQ Auth Service + * SuperMQ Combined Service * - * This is the Auth Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ -use crate::models; -use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct IssueKeyRequest { /// API key type. Keys of different type are processed differently. #[serde(rename = "type", skip_serializing_if = "Option::is_none")] pub r#type: Option, /// Number of seconds issued token is valid for. #[serde(rename = "duration", skip_serializing_if = "Option::is_none")] - pub duration: Option, + pub duration: Option, } impl IssueKeyRequest { @@ -30,3 +30,4 @@ impl IssueKeyRequest { } } + diff --git a/users/src/models/issue_token.rs b/src/models/issue_token.rs similarity index 53% rename from users/src/models/issue_token.rs rename to src/models/issue_token.rs index 84d56cbb..7075b954 100644 --- a/users/src/models/issue_token.rs +++ b/src/models/issue_token.rs @@ -1,17 +1,17 @@ /* - * SuperMQ Users Service + * SuperMQ Combined Service * - * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ -use crate::models; -use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct IssueToken { /// User identity - email address. #[serde(rename = "identity")] @@ -30,3 +30,4 @@ impl IssueToken { } } + diff --git a/users/src/models/issue_token_200_response.rs b/src/models/issue_token_200_response.rs similarity index 65% rename from users/src/models/issue_token_200_response.rs rename to src/models/issue_token_200_response.rs index b4a08f8c..2f6c65c9 100644 --- a/users/src/models/issue_token_200_response.rs +++ b/src/models/issue_token_200_response.rs @@ -1,17 +1,17 @@ /* - * SuperMQ Users Service + * SuperMQ Combined Service * - * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ -use crate::models; -use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct IssueToken200Response { /// User access token. #[serde(rename = "access_token", skip_serializing_if = "Option::is_none")] @@ -34,3 +34,4 @@ impl IssueToken200Response { } } + diff --git a/journal/src/models/journal.rs b/src/models/journal.rs similarity index 65% rename from journal/src/models/journal.rs rename to src/models/journal.rs index dccc07c8..13c47a2f 100644 --- a/journal/src/models/journal.rs +++ b/src/models/journal.rs @@ -1,17 +1,17 @@ /* - * SuperMQ Journal Log Service + * SuperMQ Combined Service * - * This is the Journal Log Server based on the OpenAPI 3.0 specification. It is the HTTP API for viewing journal log history. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 - * Contact: info@mainflux.com + * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ -use crate::models; -use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct Journal { /// Journal operation. #[serde(rename = "operation", skip_serializing_if = "Option::is_none")] @@ -38,3 +38,4 @@ impl Journal { } } + diff --git a/journal/src/models/journal_page.rs b/src/models/journal_page.rs similarity index 51% rename from journal/src/models/journal_page.rs rename to src/models/journal_page.rs index ec1dd2f8..447d81e3 100644 --- a/journal/src/models/journal_page.rs +++ b/src/models/journal_page.rs @@ -1,20 +1,20 @@ /* - * SuperMQ Journal Log Service + * SuperMQ Combined Service * - * This is the Journal Log Server based on the OpenAPI 3.0 specification. It is the HTTP API for viewing journal log history. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 - * Contact: info@mainflux.com + * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ -use crate::models; -use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct JournalPage { #[serde(rename = "journals")] - pub journals: Vec, + pub journals: Vec, /// Total number of items. #[serde(rename = "total")] pub total: i32, @@ -27,7 +27,7 @@ pub struct JournalPage { } impl JournalPage { - pub fn new(journals: Vec, total: i32, offset: i32) -> JournalPage { + pub fn new(journals: Vec, total: i32, offset: i32) -> JournalPage { JournalPage { journals, total, @@ -37,3 +37,4 @@ impl JournalPage { } } + diff --git a/auth/src/models/key.rs b/src/models/key.rs similarity index 75% rename from auth/src/models/key.rs rename to src/models/key.rs index 17e947fa..094198e2 100644 --- a/auth/src/models/key.rs +++ b/src/models/key.rs @@ -1,17 +1,17 @@ /* - * SuperMQ Auth Service + * SuperMQ Combined Service * - * This is the Auth Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ -use crate::models; -use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct Key { /// API key unique identifier #[serde(rename = "id", skip_serializing_if = "Option::is_none")] @@ -46,3 +46,4 @@ impl Key { } } + diff --git a/users/src/models/members.rs b/src/models/members.rs similarity index 78% rename from users/src/models/members.rs rename to src/models/members.rs index 3ee8d225..38e50899 100644 --- a/users/src/models/members.rs +++ b/src/models/members.rs @@ -1,17 +1,17 @@ /* - * SuperMQ Users Service + * SuperMQ Combined Service * - * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ -use crate::models; -use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct Members { /// User unique identifier. #[serde(rename = "id", skip_serializing_if = "Option::is_none")] @@ -29,7 +29,7 @@ pub struct Members { #[serde(rename = "tags", skip_serializing_if = "Option::is_none")] pub tags: Option>, #[serde(rename = "credentials", skip_serializing_if = "Option::is_none")] - pub credentials: Option>, + pub credentials: Option>, /// Arbitrary, object-encoded user's data. #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")] pub metadata: Option, @@ -61,3 +61,4 @@ impl Members { } } + diff --git a/users/src/models/members_credentials.rs b/src/models/members_credentials.rs similarity index 57% rename from users/src/models/members_credentials.rs rename to src/models/members_credentials.rs index 7c83d001..b4f02b61 100644 --- a/users/src/models/members_credentials.rs +++ b/src/models/members_credentials.rs @@ -1,17 +1,17 @@ /* - * SuperMQ Users Service + * SuperMQ Combined Service * - * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ -use crate::models; -use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct MembersCredentials { /// User's username. #[serde(rename = "username", skip_serializing_if = "Option::is_none")] @@ -30,3 +30,4 @@ impl MembersCredentials { } } + diff --git a/users/src/models/members_page.rs b/src/models/members_page.rs similarity index 57% rename from users/src/models/members_page.rs rename to src/models/members_page.rs index 3510d5cc..1d09bedc 100644 --- a/users/src/models/members_page.rs +++ b/src/models/members_page.rs @@ -1,20 +1,20 @@ /* - * SuperMQ Users Service + * SuperMQ Combined Service * - * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ -use crate::models; -use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct MembersPage { #[serde(rename = "members")] - pub members: Vec, + pub members: Vec, /// Total number of items. #[serde(rename = "total")] pub total: i32, @@ -27,7 +27,7 @@ pub struct MembersPage { } impl MembersPage { - pub fn new(members: Vec, total: i32) -> MembersPage { + pub fn new(members: Vec, total: i32) -> MembersPage { MembersPage { members, total, @@ -37,3 +37,4 @@ impl MembersPage { } } + diff --git a/readers/src/models/messages_page.rs b/src/models/messages_page.rs similarity index 59% rename from readers/src/models/messages_page.rs rename to src/models/messages_page.rs index 7bad95ee..c8a8e40e 100644 --- a/readers/src/models/messages_page.rs +++ b/src/models/messages_page.rs @@ -1,29 +1,29 @@ /* - * SuperMQ reader service + * SuperMQ Combined Service * - * HTTP API for reading messages. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ -use crate::models; -use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct MessagesPage { /// Total number of items that are present on the system. #[serde(rename = "total", skip_serializing_if = "Option::is_none")] - pub total: Option, + pub total: Option, /// Number of items that were skipped during retrieval. #[serde(rename = "offset", skip_serializing_if = "Option::is_none")] - pub offset: Option, + pub offset: Option, /// Size of the subset that was retrieved. #[serde(rename = "limit", skip_serializing_if = "Option::is_none")] - pub limit: Option, + pub limit: Option, #[serde(rename = "messages", skip_serializing_if = "Option::is_none")] - pub messages: Option>, + pub messages: Option>, } impl MessagesPage { @@ -37,3 +37,4 @@ impl MessagesPage { } } + diff --git a/readers/src/models/messages_page_messages_inner.rs b/src/models/messages_page_messages_inner.rs similarity index 80% rename from readers/src/models/messages_page_messages_inner.rs rename to src/models/messages_page_messages_inner.rs index aebad35b..7f7f2ce8 100644 --- a/readers/src/models/messages_page_messages_inner.rs +++ b/src/models/messages_page_messages_inner.rs @@ -1,17 +1,17 @@ /* - * SuperMQ reader service + * SuperMQ Combined Service * - * HTTP API for reading messages. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ -use crate::models; -use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct MessagesPageMessagesInner { /// Unique channel id. #[serde(rename = "channel", skip_serializing_if = "Option::is_none")] @@ -30,7 +30,7 @@ pub struct MessagesPageMessagesInner { pub unit: Option, /// Measured value in number. #[serde(rename = "value", skip_serializing_if = "Option::is_none")] - pub value: Option, + pub value: Option, /// Measured value in string format. #[serde(rename = "stringValue", skip_serializing_if = "Option::is_none")] pub string_value: Option, @@ -42,13 +42,13 @@ pub struct MessagesPageMessagesInner { pub data_value: Option, /// Sum value. #[serde(rename = "valueSum", skip_serializing_if = "Option::is_none")] - pub value_sum: Option, + pub value_sum: Option, /// Time of measurement. #[serde(rename = "time", skip_serializing_if = "Option::is_none")] - pub time: Option, + pub time: Option, /// Time of updating measurement. #[serde(rename = "updateTime", skip_serializing_if = "Option::is_none")] - pub update_time: Option, + pub update_time: Option, } impl MessagesPageMessagesInner { @@ -70,3 +70,4 @@ impl MessagesPageMessagesInner { } } + diff --git a/src/models/mod.rs b/src/models/mod.rs new file mode 100644 index 00000000..725a512a --- /dev/null +++ b/src/models/mod.rs @@ -0,0 +1,192 @@ +pub mod accept_invitation_request; +pub use self::accept_invitation_request::AcceptInvitationRequest; +pub mod assign_req_obj; +pub use self::assign_req_obj::AssignReqObj; +pub mod assign_user_req_obj; +pub use self::assign_user_req_obj::AssignUserReqObj; +pub mod attribute; +pub use self::attribute::Attribute; +pub mod available_actions_obj; +pub use self::available_actions_obj::AvailableActionsObj; +pub mod cert; +pub use self::cert::Cert; +pub mod certs_page; +pub use self::certs_page::CertsPage; +pub mod channel; +pub use self::channel::Channel; +pub mod channel_connection_req_schema; +pub use self::channel_connection_req_schema::ChannelConnectionReqSchema; +pub mod channel_req_obj; +pub use self::channel_req_obj::ChannelReqObj; +pub mod channel_update; +pub use self::channel_update::ChannelUpdate; +pub mod channel_update_tags; +pub use self::channel_update_tags::ChannelUpdateTags; +pub mod channels_page; +pub use self::channels_page::ChannelsPage; +pub mod children_group_req_obj; +pub use self::children_group_req_obj::ChildrenGroupReqObj; +pub mod client; +pub use self::client::Client; +pub mod client_credentials; +pub use self::client_credentials::ClientCredentials; +pub mod client_req_obj; +pub use self::client_req_obj::ClientReqObj; +pub mod client_req_obj_credentials; +pub use self::client_req_obj_credentials::ClientReqObjCredentials; +pub mod client_secret; +pub use self::client_secret::ClientSecret; +pub mod client_tags; +pub use self::client_tags::ClientTags; +pub mod client_update; +pub use self::client_update::ClientUpdate; +pub mod client_with_empty_secret; +pub use self::client_with_empty_secret::ClientWithEmptySecret; +pub mod client_with_empty_secret_credentials; +pub use self::client_with_empty_secret_credentials::ClientWithEmptySecretCredentials; +pub mod clients_page; +pub use self::clients_page::ClientsPage; +pub mod config_channels_inner; +pub use self::config_channels_inner::ConfigChannelsInner; +pub mod connection_req_schema; +pub use self::connection_req_schema::ConnectionReqSchema; +pub mod create_cert_request; +pub use self::create_cert_request::CreateCertRequest; +pub mod create_config_request; +pub use self::create_config_request::CreateConfigRequest; +pub mod create_role_obj; +pub use self::create_role_obj::CreateRoleObj; +pub mod create_subscription; +pub use self::create_subscription::CreateSubscription; +pub mod definition; +pub use self::definition::Definition; +pub mod domain; +pub use self::domain::Domain; +pub mod __domain_id__mapping_post_request; +pub use self::__domain_id__mapping_post_request::DomainIdMappingPostRequest; +pub mod domain_req_obj; +pub use self::domain_req_obj::DomainReqObj; +pub mod domain_update; +pub use self::domain_update::DomainUpdate; +pub mod domains_page; +pub use self::domains_page::DomainsPage; +pub mod email; +pub use self::email::Email; +pub mod error; +pub use self::error::Error; +pub mod group; +pub use self::group::Group; +pub mod group_req_obj; +pub use self::group_req_obj::GroupReqObj; +pub mod group_update; +pub use self::group_update::GroupUpdate; +pub mod groups_hierarchy_page; +pub use self::groups_hierarchy_page::GroupsHierarchyPage; +pub mod groups_page; +pub use self::groups_page::GroupsPage; +pub mod health_info; +pub use self::health_info::HealthInfo; +pub mod health_res; +pub use self::health_res::HealthRes; +pub mod invitation; +pub use self::invitation::Invitation; +pub mod invitation_page; +pub use self::invitation_page::InvitationPage; +pub mod issue_key_request; +pub use self::issue_key_request::IssueKeyRequest; +pub mod issue_token; +pub use self::issue_token::IssueToken; +pub mod issue_token_200_response; +pub use self::issue_token_200_response::IssueToken200Response; +pub mod journal; +pub use self::journal::Journal; +pub mod journal_page; +pub use self::journal_page::JournalPage; +pub mod key; +pub use self::key::Key; +pub mod members; +pub use self::members::Members; +pub mod members_credentials; +pub use self::members_credentials::MembersCredentials; +pub mod members_page; +pub use self::members_page::MembersPage; +pub mod messages_page; +pub use self::messages_page::MessagesPage; +pub mod messages_page_messages_inner; +pub use self::messages_page_messages_inner::MessagesPageMessagesInner; +pub mod new_role; +pub use self::new_role::NewRole; +pub mod page; +pub use self::page::Page; +pub mod parent_group_req_obj; +pub use self::parent_group_req_obj::ParentGroupReqObj; +pub mod parent_group_req_obj2; +pub use self::parent_group_req_obj2::ParentGroupReqObj2; +pub mod request_password_reset_request; +pub use self::request_password_reset_request::RequestPasswordResetRequest; +pub mod reset_password_request; +pub use self::reset_password_request::ResetPasswordRequest; +pub mod revoke; +pub use self::revoke::Revoke; +pub mod role; +pub use self::role::Role; +pub mod role_actions_obj; +pub use self::role_actions_obj::RoleActionsObj; +pub mod role_members_obj; +pub use self::role_members_obj::RoleMembersObj; +pub mod roles_page; +pub use self::roles_page::RolesPage; +pub mod sen_ml_record; +pub use self::sen_ml_record::SenMlRecord; +pub mod send_invitation_req_obj; +pub use self::send_invitation_req_obj::SendInvitationReqObj; +pub mod serial; +pub use self::serial::Serial; +pub mod serials_page; +pub use self::serials_page::SerialsPage; +pub mod state; +pub use self::state::State; +pub mod state2; +pub use self::state2::State2; +pub mod states_page; +pub use self::states_page::StatesPage; +pub mod subscription; +pub use self::subscription::Subscription; +pub mod twin_req_obj; +pub use self::twin_req_obj::TwinReqObj; +pub mod twin_res_obj; +pub use self::twin_res_obj::TwinResObj; +pub mod twins_page; +pub use self::twins_page::TwinsPage; +pub mod update_config_certs_request; +pub use self::update_config_certs_request::UpdateConfigCertsRequest; +pub mod update_config_connections_request; +pub use self::update_config_connections_request::UpdateConfigConnectionsRequest; +pub mod update_config_request; +pub use self::update_config_request::UpdateConfigRequest; +pub mod update_config_state_request; +pub use self::update_config_state_request::UpdateConfigStateRequest; +pub mod update_role_obj; +pub use self::update_role_obj::UpdateRoleObj; +pub mod user; +pub use self::user::User; +pub mod user_credentials; +pub use self::user_credentials::UserCredentials; +pub mod user_profile_picture; +pub use self::user_profile_picture::UserProfilePicture; +pub mod user_req_obj; +pub use self::user_req_obj::UserReqObj; +pub mod user_req_obj_credentials; +pub use self::user_req_obj_credentials::UserReqObjCredentials; +pub mod user_role; +pub use self::user_role::UserRole; +pub mod user_secret; +pub use self::user_secret::UserSecret; +pub mod user_tags; +pub use self::user_tags::UserTags; +pub mod user_update; +pub use self::user_update::UserUpdate; +pub mod username; +pub use self::username::Username; +pub mod users_page; +pub use self::users_page::UsersPage; diff --git a/groups/src/models/new_role.rs b/src/models/new_role.rs similarity index 76% rename from groups/src/models/new_role.rs rename to src/models/new_role.rs index cb80641a..8f37ef6f 100644 --- a/groups/src/models/new_role.rs +++ b/src/models/new_role.rs @@ -1,17 +1,17 @@ /* - * SuperMQ Groups Service + * SuperMQ Combined Service * - * This is the Groups Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform groups. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ -use crate::models; -use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct NewRole { /// Role unique identifier. #[serde(rename = "role_id", skip_serializing_if = "Option::is_none")] @@ -50,3 +50,4 @@ impl NewRole { } } + diff --git a/notifiers/src/models/page.rs b/src/models/page.rs similarity index 64% rename from notifiers/src/models/page.rs rename to src/models/page.rs index b7b60aa3..5c97cae2 100644 --- a/notifiers/src/models/page.rs +++ b/src/models/page.rs @@ -1,20 +1,20 @@ /* - * SuperMQ Notifiers service + * SuperMQ Combined Service * - * HTTP API for Notifiers service. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ -use crate::models; -use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct Page { #[serde(rename = "subscriptions", skip_serializing_if = "Option::is_none")] - pub subscriptions: Option>, + pub subscriptions: Option>, /// Total number of items. #[serde(rename = "total", skip_serializing_if = "Option::is_none")] pub total: Option, @@ -37,3 +37,4 @@ impl Page { } } + diff --git a/clients/src/models/parent_group_req_obj.rs b/src/models/parent_group_req_obj.rs similarity index 50% rename from clients/src/models/parent_group_req_obj.rs rename to src/models/parent_group_req_obj.rs index bf2cb6e0..240fae2b 100644 --- a/clients/src/models/parent_group_req_obj.rs +++ b/src/models/parent_group_req_obj.rs @@ -1,17 +1,17 @@ /* - * SuperMQ Clients Service + * SuperMQ Combined Service * - * This is the Clients Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform clients. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ -use crate::models; -use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct ParentGroupReqObj { /// Parent group unique identifier. #[serde(rename = "parent_group_id")] @@ -26,3 +26,4 @@ impl ParentGroupReqObj { } } + diff --git a/src/models/parent_group_req_obj2.rs b/src/models/parent_group_req_obj2.rs new file mode 100644 index 00000000..e734f11c --- /dev/null +++ b/src/models/parent_group_req_obj2.rs @@ -0,0 +1,29 @@ +/* + * SuperMQ Combined Service + * + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct ParentGroupReqObj2 { + /// Parent group unique identifier. + #[serde(rename = "group_id")] + pub group_id: uuid::Uuid, +} + +impl ParentGroupReqObj2 { + pub fn new(group_id: uuid::Uuid) -> ParentGroupReqObj2 { + ParentGroupReqObj2 { + group_id, + } + } +} + + diff --git a/users/src/models/request_password_reset_request.rs b/src/models/request_password_reset_request.rs similarity index 58% rename from users/src/models/request_password_reset_request.rs rename to src/models/request_password_reset_request.rs index 91466631..ba455528 100644 --- a/users/src/models/request_password_reset_request.rs +++ b/src/models/request_password_reset_request.rs @@ -1,17 +1,17 @@ /* - * SuperMQ Users Service + * SuperMQ Combined Service * - * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ -use crate::models; -use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct RequestPasswordResetRequest { /// User email. #[serde(rename = "email", skip_serializing_if = "Option::is_none")] @@ -30,3 +30,4 @@ impl RequestPasswordResetRequest { } } + diff --git a/users/src/models/reset_password_request.rs b/src/models/reset_password_request.rs similarity index 64% rename from users/src/models/reset_password_request.rs rename to src/models/reset_password_request.rs index 2386cb80..9f09a754 100644 --- a/users/src/models/reset_password_request.rs +++ b/src/models/reset_password_request.rs @@ -1,17 +1,17 @@ /* - * SuperMQ Users Service + * SuperMQ Combined Service * - * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ -use crate::models; -use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct ResetPasswordRequest { /// New password. #[serde(rename = "password", skip_serializing_if = "Option::is_none")] @@ -34,3 +34,4 @@ impl ResetPasswordRequest { } } + diff --git a/certs/src/models/revoke.rs b/src/models/revoke.rs similarity index 52% rename from certs/src/models/revoke.rs rename to src/models/revoke.rs index 52f474de..50b7c9f4 100644 --- a/certs/src/models/revoke.rs +++ b/src/models/revoke.rs @@ -1,17 +1,17 @@ /* - * SuperMQ Certs service + * SuperMQ Combined Service * - * HTTP API for Certs service Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ -use crate::models; -use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct Revoke { /// Certificate revocation time #[serde(rename = "revocation_time", skip_serializing_if = "Option::is_none")] @@ -26,3 +26,4 @@ impl Revoke { } } + diff --git a/groups/src/models/role.rs b/src/models/role.rs similarity index 76% rename from groups/src/models/role.rs rename to src/models/role.rs index ee5a09fd..1068d546 100644 --- a/groups/src/models/role.rs +++ b/src/models/role.rs @@ -1,17 +1,17 @@ /* - * SuperMQ Groups Service + * SuperMQ Combined Service * - * This is the Groups Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform groups. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ -use crate::models; -use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct Role { /// Role unique identifier. #[serde(rename = "role_id", skip_serializing_if = "Option::is_none")] @@ -50,3 +50,4 @@ impl Role { } } + diff --git a/groups/src/models/role_actions_obj.rs b/src/models/role_actions_obj.rs similarity index 50% rename from groups/src/models/role_actions_obj.rs rename to src/models/role_actions_obj.rs index 17711484..6221b618 100644 --- a/groups/src/models/role_actions_obj.rs +++ b/src/models/role_actions_obj.rs @@ -1,17 +1,17 @@ /* - * SuperMQ Groups Service + * SuperMQ Combined Service * - * This is the Groups Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform groups. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ -use crate::models; -use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct RoleActionsObj { /// List of actions to be added to a role. #[serde(rename = "actions", skip_serializing_if = "Option::is_none")] @@ -26,3 +26,4 @@ impl RoleActionsObj { } } + diff --git a/groups/src/models/role_members_obj.rs b/src/models/role_members_obj.rs similarity index 50% rename from groups/src/models/role_members_obj.rs rename to src/models/role_members_obj.rs index 8e49e45f..bc391ec9 100644 --- a/groups/src/models/role_members_obj.rs +++ b/src/models/role_members_obj.rs @@ -1,17 +1,17 @@ /* - * SuperMQ Groups Service + * SuperMQ Combined Service * - * This is the Groups Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform groups. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ -use crate::models; -use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct RoleMembersObj { /// List of members to be added to a role. #[serde(rename = "members", skip_serializing_if = "Option::is_none")] @@ -26,3 +26,4 @@ impl RoleMembersObj { } } + diff --git a/groups/src/models/roles_page.rs b/src/models/roles_page.rs similarity index 64% rename from groups/src/models/roles_page.rs rename to src/models/roles_page.rs index 81ac1748..c7f22394 100644 --- a/groups/src/models/roles_page.rs +++ b/src/models/roles_page.rs @@ -1,21 +1,21 @@ /* - * SuperMQ Groups Service + * SuperMQ Combined Service * - * This is the Groups Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform groups. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ -use crate::models; -use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct RolesPage { /// List of roles. #[serde(rename = "roles", skip_serializing_if = "Option::is_none")] - pub roles: Option>, + pub roles: Option>, /// Total number of roles. #[serde(rename = "total", skip_serializing_if = "Option::is_none")] pub total: Option, @@ -38,3 +38,4 @@ impl RolesPage { } } + diff --git a/http/src/models/sen_ml_record.rs b/src/models/sen_ml_record.rs similarity index 84% rename from http/src/models/sen_ml_record.rs rename to src/models/sen_ml_record.rs index db16277f..98897cda 100644 --- a/http/src/models/sen_ml_record.rs +++ b/src/models/sen_ml_record.rs @@ -1,17 +1,17 @@ /* - * SuperMQ http adapter + * SuperMQ Combined Service * - * HTTP API for sending messages through communication channels. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ -use crate::models; -use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct SenMlRecord { /// Base Name #[serde(rename = "bn", skip_serializing_if = "Option::is_none")] @@ -82,3 +82,4 @@ impl SenMlRecord { } } + diff --git a/invitations/src/models/send_invitation_req_obj.rs b/src/models/send_invitation_req_obj.rs similarity index 77% rename from invitations/src/models/send_invitation_req_obj.rs rename to src/models/send_invitation_req_obj.rs index 63dac198..01dca554 100644 --- a/invitations/src/models/send_invitation_req_obj.rs +++ b/src/models/send_invitation_req_obj.rs @@ -1,17 +1,17 @@ /* - * SuperMQ Invitations Service + * SuperMQ Combined Service * - * This is the Invitations Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform invitations. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ -use crate::models; -use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct SendInvitationReqObj { /// User unique identifier. #[serde(rename = "user_id")] @@ -37,6 +37,7 @@ impl SendInvitationReqObj { } } } + /// Relation between user and domain. #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] pub enum Relation { diff --git a/certs/src/models/serial.rs b/src/models/serial.rs similarity index 50% rename from certs/src/models/serial.rs rename to src/models/serial.rs index a849378f..39d57eff 100644 --- a/certs/src/models/serial.rs +++ b/src/models/serial.rs @@ -1,17 +1,17 @@ /* - * SuperMQ Certs service + * SuperMQ Combined Service * - * HTTP API for Certs service Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ -use crate::models; -use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct Serial { /// Certificate serial #[serde(rename = "serial", skip_serializing_if = "Option::is_none")] @@ -26,3 +26,4 @@ impl Serial { } } + diff --git a/certs/src/models/serials_page.rs b/src/models/serials_page.rs similarity index 70% rename from certs/src/models/serials_page.rs rename to src/models/serials_page.rs index 10f04963..b913d892 100644 --- a/certs/src/models/serials_page.rs +++ b/src/models/serials_page.rs @@ -1,17 +1,17 @@ /* - * SuperMQ Certs service + * SuperMQ Combined Service * - * HTTP API for Certs service Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ -use crate::models; -use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct SerialsPage { /// Certificate serials IDs. #[serde(rename = "serials", skip_serializing_if = "Option::is_none")] @@ -38,3 +38,4 @@ impl SerialsPage { } } + diff --git a/src/models/state.rs b/src/models/state.rs new file mode 100644 index 00000000..c5fe9492 --- /dev/null +++ b/src/models/state.rs @@ -0,0 +1,39 @@ +/* + * SuperMQ Combined Service + * + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum State { + #[serde(rename = "0")] + Variant0, + #[serde(rename = "1")] + Variant1, + +} + +impl ToString for State { + fn to_string(&self) -> String { + match self { + Self::Variant0 => String::from("0"), + Self::Variant1 => String::from("1"), + } + } +} + +impl Default for State { + fn default() -> State { + Self::Variant0 + } +} + + + + diff --git a/twins/src/models/state.rs b/src/models/state2.rs similarity index 61% rename from twins/src/models/state.rs rename to src/models/state2.rs index 7a13c515..f91a6aa1 100644 --- a/twins/src/models/state.rs +++ b/src/models/state2.rs @@ -1,24 +1,24 @@ /* - * SuperMQ twins service + * SuperMQ Combined Service * - * HTTP API for managing digital twins and their states. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ -use crate::models; -use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct State { + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct State2 { /// ID of twin state belongs to. #[serde(rename = "twin_id", skip_serializing_if = "Option::is_none")] pub twin_id: Option, /// State position in a time row of states. #[serde(rename = "id", skip_serializing_if = "Option::is_none")] - pub id: Option, + pub id: Option, /// State creation date. #[serde(rename = "created", skip_serializing_if = "Option::is_none")] pub created: Option, @@ -27,9 +27,9 @@ pub struct State { pub payload: Option, } -impl State { - pub fn new() -> State { - State { +impl State2 { + pub fn new() -> State2 { + State2 { twin_id: None, id: None, created: None, @@ -38,3 +38,4 @@ impl State { } } + diff --git a/twins/src/models/states_page.rs b/src/models/states_page.rs similarity index 60% rename from twins/src/models/states_page.rs rename to src/models/states_page.rs index 80856b52..5bd8d451 100644 --- a/twins/src/models/states_page.rs +++ b/src/models/states_page.rs @@ -1,20 +1,20 @@ /* - * SuperMQ twins service + * SuperMQ Combined Service * - * HTTP API for managing digital twins and their states. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ -use crate::models; -use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct StatesPage { #[serde(rename = "states")] - pub states: Vec, + pub states: Vec, /// Total number of items. #[serde(rename = "total", skip_serializing_if = "Option::is_none")] pub total: Option, @@ -27,7 +27,7 @@ pub struct StatesPage { } impl StatesPage { - pub fn new(states: Vec) -> StatesPage { + pub fn new(states: Vec) -> StatesPage { StatesPage { states, total: None, @@ -37,3 +37,4 @@ impl StatesPage { } } + diff --git a/notifiers/src/models/subscription.rs b/src/models/subscription.rs similarity index 71% rename from notifiers/src/models/subscription.rs rename to src/models/subscription.rs index 78691574..3fe45a2b 100644 --- a/notifiers/src/models/subscription.rs +++ b/src/models/subscription.rs @@ -1,17 +1,17 @@ /* - * SuperMQ Notifiers service + * SuperMQ Combined Service * - * HTTP API for Notifiers service. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ -use crate::models; -use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct Subscription { /// ULID id of the subscription. #[serde(rename = "id", skip_serializing_if = "Option::is_none")] @@ -38,3 +38,4 @@ impl Subscription { } } + diff --git a/twins/src/models/twin_req_obj.rs b/src/models/twin_req_obj.rs similarity index 60% rename from twins/src/models/twin_req_obj.rs rename to src/models/twin_req_obj.rs index 7fa03a68..ddc28ee8 100644 --- a/twins/src/models/twin_req_obj.rs +++ b/src/models/twin_req_obj.rs @@ -1,17 +1,17 @@ /* - * SuperMQ twins service + * SuperMQ Combined Service * - * HTTP API for managing digital twins and their states. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ -use crate::models; -use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct TwinReqObj { /// Free-form twin name. #[serde(rename = "name", skip_serializing_if = "Option::is_none")] @@ -20,7 +20,7 @@ pub struct TwinReqObj { #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")] pub metadata: Option, #[serde(rename = "definition", skip_serializing_if = "Option::is_none")] - pub definition: Option>, + pub definition: Option>, } impl TwinReqObj { @@ -33,3 +33,4 @@ impl TwinReqObj { } } + diff --git a/twins/src/models/twin_res_obj.rs b/src/models/twin_res_obj.rs similarity index 75% rename from twins/src/models/twin_res_obj.rs rename to src/models/twin_res_obj.rs index ebff5042..1920f82c 100644 --- a/twins/src/models/twin_res_obj.rs +++ b/src/models/twin_res_obj.rs @@ -1,17 +1,17 @@ /* - * SuperMQ twins service + * SuperMQ Combined Service * - * HTTP API for managing digital twins and their states. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ -use crate::models; -use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct TwinResObj { /// Email address of SuperMQ user that owns twin. #[serde(rename = "owner", skip_serializing_if = "Option::is_none")] @@ -24,7 +24,7 @@ pub struct TwinResObj { pub name: Option, /// Oridnal revision number of twin. #[serde(rename = "revision", skip_serializing_if = "Option::is_none")] - pub revision: Option, + pub revision: Option, /// Twin creation date and time. #[serde(rename = "created", skip_serializing_if = "Option::is_none")] pub created: Option, @@ -32,7 +32,7 @@ pub struct TwinResObj { #[serde(rename = "updated", skip_serializing_if = "Option::is_none")] pub updated: Option, #[serde(rename = "definitions", skip_serializing_if = "Option::is_none")] - pub definitions: Option>, + pub definitions: Option>, /// Arbitrary, object-encoded twin's data. #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")] pub metadata: Option, @@ -53,3 +53,4 @@ impl TwinResObj { } } + diff --git a/twins/src/models/twins_page.rs b/src/models/twins_page.rs similarity index 60% rename from twins/src/models/twins_page.rs rename to src/models/twins_page.rs index 655c63b1..2eb187c7 100644 --- a/twins/src/models/twins_page.rs +++ b/src/models/twins_page.rs @@ -1,20 +1,20 @@ /* - * SuperMQ twins service + * SuperMQ Combined Service * - * HTTP API for managing digital twins and their states. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ -use crate::models; -use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct TwinsPage { #[serde(rename = "twins")] - pub twins: Vec, + pub twins: Vec, /// Total number of items. #[serde(rename = "total", skip_serializing_if = "Option::is_none")] pub total: Option, @@ -27,7 +27,7 @@ pub struct TwinsPage { } impl TwinsPage { - pub fn new(twins: Vec) -> TwinsPage { + pub fn new(twins: Vec) -> TwinsPage { TwinsPage { twins, total: None, @@ -37,3 +37,4 @@ impl TwinsPage { } } + diff --git a/bootstrap/src/models/update_config_certs_request.rs b/src/models/update_config_certs_request.rs similarity index 64% rename from bootstrap/src/models/update_config_certs_request.rs rename to src/models/update_config_certs_request.rs index b882f276..48e94f85 100644 --- a/bootstrap/src/models/update_config_certs_request.rs +++ b/src/models/update_config_certs_request.rs @@ -1,17 +1,17 @@ /* - * SuperMQ Bootstrap service + * SuperMQ Combined Service * - * HTTP API for managing platform clients configuration. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ -use crate::models; -use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct UpdateConfigCertsRequest { #[serde(rename = "client_cert", skip_serializing_if = "Option::is_none")] pub client_cert: Option, @@ -31,3 +31,4 @@ impl UpdateConfigCertsRequest { } } + diff --git a/bootstrap/src/models/update_config_connections_request.rs b/src/models/update_config_connections_request.rs similarity index 54% rename from bootstrap/src/models/update_config_connections_request.rs rename to src/models/update_config_connections_request.rs index 8f6478e6..e8c1cfdd 100644 --- a/bootstrap/src/models/update_config_connections_request.rs +++ b/src/models/update_config_connections_request.rs @@ -1,17 +1,17 @@ /* - * SuperMQ Bootstrap service + * SuperMQ Combined Service * - * HTTP API for managing platform clients configuration. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ -use crate::models; -use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct UpdateConfigConnectionsRequest { #[serde(rename = "channels", skip_serializing_if = "Option::is_none")] pub channels: Option>, @@ -25,3 +25,4 @@ impl UpdateConfigConnectionsRequest { } } + diff --git a/bootstrap/src/models/update_config_request.rs b/src/models/update_config_request.rs similarity index 54% rename from bootstrap/src/models/update_config_request.rs rename to src/models/update_config_request.rs index 9302611d..5b27b9a8 100644 --- a/bootstrap/src/models/update_config_request.rs +++ b/src/models/update_config_request.rs @@ -1,17 +1,17 @@ /* - * SuperMQ Bootstrap service + * SuperMQ Combined Service * - * HTTP API for managing platform clients configuration. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ -use crate::models; -use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct UpdateConfigRequest { #[serde(rename = "content")] pub content: String, @@ -28,3 +28,4 @@ impl UpdateConfigRequest { } } + diff --git a/src/models/update_config_state_request.rs b/src/models/update_config_state_request.rs new file mode 100644 index 00000000..46d642f5 --- /dev/null +++ b/src/models/update_config_state_request.rs @@ -0,0 +1,28 @@ +/* + * SuperMQ Combined Service + * + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct UpdateConfigStateRequest { + #[serde(rename = "state", skip_serializing_if = "Option::is_none")] + pub state: Option, +} + +impl UpdateConfigStateRequest { + pub fn new() -> UpdateConfigStateRequest { + UpdateConfigStateRequest { + state: None, + } + } +} + + diff --git a/src/models/update_role_obj.rs b/src/models/update_role_obj.rs new file mode 100644 index 00000000..ab81e1ad --- /dev/null +++ b/src/models/update_role_obj.rs @@ -0,0 +1,29 @@ +/* + * SuperMQ Combined Service + * + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct UpdateRoleObj { + /// Role's name. + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, +} + +impl UpdateRoleObj { + pub fn new() -> UpdateRoleObj { + UpdateRoleObj { + name: None, + } + } +} + + diff --git a/users/src/models/user.rs b/src/models/user.rs similarity index 80% rename from users/src/models/user.rs rename to src/models/user.rs index dcc4f726..5fd94503 100644 --- a/users/src/models/user.rs +++ b/src/models/user.rs @@ -1,17 +1,17 @@ /* - * SuperMQ Users Service + * SuperMQ Combined Service * - * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ -use crate::models; -use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct User { /// User unique identifier. #[serde(rename = "id", skip_serializing_if = "Option::is_none")] @@ -29,7 +29,7 @@ pub struct User { #[serde(rename = "email", skip_serializing_if = "Option::is_none")] pub email: Option, #[serde(rename = "credentials", skip_serializing_if = "Option::is_none")] - pub credentials: Option>, + pub credentials: Option>, /// Arbitrary, object-encoded user's data. #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")] pub metadata: Option, @@ -65,3 +65,4 @@ impl User { } } + diff --git a/users/src/models/user_credentials.rs b/src/models/user_credentials.rs similarity index 51% rename from users/src/models/user_credentials.rs rename to src/models/user_credentials.rs index 750d2cef..67ebcb55 100644 --- a/users/src/models/user_credentials.rs +++ b/src/models/user_credentials.rs @@ -1,17 +1,17 @@ /* - * SuperMQ Users Service + * SuperMQ Combined Service * - * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ -use crate::models; -use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct UserCredentials { /// User's username for example john_doe for Mr John Doe. #[serde(rename = "username", skip_serializing_if = "Option::is_none")] @@ -26,3 +26,4 @@ impl UserCredentials { } } + diff --git a/users/src/models/user_profile_picture.rs b/src/models/user_profile_picture.rs similarity index 52% rename from users/src/models/user_profile_picture.rs rename to src/models/user_profile_picture.rs index adaf1ab1..c583acb6 100644 --- a/users/src/models/user_profile_picture.rs +++ b/src/models/user_profile_picture.rs @@ -1,17 +1,17 @@ /* - * SuperMQ Users Service + * SuperMQ Combined Service * - * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ -use crate::models; -use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct UserProfilePicture { /// User's profile picture URL that is represented as a string. #[serde(rename = "profile_picture")] @@ -26,3 +26,4 @@ impl UserProfilePicture { } } + diff --git a/users/src/models/user_req_obj.rs b/src/models/user_req_obj.rs similarity index 72% rename from users/src/models/user_req_obj.rs rename to src/models/user_req_obj.rs index 7aed1e61..8391eeca 100644 --- a/users/src/models/user_req_obj.rs +++ b/src/models/user_req_obj.rs @@ -1,17 +1,17 @@ /* - * SuperMQ Users Service + * SuperMQ Combined Service * - * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ -use crate::models; -use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct UserReqObj { /// User's first name. #[serde(rename = "first_name", skip_serializing_if = "Option::is_none")] @@ -26,7 +26,7 @@ pub struct UserReqObj { #[serde(rename = "tags", skip_serializing_if = "Option::is_none")] pub tags: Option>, #[serde(rename = "credentials")] - pub credentials: Box, + pub credentials: Box, /// Arbitrary, object-encoded user's data. #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")] pub metadata: Option, @@ -39,7 +39,7 @@ pub struct UserReqObj { } impl UserReqObj { - pub fn new(credentials: models::UserReqObjCredentials) -> UserReqObj { + pub fn new(credentials: crate::models::UserReqObjCredentials) -> UserReqObj { UserReqObj { first_name: None, last_name: None, @@ -53,3 +53,4 @@ impl UserReqObj { } } + diff --git a/users/src/models/user_req_obj_credentials.rs b/src/models/user_req_obj_credentials.rs similarity index 61% rename from users/src/models/user_req_obj_credentials.rs rename to src/models/user_req_obj_credentials.rs index 3d38d35d..37cbf75e 100644 --- a/users/src/models/user_req_obj_credentials.rs +++ b/src/models/user_req_obj_credentials.rs @@ -1,17 +1,17 @@ /* - * SuperMQ Users Service + * SuperMQ Combined Service * - * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ -use crate::models; -use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct UserReqObjCredentials { /// User's username for example 'admin' will be used as its unique identifier. #[serde(rename = "username", skip_serializing_if = "Option::is_none")] @@ -30,3 +30,4 @@ impl UserReqObjCredentials { } } + diff --git a/users/src/models/user_role.rs b/src/models/user_role.rs similarity index 59% rename from users/src/models/user_role.rs rename to src/models/user_role.rs index 10e44ee5..3e0bd819 100644 --- a/users/src/models/user_role.rs +++ b/src/models/user_role.rs @@ -1,17 +1,17 @@ /* - * SuperMQ Users Service + * SuperMQ Combined Service * - * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ -use crate::models; -use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct UserRole { /// User role example. #[serde(rename = "role")] @@ -25,6 +25,7 @@ impl UserRole { } } } + /// User role example. #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] pub enum Role { diff --git a/users/src/models/user_secret.rs b/src/models/user_secret.rs similarity index 54% rename from users/src/models/user_secret.rs rename to src/models/user_secret.rs index 48674015..0ba91211 100644 --- a/users/src/models/user_secret.rs +++ b/src/models/user_secret.rs @@ -1,17 +1,17 @@ /* - * SuperMQ Users Service + * SuperMQ Combined Service * - * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ -use crate::models; -use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct UserSecret { /// Old user secret password. #[serde(rename = "old_secret")] @@ -30,3 +30,4 @@ impl UserSecret { } } + diff --git a/src/models/user_tags.rs b/src/models/user_tags.rs new file mode 100644 index 00000000..347dbacd --- /dev/null +++ b/src/models/user_tags.rs @@ -0,0 +1,29 @@ +/* + * SuperMQ Combined Service + * + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct UserTags { + /// User tags. + #[serde(rename = "tags", skip_serializing_if = "Option::is_none")] + pub tags: Option>, +} + +impl UserTags { + pub fn new() -> UserTags { + UserTags { + tags: None, + } + } +} + + diff --git a/users/src/models/user_update.rs b/src/models/user_update.rs similarity index 60% rename from users/src/models/user_update.rs rename to src/models/user_update.rs index 08922708..43ae4f03 100644 --- a/users/src/models/user_update.rs +++ b/src/models/user_update.rs @@ -1,17 +1,17 @@ /* - * SuperMQ Users Service + * SuperMQ Combined Service * - * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ -use crate::models; -use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct UserUpdate { /// User's first name. #[serde(rename = "first_name")] @@ -34,3 +34,4 @@ impl UserUpdate { } } + diff --git a/src/models/username.rs b/src/models/username.rs new file mode 100644 index 00000000..b1b747b4 --- /dev/null +++ b/src/models/username.rs @@ -0,0 +1,29 @@ +/* + * SuperMQ Combined Service + * + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * + * The version of the OpenAPI document: 0.15.1 + * Contact: info@abstractmachines.fr + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct Username { + /// User's username for example 'admin' will be used as its unique identifier. + #[serde(rename = "username")] + pub username: String, +} + +impl Username { + pub fn new(username: String) -> Username { + Username { + username, + } + } +} + + diff --git a/users/src/models/users_page.rs b/src/models/users_page.rs similarity index 54% rename from users/src/models/users_page.rs rename to src/models/users_page.rs index 4181bd17..ca62f775 100644 --- a/users/src/models/users_page.rs +++ b/src/models/users_page.rs @@ -1,20 +1,20 @@ /* - * SuperMQ Users Service + * SuperMQ Combined Service * - * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) + * This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) * * The version of the OpenAPI document: 0.15.1 * Contact: info@abstractmachines.fr * Generated by: https://openapi-generator.tech */ -use crate::models; -use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct UsersPage { #[serde(rename = "users")] - pub users: Vec, + pub users: Vec, /// Total number of items. #[serde(rename = "total")] pub total: i32, @@ -27,7 +27,7 @@ pub struct UsersPage { } impl UsersPage { - pub fn new(users: Vec, total: i32, offset: i32) -> UsersPage { + pub fn new(users: Vec, total: i32, offset: i32) -> UsersPage { UsersPage { users, total, @@ -37,3 +37,4 @@ impl UsersPage { } } + diff --git a/twins/.gitignore b/twins/.gitignore deleted file mode 100644 index 6aa10640..00000000 --- a/twins/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/target/ -**/*.rs.bk -Cargo.lock diff --git a/twins/.openapi-generator-ignore b/twins/.openapi-generator-ignore deleted file mode 100644 index 7484ee59..00000000 --- a/twins/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/twins/.openapi-generator/FILES b/twins/.openapi-generator/FILES deleted file mode 100644 index f92ceb11..00000000 --- a/twins/.openapi-generator/FILES +++ /dev/null @@ -1,32 +0,0 @@ -.gitignore -.openapi-generator-ignore -.travis.yml -Cargo.toml -README.md -docs/Attribute.md -docs/Definition.md -docs/HealthApi.md -docs/HealthInfo.md -docs/State.md -docs/StatesApi.md -docs/StatesPage.md -docs/TwinReqObj.md -docs/TwinResObj.md -docs/TwinsApi.md -docs/TwinsPage.md -git_push.sh -src/apis/configuration.rs -src/apis/health_api.rs -src/apis/mod.rs -src/apis/states_api.rs -src/apis/twins_api.rs -src/lib.rs -src/models/attribute.rs -src/models/definition.rs -src/models/health_info.rs -src/models/mod.rs -src/models/state.rs -src/models/states_page.rs -src/models/twin_req_obj.rs -src/models/twin_res_obj.rs -src/models/twins_page.rs diff --git a/twins/.openapi-generator/VERSION b/twins/.openapi-generator/VERSION deleted file mode 100644 index 758bb9c8..00000000 --- a/twins/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -7.10.0 diff --git a/twins/.travis.yml b/twins/.travis.yml deleted file mode 100644 index 22761ba7..00000000 --- a/twins/.travis.yml +++ /dev/null @@ -1 +0,0 @@ -language: rust diff --git a/twins/Cargo.toml b/twins/Cargo.toml deleted file mode 100644 index 0b9c8c8b..00000000 --- a/twins/Cargo.toml +++ /dev/null @@ -1,15 +0,0 @@ -[package] -name = "Twins" -version = "0.15.1" -authors = ["info@abstractmachines.fr"] -description = "HTTP API for managing digital twins and their states. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) " -license = "Apache 2.0" -edition = "2021" - -[dependencies] -serde = { version = "^1.0", features = ["derive"] } -serde_json = "^1.0" -serde_repr = "^0.1" -url = "^2.5" -uuid = { version = "^1.8", features = ["serde", "v4"] } -reqwest = { version = "^0.12", features = ["json", "multipart"] } diff --git a/twins/README.md b/twins/README.md deleted file mode 100644 index b8a9e749..00000000 --- a/twins/README.md +++ /dev/null @@ -1,62 +0,0 @@ -# Rust API client for openapi - -HTTP API for managing digital twins and their states. -Some useful links: -- [The SuperMQ repository](https://github.com/absmach/supermq) - - - -## Overview - -This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://openapis.org) from a remote server, you can easily generate an API client. - -- API version: 0.15.1 -- Package version: 0.15.1 -- Generator version: 7.10.0 -- Build package: `org.openapitools.codegen.languages.RustClientCodegen` - -## Installation - -Put the package under your project folder in a directory named `openapi` and add the following to `Cargo.toml` under `[dependencies]`: - -``` -openapi = { path = "./openapi" } -``` - -## Documentation for API Endpoints - -All URIs are relative to *http://localhost:9018* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*HealthApi* | [**health_get**](docs/HealthApi.md#health_get) | **GET** /health | Retrieves service health check info. -*StatesApi* | [**get_states**](docs/StatesApi.md#get_states) | **GET** /states/{twinID} | Retrieves states of twin with id twinID -*TwinsApi* | [**create_twin**](docs/TwinsApi.md#create_twin) | **POST** /twins | Adds new twin -*TwinsApi* | [**get_twin**](docs/TwinsApi.md#get_twin) | **GET** /twins/{twinID} | Retrieves twin info -*TwinsApi* | [**get_twins**](docs/TwinsApi.md#get_twins) | **GET** /twins | Retrieves twins -*TwinsApi* | [**remove_twin**](docs/TwinsApi.md#remove_twin) | **DELETE** /twins/{twinID} | Removes a twin -*TwinsApi* | [**update_twin**](docs/TwinsApi.md#update_twin) | **PUT** /twins/{twinID} | Updates twin info - - -## Documentation For Models - - - [Attribute](docs/Attribute.md) - - [Definition](docs/Definition.md) - - [HealthInfo](docs/HealthInfo.md) - - [State](docs/State.md) - - [StatesPage](docs/StatesPage.md) - - [TwinReqObj](docs/TwinReqObj.md) - - [TwinResObj](docs/TwinResObj.md) - - [TwinsPage](docs/TwinsPage.md) - - -To get access to the crate's generated documentation, use: - -``` -cargo doc --open -``` - -## Author - -info@abstractmachines.fr - diff --git a/twins/docs/Attribute.md b/twins/docs/Attribute.md deleted file mode 100644 index c35530dc..00000000 --- a/twins/docs/Attribute.md +++ /dev/null @@ -1,14 +0,0 @@ -# Attribute - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | Option<**String**> | Name of the attribute. | [optional] -**channel** | Option<**String**> | SuperMQ channel used by attribute. | [optional] -**subtopic** | Option<**String**> | Subtopic used by attribute. | [optional] -**persist_state** | Option<**bool**> | Trigger state creation based on the attribute. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/twins/docs/Definition.md b/twins/docs/Definition.md deleted file mode 100644 index 40c35f7a..00000000 --- a/twins/docs/Definition.md +++ /dev/null @@ -1,12 +0,0 @@ -# Definition - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**delta** | Option<**f64**> | Minimal time delay before new state creation. | [optional] -**attributes** | Option<[**Vec**](Attribute.md)> | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/twins/docs/HealthApi.md b/twins/docs/HealthApi.md deleted file mode 100644 index 868cd47f..00000000 --- a/twins/docs/HealthApi.md +++ /dev/null @@ -1,34 +0,0 @@ -# \HealthApi - -All URIs are relative to *http://localhost:9018* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**health_get**](HealthApi.md#health_get) | **GET** /health | Retrieves service health check info. - - - -## health_get - -> models::HealthInfo health_get() -Retrieves service health check info. - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -[**models::HealthInfo**](health_info.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/health+json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/twins/docs/HealthInfo.md b/twins/docs/HealthInfo.md deleted file mode 100644 index ee8f5c6b..00000000 --- a/twins/docs/HealthInfo.md +++ /dev/null @@ -1,16 +0,0 @@ -# HealthInfo - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | Option<**String**> | Service status. | [optional] -**version** | Option<**String**> | Service version. | [optional] -**commit** | Option<**String**> | Service commit hash. | [optional] -**description** | Option<**String**> | Service description. | [optional] -**build_time** | Option<**String**> | Service build time. | [optional] -**instance_id** | Option<**String**> | Service instance ID. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/twins/docs/State.md b/twins/docs/State.md deleted file mode 100644 index 793c5338..00000000 --- a/twins/docs/State.md +++ /dev/null @@ -1,14 +0,0 @@ -# State - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**twin_id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | ID of twin state belongs to. | [optional] -**id** | Option<**f64**> | State position in a time row of states. | [optional] -**created** | Option<[**String**](string.md)> | State creation date. | [optional] -**payload** | Option<[**serde_json::Value**](.md)> | Object-encoded states's payload. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/twins/docs/StatesApi.md b/twins/docs/StatesApi.md deleted file mode 100644 index d6c3c5ff..00000000 --- a/twins/docs/StatesApi.md +++ /dev/null @@ -1,41 +0,0 @@ -# \StatesApi - -All URIs are relative to *http://localhost:9018* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**get_states**](StatesApi.md#get_states) | **GET** /states/{twinID} | Retrieves states of twin with id twinID - - - -## get_states - -> models::StatesPage get_states(twin_id, limit, offset) -Retrieves states of twin with id twinID - -Retrieves a list of states. Due to performance concerns, data is retrieved in subsets. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**twin_id** | **uuid::Uuid** | Unique twin identifier. | [required] | -**limit** | Option<**i32**> | Size of the subset to retrieve. | |[default to 10] -**offset** | Option<**i32**> | Number of items to skip during retrieval. | |[default to 0] - -### Return type - -[**models::StatesPage**](StatesPage.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/twins/docs/StatesPage.md b/twins/docs/StatesPage.md deleted file mode 100644 index 56fa62b2..00000000 --- a/twins/docs/StatesPage.md +++ /dev/null @@ -1,14 +0,0 @@ -# StatesPage - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**states** | [**Vec**](State.md) | | -**total** | Option<**i32**> | Total number of items. | [optional] -**offset** | Option<**i32**> | Number of items to skip during retrieval. | [optional] -**limit** | Option<**i32**> | Maximum number of items to return in one page. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/twins/docs/TwinReqObj.md b/twins/docs/TwinReqObj.md deleted file mode 100644 index 02557e28..00000000 --- a/twins/docs/TwinReqObj.md +++ /dev/null @@ -1,13 +0,0 @@ -# TwinReqObj - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | Option<**String**> | Free-form twin name. | [optional] -**metadata** | Option<[**serde_json::Value**](.md)> | Arbitrary, object-encoded twin's data. | [optional] -**definition** | Option<[**models::Definition**](Definition.md)> | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/twins/docs/TwinResObj.md b/twins/docs/TwinResObj.md deleted file mode 100644 index 492818c1..00000000 --- a/twins/docs/TwinResObj.md +++ /dev/null @@ -1,18 +0,0 @@ -# TwinResObj - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**owner** | Option<**String**> | Email address of SuperMQ user that owns twin. | [optional] -**id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | Unique twin identifier generated by the service. | [optional] -**name** | Option<**String**> | Free-form twin name. | [optional] -**revision** | Option<**f64**> | Oridnal revision number of twin. | [optional] -**created** | Option<[**String**](string.md)> | Twin creation date and time. | [optional] -**updated** | Option<[**String**](string.md)> | Twin update date and time. | [optional] -**definitions** | Option<[**Vec**](Definition.md)> | | [optional] -**metadata** | Option<[**serde_json::Value**](.md)> | Arbitrary, object-encoded twin's data. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/twins/docs/TwinsApi.md b/twins/docs/TwinsApi.md deleted file mode 100644 index 5e2f5061..00000000 --- a/twins/docs/TwinsApi.md +++ /dev/null @@ -1,165 +0,0 @@ -# \TwinsApi - -All URIs are relative to *http://localhost:9018* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**create_twin**](TwinsApi.md#create_twin) | **POST** /twins | Adds new twin -[**get_twin**](TwinsApi.md#get_twin) | **GET** /twins/{twinID} | Retrieves twin info -[**get_twins**](TwinsApi.md#get_twins) | **GET** /twins | Retrieves twins -[**remove_twin**](TwinsApi.md#remove_twin) | **DELETE** /twins/{twinID} | Removes a twin -[**update_twin**](TwinsApi.md#update_twin) | **PUT** /twins/{twinID} | Updates twin info - - - -## create_twin - -> create_twin(twin_req_obj) -Adds new twin - -Adds new twin to the list of twins owned by user identified using the provided access token. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**twin_req_obj** | [**TwinReqObj**](TwinReqObj.md) | JSON-formatted document describing the twin to create or update. | [required] | - -### Return type - - (empty response body) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## get_twin - -> models::TwinResObj get_twin(twin_id) -Retrieves twin info - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**twin_id** | **uuid::Uuid** | Unique twin identifier. | [required] | - -### Return type - -[**models::TwinResObj**](TwinResObj.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## get_twins - -> models::TwinsPage get_twins(limit, offset, name, metadata) -Retrieves twins - -Retrieves a list of twins. Due to performance concerns, data is retrieved in subsets. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**limit** | Option<**i32**> | Size of the subset to retrieve. | |[default to 10] -**offset** | Option<**i32**> | Number of items to skip during retrieval. | |[default to 0] -**name** | Option<**String**> | Twin name | | -**metadata** | Option<**String**> | Metadata filter. Filtering is performed matching the parameter with metadata on top level. Parameter is json. | | - -### Return type - -[**models::TwinsPage**](TwinsPage.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## remove_twin - -> remove_twin(twin_id) -Removes a twin - -Removes a twin. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**twin_id** | **uuid::Uuid** | Unique twin identifier. | [required] | - -### Return type - - (empty response body) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## update_twin - -> update_twin(twin_id, twin_req_obj) -Updates twin info - -Update is performed by replacing the current resource data with values provided in a request payload. Note that the twin's ID cannot be changed. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**twin_id** | **uuid::Uuid** | Unique twin identifier. | [required] | -**twin_req_obj** | [**TwinReqObj**](TwinReqObj.md) | JSON-formatted document describing the twin to create or update. | [required] | - -### Return type - - (empty response body) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/twins/docs/TwinsPage.md b/twins/docs/TwinsPage.md deleted file mode 100644 index e2bd97ef..00000000 --- a/twins/docs/TwinsPage.md +++ /dev/null @@ -1,14 +0,0 @@ -# TwinsPage - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**twins** | [**Vec**](TwinResObj.md) | | -**total** | Option<**i32**> | Total number of items. | [optional] -**offset** | Option<**i32**> | Number of items to skip during retrieval. | [optional] -**limit** | Option<**i32**> | Maximum number of items to return in one page. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/twins/git_push.sh b/twins/git_push.sh deleted file mode 100644 index f53a75d4..00000000 --- a/twins/git_push.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 -git_host=$4 - -if [ "$git_host" = "" ]; then - git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" -fi - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' diff --git a/twins/src/apis/configuration.rs b/twins/src/apis/configuration.rs deleted file mode 100644 index a5e9f8d2..00000000 --- a/twins/src/apis/configuration.rs +++ /dev/null @@ -1,51 +0,0 @@ -/* - * SuperMQ twins service - * - * HTTP API for managing digital twins and their states. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - - - -#[derive(Debug, Clone)] -pub struct Configuration { - pub base_path: String, - pub user_agent: Option, - pub client: reqwest::Client, - pub basic_auth: Option, - pub oauth_access_token: Option, - pub bearer_access_token: Option, - pub api_key: Option, -} - -pub type BasicAuth = (String, Option); - -#[derive(Debug, Clone)] -pub struct ApiKey { - pub prefix: Option, - pub key: String, -} - - -impl Configuration { - pub fn new() -> Configuration { - Configuration::default() - } -} - -impl Default for Configuration { - fn default() -> Self { - Configuration { - base_path: "http://localhost:9018".to_owned(), - user_agent: Some("OpenAPI-Generator/0.15.1/rust".to_owned()), - client: reqwest::Client::new(), - basic_auth: None, - oauth_access_token: None, - bearer_access_token: None, - api_key: None, - } - } -} diff --git a/twins/src/apis/health_api.rs b/twins/src/apis/health_api.rs deleted file mode 100644 index de3632db..00000000 --- a/twins/src/apis/health_api.rs +++ /dev/null @@ -1,53 +0,0 @@ -/* - * SuperMQ twins service - * - * HTTP API for managing digital twins and their states. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - - -use reqwest; -use serde::{Deserialize, Serialize}; -use crate::{apis::ResponseContent, models}; -use super::{Error, configuration}; - - -/// struct for typed errors of method [`health_get`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum HealthGetError { - Status500(), - UnknownValue(serde_json::Value), -} - - -pub async fn health_get(configuration: &configuration::Configuration, ) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/health", local_var_configuration.base_path); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - diff --git a/twins/src/lib.rs b/twins/src/lib.rs deleted file mode 100644 index e1520628..00000000 --- a/twins/src/lib.rs +++ /dev/null @@ -1,11 +0,0 @@ -#![allow(unused_imports)] -#![allow(clippy::too_many_arguments)] - -extern crate serde_repr; -extern crate serde; -extern crate serde_json; -extern crate url; -extern crate reqwest; - -pub mod apis; -pub mod models; diff --git a/twins/src/models/health_info.rs b/twins/src/models/health_info.rs deleted file mode 100644 index eaa19be0..00000000 --- a/twins/src/models/health_info.rs +++ /dev/null @@ -1,60 +0,0 @@ -/* - * SuperMQ twins service - * - * HTTP API for managing digital twins and their states. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct HealthInfo { - /// Service status. - #[serde(rename = "status", skip_serializing_if = "Option::is_none")] - pub status: Option, - /// Service version. - #[serde(rename = "version", skip_serializing_if = "Option::is_none")] - pub version: Option, - /// Service commit hash. - #[serde(rename = "commit", skip_serializing_if = "Option::is_none")] - pub commit: Option, - /// Service description. - #[serde(rename = "description", skip_serializing_if = "Option::is_none")] - pub description: Option, - /// Service build time. - #[serde(rename = "build_time", skip_serializing_if = "Option::is_none")] - pub build_time: Option, - /// Service instance ID. - #[serde(rename = "instance_id", skip_serializing_if = "Option::is_none")] - pub instance_id: Option, -} - -impl HealthInfo { - pub fn new() -> HealthInfo { - HealthInfo { - status: None, - version: None, - commit: None, - description: None, - build_time: None, - instance_id: None, - } - } -} -/// Service status. -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum Status { - #[serde(rename = "pass")] - Pass, -} - -impl Default for Status { - fn default() -> Status { - Self::Pass - } -} - diff --git a/twins/src/models/mod.rs b/twins/src/models/mod.rs deleted file mode 100644 index 93754329..00000000 --- a/twins/src/models/mod.rs +++ /dev/null @@ -1,16 +0,0 @@ -pub mod attribute; -pub use self::attribute::Attribute; -pub mod definition; -pub use self::definition::Definition; -pub mod health_info; -pub use self::health_info::HealthInfo; -pub mod state; -pub use self::state::State; -pub mod states_page; -pub use self::states_page::StatesPage; -pub mod twin_req_obj; -pub use self::twin_req_obj::TwinReqObj; -pub mod twin_res_obj; -pub use self::twin_res_obj::TwinResObj; -pub mod twins_page; -pub use self::twins_page::TwinsPage; diff --git a/users/.gitignore b/users/.gitignore deleted file mode 100644 index 6aa10640..00000000 --- a/users/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/target/ -**/*.rs.bk -Cargo.lock diff --git a/users/.openapi-generator-ignore b/users/.openapi-generator-ignore deleted file mode 100644 index 7484ee59..00000000 --- a/users/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/users/.openapi-generator/FILES b/users/.openapi-generator/FILES deleted file mode 100644 index 794a5604..00000000 --- a/users/.openapi-generator/FILES +++ /dev/null @@ -1,60 +0,0 @@ -.gitignore -.openapi-generator-ignore -.travis.yml -Cargo.toml -README.md -docs/AssignReqObj.md -docs/AssignUserReqObj.md -docs/Email.md -docs/Error.md -docs/HealthApi.md -docs/HealthRes.md -docs/IssueToken.md -docs/IssueToken200Response.md -docs/Members.md -docs/MembersCredentials.md -docs/MembersPage.md -docs/RequestPasswordResetRequest.md -docs/ResetPasswordRequest.md -docs/User.md -docs/UserCredentials.md -docs/UserProfilePicture.md -docs/UserReqObj.md -docs/UserReqObjCredentials.md -docs/UserRole.md -docs/UserSecret.md -docs/UserTags.md -docs/UserUpdate.md -docs/Username.md -docs/UsersApi.md -docs/UsersPage.md -git_push.sh -src/apis/configuration.rs -src/apis/health_api.rs -src/apis/mod.rs -src/apis/users_api.rs -src/lib.rs -src/models/assign_req_obj.rs -src/models/assign_user_req_obj.rs -src/models/email.rs -src/models/error.rs -src/models/health_res.rs -src/models/issue_token.rs -src/models/issue_token_200_response.rs -src/models/members.rs -src/models/members_credentials.rs -src/models/members_page.rs -src/models/mod.rs -src/models/request_password_reset_request.rs -src/models/reset_password_request.rs -src/models/user.rs -src/models/user_credentials.rs -src/models/user_profile_picture.rs -src/models/user_req_obj.rs -src/models/user_req_obj_credentials.rs -src/models/user_role.rs -src/models/user_secret.rs -src/models/user_tags.rs -src/models/user_update.rs -src/models/username.rs -src/models/users_page.rs diff --git a/users/.openapi-generator/VERSION b/users/.openapi-generator/VERSION deleted file mode 100644 index 758bb9c8..00000000 --- a/users/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -7.10.0 diff --git a/users/.travis.yml b/users/.travis.yml deleted file mode 100644 index 22761ba7..00000000 --- a/users/.travis.yml +++ /dev/null @@ -1 +0,0 @@ -language: rust diff --git a/users/Cargo.toml b/users/Cargo.toml deleted file mode 100644 index 6eddeba7..00000000 --- a/users/Cargo.toml +++ /dev/null @@ -1,16 +0,0 @@ -[package] -name = "Users" -version = "0.15.1" -authors = ["info@abstractmachines.fr"] -description = "This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) " -license = "Apache 2.0" -edition = "2021" - -[dependencies] -serde = { version = "^1.0", features = ["derive"] } -serde_json = "^1.0" -serde_repr = "^0.1" -url = "^2.5" -uuid = { version = "^1.8", features = ["serde", "v4"] } -reqwest = { version = "^0.12", features = ["json", "multipart"] } -tokio = { version = "1", features = ["full"] } \ No newline at end of file diff --git a/users/README.md b/users/README.md deleted file mode 100644 index b1e6a814..00000000 --- a/users/README.md +++ /dev/null @@ -1,94 +0,0 @@ -# Rust API client for openapi - -This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. -Some useful links: -- [The SuperMQ repository](https://github.com/absmach/supermq) - - - -## Overview - -This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://openapis.org) from a remote server, you can easily generate an API client. - -- API version: 0.15.1 -- Package version: 0.15.1 -- Generator version: 7.10.0 -- Build package: `org.openapitools.codegen.languages.RustClientCodegen` - -## Installation - -Put the package under your project folder in a directory named `openapi` and add the following to `Cargo.toml` under `[dependencies]`: - -``` -openapi = { path = "./openapi" } -``` - -## Documentation for API Endpoints - -All URIs are relative to *http://localhost:9002* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*HealthApi* | [**health**](docs/HealthApi.md#health) | **GET** /health | Retrieves service health check info. -*UsersApi* | [**create_user**](docs/UsersApi.md#create_user) | **POST** /users | Registers user account -*UsersApi* | [**disable_user**](docs/UsersApi.md#disable_user) | **POST** /users/{userID}/disable | Disables a user -*UsersApi* | [**domain_id_users_get**](docs/UsersApi.md#domain_id_users_get) | **GET** /{domainID}/users | List users assigned to domain -*UsersApi* | [**enable_user**](docs/UsersApi.md#enable_user) | **POST** /users/{userID}/enable | Enables a user -*UsersApi* | [**get_profile**](docs/UsersApi.md#get_profile) | **GET** /users/profile | Gets info on currently logged in user. -*UsersApi* | [**get_user**](docs/UsersApi.md#get_user) | **GET** /users/{userID} | Retrieves a user -*UsersApi* | [**issue_token**](docs/UsersApi.md#issue_token) | **POST** /users/tokens/issue | Issue Token -*UsersApi* | [**list_users**](docs/UsersApi.md#list_users) | **GET** /users | List users -*UsersApi* | [**list_users_in_channel**](docs/UsersApi.md#list_users_in_channel) | **GET** /{domainID}/channels/{channelID}/users | List users in a channel -*UsersApi* | [**list_users_in_client**](docs/UsersApi.md#list_users_in_client) | **GET** /{domainID}/clients/{clientID}/users | List users associated with a client -*UsersApi* | [**list_users_in_group**](docs/UsersApi.md#list_users_in_group) | **GET** /{domainID}/groups/{groupID}/users | List users in a group -*UsersApi* | [**refresh_token**](docs/UsersApi.md#refresh_token) | **POST** /users/tokens/refresh | Refresh Token -*UsersApi* | [**request_password_reset**](docs/UsersApi.md#request_password_reset) | **POST** /password/reset-request | User password reset request -*UsersApi* | [**reset_password**](docs/UsersApi.md#reset_password) | **PUT** /password/reset | User password reset endpoint -*UsersApi* | [**search_users**](docs/UsersApi.md#search_users) | **GET** /users/search | Search users -*UsersApi* | [**update_email**](docs/UsersApi.md#update_email) | **PATCH** /users/{userID}/email | Updates email of the user. -*UsersApi* | [**update_profile_picture**](docs/UsersApi.md#update_profile_picture) | **PATCH** /users/{userID}/picture | Updates the user's profile picture. -*UsersApi* | [**update_role**](docs/UsersApi.md#update_role) | **PATCH** /users/{userID}/role | Updates the user's role. -*UsersApi* | [**update_secret**](docs/UsersApi.md#update_secret) | **PATCH** /users/secret | Updates secret of currently logged in user. -*UsersApi* | [**update_tags**](docs/UsersApi.md#update_tags) | **PATCH** /users/{userID}/tags | Updates tags of the user. -*UsersApi* | [**update_user**](docs/UsersApi.md#update_user) | **PATCH** /users/{userID} | Updates first, last name and metadata of the user. -*UsersApi* | [**update_username**](docs/UsersApi.md#update_username) | **PATCH** /users/{userID}/username | Updates user's username. -*UsersApi* | [**users_user_id_delete**](docs/UsersApi.md#users_user_id_delete) | **DELETE** /users/{userID} | Delete a user - - -## Documentation For Models - - - [AssignReqObj](docs/AssignReqObj.md) - - [AssignUserReqObj](docs/AssignUserReqObj.md) - - [Email](docs/Email.md) - - [Error](docs/Error.md) - - [HealthRes](docs/HealthRes.md) - - [IssueToken](docs/IssueToken.md) - - [IssueToken200Response](docs/IssueToken200Response.md) - - [Members](docs/Members.md) - - [MembersCredentials](docs/MembersCredentials.md) - - [MembersPage](docs/MembersPage.md) - - [RequestPasswordResetRequest](docs/RequestPasswordResetRequest.md) - - [ResetPasswordRequest](docs/ResetPasswordRequest.md) - - [User](docs/User.md) - - [UserCredentials](docs/UserCredentials.md) - - [UserProfilePicture](docs/UserProfilePicture.md) - - [UserReqObj](docs/UserReqObj.md) - - [UserReqObjCredentials](docs/UserReqObjCredentials.md) - - [UserRole](docs/UserRole.md) - - [UserSecret](docs/UserSecret.md) - - [UserTags](docs/UserTags.md) - - [UserUpdate](docs/UserUpdate.md) - - [Username](docs/Username.md) - - [UsersPage](docs/UsersPage.md) - - -To get access to the crate's generated documentation, use: - -``` -cargo doc --open -``` - -## Author - -info@abstractmachines.fr - diff --git a/users/docs/AssignReqObj.md b/users/docs/AssignReqObj.md deleted file mode 100644 index 895b525e..00000000 --- a/users/docs/AssignReqObj.md +++ /dev/null @@ -1,13 +0,0 @@ -# AssignReqObj - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**members** | **Vec** | Members IDs | -**relation** | **String** | Permission relations. | -**member_kind** | **String** | Member kind. | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/users/docs/AssignUserReqObj.md b/users/docs/AssignUserReqObj.md deleted file mode 100644 index 9262413e..00000000 --- a/users/docs/AssignUserReqObj.md +++ /dev/null @@ -1,12 +0,0 @@ -# AssignUserReqObj - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**user_ids** | **Vec** | User IDs | -**relation** | **String** | Permission relations. | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/users/docs/Email.md b/users/docs/Email.md deleted file mode 100644 index 1abc6702..00000000 --- a/users/docs/Email.md +++ /dev/null @@ -1,11 +0,0 @@ -# Email - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**email** | **String** | User email address. | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/users/docs/Error.md b/users/docs/Error.md deleted file mode 100644 index 8e78862d..00000000 --- a/users/docs/Error.md +++ /dev/null @@ -1,11 +0,0 @@ -# Error - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**error** | Option<**String**> | Error message | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/users/docs/HealthApi.md b/users/docs/HealthApi.md deleted file mode 100644 index 99159d8a..00000000 --- a/users/docs/HealthApi.md +++ /dev/null @@ -1,34 +0,0 @@ -# \HealthApi - -All URIs are relative to *http://localhost:9002* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**health**](HealthApi.md#health) | **GET** /health | Retrieves service health check info. - - - -## health - -> models::HealthRes health() -Retrieves service health check info. - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -[**models::HealthRes**](HealthRes.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/health+json, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/users/docs/HealthRes.md b/users/docs/HealthRes.md deleted file mode 100644 index 319b16fb..00000000 --- a/users/docs/HealthRes.md +++ /dev/null @@ -1,15 +0,0 @@ -# HealthRes - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | Option<**String**> | Service status. | [optional] -**version** | Option<**String**> | Service version. | [optional] -**commit** | Option<**String**> | Service commit hash. | [optional] -**description** | Option<**String**> | Service description. | [optional] -**build_time** | Option<**String**> | Service build time. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/users/docs/IssueToken.md b/users/docs/IssueToken.md deleted file mode 100644 index cdc0841c..00000000 --- a/users/docs/IssueToken.md +++ /dev/null @@ -1,12 +0,0 @@ -# IssueToken - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**identity** | **String** | User identity - email address. | -**secret** | **String** | User secret password. | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/users/docs/IssueToken200Response.md b/users/docs/IssueToken200Response.md deleted file mode 100644 index 831b2680..00000000 --- a/users/docs/IssueToken200Response.md +++ /dev/null @@ -1,13 +0,0 @@ -# IssueToken200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**access_token** | Option<**String**> | User access token. | [optional] -**refresh_token** | Option<**String**> | User refresh token. | [optional] -**access_type** | Option<**String**> | User access token type. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/users/docs/Members.md b/users/docs/Members.md deleted file mode 100644 index a5d7e31b..00000000 --- a/users/docs/Members.md +++ /dev/null @@ -1,20 +0,0 @@ -# Members - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | User unique identifier. | [optional] -**first_name** | Option<**String**> | User's first name. | [optional] -**last_name** | Option<**String**> | User's last name. | [optional] -**email** | Option<**String**> | User's email address. | [optional] -**tags** | Option<**Vec**> | User tags. | [optional] -**credentials** | Option<[**models::MembersCredentials**](Members_credentials.md)> | | [optional] -**metadata** | Option<[**serde_json::Value**](.md)> | Arbitrary, object-encoded user's data. | [optional] -**status** | Option<**String**> | User Status | [optional] -**created_at** | Option<**String**> | Time when the group was created. | [optional] -**updated_at** | Option<**String**> | Time when the group was created. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/users/docs/MembersCredentials.md b/users/docs/MembersCredentials.md deleted file mode 100644 index e3669de6..00000000 --- a/users/docs/MembersCredentials.md +++ /dev/null @@ -1,12 +0,0 @@ -# MembersCredentials - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**username** | Option<**String**> | User's username. | [optional] -**secret** | Option<**String**> | User secret password. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/users/docs/MembersPage.md b/users/docs/MembersPage.md deleted file mode 100644 index 66f13666..00000000 --- a/users/docs/MembersPage.md +++ /dev/null @@ -1,14 +0,0 @@ -# MembersPage - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**members** | [**Vec**](Members.md) | | -**total** | **i32** | Total number of items. | -**offset** | Option<**i32**> | Number of items to skip during retrieval. | [optional] -**limit** | Option<**i32**> | Maximum number of items to return in one page. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/users/docs/RequestPasswordResetRequest.md b/users/docs/RequestPasswordResetRequest.md deleted file mode 100644 index bc5a0c83..00000000 --- a/users/docs/RequestPasswordResetRequest.md +++ /dev/null @@ -1,12 +0,0 @@ -# RequestPasswordResetRequest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**email** | Option<**String**> | User email. | [optional] -**host** | Option<**String**> | Email host. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/users/docs/ResetPasswordRequest.md b/users/docs/ResetPasswordRequest.md deleted file mode 100644 index 976524fb..00000000 --- a/users/docs/ResetPasswordRequest.md +++ /dev/null @@ -1,13 +0,0 @@ -# ResetPasswordRequest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**password** | Option<**String**> | New password. | [optional] -**confirm_password** | Option<**String**> | New confirmation password. | [optional] -**token** | Option<**String**> | Reset token generated and sent in email. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/users/docs/User.md b/users/docs/User.md deleted file mode 100644 index 58b9da37..00000000 --- a/users/docs/User.md +++ /dev/null @@ -1,21 +0,0 @@ -# User - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | User unique identifier. | [optional] -**first_name** | Option<**String**> | User's first name. | [optional] -**last_name** | Option<**String**> | User's last name. | [optional] -**tags** | Option<**Vec**> | User tags. | [optional] -**email** | Option<**String**> | User email for example email address. | [optional] -**credentials** | Option<[**models::UserCredentials**](User_credentials.md)> | | [optional] -**metadata** | Option<[**serde_json::Value**](.md)> | Arbitrary, object-encoded user's data. | [optional] -**profile_picture** | Option<**String**> | User's profile picture URL that is represented as a string. | [optional] -**status** | Option<**String**> | User Status | [optional] -**created_at** | Option<**String**> | Time when the group was created. | [optional] -**updated_at** | Option<**String**> | Time when the group was created. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/users/docs/UserCredentials.md b/users/docs/UserCredentials.md deleted file mode 100644 index 036c8628..00000000 --- a/users/docs/UserCredentials.md +++ /dev/null @@ -1,11 +0,0 @@ -# UserCredentials - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**username** | Option<**String**> | User's username for example john_doe for Mr John Doe. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/users/docs/UserProfilePicture.md b/users/docs/UserProfilePicture.md deleted file mode 100644 index 099e08c4..00000000 --- a/users/docs/UserProfilePicture.md +++ /dev/null @@ -1,11 +0,0 @@ -# UserProfilePicture - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**profile_picture** | **String** | User's profile picture URL that is represented as a string. | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/users/docs/UserReqObj.md b/users/docs/UserReqObj.md deleted file mode 100644 index 0232c189..00000000 --- a/users/docs/UserReqObj.md +++ /dev/null @@ -1,18 +0,0 @@ -# UserReqObj - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**first_name** | Option<**String**> | User's first name. | [optional] -**last_name** | Option<**String**> | User's last name. | [optional] -**email** | Option<**String**> | User's email address will be used as its unique identifier. | [optional] -**tags** | Option<**Vec**> | User tags. | [optional] -**credentials** | [**models::UserReqObjCredentials**](UserReqObj_credentials.md) | | -**metadata** | Option<[**serde_json::Value**](.md)> | Arbitrary, object-encoded user's data. | [optional] -**profile_picture** | Option<**String**> | User's profile picture URL that is represented as a string. | [optional] -**status** | Option<**String**> | User Status | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/users/docs/UserReqObjCredentials.md b/users/docs/UserReqObjCredentials.md deleted file mode 100644 index d8cfcdcb..00000000 --- a/users/docs/UserReqObjCredentials.md +++ /dev/null @@ -1,12 +0,0 @@ -# UserReqObjCredentials - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**username** | Option<**String**> | User's username for example 'admin' will be used as its unique identifier. | [optional] -**secret** | Option<**String**> | Free-form account secret used for acquiring auth token(s). | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/users/docs/UserRole.md b/users/docs/UserRole.md deleted file mode 100644 index 7aabe1e1..00000000 --- a/users/docs/UserRole.md +++ /dev/null @@ -1,11 +0,0 @@ -# UserRole - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**role** | **String** | User role example. | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/users/docs/UserSecret.md b/users/docs/UserSecret.md deleted file mode 100644 index 830c8115..00000000 --- a/users/docs/UserSecret.md +++ /dev/null @@ -1,12 +0,0 @@ -# UserSecret - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**old_secret** | **String** | Old user secret password. | -**new_secret** | **String** | New user secret password. | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/users/docs/UserTags.md b/users/docs/UserTags.md deleted file mode 100644 index dfabd374..00000000 --- a/users/docs/UserTags.md +++ /dev/null @@ -1,11 +0,0 @@ -# UserTags - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**tags** | Option<**Vec**> | User tags. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/users/docs/UserUpdate.md b/users/docs/UserUpdate.md deleted file mode 100644 index 7bdef9fc..00000000 --- a/users/docs/UserUpdate.md +++ /dev/null @@ -1,13 +0,0 @@ -# UserUpdate - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**first_name** | **String** | User's first name. | -**last_name** | **String** | User's last name. | -**metadata** | [**serde_json::Value**](.md) | Arbitrary, object-encoded user's data. | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/users/docs/Username.md b/users/docs/Username.md deleted file mode 100644 index 8efa755f..00000000 --- a/users/docs/Username.md +++ /dev/null @@ -1,11 +0,0 @@ -# Username - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**username** | **String** | User's username for example 'admin' will be used as its unique identifier. | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/users/docs/UsersApi.md b/users/docs/UsersApi.md deleted file mode 100644 index 6295826d..00000000 --- a/users/docs/UsersApi.md +++ /dev/null @@ -1,764 +0,0 @@ -# \UsersApi - -All URIs are relative to *http://localhost:9002* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**create_user**](UsersApi.md#create_user) | **POST** /users | Registers user account -[**disable_user**](UsersApi.md#disable_user) | **POST** /users/{userID}/disable | Disables a user -[**domain_id_users_get**](UsersApi.md#domain_id_users_get) | **GET** /{domainID}/users | List users assigned to domain -[**enable_user**](UsersApi.md#enable_user) | **POST** /users/{userID}/enable | Enables a user -[**get_profile**](UsersApi.md#get_profile) | **GET** /users/profile | Gets info on currently logged in user. -[**get_user**](UsersApi.md#get_user) | **GET** /users/{userID} | Retrieves a user -[**issue_token**](UsersApi.md#issue_token) | **POST** /users/tokens/issue | Issue Token -[**list_users**](UsersApi.md#list_users) | **GET** /users | List users -[**list_users_in_channel**](UsersApi.md#list_users_in_channel) | **GET** /{domainID}/channels/{channelID}/users | List users in a channel -[**list_users_in_client**](UsersApi.md#list_users_in_client) | **GET** /{domainID}/clients/{clientID}/users | List users associated with a client -[**list_users_in_group**](UsersApi.md#list_users_in_group) | **GET** /{domainID}/groups/{groupID}/users | List users in a group -[**refresh_token**](UsersApi.md#refresh_token) | **POST** /users/tokens/refresh | Refresh Token -[**request_password_reset**](UsersApi.md#request_password_reset) | **POST** /password/reset-request | User password reset request -[**reset_password**](UsersApi.md#reset_password) | **PUT** /password/reset | User password reset endpoint -[**search_users**](UsersApi.md#search_users) | **GET** /users/search | Search users -[**update_email**](UsersApi.md#update_email) | **PATCH** /users/{userID}/email | Updates email of the user. -[**update_profile_picture**](UsersApi.md#update_profile_picture) | **PATCH** /users/{userID}/picture | Updates the user's profile picture. -[**update_role**](UsersApi.md#update_role) | **PATCH** /users/{userID}/role | Updates the user's role. -[**update_secret**](UsersApi.md#update_secret) | **PATCH** /users/secret | Updates secret of currently logged in user. -[**update_tags**](UsersApi.md#update_tags) | **PATCH** /users/{userID}/tags | Updates tags of the user. -[**update_user**](UsersApi.md#update_user) | **PATCH** /users/{userID} | Updates first, last name and metadata of the user. -[**update_username**](UsersApi.md#update_username) | **PATCH** /users/{userID}/username | Updates user's username. -[**users_user_id_delete**](UsersApi.md#users_user_id_delete) | **DELETE** /users/{userID} | Delete a user - - - -## create_user - -> models::User create_user(user_req_obj) -Registers user account - -Registers new user account given email and password. New account will be uniquely identified by its email address. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**user_req_obj** | [**UserReqObj**](UserReqObj.md) | JSON-formatted document describing the new user to be registered | [required] | - -### Return type - -[**models::User**](User.md) - -### Authorization - -[refreshAuth](../README.md#refreshAuth), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## disable_user - -> models::User disable_user(user_id) -Disables a user - -Disables a specific user that is identifier by the user ID. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**user_id** | **uuid::Uuid** | Unique user identifier. | [required] | - -### Return type - -[**models::User**](User.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## domain_id_users_get - -> models::UsersPage domain_id_users_get(domain_id, limit, offset, metadata, status) -List users assigned to domain - -List users assigned to domain that is identified by the domain ID. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**limit** | Option<**i32**> | Size of the subset to retrieve. | |[default to 10] -**offset** | Option<**i32**> | Number of items to skip during retrieval. | |[default to 0] -**metadata** | Option<**String**> | Metadata filter. Filtering is performed matching the parameter with metadata on top level. Parameter is json. | | -**status** | Option<**String**> | User account status. | |[default to enabled] - -### Return type - -[**models::UsersPage**](UsersPage.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## enable_user - -> models::User enable_user(user_id) -Enables a user - -Enables a specific user that is identifier by the user ID. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**user_id** | **uuid::Uuid** | Unique user identifier. | [required] | - -### Return type - -[**models::User**](User.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## get_profile - -> models::User get_profile() -Gets info on currently logged in user. - -Gets info on currently logged in user. Info is obtained using authorization token - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -[**models::User**](User.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## get_user - -> models::User get_user(user_id) -Retrieves a user - -Retrieves a specific user that is identifier by the user ID. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**user_id** | **uuid::Uuid** | Unique user identifier. | [required] | - -### Return type - -[**models::User**](User.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## issue_token - -> models::IssueToken200Response issue_token(issue_token) -Issue Token - -Issue Access and Refresh Token used for authenticating into the system. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**issue_token** | [**IssueToken**](IssueToken.md) | Login credentials. | [required] | - -### Return type - -[**models::IssueToken200Response**](issueToken_200_response.md) - -### Authorization - -[refreshAuth](../README.md#refreshAuth), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## list_users - -> models::UsersPage list_users(limit, offset, metadata, status, first_name, last_name, username, email, tags) -List users - -Retrieves a list of users. Due to performance concerns, data is retrieved in subsets. The API must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**limit** | Option<**i32**> | Size of the subset to retrieve. | |[default to 10] -**offset** | Option<**i32**> | Number of items to skip during retrieval. | |[default to 0] -**metadata** | Option<**String**> | Metadata filter. Filtering is performed matching the parameter with metadata on top level. Parameter is json. | | -**status** | Option<**String**> | User account status. | |[default to enabled] -**first_name** | Option<**String**> | User's first name. | | -**last_name** | Option<**String**> | User's last name. | | -**username** | Option<**String**> | User's username. | | -**email** | Option<**String**> | User's email address. | | -**tags** | Option<[**Vec**](String.md)> | User tags. | | - -### Return type - -[**models::UsersPage**](UsersPage.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## list_users_in_channel - -> models::MembersPage list_users_in_channel(domain_id, channel_id, limit, offset, level, tree, metadata, name, parent_id) -List users in a channel - -Retrieves a list of users in a channel. Due to performance concerns, data is retrieved in subsets. The API must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**channel_id** | **uuid::Uuid** | Unique channel identifier. | [required] | -**limit** | Option<**i32**> | Size of the subset to retrieve. | |[default to 10] -**offset** | Option<**i32**> | Number of items to skip during retrieval. | |[default to 0] -**level** | Option<**i32**> | Level of hierarchy up to which to retrieve groups from given group id. | | -**tree** | Option<**bool**> | Specify type of response, JSON array or tree. | |[default to false] -**metadata** | Option<**String**> | Metadata filter. Filtering is performed matching the parameter with metadata on top level. Parameter is json. | | -**name** | Option<**String**> | Channel's name. | | -**parent_id** | Option<**uuid::Uuid**> | Unique parent identifier for a group. | | - -### Return type - -[**models::MembersPage**](MembersPage.md) - -### Authorization - -[refreshAuth](../README.md#refreshAuth), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## list_users_in_client - -> models::MembersPage list_users_in_client(domain_id, client_id, limit, offset, level, tree, metadata, name, parent_id) -List users associated with a client - -Retrieves a list of users associated with a client. Due to performance concerns, data is retrieved in subsets. The API must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**client_id** | **uuid::Uuid** | Unique client identifier. | [required] | -**limit** | Option<**i32**> | Size of the subset to retrieve. | |[default to 10] -**offset** | Option<**i32**> | Number of items to skip during retrieval. | |[default to 0] -**level** | Option<**i32**> | Level of hierarchy up to which to retrieve groups from given group id. | | -**tree** | Option<**bool**> | Specify type of response, JSON array or tree. | |[default to false] -**metadata** | Option<**String**> | Metadata filter. Filtering is performed matching the parameter with metadata on top level. Parameter is json. | | -**name** | Option<**String**> | Channel's name. | | -**parent_id** | Option<**uuid::Uuid**> | Unique parent identifier for a group. | | - -### Return type - -[**models::MembersPage**](MembersPage.md) - -### Authorization - -[refreshAuth](../README.md#refreshAuth), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## list_users_in_group - -> models::MembersPage list_users_in_group(domain_id, group_id, limit, offset, level, tree, metadata, name, parent_id) -List users in a group - -Retrieves a list of users in a group. Due to performance concerns, data is retrieved in subsets. The API must ensure that the entire dataset is consumed either by making subsequent requests, or by increasing the subset size of the initial request. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**domain_id** | **uuid::Uuid** | Unique domain identifier. | [required] | -**group_id** | **uuid::Uuid** | Unique group identifier. | [required] | -**limit** | Option<**i32**> | Size of the subset to retrieve. | |[default to 10] -**offset** | Option<**i32**> | Number of items to skip during retrieval. | |[default to 0] -**level** | Option<**i32**> | Level of hierarchy up to which to retrieve groups from given group id. | | -**tree** | Option<**bool**> | Specify type of response, JSON array or tree. | |[default to false] -**metadata** | Option<**String**> | Metadata filter. Filtering is performed matching the parameter with metadata on top level. Parameter is json. | | -**name** | Option<**String**> | Group's name. | | -**parent_id** | Option<**uuid::Uuid**> | Unique parent identifier for a group. | | - -### Return type - -[**models::MembersPage**](MembersPage.md) - -### Authorization - -[refreshAuth](../README.md#refreshAuth), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## refresh_token - -> models::IssueToken200Response refresh_token() -Refresh Token - -Refreshes Access and Refresh Token used for authenticating into the system. - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -[**models::IssueToken200Response**](issueToken_200_response.md) - -### Authorization - -[refreshAuth](../README.md#refreshAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## request_password_reset - -> request_password_reset(referer, request_password_reset_request) -User password reset request - -Generates a reset token and sends and email with link for resetting password. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**referer** | **String** | Host being sent by browser. | [required] | -**request_password_reset_request** | [**RequestPasswordResetRequest**](RequestPasswordResetRequest.md) | Initiate password request procedure. | [required] | - -### Return type - - (empty response body) - -### Authorization - -[refreshAuth](../README.md#refreshAuth), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## reset_password - -> reset_password(reset_password_request) -User password reset endpoint - -When user gets reset token, after he submitted email to `/password/reset-request`, posting a new password along to this endpoint will change password. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**reset_password_request** | Option<[**ResetPasswordRequest**](ResetPasswordRequest.md)> | Password reset request data, new password and token that is appended on password reset link received in email. | | - -### Return type - - (empty response body) - -### Authorization - -[refreshAuth](../README.md#refreshAuth), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## search_users - -> models::UsersPage search_users(user_id, limit, offset, username, first_name, last_name, email) -Search users - -Search users by name and identity. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**user_id** | **uuid::Uuid** | Unique user identifier. | [required] | -**limit** | Option<**i32**> | Size of the subset to retrieve. | |[default to 10] -**offset** | Option<**i32**> | Number of items to skip during retrieval. | |[default to 0] -**username** | Option<**String**> | User's username. | | -**first_name** | Option<**String**> | User's first name. | | -**last_name** | Option<**String**> | User's last name. | | -**email** | Option<**String**> | User's email address. | | - -### Return type - -[**models::UsersPage**](UsersPage.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## update_email - -> models::User update_email(user_id, email) -Updates email of the user. - -Updates email of the user with provided ID. Email is updated using authorization token and the new received email. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**user_id** | **uuid::Uuid** | Unique user identifier. | [required] | -**email** | [**Email**](Email.md) | Email change data. User can change its email. | [required] | - -### Return type - -[**models::User**](User.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## update_profile_picture - -> models::User update_profile_picture(user_id, user_profile_picture) -Updates the user's profile picture. - -Updates the user's profile picture with provided ID. Profile picture is updated using authorization token and the new received picture. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**user_id** | **uuid::Uuid** | Unique user identifier. | [required] | -**user_profile_picture** | [**UserProfilePicture**](UserProfilePicture.md) | JSON-formated document describing the profile picture of user to be update | [required] | - -### Return type - -[**models::User**](User.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## update_role - -> models::User update_role(user_id, user_role) -Updates the user's role. - -Updates role for the user with provided ID. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**user_id** | **uuid::Uuid** | Unique user identifier. | [required] | -**user_role** | [**UserRole**](UserRole.md) | JSON-formated document describing the role of the user to be updated | [required] | - -### Return type - -[**models::User**](User.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## update_secret - -> models::User update_secret(user_secret) -Updates secret of currently logged in user. - -Updates secret of currently logged in user. Secret is updated using authorization token and the new received info. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**user_secret** | [**UserSecret**](UserSecret.md) | Secret change data. User can change its secret. | [required] | - -### Return type - -[**models::User**](User.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## update_tags - -> models::User update_tags(user_id, user_tags) -Updates tags of the user. - -Updates tags of the user with provided ID. Tags is updated using authorization token and the new tags received in request. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**user_id** | **uuid::Uuid** | Unique user identifier. | [required] | -**user_tags** | [**UserTags**](UserTags.md) | JSON-formated document describing the tags of user to be update | [required] | - -### Return type - -[**models::User**](User.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## update_user - -> models::User update_user(user_id, user_update) -Updates first, last name and metadata of the user. - -Updates name and metadata of the user with provided ID. Name and metadata is updated using authorization token and the new received info. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**user_id** | **uuid::Uuid** | Unique user identifier. | [required] | -**user_update** | [**UserUpdate**](UserUpdate.md) | JSON-formated document describing the metadata and name of user to be update | [required] | - -### Return type - -[**models::User**](User.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## update_username - -> models::User update_username(user_id, username) -Updates user's username. - -Updates username of the user with provided ID. Username is updated using authorization token and the new received username. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**user_id** | **uuid::Uuid** | Unique user identifier. | [required] | -**username** | [**Username**](Username.md) | JSON-formated document describing the username of the user to be updated | [required] | - -### Return type - -[**models::User**](User.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## users_user_id_delete - -> users_user_id_delete(user_id) -Delete a user - -Delete a specific user that is identifier by the user ID. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**user_id** | **uuid::Uuid** | Unique user identifier. | [required] | - -### Return type - - (empty response body) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/users/docs/UsersPage.md b/users/docs/UsersPage.md deleted file mode 100644 index d46bd1a5..00000000 --- a/users/docs/UsersPage.md +++ /dev/null @@ -1,14 +0,0 @@ -# UsersPage - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**users** | [**Vec**](User.md) | | -**total** | **i32** | Total number of items. | -**offset** | **i32** | Number of items to skip during retrieval. | -**limit** | Option<**i32**> | Maximum number of items to return in one page. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/users/git_push.sh b/users/git_push.sh deleted file mode 100644 index f53a75d4..00000000 --- a/users/git_push.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 -git_host=$4 - -if [ "$git_host" = "" ]; then - git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" -fi - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' diff --git a/users/src/apis/configuration.rs b/users/src/apis/configuration.rs deleted file mode 100644 index 085dd13e..00000000 --- a/users/src/apis/configuration.rs +++ /dev/null @@ -1,51 +0,0 @@ -/* - * SuperMQ Users Service - * - * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - - - -#[derive(Debug, Clone)] -pub struct Configuration { - pub base_path: String, - pub user_agent: Option, - pub client: reqwest::Client, - pub basic_auth: Option, - pub oauth_access_token: Option, - pub bearer_access_token: Option, - pub api_key: Option, -} - -pub type BasicAuth = (String, Option); - -#[derive(Debug, Clone)] -pub struct ApiKey { - pub prefix: Option, - pub key: String, -} - - -impl Configuration { - pub fn new() -> Configuration { - Configuration::default() - } -} - -impl Default for Configuration { - fn default() -> Self { - Configuration { - base_path: "http://localhost:9002".to_owned(), - user_agent: Some("OpenAPI-Generator/0.15.1/rust".to_owned()), - client: reqwest::Client::new(), - basic_auth: None, - oauth_access_token: None, - bearer_access_token: None, - api_key: None, - } - } -} diff --git a/users/src/apis/health_api.rs b/users/src/apis/health_api.rs deleted file mode 100644 index 28feea5c..00000000 --- a/users/src/apis/health_api.rs +++ /dev/null @@ -1,53 +0,0 @@ -/* - * SuperMQ Users Service - * - * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - - -use reqwest; -use serde::{Deserialize, Serialize}; -use crate::{apis::ResponseContent, models}; -use super::{Error, configuration}; - - -/// struct for typed errors of method [`health`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum HealthError { - Status500(models::Error), - UnknownValue(serde_json::Value), -} - - -pub async fn health(configuration: &configuration::Configuration, ) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/health", local_var_configuration.base_path); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - diff --git a/users/src/apis/mod.rs b/users/src/apis/mod.rs deleted file mode 100644 index 82659460..00000000 --- a/users/src/apis/mod.rs +++ /dev/null @@ -1,96 +0,0 @@ -use std::error; -use std::fmt; - -#[derive(Debug, Clone)] -pub struct ResponseContent { - pub status: reqwest::StatusCode, - pub content: String, - pub entity: Option, -} - -#[derive(Debug)] -pub enum Error { - Reqwest(reqwest::Error), - Serde(serde_json::Error), - Io(std::io::Error), - ResponseError(ResponseContent), -} - -impl fmt::Display for Error { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - let (module, e) = match self { - Error::Reqwest(e) => ("reqwest", e.to_string()), - Error::Serde(e) => ("serde", e.to_string()), - Error::Io(e) => ("IO", e.to_string()), - Error::ResponseError(e) => ("response", format!("status code {}", e.status)), - }; - write!(f, "error in {}: {}", module, e) - } -} - -impl error::Error for Error { - fn source(&self) -> Option<&(dyn error::Error + 'static)> { - Some(match self { - Error::Reqwest(e) => e, - Error::Serde(e) => e, - Error::Io(e) => e, - Error::ResponseError(_) => return None, - }) - } -} - -impl From for Error { - fn from(e: reqwest::Error) -> Self { - Error::Reqwest(e) - } -} - -impl From for Error { - fn from(e: serde_json::Error) -> Self { - Error::Serde(e) - } -} - -impl From for Error { - fn from(e: std::io::Error) -> Self { - Error::Io(e) - } -} - -pub fn urlencode>(s: T) -> String { - ::url::form_urlencoded::byte_serialize(s.as_ref().as_bytes()).collect() -} - -pub fn parse_deep_object(prefix: &str, value: &serde_json::Value) -> Vec<(String, String)> { - if let serde_json::Value::Object(object) = value { - let mut params = vec![]; - - for (key, value) in object { - match value { - serde_json::Value::Object(_) => params.append(&mut parse_deep_object( - &format!("{}[{}]", prefix, key), - value, - )), - serde_json::Value::Array(array) => { - for (i, value) in array.iter().enumerate() { - params.append(&mut parse_deep_object( - &format!("{}[{}][{}]", prefix, key, i), - value, - )); - } - }, - serde_json::Value::String(s) => params.push((format!("{}[{}]", prefix, key), s.clone())), - _ => params.push((format!("{}[{}]", prefix, key), value.to_string())), - } - } - - return params; - } - - unimplemented!("Only objects are supported with style=deepObject") -} - -pub mod health_api; -pub mod users_api; - -pub mod configuration; diff --git a/users/src/lib.rs b/users/src/lib.rs deleted file mode 100644 index e1520628..00000000 --- a/users/src/lib.rs +++ /dev/null @@ -1,11 +0,0 @@ -#![allow(unused_imports)] -#![allow(clippy::too_many_arguments)] - -extern crate serde_repr; -extern crate serde; -extern crate serde_json; -extern crate url; -extern crate reqwest; - -pub mod apis; -pub mod models; diff --git a/users/src/models/email.rs b/users/src/models/email.rs deleted file mode 100644 index 4ded60df..00000000 --- a/users/src/models/email.rs +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SuperMQ Users Service - * - * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct Email { - /// User email address. - #[serde(rename = "email")] - pub email: String, -} - -impl Email { - pub fn new(email: String) -> Email { - Email { - email, - } - } -} - diff --git a/users/src/models/error.rs b/users/src/models/error.rs deleted file mode 100644 index 7e4d1974..00000000 --- a/users/src/models/error.rs +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SuperMQ Users Service - * - * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct Error { - /// Error message - #[serde(rename = "error", skip_serializing_if = "Option::is_none")] - pub error: Option, -} - -impl Error { - pub fn new() -> Error { - Error { - error: None, - } - } -} - diff --git a/users/src/models/mod.rs b/users/src/models/mod.rs deleted file mode 100644 index 72818cea..00000000 --- a/users/src/models/mod.rs +++ /dev/null @@ -1,46 +0,0 @@ -pub mod assign_req_obj; -pub use self::assign_req_obj::AssignReqObj; -pub mod assign_user_req_obj; -pub use self::assign_user_req_obj::AssignUserReqObj; -pub mod email; -pub use self::email::Email; -pub mod error; -pub use self::error::Error; -pub mod health_res; -pub use self::health_res::HealthRes; -pub mod issue_token; -pub use self::issue_token::IssueToken; -pub mod issue_token_200_response; -pub use self::issue_token_200_response::IssueToken200Response; -pub mod members; -pub use self::members::Members; -pub mod members_credentials; -pub use self::members_credentials::MembersCredentials; -pub mod members_page; -pub use self::members_page::MembersPage; -pub mod request_password_reset_request; -pub use self::request_password_reset_request::RequestPasswordResetRequest; -pub mod reset_password_request; -pub use self::reset_password_request::ResetPasswordRequest; -pub mod user; -pub use self::user::User; -pub mod user_credentials; -pub use self::user_credentials::UserCredentials; -pub mod user_profile_picture; -pub use self::user_profile_picture::UserProfilePicture; -pub mod user_req_obj; -pub use self::user_req_obj::UserReqObj; -pub mod user_req_obj_credentials; -pub use self::user_req_obj_credentials::UserReqObjCredentials; -pub mod user_role; -pub use self::user_role::UserRole; -pub mod user_secret; -pub use self::user_secret::UserSecret; -pub mod user_tags; -pub use self::user_tags::UserTags; -pub mod user_update; -pub use self::user_update::UserUpdate; -pub mod username; -pub use self::username::Username; -pub mod users_page; -pub use self::users_page::UsersPage; diff --git a/users/src/models/user_tags.rs b/users/src/models/user_tags.rs deleted file mode 100644 index a63f95c5..00000000 --- a/users/src/models/user_tags.rs +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SuperMQ Users Service - * - * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct UserTags { - /// User tags. - #[serde(rename = "tags", skip_serializing_if = "Option::is_none")] - pub tags: Option>, -} - -impl UserTags { - pub fn new() -> UserTags { - UserTags { - tags: None, - } - } -} - diff --git a/users/src/models/username.rs b/users/src/models/username.rs deleted file mode 100644 index 2d34d638..00000000 --- a/users/src/models/username.rs +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SuperMQ Users Service - * - * This is the Users Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code. Some useful links: - [The SuperMQ repository](https://github.com/absmach/supermq) - * - * The version of the OpenAPI document: 0.15.1 - * Contact: info@abstractmachines.fr - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct Username { - /// User's username for example 'admin' will be used as its unique identifier. - #[serde(rename = "username")] - pub username: String, -} - -impl Username { - pub fn new(username: String) -> Username { - Username { - username, - } - } -} - From d41536ca88a90d7d7f86d384547cc9c76c019227 Mon Sep 17 00:00:00 2001 From: Dorcas Litunya Date: Mon, 13 Jan 2025 10:34:55 +0300 Subject: [PATCH 07/10] Modify README.md to add instructions on how to use the API --- Apis.md | 189 ++++++++++++++++++++++++++++++++++++++ README.md | 264 ++++++++++++++++++------------------------------------ 2 files changed, 275 insertions(+), 178 deletions(-) create mode 100644 Apis.md diff --git a/Apis.md b/Apis.md new file mode 100644 index 00000000..a6010898 --- /dev/null +++ b/Apis.md @@ -0,0 +1,189 @@ +# Rust API client for openapi + +This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. +Some useful links: +- [The SuperMQ repository](https://github.com/absmach/supermq) + + + +## Overview + +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://openapis.org) from a remote server, you can easily generate an API client. + +- API version: 0.15.1 +- Package version: 0.15.1 +- Build package: `org.openapitools.codegen.languages.RustClientCodegen` + + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost:9001* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*CertsApi* | [**create_cert**](Models.md#create_cert) | **POST** /{domainID}/certs | Creates a certificate for client +*CertsApi* | [**get_cert**](Models.md#get_cert) | **GET** /{domainID}/certs/{certID} | Retrieves a certificate +*CertsApi* | [**get_serials**](Models.md#get_serials) | **GET** /{domainID}/serials/{clientID} | Retrieves certificates' serial IDs +*CertsApi* | [**health_get**](Models.md#health_get) | **GET** /health | Retrieves service health check info. +*CertsApi* | [**revoke_cert**](Models.md#revoke_cert) | **DELETE** /{domainID}/certs/{certID} | Revokes a certificate +*ChannelsApi* | [**connect_clients_and_channels**](Models.md#connect_clients_and_channels) | **POST** /{domainID}/channels/connect | Connects client and channel. +*ChannelsApi* | [**connect_clients_to_channel**](Models.md#connect_clients_to_channel) | **POST** /{domainID}/channels/{chanID}/connect | Connects clients to a channel +*ChannelsApi* | [**create_channel**](Models.md#create_channel) | **POST** /{domainID}/channels | Creates new channel +*ChannelsApi* | [**create_channels**](Models.md#create_channels) | **POST** /{domainID}/channels/bulk | Creates new channels +*ChannelsApi* | [**disable_channel**](Models.md#disable_channel) | **POST** /{domainID}/channels/{chanID}/disable | Disables a channel +*ChannelsApi* | [**disconnect_clients_and_channels**](Models.md#disconnect_clients_and_channels) | **POST** /{domainID}/channels/disconnect | Disconnects client and channel. +*ChannelsApi* | [**disconnect_clients_from_channel**](Models.md#disconnect_clients_from_channel) | **POST** /{domainID}/channels/{chanID}/disconnect | Disconnects clients from a channel +*ChannelsApi* | [**domain_id_channels_chan_id_delete**](Models.md#domain_id_channels_chan_id_delete) | **DELETE** /{domainID}/channels/{chanID} | Delete channel for given channel id. +*ChannelsApi* | [**enable_channel**](Models.md#enable_channel) | **POST** /{domainID}/channels/{chanID}/enable | Enables a channel +*ChannelsApi* | [**get_channel**](Models.md#get_channel) | **GET** /{domainID}/channels/{chanID} | Retrieves channel info. +*ChannelsApi* | [**list_channels**](Models.md#list_channels) | **GET** /{domainID}/channels | Lists channels. +*ChannelsApi* | [**remove_channel_parent_group**](Models.md#remove_channel_parent_group) | **DELETE** /{domainID}/channels/{chanID}/parent | Removes a parent group from a channel. +*ChannelsApi* | [**set_channel_parent_group**](Models.md#set_channel_parent_group) | **POST** /{domainID}/channels/{chanID}/parent | Sets a parent group for a channel +*ChannelsApi* | [**update_channel**](Models.md#update_channel) | **PATCH** /{domainID}/channels/{chanID} | Updates channel data. +*ChannelsApi* | [**update_channel_tags**](Models.md#update_channel_tags) | **PATCH** /{domainID}/channels/{chanID}/tags | Updates channel tags. +*ClientsApi* | [**add_client_role_action**](Models.md#add_client_role_action) | **POST** /{domainID}/clients/{clientID}/roles/{roleName}/actions | Adds a role action for a client role. +*ClientsApi* | [**add_client_role_member**](Models.md#add_client_role_member) | **POST** /{domainID}/clients/{clientID}/roles/{roleName}/members | Adds a member to a client role. +*ClientsApi* | [**bulk_create_clients**](Models.md#bulk_create_clients) | **POST** /{domainID}/clients/bulk | Bulk provisions new clients +*ClientsApi* | [**create_client**](Models.md#create_client) | **POST** /{domainID}/clients | Adds new client +*ClientsApi* | [**create_client_role**](Models.md#create_client_role) | **POST** /{domainID}/clients/{clientID}/roles | Creates a role for a client +*ClientsApi* | [**delete_all_client_role_actions**](Models.md#delete_all_client_role_actions) | **POST** /{domainID}/clients/{clientID}/roles/{roleName}/actions/delete-all | Deletes all role actions for a client role. +*ClientsApi* | [**delete_all_client_role_members**](Models.md#delete_all_client_role_members) | **POST** /{domainID}/clients/{clientID}/roles/{roleName}/members/delete-all | Deletes all members from a client role. +*ClientsApi* | [**delete_client_role**](Models.md#delete_client_role) | **DELETE** /{domainID}/clients/{clientID}/roles/{roleName} | Deletes client role. +*ClientsApi* | [**delete_client_role_action**](Models.md#delete_client_role_action) | **POST** /{domainID}/clients/{clientID}/roles/{roleName}/actions/delete | Deletes role actions for a client role. +*ClientsApi* | [**delete_client_role_members**](Models.md#delete_client_role_members) | **POST** /{domainID}/clients/{clientID}/roles/{roleName}/members/delete | Deletes members from a client role. +*ClientsApi* | [**disable_client**](Models.md#disable_client) | **POST** /{domainID}/clients/{clientID}/disable | Disables a client +*ClientsApi* | [**domain_id_clients_client_id_delete**](Models.md#domain_id_clients_client_id_delete) | **DELETE** /{domainID}/clients/{clientID} | Delete client for a client with the given id. +*ClientsApi* | [**enable_client**](Models.md#enable_client) | **POST** /{domainID}/clients/{clientID}/enable | Enables a client +*ClientsApi* | [**get_client**](Models.md#get_client) | **GET** /{domainID}/clients/{clientID} | Retrieves client info +*ClientsApi* | [**get_client_role**](Models.md#get_client_role) | **GET** /{domainID}/clients/{clientID}/roles/{roleName} | Retrieves client role. +*ClientsApi* | [**list_available_actions**](Models.md#list_available_actions) | **GET** /{domainID}/clients/roles/available-actions | Retrieves available actions. +*ClientsApi* | [**list_client_role_actions**](Models.md#list_client_role_actions) | **GET** /{domainID}/clients/{clientID}/roles/{roleName}/actions | Lists client role actions. +*ClientsApi* | [**list_client_role_members**](Models.md#list_client_role_members) | **GET** /{domainID}/clients/{clientID}/roles/{roleName}/members | Lists client role members. +*ClientsApi* | [**list_client_roles**](Models.md#list_client_roles) | **GET** /{domainID}/clients/{clientID}/roles | Retrieves clients roles. +*ClientsApi* | [**list_clients**](Models.md#list_clients) | **GET** /{domainID}/clients | Retrieves clients +*ClientsApi* | [**list_user_clients**](Models.md#list_user_clients) | **GET** /{domainID}/users/{userID}/clients | List clients asssociated with a user. +*ClientsApi* | [**remove_client_parent_group**](Models.md#remove_client_parent_group) | **DELETE** /{domainID}/clients/{clientID}/parent | Removes a parent group from a client. +*ClientsApi* | [**set_client_parent_group**](Models.md#set_client_parent_group) | **POST** /{domainID}/clients/{clientID}/parent | Sets a parent group for a client +*ClientsApi* | [**update_client**](Models.md#update_client) | **PATCH** /{domainID}/clients/{clientID} | Updates name and metadata of the client. +*ClientsApi* | [**update_client_role**](Models.md#update_client_role) | **PUT** /{domainID}/clients/{clientID}/roles/{roleName} | Updates client role. +*ClientsApi* | [**update_client_secret**](Models.md#update_client_secret) | **PATCH** /{domainID}/clients/{clientID}/secret | Updates Secret of the identified client. +*ClientsApi* | [**update_client_tags**](Models.md#update_client_tags) | **PATCH** /{domainID}/clients/{clientID}/tags | Updates tags the client. +*ConfigsApi* | [**create_config**](Models.md#create_config) | **POST** /{domainID}/clients/configs | Adds new config +*ConfigsApi* | [**get_bootstrap_config**](Models.md#get_bootstrap_config) | **GET** /clients/bootstrap/{externalId} | Retrieves configuration. +*ConfigsApi* | [**get_config**](Models.md#get_config) | **GET** /{domainID}/clients/configs/{configId} | Retrieves config info (with channels). +*ConfigsApi* | [**get_configs**](Models.md#get_configs) | **GET** /{domainID}/clients/configs | Retrieves managed configs +*ConfigsApi* | [**get_secure_bootstrap_config**](Models.md#get_secure_bootstrap_config) | **GET** /clients/bootstrap/secure/{externalId} | Retrieves configuration. +*ConfigsApi* | [**remove_config**](Models.md#remove_config) | **DELETE** /{domainID}/clients/configs/{configId} | Removes a Config +*ConfigsApi* | [**update_config**](Models.md#update_config) | **PUT** /{domainID}/clients/configs/{configId} | Updates config info +*ConfigsApi* | [**update_config_certs**](Models.md#update_config_certs) | **PATCH** /{domainID}/clients/configs/certs/{configId} | Updates certs +*ConfigsApi* | [**update_config_connections**](Models.md#update_config_connections) | **PUT** /{domainID}/clients/configs/connections/{configId} | Updates channels the client is connected to +*ConfigsApi* | [**update_config_state**](Models.md#update_config_state) | **PUT** /{domainID}/clients/state/{configId} | Updates Config state. +*DomainsApi* | [**add_domain_role_action**](Models.md#add_domain_role_action) | **POST** /domains/{domainID}/roles/{roleName}/actions | Adds a role action for a domain role. +*DomainsApi* | [**add_domain_role_member**](Models.md#add_domain_role_member) | **POST** /domains/{domainID}/roles/{roleName}/members | Adds a member to a domain role. +*DomainsApi* | [**create_domain_role**](Models.md#create_domain_role) | **POST** /domains/{domainID}/roles | Creates a role for a domain +*DomainsApi* | [**delete_all_domain_role_actions**](Models.md#delete_all_domain_role_actions) | **POST** /domains/{domainID}/roles/{roleName}/actions/delete-all | Deletes all role actions for a domain role. +*DomainsApi* | [**delete_all_domain_role_members**](Models.md#delete_all_domain_role_members) | **POST** /domains/{domainID}/roles/{roleName}/members/delete-all | Deletes all members from a domain role. +*DomainsApi* | [**delete_domain_role**](Models.md#delete_domain_role) | **DELETE** /domains/{domainID}/roles/{roleName} | Deletes domain role. +*DomainsApi* | [**delete_domain_role_action**](Models.md#delete_domain_role_action) | **POST** /domains/{domainID}/roles/{roleName}/actions/delete | Deletes role actions for a domain role. +*DomainsApi* | [**delete_domain_role_members**](Models.md#delete_domain_role_members) | **POST** /domains/{domainID}/roles/{roleName}/members/delete | Deletes members from a domain role. +*DomainsApi* | [**domains_domain_id_disable_post**](Models.md#domains_domain_id_disable_post) | **POST** /domains/{domainID}/disable | Disable a domain +*DomainsApi* | [**domains_domain_id_enable_post**](Models.md#domains_domain_id_enable_post) | **POST** /domains/{domainID}/enable | Enables a domain +*DomainsApi* | [**domains_domain_id_freeze_post**](Models.md#domains_domain_id_freeze_post) | **POST** /domains/{domainID}/freeze | Freeze a domain +*DomainsApi* | [**domains_domain_id_get**](Models.md#domains_domain_id_get) | **GET** /domains/{domainID} | Retrieves domain information +*DomainsApi* | [**domains_domain_id_patch**](Models.md#domains_domain_id_patch) | **PATCH** /domains/{domainID} | Updates name, metadata, tags and alias of the domain. +*DomainsApi* | [**domains_get**](Models.md#domains_get) | **GET** /domains | Retrieves list of domains. +*DomainsApi* | [**domains_post**](Models.md#domains_post) | **POST** /domains | Adds new domain +*DomainsApi* | [**get_domain_role**](Models.md#get_domain_role) | **GET** /domains/{domainID}/roles/{roleName} | Retrieves domain role. +*DomainsApi* | [**list_available_domain_actions**](Models.md#list_available_domain_actions) | **GET** /domains/roles/available-actions | Retrieves available actions. +*DomainsApi* | [**list_domain_role_actions**](Models.md#list_domain_role_actions) | **GET** /domains/{domainID}/roles/{roleName}/actions | Lists domain role actions. +*DomainsApi* | [**list_domain_role_members**](Models.md#list_domain_role_members) | **GET** /domains/{domainID}/roles/{roleName}/members | Lists domain role members. +*DomainsApi* | [**list_domain_roles**](Models.md#list_domain_roles) | **GET** /domains/{domainID}/roles | Retrieves domains roles. +*DomainsApi* | [**update_domain_role**](Models.md#update_domain_role) | **PUT** /domains/{domainID}/roles/{roleName} | Updates domain role. +*GroupsApi* | [**add_children_groups**](Models.md#add_children_groups) | **POST** /{domainID}/groups/{groupID}/children | Add children groups. +*GroupsApi* | [**add_group_role_action**](Models.md#add_group_role_action) | **POST** /{domainID}/groups/{groupID}/roles/{roleName}/actions | Adds a role action for a group role. +*GroupsApi* | [**add_group_role_member**](Models.md#add_group_role_member) | **POST** /{domainID}/groups/{groupID}/roles/{roleName}/members | Adds a member to a group role. +*GroupsApi* | [**create_group**](Models.md#create_group) | **POST** /{domainID}/groups | Creates new group +*GroupsApi* | [**create_group_role**](Models.md#create_group_role) | **POST** /{domainID}/groups/{groupID}/roles | Creates a role for a group +*GroupsApi* | [**delete_all_group_role_actions**](Models.md#delete_all_group_role_actions) | **POST** /{domainID}/groups/{groupID}/roles/{roleName}/actions/delete-all | Deletes all role actions for a group role. +*GroupsApi* | [**delete_all_group_role_members**](Models.md#delete_all_group_role_members) | **POST** /{domainID}/groups/{groupID}/roles/{roleName}/members/delete-all | Deletes all members from a group role. +*GroupsApi* | [**delete_group_role**](Models.md#delete_group_role) | **DELETE** /{domainID}/groups/{groupID}/roles/{roleName} | Deletes group role. +*GroupsApi* | [**delete_group_role_action**](Models.md#delete_group_role_action) | **POST** /{domainID}/groups/{groupID}/roles/{roleName}/actions/delete | Deletes role actions for a group role. +*GroupsApi* | [**delete_group_role_members**](Models.md#delete_group_role_members) | **POST** /{domainID}/groups/{groupID}/roles/{roleName}/members/delete | Deletes members from a group role. +*GroupsApi* | [**disable_group**](Models.md#disable_group) | **POST** /{domainID}/groups/{groupID}/disable | Disables a group +*GroupsApi* | [**domain_id_groups_group_id_delete**](Models.md#domain_id_groups_group_id_delete) | **DELETE** /{domainID}/groups/{groupID} | Delete group for a group with the given id. +*GroupsApi* | [**enable_group**](Models.md#enable_group) | **POST** /{domainID}/groups/{groupID}/enable | Enables a group +*GroupsApi* | [**get_group**](Models.md#get_group) | **GET** /{domainID}/groups/{groupID} | Gets group info. +*GroupsApi* | [**get_group_role**](Models.md#get_group_role) | **GET** /{domainID}/groups/{groupID}/roles/{roleName} | Retrieves group role. +*GroupsApi* | [**list_available_group_actions**](Models.md#list_available_group_actions) | **GET** /{domainID}/groups/roles/available-actions | Retrieves available actions. +*GroupsApi* | [**list_children_groups**](Models.md#list_children_groups) | **GET** /{domainID}/groups/{groupID}/children | List children of a certain group +*GroupsApi* | [**list_group_hierarchy**](Models.md#list_group_hierarchy) | **GET** /{domainID}/groups/{groupID}/hierarchy | Lists groups hierarchy. +*GroupsApi* | [**list_group_role_actions**](Models.md#list_group_role_actions) | **GET** /{domainID}/groups/{groupID}/roles/{roleName}/actions | Lists group role actions. +*GroupsApi* | [**list_group_role_members**](Models.md#list_group_role_members) | **GET** /{domainID}/groups/{groupID}/roles/{roleName}/members | Lists group role members. +*GroupsApi* | [**list_group_roles**](Models.md#list_group_roles) | **GET** /{domainID}/groups/{groupID}/roles | Retrieves groups roles. +*GroupsApi* | [**list_groups**](Models.md#list_groups) | **GET** /{domainID}/groups | Lists groups. +*GroupsApi* | [**remove_all_children_groups**](Models.md#remove_all_children_groups) | **DELETE** /{domainID}/groups/{groupID}/children/all | Remove all children groups. +*GroupsApi* | [**remove_children_groups**](Models.md#remove_children_groups) | **DELETE** /{domainID}/groups/{groupID}/children | Remove children groups. +*GroupsApi* | [**remove_group_parent_group**](Models.md#remove_group_parent_group) | **DELETE** /{domainID}/groups/{groupID}/parent | Removes a parent group from a group. +*GroupsApi* | [**set_group_parent_group**](Models.md#set_group_parent_group) | **POST** /{domainID}/groups/{groupID}/parent | Sets a parent group for a group. +*GroupsApi* | [**update_group**](Models.md#update_group) | **PUT** /{domainID}/groups/{groupID} | Updates group data. +*GroupsApi* | [**update_group_role**](Models.md#update_group_role) | **PUT** /{domainID}/groups/{groupID}/roles/{roleName} | Updates group role. +*InvitationsApi* | [**accept_invitation**](Models.md#accept_invitation) | **POST** /invitations/accept | Accept invitation +*InvitationsApi* | [**delete_invitation**](Models.md#delete_invitation) | **DELETE** /invitations/{user_id}/{domain_id} | Deletes a specific invitation +*InvitationsApi* | [**get_invitation**](Models.md#get_invitation) | **GET** /invitations/{user_id}/{domain_id} | Retrieves a specific invitation +*InvitationsApi* | [**list_invitations**](Models.md#list_invitations) | **GET** /invitations | List invitations +*InvitationsApi* | [**reject_invitation**](Models.md#reject_invitation) | **POST** /invitations/reject | Reject invitation +*InvitationsApi* | [**send_invitation**](Models.md#send_invitation) | **POST** /invitations | Send invitation +*JournalLogApi* | [**domain_id_journal_entity_type_id_get**](Models.md#domain_id_journal_entity_type_id_get) | **GET** /{domainID}/journal/{entityType}/{id} | List entity journal log +*JournalLogApi* | [**journal_user_user_id_get**](Models.md#journal_user_user_id_get) | **GET** /journal/user/{userID} | List user journal log +*KeysApi* | [**get_key**](Models.md#get_key) | **GET** /keys/{keyID} | Gets API key details. +*KeysApi* | [**issue_key**](Models.md#issue_key) | **POST** /keys | Issue API key +*KeysApi* | [**revoke_key**](Models.md#revoke_key) | **DELETE** /keys/{keyID} | Revoke API key +*MessagesApi* | [**channels_id_messages_post**](Models.md#channels_id_messages_post) | **POST** /channels/{id}/messages | Sends message to the communication channel +*NotifiersApi* | [**create_subscription**](Models.md#create_subscription) | **POST** /subscriptions | Create subscription +*NotifiersApi* | [**list_subscriptions**](Models.md#list_subscriptions) | **GET** /subscriptions | List subscriptions +*NotifiersApi* | [**remove_subscription**](Models.md#remove_subscription) | **DELETE** /subscriptions/{id} | Delete subscription with the provided id +*NotifiersApi* | [**view_subscription**](Models.md#view_subscription) | **GET** /subscriptions/{id} | Get subscription with the provided id +*ProvisionApi* | [**domain_id_mapping_get**](Models.md#domain_id_mapping_get) | **GET** /{domainID}/mapping | Gets current mapping. +*ProvisionApi* | [**domain_id_mapping_post**](Models.md#domain_id_mapping_post) | **POST** /{domainID}/mapping | Adds new device to proxy +*ReadersApi* | [**get_messages**](Models.md#get_messages) | **GET** /channels/{chanId}/messages | Retrieves messages sent to single channel +*StatesApi* | [**get_states**](Models.md#get_states) | **GET** /states/{twinID} | Retrieves states of twin with id twinID +*TwinsApi* | [**create_twin**](Models.md#create_twin) | **POST** /twins | Adds new twin +*TwinsApi* | [**get_twin**](Models.md#get_twin) | **GET** /twins/{twinID} | Retrieves twin info +*TwinsApi* | [**get_twins**](Models.md#get_twins) | **GET** /twins | Retrieves twins +*TwinsApi* | [**remove_twin**](Models.md#remove_twin) | **DELETE** /twins/{twinID} | Removes a twin +*TwinsApi* | [**update_twin**](Models.md#update_twin) | **PUT** /twins/{twinID} | Updates twin info +*UsersApi* | [**create_user**](Models.md#create_user) | **POST** /users | Registers user account +*UsersApi* | [**disable_user**](Models.md#disable_user) | **POST** /users/{userID}/disable | Disables a user +*UsersApi* | [**domain_id_users_get**](Models.md#domain_id_users_get) | **GET** /{domainID}/users | List users assigned to domain +*UsersApi* | [**enable_user**](Models.md#enable_user) | **POST** /users/{userID}/enable | Enables a user +*UsersApi* | [**get_profile**](Models.md#get_profile) | **GET** /users/profile | Gets info on currently logged in user. +*UsersApi* | [**get_user**](Models.md#get_user) | **GET** /users/{userID} | Retrieves a user +*UsersApi* | [**issue_token**](Models.md#issue_token) | **POST** /users/tokens/issue | Issue Token +*UsersApi* | [**list_users**](Models.md#list_users) | **GET** /users | List users +*UsersApi* | [**list_users_in_channel**](Models.md#list_users_in_channel) | **GET** /{domainID}/channels/{channelID}/users | List users in a channel +*UsersApi* | [**list_users_in_client**](Models.md#list_users_in_client) | **GET** /{domainID}/clients/{clientID}/users | List users associated with a client +*UsersApi* | [**list_users_in_group**](Models.md#list_users_in_group) | **GET** /{domainID}/groups/{groupID}/users | List users in a group +*UsersApi* | [**refresh_token**](Models.md#refresh_token) | **POST** /users/tokens/refresh | Refresh Token +*UsersApi* | [**request_password_reset**](Models.md#request_password_reset) | **POST** /password/reset-request | User password reset request +*UsersApi* | [**reset_password**](Models.md#reset_password) | **PUT** /password/reset | User password reset endpoint +*UsersApi* | [**search_users**](Models.md#search_users) | **GET** /users/search | Search users +*UsersApi* | [**update_email**](Models.md#update_email) | **PATCH** /users/{userID}/email | Updates email of the user. +*UsersApi* | [**update_profile_picture**](Models.md#update_profile_picture) | **PATCH** /users/{userID}/picture | Updates the user's profile picture. +*UsersApi* | [**update_role**](Models.md#update_role) | **PATCH** /users/{userID}/role | Updates the user's role. +*UsersApi* | [**update_secret**](Models.md#update_secret) | **PATCH** /users/secret | Updates secret of currently logged in user. +*UsersApi* | [**update_tags**](Models.md#update_tags) | **PATCH** /users/{userID}/tags | Updates tags of the user. +*UsersApi* | [**update_user**](Models.md#update_user) | **PATCH** /users/{userID} | Updates first, last name and metadata of the user. +*UsersApi* | [**update_username**](Models.md#update_username) | **PATCH** /users/{userID}/username | Updates user's username. +*UsersApi* | [**users_user_id_delete**](Models.md#users_user_id_delete) | **DELETE** /users/{userID} | Delete a user + + +To get access to the crate's generated documentation, use: + +``` +cargo doc --open +``` + +## Author + +info@abstractmachines.fr + diff --git a/README.md b/README.md index 9445ed01..157a8a55 100644 --- a/README.md +++ b/README.md @@ -1,196 +1,104 @@ -# Rust API client for openapi +# `sdk_rust` SDK -This is the SuperMQ Combined Service based on the OpenAPI 3.0 specification. It is the HTTP API for managing SuperMQ. You can now help us improve the API whether it's by making changes to the definition itself or to the code. -Some useful links: -- [The SuperMQ repository](https://github.com/absmach/supermq) +## Introduction +Welcome to the `sdk_rust` SDK! This SDK provides various functionalities, including APIs, models, and configuration management that you can integrate into your Rust projects. This guide will show you how to add the SDK to your project and use it effectively. -## Overview +## Adding the SDK to Your Project -This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://openapis.org) from a remote server, you can easily generate an API client. +Follow these steps to add `sdk_rust` as a dependency: -- API version: 0.15.1 -- Package version: 0.15.1 -- Build package: `org.openapitools.codegen.languages.RustClientCodegen` +1. **Add the SDK as a Git dependency**: -## Installation + Open your `Cargo.toml` file in the `my_rust_project` directory, and add the following dependency under `[dependencies]`: -Put the package under your project folder in a directory named `openapi` and add the following to `Cargo.toml` under `[dependencies]`: + ```toml + [dependencies] + sdk_rust = { git = "https://github.com/your-username/supermq", path = "sdk_rust" } +Replace your-username with your actual GitHub username or organization name, and sdk_rust with the path to the SDK crate within the supermq repository if it's not in the root. +2. **Build and run your project:** + +With the SDK added as a dependency, you can now build and run your project using Cargo: + +First, build the project: + +```bash +cargo build ``` -openapi = { path = "./openapi" } + +Then, run the application: +```bash +cargo run ``` -## Documentation for API Endpoints - -All URIs are relative to *http://localhost:9001* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*CertsApi* | [**create_cert**](Models.md#create_cert) | **POST** /{domainID}/certs | Creates a certificate for client -*CertsApi* | [**get_cert**](Models.md#get_cert) | **GET** /{domainID}/certs/{certID} | Retrieves a certificate -*CertsApi* | [**get_serials**](Models.md#get_serials) | **GET** /{domainID}/serials/{clientID} | Retrieves certificates' serial IDs -*CertsApi* | [**health_get**](Models.md#health_get) | **GET** /health | Retrieves service health check info. -*CertsApi* | [**revoke_cert**](Models.md#revoke_cert) | **DELETE** /{domainID}/certs/{certID} | Revokes a certificate -*ChannelsApi* | [**connect_clients_and_channels**](Models.md#connect_clients_and_channels) | **POST** /{domainID}/channels/connect | Connects client and channel. -*ChannelsApi* | [**connect_clients_to_channel**](Models.md#connect_clients_to_channel) | **POST** /{domainID}/channels/{chanID}/connect | Connects clients to a channel -*ChannelsApi* | [**create_channel**](Models.md#create_channel) | **POST** /{domainID}/channels | Creates new channel -*ChannelsApi* | [**create_channels**](Models.md#create_channels) | **POST** /{domainID}/channels/bulk | Creates new channels -*ChannelsApi* | [**disable_channel**](Models.md#disable_channel) | **POST** /{domainID}/channels/{chanID}/disable | Disables a channel -*ChannelsApi* | [**disconnect_clients_and_channels**](Models.md#disconnect_clients_and_channels) | **POST** /{domainID}/channels/disconnect | Disconnects client and channel. -*ChannelsApi* | [**disconnect_clients_from_channel**](Models.md#disconnect_clients_from_channel) | **POST** /{domainID}/channels/{chanID}/disconnect | Disconnects clients from a channel -*ChannelsApi* | [**domain_id_channels_chan_id_delete**](Models.md#domain_id_channels_chan_id_delete) | **DELETE** /{domainID}/channels/{chanID} | Delete channel for given channel id. -*ChannelsApi* | [**enable_channel**](Models.md#enable_channel) | **POST** /{domainID}/channels/{chanID}/enable | Enables a channel -*ChannelsApi* | [**get_channel**](Models.md#get_channel) | **GET** /{domainID}/channels/{chanID} | Retrieves channel info. -*ChannelsApi* | [**list_channels**](Models.md#list_channels) | **GET** /{domainID}/channels | Lists channels. -*ChannelsApi* | [**remove_channel_parent_group**](Models.md#remove_channel_parent_group) | **DELETE** /{domainID}/channels/{chanID}/parent | Removes a parent group from a channel. -*ChannelsApi* | [**set_channel_parent_group**](Models.md#set_channel_parent_group) | **POST** /{domainID}/channels/{chanID}/parent | Sets a parent group for a channel -*ChannelsApi* | [**update_channel**](Models.md#update_channel) | **PATCH** /{domainID}/channels/{chanID} | Updates channel data. -*ChannelsApi* | [**update_channel_tags**](Models.md#update_channel_tags) | **PATCH** /{domainID}/channels/{chanID}/tags | Updates channel tags. -*ClientsApi* | [**add_client_role_action**](Models.md#add_client_role_action) | **POST** /{domainID}/clients/{clientID}/roles/{roleName}/actions | Adds a role action for a client role. -*ClientsApi* | [**add_client_role_member**](Models.md#add_client_role_member) | **POST** /{domainID}/clients/{clientID}/roles/{roleName}/members | Adds a member to a client role. -*ClientsApi* | [**bulk_create_clients**](Models.md#bulk_create_clients) | **POST** /{domainID}/clients/bulk | Bulk provisions new clients -*ClientsApi* | [**create_client**](Models.md#create_client) | **POST** /{domainID}/clients | Adds new client -*ClientsApi* | [**create_client_role**](Models.md#create_client_role) | **POST** /{domainID}/clients/{clientID}/roles | Creates a role for a client -*ClientsApi* | [**delete_all_client_role_actions**](Models.md#delete_all_client_role_actions) | **POST** /{domainID}/clients/{clientID}/roles/{roleName}/actions/delete-all | Deletes all role actions for a client role. -*ClientsApi* | [**delete_all_client_role_members**](Models.md#delete_all_client_role_members) | **POST** /{domainID}/clients/{clientID}/roles/{roleName}/members/delete-all | Deletes all members from a client role. -*ClientsApi* | [**delete_client_role**](Models.md#delete_client_role) | **DELETE** /{domainID}/clients/{clientID}/roles/{roleName} | Deletes client role. -*ClientsApi* | [**delete_client_role_action**](Models.md#delete_client_role_action) | **POST** /{domainID}/clients/{clientID}/roles/{roleName}/actions/delete | Deletes role actions for a client role. -*ClientsApi* | [**delete_client_role_members**](Models.md#delete_client_role_members) | **POST** /{domainID}/clients/{clientID}/roles/{roleName}/members/delete | Deletes members from a client role. -*ClientsApi* | [**disable_client**](Models.md#disable_client) | **POST** /{domainID}/clients/{clientID}/disable | Disables a client -*ClientsApi* | [**domain_id_clients_client_id_delete**](Models.md#domain_id_clients_client_id_delete) | **DELETE** /{domainID}/clients/{clientID} | Delete client for a client with the given id. -*ClientsApi* | [**enable_client**](Models.md#enable_client) | **POST** /{domainID}/clients/{clientID}/enable | Enables a client -*ClientsApi* | [**get_client**](Models.md#get_client) | **GET** /{domainID}/clients/{clientID} | Retrieves client info -*ClientsApi* | [**get_client_role**](Models.md#get_client_role) | **GET** /{domainID}/clients/{clientID}/roles/{roleName} | Retrieves client role. -*ClientsApi* | [**list_available_actions**](Models.md#list_available_actions) | **GET** /{domainID}/clients/roles/available-actions | Retrieves available actions. -*ClientsApi* | [**list_client_role_actions**](Models.md#list_client_role_actions) | **GET** /{domainID}/clients/{clientID}/roles/{roleName}/actions | Lists client role actions. -*ClientsApi* | [**list_client_role_members**](Models.md#list_client_role_members) | **GET** /{domainID}/clients/{clientID}/roles/{roleName}/members | Lists client role members. -*ClientsApi* | [**list_client_roles**](Models.md#list_client_roles) | **GET** /{domainID}/clients/{clientID}/roles | Retrieves clients roles. -*ClientsApi* | [**list_clients**](Models.md#list_clients) | **GET** /{domainID}/clients | Retrieves clients -*ClientsApi* | [**list_user_clients**](Models.md#list_user_clients) | **GET** /{domainID}/users/{userID}/clients | List clients asssociated with a user. -*ClientsApi* | [**remove_client_parent_group**](Models.md#remove_client_parent_group) | **DELETE** /{domainID}/clients/{clientID}/parent | Removes a parent group from a client. -*ClientsApi* | [**set_client_parent_group**](Models.md#set_client_parent_group) | **POST** /{domainID}/clients/{clientID}/parent | Sets a parent group for a client -*ClientsApi* | [**update_client**](Models.md#update_client) | **PATCH** /{domainID}/clients/{clientID} | Updates name and metadata of the client. -*ClientsApi* | [**update_client_role**](Models.md#update_client_role) | **PUT** /{domainID}/clients/{clientID}/roles/{roleName} | Updates client role. -*ClientsApi* | [**update_client_secret**](Models.md#update_client_secret) | **PATCH** /{domainID}/clients/{clientID}/secret | Updates Secret of the identified client. -*ClientsApi* | [**update_client_tags**](Models.md#update_client_tags) | **PATCH** /{domainID}/clients/{clientID}/tags | Updates tags the client. -*ConfigsApi* | [**create_config**](Models.md#create_config) | **POST** /{domainID}/clients/configs | Adds new config -*ConfigsApi* | [**get_bootstrap_config**](Models.md#get_bootstrap_config) | **GET** /clients/bootstrap/{externalId} | Retrieves configuration. -*ConfigsApi* | [**get_config**](Models.md#get_config) | **GET** /{domainID}/clients/configs/{configId} | Retrieves config info (with channels). -*ConfigsApi* | [**get_configs**](Models.md#get_configs) | **GET** /{domainID}/clients/configs | Retrieves managed configs -*ConfigsApi* | [**get_secure_bootstrap_config**](Models.md#get_secure_bootstrap_config) | **GET** /clients/bootstrap/secure/{externalId} | Retrieves configuration. -*ConfigsApi* | [**remove_config**](Models.md#remove_config) | **DELETE** /{domainID}/clients/configs/{configId} | Removes a Config -*ConfigsApi* | [**update_config**](Models.md#update_config) | **PUT** /{domainID}/clients/configs/{configId} | Updates config info -*ConfigsApi* | [**update_config_certs**](Models.md#update_config_certs) | **PATCH** /{domainID}/clients/configs/certs/{configId} | Updates certs -*ConfigsApi* | [**update_config_connections**](Models.md#update_config_connections) | **PUT** /{domainID}/clients/configs/connections/{configId} | Updates channels the client is connected to -*ConfigsApi* | [**update_config_state**](Models.md#update_config_state) | **PUT** /{domainID}/clients/state/{configId} | Updates Config state. -*DomainsApi* | [**add_domain_role_action**](Models.md#add_domain_role_action) | **POST** /domains/{domainID}/roles/{roleName}/actions | Adds a role action for a domain role. -*DomainsApi* | [**add_domain_role_member**](Models.md#add_domain_role_member) | **POST** /domains/{domainID}/roles/{roleName}/members | Adds a member to a domain role. -*DomainsApi* | [**create_domain_role**](Models.md#create_domain_role) | **POST** /domains/{domainID}/roles | Creates a role for a domain -*DomainsApi* | [**delete_all_domain_role_actions**](Models.md#delete_all_domain_role_actions) | **POST** /domains/{domainID}/roles/{roleName}/actions/delete-all | Deletes all role actions for a domain role. -*DomainsApi* | [**delete_all_domain_role_members**](Models.md#delete_all_domain_role_members) | **POST** /domains/{domainID}/roles/{roleName}/members/delete-all | Deletes all members from a domain role. -*DomainsApi* | [**delete_domain_role**](Models.md#delete_domain_role) | **DELETE** /domains/{domainID}/roles/{roleName} | Deletes domain role. -*DomainsApi* | [**delete_domain_role_action**](Models.md#delete_domain_role_action) | **POST** /domains/{domainID}/roles/{roleName}/actions/delete | Deletes role actions for a domain role. -*DomainsApi* | [**delete_domain_role_members**](Models.md#delete_domain_role_members) | **POST** /domains/{domainID}/roles/{roleName}/members/delete | Deletes members from a domain role. -*DomainsApi* | [**domains_domain_id_disable_post**](Models.md#domains_domain_id_disable_post) | **POST** /domains/{domainID}/disable | Disable a domain -*DomainsApi* | [**domains_domain_id_enable_post**](Models.md#domains_domain_id_enable_post) | **POST** /domains/{domainID}/enable | Enables a domain -*DomainsApi* | [**domains_domain_id_freeze_post**](Models.md#domains_domain_id_freeze_post) | **POST** /domains/{domainID}/freeze | Freeze a domain -*DomainsApi* | [**domains_domain_id_get**](Models.md#domains_domain_id_get) | **GET** /domains/{domainID} | Retrieves domain information -*DomainsApi* | [**domains_domain_id_patch**](Models.md#domains_domain_id_patch) | **PATCH** /domains/{domainID} | Updates name, metadata, tags and alias of the domain. -*DomainsApi* | [**domains_get**](Models.md#domains_get) | **GET** /domains | Retrieves list of domains. -*DomainsApi* | [**domains_post**](Models.md#domains_post) | **POST** /domains | Adds new domain -*DomainsApi* | [**get_domain_role**](Models.md#get_domain_role) | **GET** /domains/{domainID}/roles/{roleName} | Retrieves domain role. -*DomainsApi* | [**list_available_domain_actions**](Models.md#list_available_domain_actions) | **GET** /domains/roles/available-actions | Retrieves available actions. -*DomainsApi* | [**list_domain_role_actions**](Models.md#list_domain_role_actions) | **GET** /domains/{domainID}/roles/{roleName}/actions | Lists domain role actions. -*DomainsApi* | [**list_domain_role_members**](Models.md#list_domain_role_members) | **GET** /domains/{domainID}/roles/{roleName}/members | Lists domain role members. -*DomainsApi* | [**list_domain_roles**](Models.md#list_domain_roles) | **GET** /domains/{domainID}/roles | Retrieves domains roles. -*DomainsApi* | [**update_domain_role**](Models.md#update_domain_role) | **PUT** /domains/{domainID}/roles/{roleName} | Updates domain role. -*GroupsApi* | [**add_children_groups**](Models.md#add_children_groups) | **POST** /{domainID}/groups/{groupID}/children | Add children groups. -*GroupsApi* | [**add_group_role_action**](Models.md#add_group_role_action) | **POST** /{domainID}/groups/{groupID}/roles/{roleName}/actions | Adds a role action for a group role. -*GroupsApi* | [**add_group_role_member**](Models.md#add_group_role_member) | **POST** /{domainID}/groups/{groupID}/roles/{roleName}/members | Adds a member to a group role. -*GroupsApi* | [**create_group**](Models.md#create_group) | **POST** /{domainID}/groups | Creates new group -*GroupsApi* | [**create_group_role**](Models.md#create_group_role) | **POST** /{domainID}/groups/{groupID}/roles | Creates a role for a group -*GroupsApi* | [**delete_all_group_role_actions**](Models.md#delete_all_group_role_actions) | **POST** /{domainID}/groups/{groupID}/roles/{roleName}/actions/delete-all | Deletes all role actions for a group role. -*GroupsApi* | [**delete_all_group_role_members**](Models.md#delete_all_group_role_members) | **POST** /{domainID}/groups/{groupID}/roles/{roleName}/members/delete-all | Deletes all members from a group role. -*GroupsApi* | [**delete_group_role**](Models.md#delete_group_role) | **DELETE** /{domainID}/groups/{groupID}/roles/{roleName} | Deletes group role. -*GroupsApi* | [**delete_group_role_action**](Models.md#delete_group_role_action) | **POST** /{domainID}/groups/{groupID}/roles/{roleName}/actions/delete | Deletes role actions for a group role. -*GroupsApi* | [**delete_group_role_members**](Models.md#delete_group_role_members) | **POST** /{domainID}/groups/{groupID}/roles/{roleName}/members/delete | Deletes members from a group role. -*GroupsApi* | [**disable_group**](Models.md#disable_group) | **POST** /{domainID}/groups/{groupID}/disable | Disables a group -*GroupsApi* | [**domain_id_groups_group_id_delete**](Models.md#domain_id_groups_group_id_delete) | **DELETE** /{domainID}/groups/{groupID} | Delete group for a group with the given id. -*GroupsApi* | [**enable_group**](Models.md#enable_group) | **POST** /{domainID}/groups/{groupID}/enable | Enables a group -*GroupsApi* | [**get_group**](Models.md#get_group) | **GET** /{domainID}/groups/{groupID} | Gets group info. -*GroupsApi* | [**get_group_role**](Models.md#get_group_role) | **GET** /{domainID}/groups/{groupID}/roles/{roleName} | Retrieves group role. -*GroupsApi* | [**list_available_group_actions**](Models.md#list_available_group_actions) | **GET** /{domainID}/groups/roles/available-actions | Retrieves available actions. -*GroupsApi* | [**list_children_groups**](Models.md#list_children_groups) | **GET** /{domainID}/groups/{groupID}/children | List children of a certain group -*GroupsApi* | [**list_group_hierarchy**](Models.md#list_group_hierarchy) | **GET** /{domainID}/groups/{groupID}/hierarchy | Lists groups hierarchy. -*GroupsApi* | [**list_group_role_actions**](Models.md#list_group_role_actions) | **GET** /{domainID}/groups/{groupID}/roles/{roleName}/actions | Lists group role actions. -*GroupsApi* | [**list_group_role_members**](Models.md#list_group_role_members) | **GET** /{domainID}/groups/{groupID}/roles/{roleName}/members | Lists group role members. -*GroupsApi* | [**list_group_roles**](Models.md#list_group_roles) | **GET** /{domainID}/groups/{groupID}/roles | Retrieves groups roles. -*GroupsApi* | [**list_groups**](Models.md#list_groups) | **GET** /{domainID}/groups | Lists groups. -*GroupsApi* | [**remove_all_children_groups**](Models.md#remove_all_children_groups) | **DELETE** /{domainID}/groups/{groupID}/children/all | Remove all children groups. -*GroupsApi* | [**remove_children_groups**](Models.md#remove_children_groups) | **DELETE** /{domainID}/groups/{groupID}/children | Remove children groups. -*GroupsApi* | [**remove_group_parent_group**](Models.md#remove_group_parent_group) | **DELETE** /{domainID}/groups/{groupID}/parent | Removes a parent group from a group. -*GroupsApi* | [**set_group_parent_group**](Models.md#set_group_parent_group) | **POST** /{domainID}/groups/{groupID}/parent | Sets a parent group for a group. -*GroupsApi* | [**update_group**](Models.md#update_group) | **PUT** /{domainID}/groups/{groupID} | Updates group data. -*GroupsApi* | [**update_group_role**](Models.md#update_group_role) | **PUT** /{domainID}/groups/{groupID}/roles/{roleName} | Updates group role. -*InvitationsApi* | [**accept_invitation**](Models.md#accept_invitation) | **POST** /invitations/accept | Accept invitation -*InvitationsApi* | [**delete_invitation**](Models.md#delete_invitation) | **DELETE** /invitations/{user_id}/{domain_id} | Deletes a specific invitation -*InvitationsApi* | [**get_invitation**](Models.md#get_invitation) | **GET** /invitations/{user_id}/{domain_id} | Retrieves a specific invitation -*InvitationsApi* | [**list_invitations**](Models.md#list_invitations) | **GET** /invitations | List invitations -*InvitationsApi* | [**reject_invitation**](Models.md#reject_invitation) | **POST** /invitations/reject | Reject invitation -*InvitationsApi* | [**send_invitation**](Models.md#send_invitation) | **POST** /invitations | Send invitation -*JournalLogApi* | [**domain_id_journal_entity_type_id_get**](Models.md#domain_id_journal_entity_type_id_get) | **GET** /{domainID}/journal/{entityType}/{id} | List entity journal log -*JournalLogApi* | [**journal_user_user_id_get**](Models.md#journal_user_user_id_get) | **GET** /journal/user/{userID} | List user journal log -*KeysApi* | [**get_key**](Models.md#get_key) | **GET** /keys/{keyID} | Gets API key details. -*KeysApi* | [**issue_key**](Models.md#issue_key) | **POST** /keys | Issue API key -*KeysApi* | [**revoke_key**](Models.md#revoke_key) | **DELETE** /keys/{keyID} | Revoke API key -*MessagesApi* | [**channels_id_messages_post**](Models.md#channels_id_messages_post) | **POST** /channels/{id}/messages | Sends message to the communication channel -*NotifiersApi* | [**create_subscription**](Models.md#create_subscription) | **POST** /subscriptions | Create subscription -*NotifiersApi* | [**list_subscriptions**](Models.md#list_subscriptions) | **GET** /subscriptions | List subscriptions -*NotifiersApi* | [**remove_subscription**](Models.md#remove_subscription) | **DELETE** /subscriptions/{id} | Delete subscription with the provided id -*NotifiersApi* | [**view_subscription**](Models.md#view_subscription) | **GET** /subscriptions/{id} | Get subscription with the provided id -*ProvisionApi* | [**domain_id_mapping_get**](Models.md#domain_id_mapping_get) | **GET** /{domainID}/mapping | Gets current mapping. -*ProvisionApi* | [**domain_id_mapping_post**](Models.md#domain_id_mapping_post) | **POST** /{domainID}/mapping | Adds new device to proxy -*ReadersApi* | [**get_messages**](Models.md#get_messages) | **GET** /channels/{chanId}/messages | Retrieves messages sent to single channel -*StatesApi* | [**get_states**](Models.md#get_states) | **GET** /states/{twinID} | Retrieves states of twin with id twinID -*TwinsApi* | [**create_twin**](Models.md#create_twin) | **POST** /twins | Adds new twin -*TwinsApi* | [**get_twin**](Models.md#get_twin) | **GET** /twins/{twinID} | Retrieves twin info -*TwinsApi* | [**get_twins**](Models.md#get_twins) | **GET** /twins | Retrieves twins -*TwinsApi* | [**remove_twin**](Models.md#remove_twin) | **DELETE** /twins/{twinID} | Removes a twin -*TwinsApi* | [**update_twin**](Models.md#update_twin) | **PUT** /twins/{twinID} | Updates twin info -*UsersApi* | [**create_user**](Models.md#create_user) | **POST** /users | Registers user account -*UsersApi* | [**disable_user**](Models.md#disable_user) | **POST** /users/{userID}/disable | Disables a user -*UsersApi* | [**domain_id_users_get**](Models.md#domain_id_users_get) | **GET** /{domainID}/users | List users assigned to domain -*UsersApi* | [**enable_user**](Models.md#enable_user) | **POST** /users/{userID}/enable | Enables a user -*UsersApi* | [**get_profile**](Models.md#get_profile) | **GET** /users/profile | Gets info on currently logged in user. -*UsersApi* | [**get_user**](Models.md#get_user) | **GET** /users/{userID} | Retrieves a user -*UsersApi* | [**issue_token**](Models.md#issue_token) | **POST** /users/tokens/issue | Issue Token -*UsersApi* | [**list_users**](Models.md#list_users) | **GET** /users | List users -*UsersApi* | [**list_users_in_channel**](Models.md#list_users_in_channel) | **GET** /{domainID}/channels/{channelID}/users | List users in a channel -*UsersApi* | [**list_users_in_client**](Models.md#list_users_in_client) | **GET** /{domainID}/clients/{clientID}/users | List users associated with a client -*UsersApi* | [**list_users_in_group**](Models.md#list_users_in_group) | **GET** /{domainID}/groups/{groupID}/users | List users in a group -*UsersApi* | [**refresh_token**](Models.md#refresh_token) | **POST** /users/tokens/refresh | Refresh Token -*UsersApi* | [**request_password_reset**](Models.md#request_password_reset) | **POST** /password/reset-request | User password reset request -*UsersApi* | [**reset_password**](Models.md#reset_password) | **PUT** /password/reset | User password reset endpoint -*UsersApi* | [**search_users**](Models.md#search_users) | **GET** /users/search | Search users -*UsersApi* | [**update_email**](Models.md#update_email) | **PATCH** /users/{userID}/email | Updates email of the user. -*UsersApi* | [**update_profile_picture**](Models.md#update_profile_picture) | **PATCH** /users/{userID}/picture | Updates the user's profile picture. -*UsersApi* | [**update_role**](Models.md#update_role) | **PATCH** /users/{userID}/role | Updates the user's role. -*UsersApi* | [**update_secret**](Models.md#update_secret) | **PATCH** /users/secret | Updates secret of currently logged in user. -*UsersApi* | [**update_tags**](Models.md#update_tags) | **PATCH** /users/{userID}/tags | Updates tags of the user. -*UsersApi* | [**update_user**](Models.md#update_user) | **PATCH** /users/{userID} | Updates first, last name and metadata of the user. -*UsersApi* | [**update_username**](Models.md#update_username) | **PATCH** /users/{userID}/username | Updates user's username. -*UsersApi* | [**users_user_id_delete**](Models.md#users_user_id_delete) | **DELETE** /users/{userID} | Delete a user - - -To get access to the crate's generated documentation, use: +## Using the SDK in Your Code +Once you've added the SDK to your project, you can begin using its functionality in your code. + +**Example Project Flow** + +1. Initialization: Configure the SDK for use (e.g., set up the API base URL, authentication token). +2. Function Calls: Use provided functions like run_example() to interact with the SDK’s functionality. +3. Error Handling: Catch errors and handle them (e.g., failed API requests). +Folder Structure of the SDK (sdk_rust) + + + +Here’s an example of how you can use the users_api::create_user function to create a user in your main.rs file in your project: ``` -cargo doc --open +use sdk_rust::apis::users_api::create_user; +use sdk_rust::models::{UserReqObj, UserReqObjCredentials}; +use sdk_rust::configuration::Configuration; +use serde_json::json; + +#[tokio::main] +async fn main() { + // Construct the configuration with the API base URL and bearer token + let mut config = Configuration::new(); + config.base_path = "http://localhost:9002".to_string(); + config.bearer_access_token = Some("Put your bearer token here".to_string()); + + // Create credentials for the user + let credentials = Box::new(UserReqObjCredentials { + username: Some("admin".to_string()), + secret: Some("password".to_string()), + }); + + let metadata = Some(json!({ + "domain": "example.com", + })); + + // Construct the user request object + let user_req_obj = UserReqObj { + first_name: Some("Njeri".to_string()), + last_name: Some("Doe".to_string()), + email: Some("njeri@example.com".to_string()), + tags: Some(vec!["tag1".to_string(), "tag2".to_string()]), + credentials: credentials, + metadata: metadata, + profile_picture: Some("https://example.com/profile.jpg".to_string()), + status: Some("enabled".to_string()), + }; + + // Call the create_user function + match create_user(&config, user_req_obj).await { + Ok(user) => { + println!("User created successfully: {:?}", user); + } + Err(err) => { + eprintln!("Error creating user: {:?}", err); + } + } +} + + ``` -## Author -info@abstractmachines.fr + + +## Getting Help +For additional details on how to use the SDK, refer to the SDK documentation in the apis.md and models.md files in the sdk-rust repository. From 7921fe4599185c42e8b806cb3e79f0daab885a9e Mon Sep 17 00:00:00 2001 From: Dorcas Litunya Date: Mon, 13 Jan 2025 10:35:20 +0300 Subject: [PATCH 08/10] Update examples to work better --- src/apis/examples.rs | 12 ++++++++++-- src/apis/mod.rs | 1 + src/main.rs | 17 ++++++++--------- 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/src/apis/examples.rs b/src/apis/examples.rs index 1554d58e..7275251c 100644 --- a/src/apis/examples.rs +++ b/src/apis/examples.rs @@ -3,10 +3,18 @@ use crate::models::*; use serde_json::json; -use crate::apis::users_api::*; +//use crate::apis::users_api::*; -async fn run_example() { +//use super::users_api::create_user; + +use crate::apis::users_api::create_user; + +use super::configuration::Configuration; + + +pub async fn run_example() { // Construct the configuration with the actual API base URL and authorization token + println!("I am inside run_example in examples.rs"); let mut config = Configuration::new(); config.base_path = "http://localhost:9002".to_string(); config.bearer_access_token = Some("Put your bearer token here".to_string()); diff --git a/src/apis/mod.rs b/src/apis/mod.rs index 24b4ad30..ab739007 100644 --- a/src/apis/mod.rs +++ b/src/apis/mod.rs @@ -108,3 +108,4 @@ pub mod users_api; pub mod configuration; pub mod examples; + diff --git a/src/main.rs b/src/main.rs index e2b849c2..7b65ee61 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,12 +1,11 @@ -// src/main.rs - -mod apis { // Define the api module - pub mod examples; - pub mod configuration; // Include the examples.rs file from the api directory -} +use sdk_rust::apis::examples; // Replace `my_crate` with your actual crate name #[tokio::main] async fn main() { - // Call the function from examples module - api::examples::run_example(); -} + println!("Starting the application..."); + + // Call the asynchronous function + examples::run_example().await; + + println!("I have run run_example"); +} \ No newline at end of file From 3fb2e8a20fb5ecc3ab570e6f2f22ee481e3f5fa5 Mon Sep 17 00:00:00 2001 From: Dorcas Litunya Date: Mon, 13 Jan 2025 10:38:23 +0300 Subject: [PATCH 09/10] Small changes to README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 157a8a55..8db78137 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ ## Introduction -Welcome to the `sdk_rust` SDK! This SDK provides various functionalities, including APIs, models, and configuration management that you can integrate into your Rust projects. This guide will show you how to add the SDK to your project and use it effectively. +Welcome to the SuperMQ Rust SDK! This SDK provides various functionalities, including APIs, models, and configuration management that you can integrate into your Rust projects. This guide will show you how to add the SDK to your project and use it effectively. ## Adding the SDK to Your Project @@ -15,7 +15,7 @@ Follow these steps to add `sdk_rust` as a dependency: ```toml [dependencies] - sdk_rust = { git = "https://github.com/your-username/supermq", path = "sdk_rust" } + sdk_rust = { git = "https://github.com/absmach/sdk-rust", branch = "rust-sdk-dorcas" } Replace your-username with your actual GitHub username or organization name, and sdk_rust with the path to the SDK crate within the supermq repository if it's not in the root. 2. **Build and run your project:** From d903163065b9d8765ad85a892cd9afdecb5eeac3 Mon Sep 17 00:00:00 2001 From: Dorcas Litunya Date: Mon, 13 Jan 2025 10:38:23 +0300 Subject: [PATCH 10/10] Small changes to README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 157a8a55..474096c4 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -# `sdk_rust` SDK +# SuperMQ Rust SDK ## Introduction -Welcome to the `sdk_rust` SDK! This SDK provides various functionalities, including APIs, models, and configuration management that you can integrate into your Rust projects. This guide will show you how to add the SDK to your project and use it effectively. +Welcome to the SuperMQ Rust SDK! This SDK provides various functionalities, including APIs, models, and configuration management that you can integrate into your Rust projects. This guide will show you how to add the SDK to your project and use it effectively. ## Adding the SDK to Your Project @@ -15,7 +15,7 @@ Follow these steps to add `sdk_rust` as a dependency: ```toml [dependencies] - sdk_rust = { git = "https://github.com/your-username/supermq", path = "sdk_rust" } + sdk_rust = { git = "https://github.com/absmach/sdk-rust", branch = "rust-sdk-dorcas" } Replace your-username with your actual GitHub username or organization name, and sdk_rust with the path to the SDK crate within the supermq repository if it's not in the root. 2. **Build and run your project:**