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/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/Cargo.lock b/Cargo.lock new file mode 100644 index 00000000..e2e3316b --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,1460 @@ +# 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 = "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 0.52.6", +] + +[[package]] +name = "base64" +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 = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[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" +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 = "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 = "gimli" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" + +[[package]] +name = "h2" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "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 = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" +dependencies = [ + "bytes", + "http", + "pin-project-lite", +] + +[[package]] +name = "httparse" +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 = "0.14.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41dfc780fdec9373c01bae43289ea34c972e40ee3c9f6b3c8801a35f35586ce7" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[package]] +name = "hyper-tls" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" +dependencies = [ + "bytes", + "hyper", + "native-tls", + "tokio", + "tokio-native-tls", +] + +[[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 = "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 = "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 = "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 2.6.0", + "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 0.52.6", +] + +[[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 = "quote" +version = "1.0.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "redox_syscall" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" +dependencies = [ + "bitflags 2.6.0", +] + +[[package]] +name = "reqwest" +version = "0.11.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" +dependencies = [ + "base64", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "hyper", + "hyper-tls", + "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", + "winreg", +] + +[[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 2.6.0", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.59.0", +] + +[[package]] +name = "rustls-pemfile" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" +dependencies = [ + "base64", +] + +[[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 = "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 2.6.0", + "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_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 = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[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 = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" + +[[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.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +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-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 = "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 = "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 = "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 = [ + "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-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "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]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm", + "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" +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.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" +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 = "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..6798121a --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,21 @@ +[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/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..474096c4 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,104 @@ -# sdk-rust -Rust SDK for SuperMQ +# SuperMQ Rust SDK + +## Introduction + +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 + +Follow these steps to add `sdk_rust` as a dependency: + +1. **Add the SDK as a Git dependency**: + + Open your `Cargo.toml` file in the `my_rust_project` directory, and add the following dependency under `[dependencies]`: + + ```toml + [dependencies] + 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:** + +With the SDK added as a dependency, you can now build and run your project using Cargo: + +First, build the project: + +```bash +cargo build +``` + +Then, run the application: +```bash +cargo run +``` + +## 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: + +``` +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); + } + } +} + + +``` + + + + +## 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. + 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/src/apis/certs_api.rs b/src/apis/certs_api.rs new file mode 100644 index 00000000..25383fce --- /dev/null +++ b/src/apis/certs_api.rs @@ -0,0 +1,266 @@ +/* + * 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 [`create_cert`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CreateCertError { + Status400(), + Status401(), + Status403(), + Status415(), + Status422(), + Status500(crate::models::Error), + 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(crate::models::Error), + 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(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), +} + +/// struct for typed errors of method [`revoke_cert`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RevokeCertError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + 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> { + 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()); + }; + 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()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_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()); + }; + 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?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).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()); + }; + 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?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).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 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> { + 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()); + }; + 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?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).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/src/apis/channels_api.rs b/src/apis/channels_api.rs new file mode 100644 index 00000000..9ffc1699 --- /dev/null +++ b/src/apis/channels_api.rs @@ -0,0 +1,749 @@ +/* + * 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 [`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)] +pub enum CreateChannelError { + Status400(), + Status401(), + Status403(), + Status404(), + Status409(), + Status415(), + Status422(), + Status500(crate::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(crate::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(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), +} + +/// 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(crate::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(crate::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(crate::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(crate::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(crate::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(crate::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(crate::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(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: crate::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)) + } +} + +/// 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; + + 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: 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}/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: 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}/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: crate::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: crate::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/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/src/apis/configuration.rs b/src/apis/configuration.rs new file mode 100644 index 00000000..80d4c699 --- /dev/null +++ b/src/apis/configuration.rs @@ -0,0 +1,53 @@ +/* + * 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(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, + // TODO: take an oauth2 token source, similar to the go one +} + +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/src/apis/domains_api.rs b/src/apis/domains_api.rs new file mode 100644 index 00000000..b972ac97 --- /dev/null +++ b/src/apis/domains_api.rs @@ -0,0 +1,982 @@ +/* + * 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_domain_role_action`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AddDomainRoleActionError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(crate::models::Error), + 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(crate::models::Error), + 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(crate::models::Error), + 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(crate::models::Error), + 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(crate::models::Error), + 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(crate::models::Error), + 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(crate::models::Error), + 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(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), +} + +/// 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(crate::models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_available_domain_actions`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListAvailableDomainActionsError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(crate::models::Error), + 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(crate::models::Error), + 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(crate::models::Error), + 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(crate::models::Error), + 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(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: crate::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: crate::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: crate::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: crate::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: crate::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)) + } +} + +/// 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> { + 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_domain_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: crate::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/src/apis/examples.rs b/src/apis/examples.rs new file mode 100644 index 00000000..7275251c --- /dev/null +++ b/src/apis/examples.rs @@ -0,0 +1,86 @@ +/* This is a sample document to show how to implement the SDK. */ + +use crate::models::*; +use serde_json::json; + +//use crate::apis::users_api::*; + +//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()); + + // 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/src/apis/invitations_api.rs b/src/apis/invitations_api.rs new file mode 100644 index 00000000..4f6bc5da --- /dev/null +++ b/src/apis/invitations_api.rs @@ -0,0 +1,297 @@ +/* + * 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 [`accept_invitation`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AcceptInvitationError { + Status400(), + Status401(), + Status404(), + Status500(crate::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(crate::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(crate::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(crate::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(crate::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(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: crate::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, 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; + + 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) = 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: crate::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: crate::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/src/apis/journal_log_api.rs b/src/apis/journal_log_api.rs new file mode 100644 index 00000000..3c253c7e --- /dev/null +++ b/src/apis/journal_log_api.rs @@ -0,0 +1,154 @@ +/* + * 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 [`domain_id_journal_entity_type_id_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DomainIdJournalEntityTypeIdGetError { + Status400(), + Status401(), + Status403(), + Status404(), + Status422(), + Status500(crate::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(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> { + 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/src/apis/keys_api.rs b/src/apis/keys_api.rs new file mode 100644 index 00000000..bf9889df --- /dev/null +++ b/src/apis/keys_api.rs @@ -0,0 +1,172 @@ +/* + * 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 [`get_key`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetKeyError { + Status400(), + Status401(), + Status404(), + Status500(crate::models::Error), + 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(crate::models::Error), + 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(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> { + 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()); + }; + 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?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).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: crate::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()); + }; + 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()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_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()); + }; + 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?; + + let local_var_status = local_var_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/src/apis/messages_api.rs b/src/apis/messages_api.rs new file mode 100644 index 00000000..dbd83aaa --- /dev/null +++ b/src/apis/messages_api.rs @@ -0,0 +1,71 @@ +/* + * 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 [`channels_id_messages_post`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ChannelsIdMessagesPostError { + Status400(), + Status401(), + Status404(), + Status415(), + 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> { + 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_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()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_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/src/apis/mod.rs b/src/apis/mod.rs new file mode 100644 index 00000000..ab739007 --- /dev/null +++ b/src/apis/mod.rs @@ -0,0 +1,111 @@ +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 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/src/apis/notifiers_api.rs b/src/apis/notifiers_api.rs new file mode 100644 index 00000000..cdc914a4 --- /dev/null +++ b/src/apis/notifiers_api.rs @@ -0,0 +1,243 @@ +/* + * 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 [`create_subscription`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CreateSubscriptionError { + Status400(), + Status401(), + Status403(), + Status409(), + Status415(), + Status422(), + Status500(crate::models::Error), + 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(crate::models::Error), + 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(crate::models::Error), + 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(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: crate::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()); + }; + 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()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_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()); + }; + 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?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).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()); + }; + 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?; + + let local_var_status = local_var_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()); + }; + 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?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).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/src/apis/provision_api.rs b/src/apis/provision_api.rs new file mode 100644 index 00000000..de4c1e77 --- /dev/null +++ b/src/apis/provision_api.rs @@ -0,0 +1,124 @@ +/* + * 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 [`domain_id_mapping_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DomainIdMappingGetError { + Status401(), + Status403(), + Status415(), + Status422(), + Status500(crate::models::Error), + 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(crate::models::Error), + 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()); + }; + 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?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).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()); + }; + 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()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_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/src/apis/readers_api.rs b/src/apis/readers_api.rs new file mode 100644 index 00000000..d96abfbc --- /dev/null +++ b/src/apis/readers_api.rs @@ -0,0 +1,104 @@ +/* + * 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 [`get_messages`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetMessagesError { + Status400(), + Status401(), + 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> { + 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_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?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).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/src/apis/states_api.rs b/src/apis/states_api.rs new file mode 100644 index 00000000..ab5b20ee --- /dev/null +++ b/src/apis/states_api.rs @@ -0,0 +1,76 @@ +/* + * 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 [`get_states`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetStatesError { + Status400(), + Status401(), + Status404(), + Status422(), + 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> { + 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()); + }; + 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?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).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/src/apis/twins_api.rs b/src/apis/twins_api.rs new file mode 100644 index 00000000..8a48cb9b --- /dev/null +++ b/src/apis/twins_api.rs @@ -0,0 +1,292 @@ +/* + * 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 [`create_twin`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CreateTwinError { + Status400(), + Status401(), + Status415(), + Status422(), + Status500(crate::models::Error), + 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(crate::models::Error), + 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(crate::models::Error), + 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(crate::models::Error), + 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(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: crate::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()); + }; + 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()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_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()); + }; + 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?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).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()); + }; + 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?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).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()); + }; + 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?; + + let local_var_status = local_var_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: crate::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()); + }; + 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()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_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/src/apis/users_api.rs b/src/apis/users_api.rs new file mode 100644 index 00000000..67eea9af --- /dev/null +++ b/src/apis/users_api.rs @@ -0,0 +1,1233 @@ +/* + * 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 [`create_user`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CreateUserError { + Status400(), + Status401(), + Status403(), + Status409(), + Status415(), + Status422(), + Status500(crate::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(crate::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(crate::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(crate::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(crate::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(crate::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(crate::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(crate::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(crate::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(crate::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(crate::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(crate::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(crate::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(crate::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(crate::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(crate::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(crate::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(crate::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(crate::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(crate::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(crate::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(crate::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(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: crate::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_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(&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: crate::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_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_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_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?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).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_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?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).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_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?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).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: crate::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_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(&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_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(&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(&[("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: crate::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: crate::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: crate::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: crate::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: crate::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: crate::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: crate::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/src/lib.rs b/src/lib.rs new file mode 100644 index 00000000..c1dd666f --- /dev/null +++ b/src/lib.rs @@ -0,0 +1,10 @@ +#[macro_use] +extern crate serde_derive; + +extern crate serde; +extern crate serde_json; +extern crate url; +extern crate reqwest; + +pub mod apis; +pub mod models; diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 00000000..7b65ee61 --- /dev/null +++ b/src/main.rs @@ -0,0 +1,11 @@ +use sdk_rust::apis::examples; // Replace `my_crate` with your actual crate name + +#[tokio::main] +async fn main() { + println!("Starting the application..."); + + // Call the asynchronous function + examples::run_example().await; + + println!("I have run run_example"); +} \ No newline at end of file diff --git a/src/models/__domain_id__mapping_post_request.rs b/src/models/__domain_id__mapping_post_request.rs new file mode 100644 index 00000000..9b1a8c8c --- /dev/null +++ b/src/models/__domain_id__mapping_post_request.rs @@ -0,0 +1,34 @@ +/* + * 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 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/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/src/models/assign_req_obj.rs b/src/models/assign_req_obj.rs new file mode 100644 index 00000000..87a21e01 --- /dev/null +++ b/src/models/assign_req_obj.rs @@ -0,0 +1,37 @@ +/* + * 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 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/src/models/assign_user_req_obj.rs b/src/models/assign_user_req_obj.rs new file mode 100644 index 00000000..e5cff574 --- /dev/null +++ b/src/models/assign_user_req_obj.rs @@ -0,0 +1,33 @@ +/* + * 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 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/src/models/attribute.rs b/src/models/attribute.rs new file mode 100644 index 00000000..a73bfc3c --- /dev/null +++ b/src/models/attribute.rs @@ -0,0 +1,41 @@ +/* + * 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 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/src/models/available_actions_obj.rs b/src/models/available_actions_obj.rs new file mode 100644 index 00000000..0a218200 --- /dev/null +++ b/src/models/available_actions_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 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/src/models/cert.rs b/src/models/cert.rs new file mode 100644 index 00000000..1678b5b1 --- /dev/null +++ b/src/models/cert.rs @@ -0,0 +1,49 @@ +/* + * 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 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/src/models/certs_page.rs b/src/models/certs_page.rs new file mode 100644 index 00000000..af8c54c0 --- /dev/null +++ b/src/models/certs_page.rs @@ -0,0 +1,40 @@ +/* + * 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 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/src/models/channel.rs b/src/models/channel.rs new file mode 100644 index 00000000..06c16db0 --- /dev/null +++ b/src/models/channel.rs @@ -0,0 +1,69 @@ +/* + * 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 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/src/models/channel_connection_req_schema.rs b/src/models/channel_connection_req_schema.rs new file mode 100644 index 00000000..741571ad --- /dev/null +++ b/src/models/channel_connection_req_schema.rs @@ -0,0 +1,33 @@ +/* + * 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 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/src/models/channel_req_obj.rs b/src/models/channel_req_obj.rs new file mode 100644 index 00000000..256558fc --- /dev/null +++ b/src/models/channel_req_obj.rs @@ -0,0 +1,45 @@ +/* + * 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 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/src/models/channel_update.rs b/src/models/channel_update.rs new file mode 100644 index 00000000..dea40b4d --- /dev/null +++ b/src/models/channel_update.rs @@ -0,0 +1,37 @@ +/* + * 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 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/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/src/models/channels_page.rs b/src/models/channels_page.rs new file mode 100644 index 00000000..0b7a78b2 --- /dev/null +++ b/src/models/channels_page.rs @@ -0,0 +1,40 @@ +/* + * 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 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/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/src/models/client.rs b/src/models/client.rs new file mode 100644 index 00000000..98d61da5 --- /dev/null +++ b/src/models/client.rs @@ -0,0 +1,60 @@ +/* + * 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 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/src/models/client_credentials.rs b/src/models/client_credentials.rs new file mode 100644 index 00000000..83fc3f99 --- /dev/null +++ b/src/models/client_credentials.rs @@ -0,0 +1,33 @@ +/* + * 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 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/src/models/client_req_obj.rs b/src/models/client_req_obj.rs new file mode 100644 index 00000000..eeaf3187 --- /dev/null +++ b/src/models/client_req_obj.rs @@ -0,0 +1,44 @@ +/* + * 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 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: crate::models::ClientReqObjCredentials) -> ClientReqObj { + ClientReqObj { + name: None, + tags: None, + credentials: Box::new(credentials), + metadata: None, + status: None, + } + } +} + + diff --git a/src/models/client_req_obj_credentials.rs b/src/models/client_req_obj_credentials.rs new file mode 100644 index 00000000..2daef10e --- /dev/null +++ b/src/models/client_req_obj_credentials.rs @@ -0,0 +1,33 @@ +/* + * 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 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/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/src/models/client_update.rs b/src/models/client_update.rs new file mode 100644 index 00000000..4855fb2e --- /dev/null +++ b/src/models/client_update.rs @@ -0,0 +1,33 @@ +/* + * 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 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/src/models/client_with_empty_secret.rs b/src/models/client_with_empty_secret.rs new file mode 100644 index 00000000..536d2e79 --- /dev/null +++ b/src/models/client_with_empty_secret.rs @@ -0,0 +1,60 @@ +/* + * 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 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/src/models/client_with_empty_secret_credentials.rs b/src/models/client_with_empty_secret_credentials.rs new file mode 100644 index 00000000..8016c22d --- /dev/null +++ b/src/models/client_with_empty_secret_credentials.rs @@ -0,0 +1,33 @@ +/* + * 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 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/src/models/clients_page.rs b/src/models/clients_page.rs new file mode 100644 index 00000000..25566e55 --- /dev/null +++ b/src/models/clients_page.rs @@ -0,0 +1,40 @@ +/* + * 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 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/src/models/config_channels_inner.rs b/src/models/config_channels_inner.rs new file mode 100644 index 00000000..30f2acae --- /dev/null +++ b/src/models/config_channels_inner.rs @@ -0,0 +1,37 @@ +/* + * 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 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/src/models/connection_req_schema.rs b/src/models/connection_req_schema.rs new file mode 100644 index 00000000..894356f6 --- /dev/null +++ b/src/models/connection_req_schema.rs @@ -0,0 +1,37 @@ +/* + * 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 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/src/models/create_cert_request.rs b/src/models/create_cert_request.rs new file mode 100644 index 00000000..9c3f5b6f --- /dev/null +++ b/src/models/create_cert_request.rs @@ -0,0 +1,31 @@ +/* + * 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 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/src/models/create_config_request.rs b/src/models/create_config_request.rs new file mode 100644 index 00000000..d346ae42 --- /dev/null +++ b/src/models/create_config_request.rs @@ -0,0 +1,57 @@ +/* + * 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 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/src/models/create_role_obj.rs b/src/models/create_role_obj.rs new file mode 100644 index 00000000..e06b9d9e --- /dev/null +++ b/src/models/create_role_obj.rs @@ -0,0 +1,37 @@ +/* + * 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 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/src/models/create_subscription.rs b/src/models/create_subscription.rs new file mode 100644 index 00000000..fe0112cd --- /dev/null +++ b/src/models/create_subscription.rs @@ -0,0 +1,33 @@ +/* + * 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 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/src/models/definition.rs b/src/models/definition.rs new file mode 100644 index 00000000..1d411fb7 --- /dev/null +++ b/src/models/definition.rs @@ -0,0 +1,32 @@ +/* + * 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 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/src/models/domain.rs b/src/models/domain.rs new file mode 100644 index 00000000..98d74015 --- /dev/null +++ b/src/models/domain.rs @@ -0,0 +1,65 @@ +/* + * 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 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/src/models/domain_req_obj.rs b/src/models/domain_req_obj.rs new file mode 100644 index 00000000..45e4a237 --- /dev/null +++ b/src/models/domain_req_obj.rs @@ -0,0 +1,41 @@ +/* + * 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 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/src/models/domain_update.rs b/src/models/domain_update.rs new file mode 100644 index 00000000..981d9fac --- /dev/null +++ b/src/models/domain_update.rs @@ -0,0 +1,41 @@ +/* + * 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 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/src/models/domains_page.rs b/src/models/domains_page.rs new file mode 100644 index 00000000..7e511f91 --- /dev/null +++ b/src/models/domains_page.rs @@ -0,0 +1,40 @@ +/* + * 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 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/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/src/models/group.rs b/src/models/group.rs new file mode 100644 index 00000000..b8dc0b59 --- /dev/null +++ b/src/models/group.rs @@ -0,0 +1,69 @@ +/* + * 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 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/src/models/group_req_obj.rs b/src/models/group_req_obj.rs new file mode 100644 index 00000000..b0d7838e --- /dev/null +++ b/src/models/group_req_obj.rs @@ -0,0 +1,45 @@ +/* + * 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 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/src/models/group_update.rs b/src/models/group_update.rs new file mode 100644 index 00000000..d94f28a4 --- /dev/null +++ b/src/models/group_update.rs @@ -0,0 +1,37 @@ +/* + * 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 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/src/models/groups_hierarchy_page.rs b/src/models/groups_hierarchy_page.rs new file mode 100644 index 00000000..0e3c9a9c --- /dev/null +++ b/src/models/groups_hierarchy_page.rs @@ -0,0 +1,36 @@ +/* + * 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 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/src/models/groups_page.rs b/src/models/groups_page.rs new file mode 100644 index 00000000..3f9e5e80 --- /dev/null +++ b/src/models/groups_page.rs @@ -0,0 +1,40 @@ +/* + * 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 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/src/models/health_info.rs b/src/models/health_info.rs new file mode 100644 index 00000000..324c6e3e --- /dev/null +++ b/src/models/health_info.rs @@ -0,0 +1,61 @@ +/* + * 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 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/src/models/health_res.rs b/src/models/health_res.rs new file mode 100644 index 00000000..4dc367bb --- /dev/null +++ b/src/models/health_res.rs @@ -0,0 +1,57 @@ +/* + * 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 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/src/models/invitation.rs b/src/models/invitation.rs new file mode 100644 index 00000000..7ece77d0 --- /dev/null +++ b/src/models/invitation.rs @@ -0,0 +1,83 @@ +/* + * 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 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/src/models/invitation_page.rs b/src/models/invitation_page.rs new file mode 100644 index 00000000..976e1db3 --- /dev/null +++ b/src/models/invitation_page.rs @@ -0,0 +1,40 @@ +/* + * 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 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/src/models/issue_key_request.rs b/src/models/issue_key_request.rs new file mode 100644 index 00000000..0eedb9db --- /dev/null +++ b/src/models/issue_key_request.rs @@ -0,0 +1,33 @@ +/* + * 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 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/src/models/issue_token.rs b/src/models/issue_token.rs new file mode 100644 index 00000000..7075b954 --- /dev/null +++ b/src/models/issue_token.rs @@ -0,0 +1,33 @@ +/* + * 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 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/src/models/issue_token_200_response.rs b/src/models/issue_token_200_response.rs new file mode 100644 index 00000000..2f6c65c9 --- /dev/null +++ b/src/models/issue_token_200_response.rs @@ -0,0 +1,37 @@ +/* + * 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 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/src/models/journal.rs b/src/models/journal.rs new file mode 100644 index 00000000..13c47a2f --- /dev/null +++ b/src/models/journal.rs @@ -0,0 +1,41 @@ +/* + * 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 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/src/models/journal_page.rs b/src/models/journal_page.rs new file mode 100644 index 00000000..447d81e3 --- /dev/null +++ b/src/models/journal_page.rs @@ -0,0 +1,40 @@ +/* + * 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 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/src/models/key.rs b/src/models/key.rs new file mode 100644 index 00000000..094198e2 --- /dev/null +++ b/src/models/key.rs @@ -0,0 +1,49 @@ +/* + * 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 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/src/models/members.rs b/src/models/members.rs new file mode 100644 index 00000000..38e50899 --- /dev/null +++ b/src/models/members.rs @@ -0,0 +1,64 @@ +/* + * 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 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/src/models/members_credentials.rs b/src/models/members_credentials.rs new file mode 100644 index 00000000..b4f02b61 --- /dev/null +++ b/src/models/members_credentials.rs @@ -0,0 +1,33 @@ +/* + * 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 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/src/models/members_page.rs b/src/models/members_page.rs new file mode 100644 index 00000000..1d09bedc --- /dev/null +++ b/src/models/members_page.rs @@ -0,0 +1,40 @@ +/* + * 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 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/src/models/messages_page.rs b/src/models/messages_page.rs new file mode 100644 index 00000000..c8a8e40e --- /dev/null +++ b/src/models/messages_page.rs @@ -0,0 +1,40 @@ +/* + * 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 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/src/models/messages_page_messages_inner.rs b/src/models/messages_page_messages_inner.rs new file mode 100644 index 00000000..7f7f2ce8 --- /dev/null +++ b/src/models/messages_page_messages_inner.rs @@ -0,0 +1,73 @@ +/* + * 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 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/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/src/models/new_role.rs b/src/models/new_role.rs new file mode 100644 index 00000000..8f37ef6f --- /dev/null +++ b/src/models/new_role.rs @@ -0,0 +1,53 @@ +/* + * 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 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/src/models/page.rs b/src/models/page.rs new file mode 100644 index 00000000..5c97cae2 --- /dev/null +++ b/src/models/page.rs @@ -0,0 +1,40 @@ +/* + * 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 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/src/models/parent_group_req_obj.rs b/src/models/parent_group_req_obj.rs new file mode 100644 index 00000000..240fae2b --- /dev/null +++ b/src/models/parent_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 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/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/src/models/request_password_reset_request.rs b/src/models/request_password_reset_request.rs new file mode 100644 index 00000000..ba455528 --- /dev/null +++ b/src/models/request_password_reset_request.rs @@ -0,0 +1,33 @@ +/* + * 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 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/src/models/reset_password_request.rs b/src/models/reset_password_request.rs new file mode 100644 index 00000000..9f09a754 --- /dev/null +++ b/src/models/reset_password_request.rs @@ -0,0 +1,37 @@ +/* + * 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 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/src/models/revoke.rs b/src/models/revoke.rs new file mode 100644 index 00000000..50b7c9f4 --- /dev/null +++ b/src/models/revoke.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 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/src/models/role.rs b/src/models/role.rs new file mode 100644 index 00000000..1068d546 --- /dev/null +++ b/src/models/role.rs @@ -0,0 +1,53 @@ +/* + * 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 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/src/models/role_actions_obj.rs b/src/models/role_actions_obj.rs new file mode 100644 index 00000000..6221b618 --- /dev/null +++ b/src/models/role_actions_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 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/src/models/role_members_obj.rs b/src/models/role_members_obj.rs new file mode 100644 index 00000000..bc391ec9 --- /dev/null +++ b/src/models/role_members_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 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/src/models/roles_page.rs b/src/models/roles_page.rs new file mode 100644 index 00000000..c7f22394 --- /dev/null +++ b/src/models/roles_page.rs @@ -0,0 +1,41 @@ +/* + * 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 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/src/models/sen_ml_record.rs b/src/models/sen_ml_record.rs new file mode 100644 index 00000000..98897cda --- /dev/null +++ b/src/models/sen_ml_record.rs @@ -0,0 +1,85 @@ +/* + * 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 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/src/models/send_invitation_req_obj.rs b/src/models/send_invitation_req_obj.rs new file mode 100644 index 00000000..01dca554 --- /dev/null +++ b/src/models/send_invitation_req_obj.rs @@ -0,0 +1,71 @@ +/* + * 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 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/src/models/serial.rs b/src/models/serial.rs new file mode 100644 index 00000000..39d57eff --- /dev/null +++ b/src/models/serial.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 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/src/models/serials_page.rs b/src/models/serials_page.rs new file mode 100644 index 00000000..b913d892 --- /dev/null +++ b/src/models/serials_page.rs @@ -0,0 +1,41 @@ +/* + * 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 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/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/src/models/state2.rs b/src/models/state2.rs new file mode 100644 index 00000000..f91a6aa1 --- /dev/null +++ b/src/models/state2.rs @@ -0,0 +1,41 @@ +/* + * 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 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, + /// 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 State2 { + pub fn new() -> State2 { + State2 { + twin_id: None, + id: None, + created: None, + payload: None, + } + } +} + + diff --git a/src/models/states_page.rs b/src/models/states_page.rs new file mode 100644 index 00000000..5bd8d451 --- /dev/null +++ b/src/models/states_page.rs @@ -0,0 +1,40 @@ +/* + * 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 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/src/models/subscription.rs b/src/models/subscription.rs new file mode 100644 index 00000000..3fe45a2b --- /dev/null +++ b/src/models/subscription.rs @@ -0,0 +1,41 @@ +/* + * 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 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/src/models/twin_req_obj.rs b/src/models/twin_req_obj.rs new file mode 100644 index 00000000..ddc28ee8 --- /dev/null +++ b/src/models/twin_req_obj.rs @@ -0,0 +1,36 @@ +/* + * 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 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/src/models/twin_res_obj.rs b/src/models/twin_res_obj.rs new file mode 100644 index 00000000..1920f82c --- /dev/null +++ b/src/models/twin_res_obj.rs @@ -0,0 +1,56 @@ +/* + * 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 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/src/models/twins_page.rs b/src/models/twins_page.rs new file mode 100644 index 00000000..2eb187c7 --- /dev/null +++ b/src/models/twins_page.rs @@ -0,0 +1,40 @@ +/* + * 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 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/src/models/update_config_certs_request.rs b/src/models/update_config_certs_request.rs new file mode 100644 index 00000000..48e94f85 --- /dev/null +++ b/src/models/update_config_certs_request.rs @@ -0,0 +1,34 @@ +/* + * 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 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/src/models/update_config_connections_request.rs b/src/models/update_config_connections_request.rs new file mode 100644 index 00000000..e8c1cfdd --- /dev/null +++ b/src/models/update_config_connections_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 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/src/models/update_config_request.rs b/src/models/update_config_request.rs new file mode 100644 index 00000000..5b27b9a8 --- /dev/null +++ b/src/models/update_config_request.rs @@ -0,0 +1,31 @@ +/* + * 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 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/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/src/models/user.rs b/src/models/user.rs new file mode 100644 index 00000000..5fd94503 --- /dev/null +++ b/src/models/user.rs @@ -0,0 +1,68 @@ +/* + * 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 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/src/models/user_credentials.rs b/src/models/user_credentials.rs new file mode 100644 index 00000000..67ebcb55 --- /dev/null +++ b/src/models/user_credentials.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 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/src/models/user_profile_picture.rs b/src/models/user_profile_picture.rs new file mode 100644 index 00000000..c583acb6 --- /dev/null +++ b/src/models/user_profile_picture.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 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/src/models/user_req_obj.rs b/src/models/user_req_obj.rs new file mode 100644 index 00000000..8391eeca --- /dev/null +++ b/src/models/user_req_obj.rs @@ -0,0 +1,56 @@ +/* + * 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 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: crate::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/src/models/user_req_obj_credentials.rs b/src/models/user_req_obj_credentials.rs new file mode 100644 index 00000000..37cbf75e --- /dev/null +++ b/src/models/user_req_obj_credentials.rs @@ -0,0 +1,33 @@ +/* + * 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 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/src/models/user_role.rs b/src/models/user_role.rs new file mode 100644 index 00000000..3e0bd819 --- /dev/null +++ b/src/models/user_role.rs @@ -0,0 +1,43 @@ +/* + * 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 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/src/models/user_secret.rs b/src/models/user_secret.rs new file mode 100644 index 00000000..0ba91211 --- /dev/null +++ b/src/models/user_secret.rs @@ -0,0 +1,33 @@ +/* + * 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 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/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/src/models/user_update.rs b/src/models/user_update.rs new file mode 100644 index 00000000..43ae4f03 --- /dev/null +++ b/src/models/user_update.rs @@ -0,0 +1,37 @@ +/* + * 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 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/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/src/models/users_page.rs b/src/models/users_page.rs new file mode 100644 index 00000000..ca62f775 --- /dev/null +++ b/src/models/users_page.rs @@ -0,0 +1,40 @@ +/* + * 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 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, + } + } +} + +