Latest generation of API from openapi json files

Signed-off-by: Erik Hollensbe <git@hollensbe.org>
This commit is contained in:
Erik Hollensbe
2022-02-20 02:58:52 -08:00
parent 063ecb1357
commit 2f864f42f5
60 changed files with 353 additions and 307 deletions
@@ -5,6 +5,7 @@ Cargo.toml
README.md
docs/ApiToken.md
docs/AuthMethods.md
docs/Dns.md
docs/InviteStatus.md
docs/IpRange.md
docs/Ipv4AssignMode.md
@@ -14,7 +15,6 @@ docs/MemberConfig.md
docs/Network.md
docs/NetworkApi.md
docs/NetworkConfig.md
docs/NetworkConfigDns.md
docs/NetworkMemberApi.md
docs/Organization.md
docs/OrganizationInvitation.md
@@ -39,6 +39,7 @@ src/apis/util_api.rs
src/lib.rs
src/models/api_token.rs
src/models/auth_methods.rs
src/models/dns.rs
src/models/invite_status.rs
src/models/ip_range.rs
src/models/ipv4_assign_mode.rs
@@ -48,7 +49,6 @@ src/models/member_config.rs
src/models/mod.rs
src/models/network.rs
src/models/network_config.rs
src/models/network_config_dns.rs
src/models/organization.rs
src/models/organization_invitation.rs
src/models/organization_member.rs
@@ -1 +1 @@
5.3.0-SNAPSHOT
6.0.0-SNAPSHOT
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "zerotier-central-api"
version = "1.0.2"
version = "1.0.3"
edition = "2018"
description = "OpenAPI bindings to the ZeroTier Central (https://my.zerotier.com) service"
authors = ["Erik Hollensbe <erik.hollensbe@zerotier.com>", "Adam Ierymenko <adam.ierymenko@zerotier.com>"]
+8 -7
View File
@@ -1,22 +1,23 @@
# Rust API client for zerotier-central-api
ZeroTier Central Network Management Portal API.<p>All API requests must have an API token header specified in the <code>Authorization: Bearer xxxxx</code> format. You can generate your API key by logging into <a href=\"https://my.zerotier.com\">ZeroTier Central</a> and creating a token on the Account page.</p><p>eg. <code>curl -X GET -H \"Authorization: bearer xxxxx\" https://my.zerotier.com/api/v1/network</code></p>
ZeroTier Central Network Management Portal API.<p>All API requests must have an API token header specified in the <code>Authorization: Bearer xxxxx</code> format. You can generate your API key by logging into <a href=\"https://my.zerotier.com\">ZeroTier Central</a> and creating a token on the Account page.</p><p>eg. <code>curl -X GET -H \"Authorization: bearer xxxxx\" https://my.zerotier.com/api/v1/network</code></p><p><h3>Rate Limiting</h3></p><p>The ZeroTier Central API implements rate limiting. Paid users are limited to 100 requests per second. Free users are limited to 20 requests per second.</p> <p> You can get the OpenAPI spec here as well: <code>https://docs.zerotier.com/openapi/centralv1.json</code></p>
For more information, please visit [https://discuss.zerotier.com](https://discuss.zerotier.com)
## 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: v1
- Package version: 1.0.0
- Build package: org.openapitools.codegen.languages.RustClientCodegen
For more information, please visit [https://discuss.zerotier.com](https://discuss.zerotier.com)
- Package version: v1
- Build package: `org.openapitools.codegen.languages.RustClientCodegen`
## Installation
Put the package under your project folder and add the following to `Cargo.toml` under `[dependencies]`:
Put the package under your project folder in a directory named `zerotier-central-api` and add the following to `Cargo.toml` under `[dependencies]`:
```
openapi = { path = "./generated" }
zerotier-central-api = { path = "./zerotier-central-api" }
```
## Documentation for API Endpoints
@@ -55,6 +56,7 @@ Class | Method | HTTP request | Description
- [ApiToken](docs/ApiToken.md)
- [AuthMethods](docs/AuthMethods.md)
- [Dns](docs/Dns.md)
- [InviteStatus](docs/InviteStatus.md)
- [IpRange](docs/IpRange.md)
- [Ipv4AssignMode](docs/Ipv4AssignMode.md)
@@ -63,7 +65,6 @@ Class | Method | HTTP request | Description
- [MemberConfig](docs/MemberConfig.md)
- [Network](docs/Network.md)
- [NetworkConfig](docs/NetworkConfig.md)
- [NetworkConfigDns](docs/NetworkConfigDns.md)
- [Organization](docs/Organization.md)
- [OrganizationInvitation](docs/OrganizationInvitation.md)
- [OrganizationMember](docs/OrganizationMember.md)
@@ -1,4 +1,4 @@
# NetworkConfigDns
# Dns
## Properties
+1 -1
View File
@@ -7,7 +7,7 @@ Name | Type | Description | Notes
**id** | Option<**String**> | Network ID | [optional][readonly]
**creation_time** | Option<**i64**> | Time the network was created | [optional][readonly]
**capabilities** | Option<[**Vec<serde_json::Value>**](serde_json::Value.md)> | Array of network capabilities | [optional]
**dns** | Option<[**crate::models::NetworkConfigDns**](NetworkConfig_dns.md)> | | [optional]
**dns** | Option<[**crate::models::Dns**](.md)> | | [optional]
**enable_broadcast** | Option<**bool**> | Enable broadcast packets on the network | [optional]
**ip_assignment_pools** | Option<[**Vec<crate::models::IpRange>**](IPRange.md)> | Range of IP addresses for the auto assign pool | [optional]
**last_modified** | Option<**i64**> | Time the network was last modified | [optional][readonly]
+3 -3
View File
@@ -1,7 +1,7 @@
#!/bin/sh
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
#
# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com"
# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com"
git_user_id=$1
git_repo_id=$2
@@ -38,14 +38,14 @@ git add .
git commit -m "$release_note"
# Sets the new remote
git_remote=`git remote`
git_remote=$(git remote)
if [ "$git_remote" = "" ]; then # git remote not defined
if [ "$GIT_TOKEN" = "" ]; then
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
else
git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git
git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git
fi
fi
@@ -1,7 +1,7 @@
/*
* ZeroTier Central API
*
* ZeroTier Central Network Management Portal API.<p>All API requests must have an API token header specified in the <code>Authorization: Bearer xxxxx</code> format. You can generate your API key by logging into <a href=\"https://my.zerotier.com\">ZeroTier Central</a> and creating a token on the Account page.</p><p>eg. <code>curl -X GET -H \"Authorization: bearer xxxxx\" https://my.zerotier.com/api/v1/network</code></p>
* ZeroTier Central Network Management Portal API.<p>All API requests must have an API token header specified in the <code>Authorization: Bearer xxxxx</code> format. You can generate your API key by logging into <a href=\"https://my.zerotier.com\">ZeroTier Central</a> and creating a token on the Account page.</p><p>eg. <code>curl -X GET -H \"Authorization: bearer xxxxx\" https://my.zerotier.com/api/v1/network</code></p><p><h3>Rate Limiting</h3></p><p>The ZeroTier Central API implements rate limiting. Paid users are limited to 100 requests per second. Free users are limited to 20 requests per second.</p> <p> You can get the OpenAPI spec here as well: <code>https://docs.zerotier.com/openapi/centralv1.json</code></p>
*
* The version of the OpenAPI document: v1
*
+31 -26
View File
@@ -1,7 +1,7 @@
/*
* ZeroTier Central API
*
* ZeroTier Central Network Management Portal API.<p>All API requests must have an API token header specified in the <code>Authorization: Bearer xxxxx</code> format. You can generate your API key by logging into <a href=\"https://my.zerotier.com\">ZeroTier Central</a> and creating a token on the Account page.</p><p>eg. <code>curl -X GET -H \"Authorization: bearer xxxxx\" https://my.zerotier.com/api/v1/network</code></p>
* ZeroTier Central Network Management Portal API.<p>All API requests must have an API token header specified in the <code>Authorization: Bearer xxxxx</code> format. You can generate your API key by logging into <a href=\"https://my.zerotier.com\">ZeroTier Central</a> and creating a token on the Account page.</p><p>eg. <code>curl -X GET -H \"Authorization: bearer xxxxx\" https://my.zerotier.com/api/v1/network</code></p><p><h3>Rate Limiting</h3></p><p>The ZeroTier Central API implements rate limiting. Paid users are limited to 100 requests per second. Free users are limited to 20 requests per second.</p> <p> You can get the OpenAPI spec here as well: <code>https://docs.zerotier.com/openapi/centralv1.json</code></p>
*
* The version of the OpenAPI document: v1
*
@@ -15,7 +15,7 @@ use crate::apis::ResponseContent;
use super::{Error, configuration};
/// struct for typed errors of method `delete_network`
/// struct for typed errors of method [`delete_network`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeleteNetworkError {
@@ -25,7 +25,7 @@ pub enum DeleteNetworkError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method `get_network_by_id`
/// struct for typed errors of method [`get_network_by_id`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetNetworkByIdError {
@@ -35,7 +35,7 @@ pub enum GetNetworkByIdError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method `get_network_list`
/// struct for typed errors of method [`get_network_list`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetNetworkListError {
@@ -43,7 +43,7 @@ pub enum GetNetworkListError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method `new_network`
/// struct for typed errors of method [`new_network`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum NewNetworkError {
@@ -51,7 +51,7 @@ pub enum NewNetworkError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method `update_network`
/// struct for typed errors of method [`update_network`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum UpdateNetworkError {
@@ -63,16 +63,17 @@ pub enum UpdateNetworkError {
pub async fn delete_network(configuration: &configuration::Configuration, network_id: &str) -> Result<(), Error<DeleteNetworkError>> {
let local_var_configuration = configuration;
let local_var_client = &configuration.client;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/network/{networkID}", configuration.base_path, networkID=crate::apis::urlencode(network_id));
let local_var_uri_str = format!("{}/network/{networkID}", local_var_configuration.base_path, networkID=crate::apis::urlencode(network_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) = configuration.user_agent {
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_token) = configuration.bearer_access_token {
if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
};
@@ -93,16 +94,17 @@ pub async fn delete_network(configuration: &configuration::Configuration, networ
/// Returns a single network
pub async fn get_network_by_id(configuration: &configuration::Configuration, network_id: &str) -> Result<crate::models::Network, Error<GetNetworkByIdError>> {
let local_var_configuration = configuration;
let local_var_client = &configuration.client;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/network/{networkID}", configuration.base_path, networkID=crate::apis::urlencode(network_id));
let local_var_uri_str = format!("{}/network/{networkID}", local_var_configuration.base_path, networkID=crate::apis::urlencode(network_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) = configuration.user_agent {
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_token) = configuration.bearer_access_token {
if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
};
@@ -122,16 +124,17 @@ pub async fn get_network_by_id(configuration: &configuration::Configuration, net
}
pub async fn get_network_list(configuration: &configuration::Configuration, ) -> Result<Vec<crate::models::Network>, Error<GetNetworkListError>> {
let local_var_configuration = configuration;
let local_var_client = &configuration.client;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/network", configuration.base_path);
let local_var_uri_str = format!("{}/network", 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) = configuration.user_agent {
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_token) = configuration.bearer_access_token {
if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
};
@@ -151,16 +154,17 @@ pub async fn get_network_list(configuration: &configuration::Configuration, ) ->
}
pub async fn new_network(configuration: &configuration::Configuration, body: serde_json::Value) -> Result<crate::models::Network, Error<NewNetworkError>> {
let local_var_configuration = configuration;
let local_var_client = &configuration.client;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/network", configuration.base_path);
let local_var_uri_str = format!("{}/network", 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) = configuration.user_agent {
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_token) = configuration.bearer_access_token {
if let Some(ref 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(&body);
@@ -181,16 +185,17 @@ pub async fn new_network(configuration: &configuration::Configuration, body: ser
}
pub async fn update_network(configuration: &configuration::Configuration, network_id: &str, network: crate::models::Network) -> Result<crate::models::Network, Error<UpdateNetworkError>> {
let local_var_configuration = configuration;
let local_var_client = &configuration.client;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/network/{networkID}", configuration.base_path, networkID=crate::apis::urlencode(network_id));
let local_var_uri_str = format!("{}/network/{networkID}", local_var_configuration.base_path, networkID=crate::apis::urlencode(network_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) = configuration.user_agent {
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_token) = configuration.bearer_access_token {
if let Some(ref 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(&network);
@@ -1,7 +1,7 @@
/*
* ZeroTier Central API
*
* ZeroTier Central Network Management Portal API.<p>All API requests must have an API token header specified in the <code>Authorization: Bearer xxxxx</code> format. You can generate your API key by logging into <a href=\"https://my.zerotier.com\">ZeroTier Central</a> and creating a token on the Account page.</p><p>eg. <code>curl -X GET -H \"Authorization: bearer xxxxx\" https://my.zerotier.com/api/v1/network</code></p>
* ZeroTier Central Network Management Portal API.<p>All API requests must have an API token header specified in the <code>Authorization: Bearer xxxxx</code> format. You can generate your API key by logging into <a href=\"https://my.zerotier.com\">ZeroTier Central</a> and creating a token on the Account page.</p><p>eg. <code>curl -X GET -H \"Authorization: bearer xxxxx\" https://my.zerotier.com/api/v1/network</code></p><p><h3>Rate Limiting</h3></p><p>The ZeroTier Central API implements rate limiting. Paid users are limited to 100 requests per second. Free users are limited to 20 requests per second.</p> <p> You can get the OpenAPI spec here as well: <code>https://docs.zerotier.com/openapi/centralv1.json</code></p>
*
* The version of the OpenAPI document: v1
*
@@ -15,7 +15,7 @@ use crate::apis::ResponseContent;
use super::{Error, configuration};
/// struct for typed errors of method `delete_network_member`
/// struct for typed errors of method [`delete_network_member`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeleteNetworkMemberError {
@@ -25,7 +25,7 @@ pub enum DeleteNetworkMemberError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method `get_network_member`
/// struct for typed errors of method [`get_network_member`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetNetworkMemberError {
@@ -35,7 +35,7 @@ pub enum GetNetworkMemberError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method `get_network_member_list`
/// struct for typed errors of method [`get_network_member_list`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetNetworkMemberListError {
@@ -45,7 +45,7 @@ pub enum GetNetworkMemberListError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method `update_network_member`
/// struct for typed errors of method [`update_network_member`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum UpdateNetworkMemberError {
@@ -57,16 +57,17 @@ pub enum UpdateNetworkMemberError {
pub async fn delete_network_member(configuration: &configuration::Configuration, network_id: &str, member_id: &str) -> Result<(), Error<DeleteNetworkMemberError>> {
let local_var_configuration = configuration;
let local_var_client = &configuration.client;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/network/{networkID}/member/{memberID}", configuration.base_path, networkID=crate::apis::urlencode(network_id), memberID=crate::apis::urlencode(member_id));
let local_var_uri_str = format!("{}/network/{networkID}/member/{memberID}", local_var_configuration.base_path, networkID=crate::apis::urlencode(network_id), memberID=crate::apis::urlencode(member_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) = configuration.user_agent {
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_token) = configuration.bearer_access_token {
if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
};
@@ -86,16 +87,17 @@ pub async fn delete_network_member(configuration: &configuration::Configuration,
}
pub async fn get_network_member(configuration: &configuration::Configuration, network_id: &str, member_id: &str) -> Result<crate::models::Member, Error<GetNetworkMemberError>> {
let local_var_configuration = configuration;
let local_var_client = &configuration.client;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/network/{networkID}/member/{memberID}", configuration.base_path, networkID=crate::apis::urlencode(network_id), memberID=crate::apis::urlencode(member_id));
let local_var_uri_str = format!("{}/network/{networkID}/member/{memberID}", local_var_configuration.base_path, networkID=crate::apis::urlencode(network_id), memberID=crate::apis::urlencode(member_id));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = configuration.user_agent {
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_token) = configuration.bearer_access_token {
if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
};
@@ -115,16 +117,17 @@ pub async fn get_network_member(configuration: &configuration::Configuration, ne
}
pub async fn get_network_member_list(configuration: &configuration::Configuration, network_id: &str) -> Result<Vec<crate::models::Member>, Error<GetNetworkMemberListError>> {
let local_var_configuration = configuration;
let local_var_client = &configuration.client;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/network/{networkID}/member", configuration.base_path, networkID=crate::apis::urlencode(network_id));
let local_var_uri_str = format!("{}/network/{networkID}/member", local_var_configuration.base_path, networkID=crate::apis::urlencode(network_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) = configuration.user_agent {
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_token) = configuration.bearer_access_token {
if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
};
@@ -144,16 +147,17 @@ pub async fn get_network_member_list(configuration: &configuration::Configuratio
}
pub async fn update_network_member(configuration: &configuration::Configuration, network_id: &str, member_id: &str, member: crate::models::Member) -> Result<crate::models::Member, Error<UpdateNetworkMemberError>> {
let local_var_configuration = configuration;
let local_var_client = &configuration.client;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/network/{networkID}/member/{memberID}", configuration.base_path, networkID=crate::apis::urlencode(network_id), memberID=crate::apis::urlencode(member_id));
let local_var_uri_str = format!("{}/network/{networkID}/member/{memberID}", local_var_configuration.base_path, networkID=crate::apis::urlencode(network_id), memberID=crate::apis::urlencode(member_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) = configuration.user_agent {
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_token) = configuration.bearer_access_token {
if let Some(ref 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(&member);
@@ -1,7 +1,7 @@
/*
* ZeroTier Central API
*
* ZeroTier Central Network Management Portal API.<p>All API requests must have an API token header specified in the <code>Authorization: Bearer xxxxx</code> format. You can generate your API key by logging into <a href=\"https://my.zerotier.com\">ZeroTier Central</a> and creating a token on the Account page.</p><p>eg. <code>curl -X GET -H \"Authorization: bearer xxxxx\" https://my.zerotier.com/api/v1/network</code></p>
* ZeroTier Central Network Management Portal API.<p>All API requests must have an API token header specified in the <code>Authorization: Bearer xxxxx</code> format. You can generate your API key by logging into <a href=\"https://my.zerotier.com\">ZeroTier Central</a> and creating a token on the Account page.</p><p>eg. <code>curl -X GET -H \"Authorization: bearer xxxxx\" https://my.zerotier.com/api/v1/network</code></p><p><h3>Rate Limiting</h3></p><p>The ZeroTier Central API implements rate limiting. Paid users are limited to 100 requests per second. Free users are limited to 20 requests per second.</p> <p> You can get the OpenAPI spec here as well: <code>https://docs.zerotier.com/openapi/centralv1.json</code></p>
*
* The version of the OpenAPI document: v1
*
@@ -15,7 +15,7 @@ use crate::apis::ResponseContent;
use super::{Error, configuration};
/// struct for typed errors of method `accept_invitation`
/// struct for typed errors of method [`accept_invitation`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum AcceptInvitationError {
@@ -25,7 +25,7 @@ pub enum AcceptInvitationError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method `decline_invitation`
/// struct for typed errors of method [`decline_invitation`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeclineInvitationError {
@@ -35,7 +35,7 @@ pub enum DeclineInvitationError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method `get_invitation_by_id`
/// struct for typed errors of method [`get_invitation_by_id`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetInvitationByIdError {
@@ -45,7 +45,7 @@ pub enum GetInvitationByIdError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method `get_organization`
/// struct for typed errors of method [`get_organization`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetOrganizationError {
@@ -55,7 +55,7 @@ pub enum GetOrganizationError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method `get_organization_by_id`
/// struct for typed errors of method [`get_organization_by_id`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetOrganizationByIdError {
@@ -65,7 +65,7 @@ pub enum GetOrganizationByIdError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method `get_organization_invitation_list`
/// struct for typed errors of method [`get_organization_invitation_list`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetOrganizationInvitationListError {
@@ -75,7 +75,7 @@ pub enum GetOrganizationInvitationListError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method `get_organization_members`
/// struct for typed errors of method [`get_organization_members`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetOrganizationMembersError {
@@ -85,7 +85,7 @@ pub enum GetOrganizationMembersError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method `invite_user_by_email`
/// struct for typed errors of method [`invite_user_by_email`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum InviteUserByEmailError {
@@ -97,16 +97,17 @@ pub enum InviteUserByEmailError {
pub async fn accept_invitation(configuration: &configuration::Configuration, invite_id: &str) -> Result<crate::models::OrganizationInvitation, Error<AcceptInvitationError>> {
let local_var_configuration = configuration;
let local_var_client = &configuration.client;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/org-invitation/{inviteID}", configuration.base_path, inviteID=crate::apis::urlencode(invite_id));
let local_var_uri_str = format!("{}/org-invitation/{inviteID}", local_var_configuration.base_path, inviteID=crate::apis::urlencode(invite_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) = configuration.user_agent {
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_token) = configuration.bearer_access_token {
if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
};
@@ -126,16 +127,17 @@ pub async fn accept_invitation(configuration: &configuration::Configuration, inv
}
pub async fn decline_invitation(configuration: &configuration::Configuration, invite_id: &str) -> Result<(), Error<DeclineInvitationError>> {
let local_var_configuration = configuration;
let local_var_client = &configuration.client;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/org-invitation/{inviteID}", configuration.base_path, inviteID=crate::apis::urlencode(invite_id));
let local_var_uri_str = format!("{}/org-invitation/{inviteID}", local_var_configuration.base_path, inviteID=crate::apis::urlencode(invite_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) = configuration.user_agent {
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_token) = configuration.bearer_access_token {
if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
};
@@ -155,16 +157,17 @@ pub async fn decline_invitation(configuration: &configuration::Configuration, in
}
pub async fn get_invitation_by_id(configuration: &configuration::Configuration, invite_id: &str) -> Result<crate::models::OrganizationInvitation, Error<GetInvitationByIdError>> {
let local_var_configuration = configuration;
let local_var_client = &configuration.client;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/org-invitation/{inviteID}", configuration.base_path, inviteID=crate::apis::urlencode(invite_id));
let local_var_uri_str = format!("{}/org-invitation/{inviteID}", local_var_configuration.base_path, inviteID=crate::apis::urlencode(invite_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) = configuration.user_agent {
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_token) = configuration.bearer_access_token {
if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
};
@@ -184,16 +187,17 @@ pub async fn get_invitation_by_id(configuration: &configuration::Configuration,
}
pub async fn get_organization(configuration: &configuration::Configuration, ) -> Result<crate::models::Organization, Error<GetOrganizationError>> {
let local_var_configuration = configuration;
let local_var_client = &configuration.client;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/org", configuration.base_path);
let local_var_uri_str = format!("{}/org", 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) = configuration.user_agent {
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_token) = configuration.bearer_access_token {
if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
};
@@ -213,16 +217,17 @@ pub async fn get_organization(configuration: &configuration::Configuration, ) ->
}
pub async fn get_organization_by_id(configuration: &configuration::Configuration, org_id: &str) -> Result<crate::models::Organization, Error<GetOrganizationByIdError>> {
let local_var_configuration = configuration;
let local_var_client = &configuration.client;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/org/{orgID}", configuration.base_path, orgID=crate::apis::urlencode(org_id));
let local_var_uri_str = format!("{}/org/{orgID}", local_var_configuration.base_path, orgID=crate::apis::urlencode(org_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) = configuration.user_agent {
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_token) = configuration.bearer_access_token {
if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
};
@@ -242,16 +247,17 @@ pub async fn get_organization_by_id(configuration: &configuration::Configuration
}
pub async fn get_organization_invitation_list(configuration: &configuration::Configuration, ) -> Result<Vec<crate::models::OrganizationInvitation>, Error<GetOrganizationInvitationListError>> {
let local_var_configuration = configuration;
let local_var_client = &configuration.client;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/org-invitation", configuration.base_path);
let local_var_uri_str = format!("{}/org-invitation", 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) = configuration.user_agent {
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_token) = configuration.bearer_access_token {
if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
};
@@ -271,16 +277,17 @@ pub async fn get_organization_invitation_list(configuration: &configuration::Con
}
pub async fn get_organization_members(configuration: &configuration::Configuration, org_id: &str) -> Result<crate::models::OrganizationMember, Error<GetOrganizationMembersError>> {
let local_var_configuration = configuration;
let local_var_client = &configuration.client;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/org/{orgID}/user", configuration.base_path, orgID=crate::apis::urlencode(org_id));
let local_var_uri_str = format!("{}/org/{orgID}/user", local_var_configuration.base_path, orgID=crate::apis::urlencode(org_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) = configuration.user_agent {
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_token) = configuration.bearer_access_token {
if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
};
@@ -300,16 +307,17 @@ pub async fn get_organization_members(configuration: &configuration::Configurati
}
pub async fn invite_user_by_email(configuration: &configuration::Configuration, organization_invitation: crate::models::OrganizationInvitation) -> Result<crate::models::OrganizationInvitation, Error<InviteUserByEmailError>> {
let local_var_configuration = configuration;
let local_var_client = &configuration.client;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/org-invitation", configuration.base_path);
let local_var_uri_str = format!("{}/org-invitation", 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) = configuration.user_agent {
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_token) = configuration.bearer_access_token {
if let Some(ref 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(&organization_invitation);
+31 -26
View File
@@ -1,7 +1,7 @@
/*
* ZeroTier Central API
*
* ZeroTier Central Network Management Portal API.<p>All API requests must have an API token header specified in the <code>Authorization: Bearer xxxxx</code> format. You can generate your API key by logging into <a href=\"https://my.zerotier.com\">ZeroTier Central</a> and creating a token on the Account page.</p><p>eg. <code>curl -X GET -H \"Authorization: bearer xxxxx\" https://my.zerotier.com/api/v1/network</code></p>
* ZeroTier Central Network Management Portal API.<p>All API requests must have an API token header specified in the <code>Authorization: Bearer xxxxx</code> format. You can generate your API key by logging into <a href=\"https://my.zerotier.com\">ZeroTier Central</a> and creating a token on the Account page.</p><p>eg. <code>curl -X GET -H \"Authorization: bearer xxxxx\" https://my.zerotier.com/api/v1/network</code></p><p><h3>Rate Limiting</h3></p><p>The ZeroTier Central API implements rate limiting. Paid users are limited to 100 requests per second. Free users are limited to 20 requests per second.</p> <p> You can get the OpenAPI spec here as well: <code>https://docs.zerotier.com/openapi/centralv1.json</code></p>
*
* The version of the OpenAPI document: v1
*
@@ -15,7 +15,7 @@ use crate::apis::ResponseContent;
use super::{Error, configuration};
/// struct for typed errors of method `add_api_token`
/// struct for typed errors of method [`add_api_token`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum AddApiTokenError {
@@ -26,7 +26,7 @@ pub enum AddApiTokenError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method `delete_api_token`
/// struct for typed errors of method [`delete_api_token`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeleteApiTokenError {
@@ -36,7 +36,7 @@ pub enum DeleteApiTokenError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method `delete_user_by_id`
/// struct for typed errors of method [`delete_user_by_id`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeleteUserByIdError {
@@ -46,7 +46,7 @@ pub enum DeleteUserByIdError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method `get_user_by_id`
/// struct for typed errors of method [`get_user_by_id`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetUserByIdError {
@@ -56,7 +56,7 @@ pub enum GetUserByIdError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method `update_user_by_id`
/// struct for typed errors of method [`update_user_by_id`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum UpdateUserByIdError {
@@ -68,16 +68,17 @@ pub enum UpdateUserByIdError {
pub async fn add_api_token(configuration: &configuration::Configuration, user_id: &str, api_token: crate::models::ApiToken) -> Result<crate::models::ApiToken, Error<AddApiTokenError>> {
let local_var_configuration = configuration;
let local_var_client = &configuration.client;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/user/{userID}/token", configuration.base_path, userID=crate::apis::urlencode(user_id));
let local_var_uri_str = format!("{}/user/{userID}/token", 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) = configuration.user_agent {
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_token) = configuration.bearer_access_token {
if let Some(ref 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(&api_token);
@@ -98,16 +99,17 @@ pub async fn add_api_token(configuration: &configuration::Configuration, user_id
}
pub async fn delete_api_token(configuration: &configuration::Configuration, user_id: &str, token_name: &str) -> Result<(), Error<DeleteApiTokenError>> {
let local_var_configuration = configuration;
let local_var_client = &configuration.client;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/user/{userID}/token/{tokenName}", configuration.base_path, userID=crate::apis::urlencode(user_id), tokenName=crate::apis::urlencode(token_name));
let local_var_uri_str = format!("{}/user/{userID}/token/{tokenName}", local_var_configuration.base_path, userID=crate::apis::urlencode(user_id), tokenName=crate::apis::urlencode(token_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) = configuration.user_agent {
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_token) = configuration.bearer_access_token {
if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
};
@@ -128,16 +130,17 @@ pub async fn delete_api_token(configuration: &configuration::Configuration, user
/// Deletes the user and all associated networks. This is not reversible. Delete at your own risk.
pub async fn delete_user_by_id(configuration: &configuration::Configuration, user_id: &str) -> Result<(), Error<DeleteUserByIdError>> {
let local_var_configuration = configuration;
let local_var_client = &configuration.client;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/user/{userID}", configuration.base_path, userID=crate::apis::urlencode(user_id));
let local_var_uri_str = format!("{}/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::DELETE, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = configuration.user_agent {
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_token) = configuration.bearer_access_token {
if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
};
@@ -157,16 +160,17 @@ pub async fn delete_user_by_id(configuration: &configuration::Configuration, use
}
pub async fn get_user_by_id(configuration: &configuration::Configuration, user_id: &str) -> Result<crate::models::User, Error<GetUserByIdError>> {
let local_var_configuration = configuration;
let local_var_client = &configuration.client;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/user/{userID}", configuration.base_path, userID=crate::apis::urlencode(user_id));
let local_var_uri_str = format!("{}/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_user_agent) = configuration.user_agent {
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_token) = configuration.bearer_access_token {
if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
};
@@ -186,16 +190,17 @@ pub async fn get_user_by_id(configuration: &configuration::Configuration, user_i
}
pub async fn update_user_by_id(configuration: &configuration::Configuration, user_id: &str, user: crate::models::User) -> Result<crate::models::User, Error<UpdateUserByIdError>> {
let local_var_configuration = configuration;
let local_var_client = &configuration.client;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/user/{userID}", configuration.base_path, userID=crate::apis::urlencode(user_id));
let local_var_uri_str = format!("{}/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::POST, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = configuration.user_agent {
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_token) = configuration.bearer_access_token {
if let Some(ref 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);
+13 -11
View File
@@ -1,7 +1,7 @@
/*
* ZeroTier Central API
*
* ZeroTier Central Network Management Portal API.<p>All API requests must have an API token header specified in the <code>Authorization: Bearer xxxxx</code> format. You can generate your API key by logging into <a href=\"https://my.zerotier.com\">ZeroTier Central</a> and creating a token on the Account page.</p><p>eg. <code>curl -X GET -H \"Authorization: bearer xxxxx\" https://my.zerotier.com/api/v1/network</code></p>
* ZeroTier Central Network Management Portal API.<p>All API requests must have an API token header specified in the <code>Authorization: Bearer xxxxx</code> format. You can generate your API key by logging into <a href=\"https://my.zerotier.com\">ZeroTier Central</a> and creating a token on the Account page.</p><p>eg. <code>curl -X GET -H \"Authorization: bearer xxxxx\" https://my.zerotier.com/api/v1/network</code></p><p><h3>Rate Limiting</h3></p><p>The ZeroTier Central API implements rate limiting. Paid users are limited to 100 requests per second. Free users are limited to 20 requests per second.</p> <p> You can get the OpenAPI spec here as well: <code>https://docs.zerotier.com/openapi/centralv1.json</code></p>
*
* The version of the OpenAPI document: v1
*
@@ -15,14 +15,14 @@ use crate::apis::ResponseContent;
use super::{Error, configuration};
/// struct for typed errors of method `get_random_token`
/// struct for typed errors of method [`get_random_token`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetRandomTokenError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method `get_status`
/// struct for typed errors of method [`get_status`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetStatusError {
@@ -32,16 +32,17 @@ pub enum GetStatusError {
/// Get a random 32 character. Used by the web UI to generate API keys
pub async fn get_random_token(configuration: &configuration::Configuration, ) -> Result<crate::models::RandomToken, Error<GetRandomTokenError>> {
let local_var_configuration = configuration;
let local_var_client = &configuration.client;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/randomToken", configuration.base_path);
let local_var_uri_str = format!("{}/randomToken", 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) = configuration.user_agent {
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_token) = configuration.bearer_access_token {
if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
};
@@ -61,16 +62,17 @@ pub async fn get_random_token(configuration: &configuration::Configuration, ) ->
}
pub async fn get_status(configuration: &configuration::Configuration, ) -> Result<crate::models::Status, Error<GetStatusError>> {
let local_var_configuration = configuration;
let local_var_client = &configuration.client;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/status", configuration.base_path);
let local_var_uri_str = format!("{}/status", 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) = configuration.user_agent {
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_token) = configuration.bearer_access_token {
if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
};
+2 -2
View File
@@ -1,7 +1,7 @@
/*
* ZeroTier Central API
*
* ZeroTier Central Network Management Portal API.<p>All API requests must have an API token header specified in the <code>Authorization: Bearer xxxxx</code> format. You can generate your API key by logging into <a href=\"https://my.zerotier.com\">ZeroTier Central</a> and creating a token on the Account page.</p><p>eg. <code>curl -X GET -H \"Authorization: bearer xxxxx\" https://my.zerotier.com/api/v1/network</code></p>
* ZeroTier Central Network Management Portal API.<p>All API requests must have an API token header specified in the <code>Authorization: Bearer xxxxx</code> format. You can generate your API key by logging into <a href=\"https://my.zerotier.com\">ZeroTier Central</a> and creating a token on the Account page.</p><p>eg. <code>curl -X GET -H \"Authorization: bearer xxxxx\" https://my.zerotier.com/api/v1/network</code></p><p><h3>Rate Limiting</h3></p><p>The ZeroTier Central API implements rate limiting. Paid users are limited to 100 requests per second. Free users are limited to 20 requests per second.</p> <p> You can get the OpenAPI spec here as well: <code>https://docs.zerotier.com/openapi/centralv1.json</code></p>
*
* The version of the OpenAPI document: v1
*
@@ -11,7 +11,7 @@
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct ApiToken {
/// user specified token name
#[serde(rename = "tokenName", skip_serializing_if = "Option::is_none")]
@@ -1,7 +1,7 @@
/*
* ZeroTier Central API
*
* ZeroTier Central Network Management Portal API.<p>All API requests must have an API token header specified in the <code>Authorization: Bearer xxxxx</code> format. You can generate your API key by logging into <a href=\"https://my.zerotier.com\">ZeroTier Central</a> and creating a token on the Account page.</p><p>eg. <code>curl -X GET -H \"Authorization: bearer xxxxx\" https://my.zerotier.com/api/v1/network</code></p>
* ZeroTier Central Network Management Portal API.<p>All API requests must have an API token header specified in the <code>Authorization: Bearer xxxxx</code> format. You can generate your API key by logging into <a href=\"https://my.zerotier.com\">ZeroTier Central</a> and creating a token on the Account page.</p><p>eg. <code>curl -X GET -H \"Authorization: bearer xxxxx\" https://my.zerotier.com/api/v1/network</code></p><p><h3>Rate Limiting</h3></p><p>The ZeroTier Central API implements rate limiting. Paid users are limited to 100 requests per second. Free users are limited to 20 requests per second.</p> <p> You can get the OpenAPI spec here as well: <code>https://docs.zerotier.com/openapi/centralv1.json</code></p>
*
* The version of the OpenAPI document: v1
*
@@ -11,7 +11,7 @@
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct AuthMethods {
/// email address for built-in authentication
#[serde(rename = "local", skip_serializing_if = "Option::is_none")]
@@ -1,7 +1,7 @@
/*
* ZeroTier Central API
*
* ZeroTier Central Network Management Portal API.<p>All API requests must have an API token header specified in the <code>Authorization: Bearer xxxxx</code> format. You can generate your API key by logging into <a href=\"https://my.zerotier.com\">ZeroTier Central</a> and creating a token on the Account page.</p><p>eg. <code>curl -X GET -H \"Authorization: bearer xxxxx\" https://my.zerotier.com/api/v1/network</code></p>
* ZeroTier Central Network Management Portal API.<p>All API requests must have an API token header specified in the <code>Authorization: Bearer xxxxx</code> format. You can generate your API key by logging into <a href=\"https://my.zerotier.com\">ZeroTier Central</a> and creating a token on the Account page.</p><p>eg. <code>curl -X GET -H \"Authorization: bearer xxxxx\" https://my.zerotier.com/api/v1/network</code></p><p><h3>Rate Limiting</h3></p><p>The ZeroTier Central API implements rate limiting. Paid users are limited to 100 requests per second. Free users are limited to 20 requests per second.</p> <p> You can get the OpenAPI spec here as well: <code>https://docs.zerotier.com/openapi/centralv1.json</code></p>
*
* The version of the OpenAPI document: v1
*
@@ -11,8 +11,8 @@
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct NetworkConfigDns {
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct Dns {
/// Search domain to use for DNS records
#[serde(rename = "domain", skip_serializing_if = "Option::is_none")]
pub domain: Option<String>,
@@ -21,9 +21,9 @@ pub struct NetworkConfigDns {
pub servers: Option<Vec<String>>,
}
impl NetworkConfigDns {
pub fn new() -> NetworkConfigDns {
NetworkConfigDns {
impl Dns {
pub fn new() -> Dns {
Dns {
domain: None,
servers: None,
}
@@ -1,7 +1,7 @@
/*
* ZeroTier Central API
*
* ZeroTier Central Network Management Portal API.<p>All API requests must have an API token header specified in the <code>Authorization: Bearer xxxxx</code> format. You can generate your API key by logging into <a href=\"https://my.zerotier.com\">ZeroTier Central</a> and creating a token on the Account page.</p><p>eg. <code>curl -X GET -H \"Authorization: bearer xxxxx\" https://my.zerotier.com/api/v1/network</code></p>
* ZeroTier Central Network Management Portal API.<p>All API requests must have an API token header specified in the <code>Authorization: Bearer xxxxx</code> format. You can generate your API key by logging into <a href=\"https://my.zerotier.com\">ZeroTier Central</a> and creating a token on the Account page.</p><p>eg. <code>curl -X GET -H \"Authorization: bearer xxxxx\" https://my.zerotier.com/api/v1/network</code></p><p><h3>Rate Limiting</h3></p><p>The ZeroTier Central API implements rate limiting. Paid users are limited to 100 requests per second. Free users are limited to 20 requests per second.</p> <p> You can get the OpenAPI spec here as well: <code>https://docs.zerotier.com/openapi/centralv1.json</code></p>
*
* The version of the OpenAPI document: v1
*
@@ -31,6 +31,12 @@ impl ToString for InviteStatus {
}
}
impl Default for InviteStatus {
fn default() -> InviteStatus {
Self::Pending
}
}
+2 -2
View File
@@ -1,7 +1,7 @@
/*
* ZeroTier Central API
*
* ZeroTier Central Network Management Portal API.<p>All API requests must have an API token header specified in the <code>Authorization: Bearer xxxxx</code> format. You can generate your API key by logging into <a href=\"https://my.zerotier.com\">ZeroTier Central</a> and creating a token on the Account page.</p><p>eg. <code>curl -X GET -H \"Authorization: bearer xxxxx\" https://my.zerotier.com/api/v1/network</code></p>
* ZeroTier Central Network Management Portal API.<p>All API requests must have an API token header specified in the <code>Authorization: Bearer xxxxx</code> format. You can generate your API key by logging into <a href=\"https://my.zerotier.com\">ZeroTier Central</a> and creating a token on the Account page.</p><p>eg. <code>curl -X GET -H \"Authorization: bearer xxxxx\" https://my.zerotier.com/api/v1/network</code></p><p><h3>Rate Limiting</h3></p><p>The ZeroTier Central API implements rate limiting. Paid users are limited to 100 requests per second. Free users are limited to 20 requests per second.</p> <p> You can get the OpenAPI spec here as well: <code>https://docs.zerotier.com/openapi/centralv1.json</code></p>
*
* The version of the OpenAPI document: v1
*
@@ -11,7 +11,7 @@
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct IpRange {
#[serde(rename = "ipRangeStart", skip_serializing_if = "Option::is_none")]
pub ip_range_start: Option<String>,
@@ -1,7 +1,7 @@
/*
* ZeroTier Central API
*
* ZeroTier Central Network Management Portal API.<p>All API requests must have an API token header specified in the <code>Authorization: Bearer xxxxx</code> format. You can generate your API key by logging into <a href=\"https://my.zerotier.com\">ZeroTier Central</a> and creating a token on the Account page.</p><p>eg. <code>curl -X GET -H \"Authorization: bearer xxxxx\" https://my.zerotier.com/api/v1/network</code></p>
* ZeroTier Central Network Management Portal API.<p>All API requests must have an API token header specified in the <code>Authorization: Bearer xxxxx</code> format. You can generate your API key by logging into <a href=\"https://my.zerotier.com\">ZeroTier Central</a> and creating a token on the Account page.</p><p>eg. <code>curl -X GET -H \"Authorization: bearer xxxxx\" https://my.zerotier.com/api/v1/network</code></p><p><h3>Rate Limiting</h3></p><p>The ZeroTier Central API implements rate limiting. Paid users are limited to 100 requests per second. Free users are limited to 20 requests per second.</p> <p> You can get the OpenAPI spec here as well: <code>https://docs.zerotier.com/openapi/centralv1.json</code></p>
*
* The version of the OpenAPI document: v1
*
@@ -11,7 +11,7 @@
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct Ipv4AssignMode {
#[serde(rename = "zt", skip_serializing_if = "Option::is_none")]
pub zt: Option<bool>,
@@ -1,7 +1,7 @@
/*
* ZeroTier Central API
*
* ZeroTier Central Network Management Portal API.<p>All API requests must have an API token header specified in the <code>Authorization: Bearer xxxxx</code> format. You can generate your API key by logging into <a href=\"https://my.zerotier.com\">ZeroTier Central</a> and creating a token on the Account page.</p><p>eg. <code>curl -X GET -H \"Authorization: bearer xxxxx\" https://my.zerotier.com/api/v1/network</code></p>
* ZeroTier Central Network Management Portal API.<p>All API requests must have an API token header specified in the <code>Authorization: Bearer xxxxx</code> format. You can generate your API key by logging into <a href=\"https://my.zerotier.com\">ZeroTier Central</a> and creating a token on the Account page.</p><p>eg. <code>curl -X GET -H \"Authorization: bearer xxxxx\" https://my.zerotier.com/api/v1/network</code></p><p><h3>Rate Limiting</h3></p><p>The ZeroTier Central API implements rate limiting. Paid users are limited to 100 requests per second. Free users are limited to 20 requests per second.</p> <p> You can get the OpenAPI spec here as well: <code>https://docs.zerotier.com/openapi/centralv1.json</code></p>
*
* The version of the OpenAPI document: v1
*
@@ -11,7 +11,7 @@
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct Ipv6AssignMode {
#[serde(rename = "6plane", skip_serializing_if = "Option::is_none")]
pub var_6plane: Option<bool>,

Some files were not shown because too many files have changed in this diff Show More