#![allow(unused_imports)]
#![cfg_attr(rustfmt, rustfmt_skip)]
use crate::{Client, ClientBuilder, Credentials, Retry};
use anyhow::Error;
use serde_json::Value;
use std::time::Duration;
use crate::util::urlencode;
pub struct Auth {
pub client: Client
}
#[allow(non_snake_case)]
impl Auth {
pub fn new<CB: Into<ClientBuilder>>(client_builder: CB) -> Result<Self, Error> {
Ok(Self{
client: client_builder
.into()
.path_prefix("api/auth/v1/")
.build()?,
})
}
pub async fn ping(&self) -> Result<(), Error> {
let method = "GET";
let (path, query) = Self::ping_details();
let body = None;
let resp = self.client.request(method, path, query, body).await?;
resp.bytes().await?;
Ok(())
}
pub fn ping_url(&self) -> Result<String, Error> {
let (path, query) = Self::ping_details();
self.client.make_url(path, query)
}
pub fn ping_signed_url(&self, ttl: Duration) -> Result<String, Error> {
let (path, query) = Self::ping_details();
self.client.make_signed_url(path, query, ttl)
}
fn ping_details<'a>() -> (&'static str, Option<Vec<(&'static str, &'a str)>>) {
let path = "ping";
let query = None;
(path, query)
}
pub async fn lbheartbeat(&self) -> Result<(), Error> {
let method = "GET";
let (path, query) = Self::lbheartbeat_details();
let body = None;
let resp = self.client.request(method, path, query, body).await?;
resp.bytes().await?;
Ok(())
}
pub fn lbheartbeat_url(&self) -> Result<String, Error> {
let (path, query) = Self::lbheartbeat_details();
self.client.make_url(path, query)
}
pub fn lbheartbeat_signed_url(&self, ttl: Duration) -> Result<String, Error> {
let (path, query) = Self::lbheartbeat_details();
self.client.make_signed_url(path, query, ttl)
}
fn lbheartbeat_details<'a>() -> (&'static str, Option<Vec<(&'static str, &'a str)>>) {
let path = "__lbheartbeat__";
let query = None;
(path, query)
}
pub async fn version(&self) -> Result<(), Error> {
let method = "GET";
let (path, query) = Self::version_details();
let body = None;
let resp = self.client.request(method, path, query, body).await?;
resp.bytes().await?;
Ok(())
}
pub fn version_url(&self) -> Result<String, Error> {
let (path, query) = Self::version_details();
self.client.make_url(path, query)
}
pub fn version_signed_url(&self, ttl: Duration) -> Result<String, Error> {
let (path, query) = Self::version_details();
self.client.make_signed_url(path, query, ttl)
}
fn version_details<'a>() -> (&'static str, Option<Vec<(&'static str, &'a str)>>) {
let path = "__version__";
let query = None;
(path, query)
}
pub async fn listClients(&self, prefix: Option<&str>, continuationToken: Option<&str>, limit: Option<&str>) -> Result<Value, Error> {
let method = "GET";
let (path, query) = Self::listClients_details(prefix, continuationToken, limit);
let body = None;
let resp = self.client.request(method, path, query, body).await?;
Ok(resp.json().await?)
}
pub fn listClients_url(&self, prefix: Option<&str>, continuationToken: Option<&str>, limit: Option<&str>) -> Result<String, Error> {
let (path, query) = Self::listClients_details(prefix, continuationToken, limit);
self.client.make_url(path, query)
}
pub fn listClients_signed_url(&self, prefix: Option<&str>, continuationToken: Option<&str>, limit: Option<&str>, ttl: Duration) -> Result<String, Error> {
let (path, query) = Self::listClients_details(prefix, continuationToken, limit);
self.client.make_signed_url(path, query, ttl)
}
fn listClients_details<'a>(prefix: Option<&'a str>, continuationToken: Option<&'a str>, limit: Option<&'a str>) -> (&'static str, Option<Vec<(&'static str, &'a str)>>) {
let path = "clients/";
let mut query = None;
if let Some(q) = prefix {
query.get_or_insert_with(Vec::new).push(("prefix", q));
}
if let Some(q) = continuationToken {
query.get_or_insert_with(Vec::new).push(("continuationToken", q));
}
if let Some(q) = limit {
query.get_or_insert_with(Vec::new).push(("limit", q));
}
(path, query)
}
pub async fn client(&self, clientId: &str) -> Result<Value, Error> {
let method = "GET";
let (path, query) = Self::client_details(clientId);
let body = None;
let resp = self.client.request(method, &path, query, body).await?;
Ok(resp.json().await?)
}
pub fn client_url(&self, clientId: &str) -> Result<String, Error> {
let (path, query) = Self::client_details(clientId);
self.client.make_url(&path, query)
}
pub fn client_signed_url(&self, clientId: &str, ttl: Duration) -> Result<String, Error> {
let (path, query) = Self::client_details(clientId);
self.client.make_signed_url(&path, query, ttl)
}
fn client_details<'a>(clientId: &'a str) -> (String, Option<Vec<(&'static str, &'a str)>>) {
let path = format!("clients/{}", urlencode(clientId));
let query = None;
(path, query)
}
pub async fn createClient(&self, clientId: &str, payload: &Value) -> Result<Value, Error> {
let method = "PUT";
let (path, query) = Self::createClient_details(clientId);
let body = Some(payload);
let resp = self.client.request(method, &path, query, body).await?;
Ok(resp.json().await?)
}
fn createClient_details<'a>(clientId: &'a str) -> (String, Option<Vec<(&'static str, &'a str)>>) {
let path = format!("clients/{}", urlencode(clientId));
let query = None;
(path, query)
}
pub async fn getEntityHistory(&self, entityType: &str, entityId: &str, continuationToken: Option<&str>, limit: Option<&str>) -> Result<Value, Error> {
let method = "GET";
let (path, query) = Self::getEntityHistory_details(entityType, entityId, continuationToken, limit);
let body = None;
let resp = self.client.request(method, &path, query, body).await?;
Ok(resp.json().await?)
}
pub fn getEntityHistory_url(&self, entityType: &str, entityId: &str, continuationToken: Option<&str>, limit: Option<&str>) -> Result<String, Error> {
let (path, query) = Self::getEntityHistory_details(entityType, entityId, continuationToken, limit);
self.client.make_url(&path, query)
}
pub fn getEntityHistory_signed_url(&self, entityType: &str, entityId: &str, continuationToken: Option<&str>, limit: Option<&str>, ttl: Duration) -> Result<String, Error> {
let (path, query) = Self::getEntityHistory_details(entityType, entityId, continuationToken, limit);
self.client.make_signed_url(&path, query, ttl)
}
fn getEntityHistory_details<'a>(entityType: &'a str, entityId: &'a str, continuationToken: Option<&'a str>, limit: Option<&'a str>) -> (String, Option<Vec<(&'static str, &'a str)>>) {
let path = format!("audit/{}/{}", urlencode(entityType), urlencode(entityId));
let mut query = None;
if let Some(q) = continuationToken {
query.get_or_insert_with(Vec::new).push(("continuationToken", q));
}
if let Some(q) = limit {
query.get_or_insert_with(Vec::new).push(("limit", q));
}
(path, query)
}
pub async fn listAuditHistory(&self, clientId: &str, continuationToken: Option<&str>, limit: Option<&str>) -> Result<Value, Error> {
let method = "GET";
let (path, query) = Self::listAuditHistory_details(clientId, continuationToken, limit);
let body = None;
let resp = self.client.request(method, &path, query, body).await?;
Ok(resp.json().await?)
}
pub fn listAuditHistory_url(&self, clientId: &str, continuationToken: Option<&str>, limit: Option<&str>) -> Result<String, Error> {
let (path, query) = Self::listAuditHistory_details(clientId, continuationToken, limit);
self.client.make_url(&path, query)
}
pub fn listAuditHistory_signed_url(&self, clientId: &str, continuationToken: Option<&str>, limit: Option<&str>, ttl: Duration) -> Result<String, Error> {
let (path, query) = Self::listAuditHistory_details(clientId, continuationToken, limit);
self.client.make_signed_url(&path, query, ttl)
}
fn listAuditHistory_details<'a>(clientId: &'a str, continuationToken: Option<&'a str>, limit: Option<&'a str>) -> (String, Option<Vec<(&'static str, &'a str)>>) {
let path = format!("clients/{}/audit", urlencode(clientId));
let mut query = None;
if let Some(q) = continuationToken {
query.get_or_insert_with(Vec::new).push(("continuationToken", q));
}
if let Some(q) = limit {
query.get_or_insert_with(Vec::new).push(("limit", q));
}
(path, query)
}
pub async fn resetAccessToken(&self, clientId: &str) -> Result<Value, Error> {
let method = "POST";
let (path, query) = Self::resetAccessToken_details(clientId);
let body = None;
let resp = self.client.request(method, &path, query, body).await?;
Ok(resp.json().await?)
}
fn resetAccessToken_details<'a>(clientId: &'a str) -> (String, Option<Vec<(&'static str, &'a str)>>) {
let path = format!("clients/{}/reset", urlencode(clientId));
let query = None;
(path, query)
}
pub async fn updateClient(&self, clientId: &str, payload: &Value) -> Result<Value, Error> {
let method = "POST";
let (path, query) = Self::updateClient_details(clientId);
let body = Some(payload);
let resp = self.client.request(method, &path, query, body).await?;
Ok(resp.json().await?)
}
fn updateClient_details<'a>(clientId: &'a str) -> (String, Option<Vec<(&'static str, &'a str)>>) {
let path = format!("clients/{}", urlencode(clientId));
let query = None;
(path, query)
}
pub async fn enableClient(&self, clientId: &str) -> Result<Value, Error> {
let method = "POST";
let (path, query) = Self::enableClient_details(clientId);
let body = None;
let resp = self.client.request(method, &path, query, body).await?;
Ok(resp.json().await?)
}
fn enableClient_details<'a>(clientId: &'a str) -> (String, Option<Vec<(&'static str, &'a str)>>) {
let path = format!("clients/{}/enable", urlencode(clientId));
let query = None;
(path, query)
}
pub async fn disableClient(&self, clientId: &str) -> Result<Value, Error> {
let method = "POST";
let (path, query) = Self::disableClient_details(clientId);
let body = None;
let resp = self.client.request(method, &path, query, body).await?;
Ok(resp.json().await?)
}
fn disableClient_details<'a>(clientId: &'a str) -> (String, Option<Vec<(&'static str, &'a str)>>) {
let path = format!("clients/{}/disable", urlencode(clientId));
let query = None;
(path, query)
}
pub async fn deleteClient(&self, clientId: &str) -> Result<(), Error> {
let method = "DELETE";
let (path, query) = Self::deleteClient_details(clientId);
let body = None;
let resp = self.client.request(method, &path, query, body).await?;
resp.bytes().await?;
Ok(())
}
fn deleteClient_details<'a>(clientId: &'a str) -> (String, Option<Vec<(&'static str, &'a str)>>) {
let path = format!("clients/{}", urlencode(clientId));
let query = None;
(path, query)
}
pub async fn listRoles(&self) -> Result<Value, Error> {
let method = "GET";
let (path, query) = Self::listRoles_details();
let body = None;
let resp = self.client.request(method, path, query, body).await?;
Ok(resp.json().await?)
}
pub fn listRoles_url(&self) -> Result<String, Error> {
let (path, query) = Self::listRoles_details();
self.client.make_url(path, query)
}
pub fn listRoles_signed_url(&self, ttl: Duration) -> Result<String, Error> {
let (path, query) = Self::listRoles_details();
self.client.make_signed_url(path, query, ttl)
}
fn listRoles_details<'a>() -> (&'static str, Option<Vec<(&'static str, &'a str)>>) {
let path = "roles/";
let query = None;
(path, query)
}
pub async fn listRoles2(&self, continuationToken: Option<&str>, limit: Option<&str>) -> Result<Value, Error> {
let method = "GET";
let (path, query) = Self::listRoles2_details(continuationToken, limit);
let body = None;
let resp = self.client.request(method, path, query, body).await?;
Ok(resp.json().await?)
}
pub fn listRoles2_url(&self, continuationToken: Option<&str>, limit: Option<&str>) -> Result<String, Error> {
let (path, query) = Self::listRoles2_details(continuationToken, limit);
self.client.make_url(path, query)
}
pub fn listRoles2_signed_url(&self, continuationToken: Option<&str>, limit: Option<&str>, ttl: Duration) -> Result<String, Error> {
let (path, query) = Self::listRoles2_details(continuationToken, limit);
self.client.make_signed_url(path, query, ttl)
}
fn listRoles2_details<'a>(continuationToken: Option<&'a str>, limit: Option<&'a str>) -> (&'static str, Option<Vec<(&'static str, &'a str)>>) {
let path = "roles2/";
let mut query = None;
if let Some(q) = continuationToken {
query.get_or_insert_with(Vec::new).push(("continuationToken", q));
}
if let Some(q) = limit {
query.get_or_insert_with(Vec::new).push(("limit", q));
}
(path, query)
}
pub async fn listRoleIds(&self, continuationToken: Option<&str>, limit: Option<&str>) -> Result<Value, Error> {
let method = "GET";
let (path, query) = Self::listRoleIds_details(continuationToken, limit);
let body = None;
let resp = self.client.request(method, path, query, body).await?;
Ok(resp.json().await?)
}
pub fn listRoleIds_url(&self, continuationToken: Option<&str>, limit: Option<&str>) -> Result<String, Error> {
let (path, query) = Self::listRoleIds_details(continuationToken, limit);
self.client.make_url(path, query)
}
pub fn listRoleIds_signed_url(&self, continuationToken: Option<&str>, limit: Option<&str>, ttl: Duration) -> Result<String, Error> {
let (path, query) = Self::listRoleIds_details(continuationToken, limit);
self.client.make_signed_url(path, query, ttl)
}
fn listRoleIds_details<'a>(continuationToken: Option<&'a str>, limit: Option<&'a str>) -> (&'static str, Option<Vec<(&'static str, &'a str)>>) {
let path = "roleids/";
let mut query = None;
if let Some(q) = continuationToken {
query.get_or_insert_with(Vec::new).push(("continuationToken", q));
}
if let Some(q) = limit {
query.get_or_insert_with(Vec::new).push(("limit", q));
}
(path, query)
}
pub async fn role(&self, roleId: &str) -> Result<Value, Error> {
let method = "GET";
let (path, query) = Self::role_details(roleId);
let body = None;
let resp = self.client.request(method, &path, query, body).await?;
Ok(resp.json().await?)
}
pub fn role_url(&self, roleId: &str) -> Result<String, Error> {
let (path, query) = Self::role_details(roleId);
self.client.make_url(&path, query)
}
pub fn role_signed_url(&self, roleId: &str, ttl: Duration) -> Result<String, Error> {
let (path, query) = Self::role_details(roleId);
self.client.make_signed_url(&path, query, ttl)
}
fn role_details<'a>(roleId: &'a str) -> (String, Option<Vec<(&'static str, &'a str)>>) {
let path = format!("roles/{}", urlencode(roleId));
let query = None;
(path, query)
}
pub async fn createRole(&self, roleId: &str, payload: &Value) -> Result<Value, Error> {
let method = "PUT";
let (path, query) = Self::createRole_details(roleId);
let body = Some(payload);
let resp = self.client.request(method, &path, query, body).await?;
Ok(resp.json().await?)
}
fn createRole_details<'a>(roleId: &'a str) -> (String, Option<Vec<(&'static str, &'a str)>>) {
let path = format!("roles/{}", urlencode(roleId));
let query = None;
(path, query)
}
pub async fn updateRole(&self, roleId: &str, payload: &Value) -> Result<Value, Error> {
let method = "POST";
let (path, query) = Self::updateRole_details(roleId);
let body = Some(payload);
let resp = self.client.request(method, &path, query, body).await?;
Ok(resp.json().await?)
}
fn updateRole_details<'a>(roleId: &'a str) -> (String, Option<Vec<(&'static str, &'a str)>>) {
let path = format!("roles/{}", urlencode(roleId));
let query = None;
(path, query)
}
pub async fn deleteRole(&self, roleId: &str) -> Result<(), Error> {
let method = "DELETE";
let (path, query) = Self::deleteRole_details(roleId);
let body = None;
let resp = self.client.request(method, &path, query, body).await?;
resp.bytes().await?;
Ok(())
}
fn deleteRole_details<'a>(roleId: &'a str) -> (String, Option<Vec<(&'static str, &'a str)>>) {
let path = format!("roles/{}", urlencode(roleId));
let query = None;
(path, query)
}
pub async fn expandScopes(&self, payload: &Value) -> Result<Value, Error> {
let method = "POST";
let (path, query) = Self::expandScopes_details();
let body = Some(payload);
let resp = self.client.request(method, path, query, body).await?;
Ok(resp.json().await?)
}
fn expandScopes_details<'a>() -> (&'static str, Option<Vec<(&'static str, &'a str)>>) {
let path = "scopes/expand";
let query = None;
(path, query)
}
pub async fn currentScopes(&self) -> Result<Value, Error> {
let method = "GET";
let (path, query) = Self::currentScopes_details();
let body = None;
let resp = self.client.request(method, path, query, body).await?;
Ok(resp.json().await?)
}
pub fn currentScopes_url(&self) -> Result<String, Error> {
let (path, query) = Self::currentScopes_details();
self.client.make_url(path, query)
}
pub fn currentScopes_signed_url(&self, ttl: Duration) -> Result<String, Error> {
let (path, query) = Self::currentScopes_details();
self.client.make_signed_url(path, query, ttl)
}
fn currentScopes_details<'a>() -> (&'static str, Option<Vec<(&'static str, &'a str)>>) {
let path = "scopes/current";
let query = None;
(path, query)
}
pub async fn awsS3Credentials(&self, level: &str, bucket: &str, prefix: &str, format: Option<&str>) -> Result<Value, Error> {
let method = "GET";
let (path, query) = Self::awsS3Credentials_details(level, bucket, prefix, format);
let body = None;
let resp = self.client.request(method, &path, query, body).await?;
Ok(resp.json().await?)
}
pub fn awsS3Credentials_url(&self, level: &str, bucket: &str, prefix: &str, format: Option<&str>) -> Result<String, Error> {
let (path, query) = Self::awsS3Credentials_details(level, bucket, prefix, format);
self.client.make_url(&path, query)
}
pub fn awsS3Credentials_signed_url(&self, level: &str, bucket: &str, prefix: &str, format: Option<&str>, ttl: Duration) -> Result<String, Error> {
let (path, query) = Self::awsS3Credentials_details(level, bucket, prefix, format);
self.client.make_signed_url(&path, query, ttl)
}
fn awsS3Credentials_details<'a>(level: &'a str, bucket: &'a str, prefix: &'a str, format: Option<&'a str>) -> (String, Option<Vec<(&'static str, &'a str)>>) {
let path = format!("aws/s3/{}/{}/{}", urlencode(level), urlencode(bucket), urlencode(prefix));
let mut query = None;
if let Some(q) = format {
query.get_or_insert_with(Vec::new).push(("format", q));
}
(path, query)
}
pub async fn azureAccounts(&self) -> Result<Value, Error> {
let method = "GET";
let (path, query) = Self::azureAccounts_details();
let body = None;
let resp = self.client.request(method, path, query, body).await?;
Ok(resp.json().await?)
}
pub fn azureAccounts_url(&self) -> Result<String, Error> {
let (path, query) = Self::azureAccounts_details();
self.client.make_url(path, query)
}
pub fn azureAccounts_signed_url(&self, ttl: Duration) -> Result<String, Error> {
let (path, query) = Self::azureAccounts_details();
self.client.make_signed_url(path, query, ttl)
}
fn azureAccounts_details<'a>() -> (&'static str, Option<Vec<(&'static str, &'a str)>>) {
let path = "azure/accounts";
let query = None;
(path, query)
}
pub async fn azureTables(&self, account: &str, continuationToken: Option<&str>) -> Result<Value, Error> {
let method = "GET";
let (path, query) = Self::azureTables_details(account, continuationToken);
let body = None;
let resp = self.client.request(method, &path, query, body).await?;
Ok(resp.json().await?)
}
pub fn azureTables_url(&self, account: &str, continuationToken: Option<&str>) -> Result<String, Error> {
let (path, query) = Self::azureTables_details(account, continuationToken);
self.client.make_url(&path, query)
}
pub fn azureTables_signed_url(&self, account: &str, continuationToken: Option<&str>, ttl: Duration) -> Result<String, Error> {
let (path, query) = Self::azureTables_details(account, continuationToken);
self.client.make_signed_url(&path, query, ttl)
}
fn azureTables_details<'a>(account: &'a str, continuationToken: Option<&'a str>) -> (String, Option<Vec<(&'static str, &'a str)>>) {
let path = format!("azure/{}/tables", urlencode(account));
let mut query = None;
if let Some(q) = continuationToken {
query.get_or_insert_with(Vec::new).push(("continuationToken", q));
}
(path, query)
}
pub async fn azureTableSAS(&self, account: &str, table: &str, level: &str) -> Result<Value, Error> {
let method = "GET";
let (path, query) = Self::azureTableSAS_details(account, table, level);
let body = None;
let resp = self.client.request(method, &path, query, body).await?;
Ok(resp.json().await?)
}
pub fn azureTableSAS_url(&self, account: &str, table: &str, level: &str) -> Result<String, Error> {
let (path, query) = Self::azureTableSAS_details(account, table, level);
self.client.make_url(&path, query)
}
pub fn azureTableSAS_signed_url(&self, account: &str, table: &str, level: &str, ttl: Duration) -> Result<String, Error> {
let (path, query) = Self::azureTableSAS_details(account, table, level);
self.client.make_signed_url(&path, query, ttl)
}
fn azureTableSAS_details<'a>(account: &'a str, table: &'a str, level: &'a str) -> (String, Option<Vec<(&'static str, &'a str)>>) {
let path = format!("azure/{}/table/{}/{}", urlencode(account), urlencode(table), urlencode(level));
let query = None;
(path, query)
}
pub async fn azureContainers(&self, account: &str, continuationToken: Option<&str>) -> Result<Value, Error> {
let method = "GET";
let (path, query) = Self::azureContainers_details(account, continuationToken);
let body = None;
let resp = self.client.request(method, &path, query, body).await?;
Ok(resp.json().await?)
}
pub fn azureContainers_url(&self, account: &str, continuationToken: Option<&str>) -> Result<String, Error> {
let (path, query) = Self::azureContainers_details(account, continuationToken);
self.client.make_url(&path, query)
}
pub fn azureContainers_signed_url(&self, account: &str, continuationToken: Option<&str>, ttl: Duration) -> Result<String, Error> {
let (path, query) = Self::azureContainers_details(account, continuationToken);
self.client.make_signed_url(&path, query, ttl)
}
fn azureContainers_details<'a>(account: &'a str, continuationToken: Option<&'a str>) -> (String, Option<Vec<(&'static str, &'a str)>>) {
let path = format!("azure/{}/containers", urlencode(account));
let mut query = None;
if let Some(q) = continuationToken {
query.get_or_insert_with(Vec::new).push(("continuationToken", q));
}
(path, query)
}
pub async fn azureContainerSAS(&self, account: &str, container: &str, level: &str) -> Result<Value, Error> {
let method = "GET";
let (path, query) = Self::azureContainerSAS_details(account, container, level);
let body = None;
let resp = self.client.request(method, &path, query, body).await?;
Ok(resp.json().await?)
}
pub fn azureContainerSAS_url(&self, account: &str, container: &str, level: &str) -> Result<String, Error> {
let (path, query) = Self::azureContainerSAS_details(account, container, level);
self.client.make_url(&path, query)
}
pub fn azureContainerSAS_signed_url(&self, account: &str, container: &str, level: &str, ttl: Duration) -> Result<String, Error> {
let (path, query) = Self::azureContainerSAS_details(account, container, level);
self.client.make_signed_url(&path, query, ttl)
}
fn azureContainerSAS_details<'a>(account: &'a str, container: &'a str, level: &'a str) -> (String, Option<Vec<(&'static str, &'a str)>>) {
let path = format!("azure/{}/containers/{}/{}", urlencode(account), urlencode(container), urlencode(level));
let query = None;
(path, query)
}
pub async fn sentryDSN(&self, project: &str) -> Result<Value, Error> {
let method = "GET";
let (path, query) = Self::sentryDSN_details(project);
let body = None;
let resp = self.client.request(method, &path, query, body).await?;
Ok(resp.json().await?)
}
pub fn sentryDSN_url(&self, project: &str) -> Result<String, Error> {
let (path, query) = Self::sentryDSN_details(project);
self.client.make_url(&path, query)
}
pub fn sentryDSN_signed_url(&self, project: &str, ttl: Duration) -> Result<String, Error> {
let (path, query) = Self::sentryDSN_details(project);
self.client.make_signed_url(&path, query, ttl)
}
fn sentryDSN_details<'a>(project: &'a str) -> (String, Option<Vec<(&'static str, &'a str)>>) {
let path = format!("sentry/{}/dsn", urlencode(project));
let query = None;
(path, query)
}
pub async fn websocktunnelToken(&self, wstAudience: &str, wstClient: &str) -> Result<Value, Error> {
let method = "GET";
let (path, query) = Self::websocktunnelToken_details(wstAudience, wstClient);
let body = None;
let resp = self.client.request(method, &path, query, body).await?;
Ok(resp.json().await?)
}
pub fn websocktunnelToken_url(&self, wstAudience: &str, wstClient: &str) -> Result<String, Error> {
let (path, query) = Self::websocktunnelToken_details(wstAudience, wstClient);
self.client.make_url(&path, query)
}
pub fn websocktunnelToken_signed_url(&self, wstAudience: &str, wstClient: &str, ttl: Duration) -> Result<String, Error> {
let (path, query) = Self::websocktunnelToken_details(wstAudience, wstClient);
self.client.make_signed_url(&path, query, ttl)
}
fn websocktunnelToken_details<'a>(wstAudience: &'a str, wstClient: &'a str) -> (String, Option<Vec<(&'static str, &'a str)>>) {
let path = format!("websocktunnel/{}/{}", urlencode(wstAudience), urlencode(wstClient));
let query = None;
(path, query)
}
pub async fn gcpCredentials(&self, projectId: &str, serviceAccount: &str) -> Result<Value, Error> {
let method = "GET";
let (path, query) = Self::gcpCredentials_details(projectId, serviceAccount);
let body = None;
let resp = self.client.request(method, &path, query, body).await?;
Ok(resp.json().await?)
}
pub fn gcpCredentials_url(&self, projectId: &str, serviceAccount: &str) -> Result<String, Error> {
let (path, query) = Self::gcpCredentials_details(projectId, serviceAccount);
self.client.make_url(&path, query)
}
pub fn gcpCredentials_signed_url(&self, projectId: &str, serviceAccount: &str, ttl: Duration) -> Result<String, Error> {
let (path, query) = Self::gcpCredentials_details(projectId, serviceAccount);
self.client.make_signed_url(&path, query, ttl)
}
fn gcpCredentials_details<'a>(projectId: &'a str, serviceAccount: &'a str) -> (String, Option<Vec<(&'static str, &'a str)>>) {
let path = format!("gcp/credentials/{}/{}", urlencode(projectId), urlencode(serviceAccount));
let query = None;
(path, query)
}
pub async fn authenticateHawk(&self, payload: &Value) -> Result<Value, Error> {
let method = "POST";
let (path, query) = Self::authenticateHawk_details();
let body = Some(payload);
let resp = self.client.request(method, path, query, body).await?;
Ok(resp.json().await?)
}
fn authenticateHawk_details<'a>() -> (&'static str, Option<Vec<(&'static str, &'a str)>>) {
let path = "authenticate-hawk";
let query = None;
(path, query)
}
pub async fn testAuthenticate(&self, payload: &Value) -> Result<Value, Error> {
let method = "POST";
let (path, query) = Self::testAuthenticate_details();
let body = Some(payload);
let resp = self.client.request(method, path, query, body).await?;
Ok(resp.json().await?)
}
fn testAuthenticate_details<'a>() -> (&'static str, Option<Vec<(&'static str, &'a str)>>) {
let path = "test-authenticate";
let query = None;
(path, query)
}
pub async fn testAuthenticateGet(&self) -> Result<Value, Error> {
let method = "GET";
let (path, query) = Self::testAuthenticateGet_details();
let body = None;
let resp = self.client.request(method, path, query, body).await?;
Ok(resp.json().await?)
}
pub fn testAuthenticateGet_url(&self) -> Result<String, Error> {
let (path, query) = Self::testAuthenticateGet_details();
self.client.make_url(path, query)
}
pub fn testAuthenticateGet_signed_url(&self, ttl: Duration) -> Result<String, Error> {
let (path, query) = Self::testAuthenticateGet_details();
self.client.make_signed_url(path, query, ttl)
}
fn testAuthenticateGet_details<'a>() -> (&'static str, Option<Vec<(&'static str, &'a str)>>) {
let path = "test-authenticate-get/";
let query = None;
(path, query)
}
pub async fn heartbeat(&self) -> Result<(), Error> {
let method = "GET";
let (path, query) = Self::heartbeat_details();
let body = None;
let resp = self.client.request(method, path, query, body).await?;
resp.bytes().await?;
Ok(())
}
pub fn heartbeat_url(&self) -> Result<String, Error> {
let (path, query) = Self::heartbeat_details();
self.client.make_url(path, query)
}
pub fn heartbeat_signed_url(&self, ttl: Duration) -> Result<String, Error> {
let (path, query) = Self::heartbeat_details();
self.client.make_signed_url(path, query, ttl)
}
fn heartbeat_details<'a>() -> (&'static str, Option<Vec<(&'static str, &'a str)>>) {
let path = "__heartbeat__";
let query = None;
(path, query)
}
}