pub struct Hidden {
pub client: Client,
}requests only.Fields§
§client: ClientImplementations§
Source§impl Hidden
impl Hidden
Sourcepub async fn auth_api_key<'a>(&'a self) -> Result<AuthApiKeyResponse, Error>
pub async fn auth_api_key<'a>(&'a self) -> Result<AuthApiKeyResponse, Error>
Authenticate using an api-key. This is disabled on production but can be used in dev to login without email magic.
This returns a session token.
async fn example_hidden_auth_api_key() -> anyhow::Result<()> {
let client = kittycad::Client::new_from_env();
let result: kittycad::types::AuthApiKeyResponse = client.hidden().auth_api_key().await?;
println!("{:?}", result);
Ok(())
}Sourcepub async fn auth_email<'a>(
&'a self,
body: &EmailAuthenticationForm,
) -> Result<VerificationTokenResponse, Error>
pub async fn auth_email<'a>( &'a self, body: &EmailAuthenticationForm, ) -> Result<VerificationTokenResponse, Error>
Create an email verification request for a user.
async fn example_hidden_auth_email() -> anyhow::Result<()> {
let client = kittycad::Client::new_from_env();
let result: kittycad::types::VerificationTokenResponse = client
.hidden()
.auth_email(&kittycad::types::EmailAuthenticationForm {
callback_url: Some("https://example.com/foo/bar".to_string()),
email: "email@example.com".to_string(),
})
.await?;
println!("{:?}", result);
Ok(())
}Sourcepub async fn auth_email_marketing_confirm_post<'a>(
&'a self,
body: &EmailMarketingConfirmTokenBody,
) -> Result<(), Error>
pub async fn auth_email_marketing_confirm_post<'a>( &'a self, body: &EmailMarketingConfirmTokenBody, ) -> Result<(), Error>
Consume a confirmation token and finalize double opt-in.
async fn example_hidden_auth_email_marketing_confirm_post() -> anyhow::Result<()> {
let client = kittycad::Client::new_from_env();
client
.hidden()
.auth_email_marketing_confirm_post(&kittycad::types::EmailMarketingConfirmTokenBody {
token: "some-string".to_string(),
})
.await?;
Ok(())
}Sourcepub async fn auth_email_callback<'a>(
&'a self,
callback_url: Option<String>,
email: &'a str,
token: &'a str,
) -> Result<(), Error>
pub async fn auth_email_callback<'a>( &'a self, callback_url: Option<String>, email: &'a str, token: &'a str, ) -> Result<(), Error>
Listen for callbacks for email authentication for users.
Parameters:
callback_url: Option<String>: The URL to redirect back to after we have authenticated.email: &'astr: The user’s email. (required)token: &'astr: The verification token. (required)
async fn example_hidden_auth_email_callback() -> anyhow::Result<()> {
let client = kittycad::Client::new_from_env();
client
.hidden()
.auth_email_callback(
Some("https://example.com/foo/bar".to_string()),
"email@example.com",
"some-string",
)
.await?;
Ok(())
}Sourcepub async fn get_auth_saml_by_org<'a>(
&'a self,
callback_url: Option<String>,
org_id: Uuid,
) -> Result<(), Error>
pub async fn get_auth_saml_by_org<'a>( &'a self, callback_url: Option<String>, org_id: Uuid, ) -> Result<(), Error>
GET /auth/saml/{org_id}
Redirects the browser straight to the org’s SAML IdP.
Parameters:
callback_url: Option<String>: The URL to redirect back to after we have authenticated.org_id: uuid::Uuid: The ID of the organisation that owns the IdP. (required)
use std::str::FromStr;
async fn example_hidden_get_auth_saml_by_org() -> anyhow::Result<()> {
let client = kittycad::Client::new_from_env();
client
.hidden()
.get_auth_saml_by_org(
Some("https://example.com/foo/bar".to_string()),
uuid::Uuid::from_str("d9797f8d-9ad6-4e08-90d7-2ec17e13471c")?,
)
.await?;
Ok(())
}Sourcepub async fn get_auth_saml<'a>(
&'a self,
callback_url: Option<String>,
provider_id: Uuid,
) -> Result<(), Error>
pub async fn get_auth_saml<'a>( &'a self, callback_url: Option<String>, provider_id: Uuid, ) -> Result<(), Error>
Get a redirect straight to the SAML IdP.
The UI uses this to avoid having to ask the API anything about the IdP. It already knows the SAML IdP ID from the path, so it can just link to this path and rely on the API to redirect to the actual IdP.
Parameters:
callback_url: Option<String>: The URL to redirect back to after we have authenticated.provider_id: uuid::Uuid: The ID of the identity provider. (required)
use std::str::FromStr;
async fn example_hidden_get_auth_saml() -> anyhow::Result<()> {
let client = kittycad::Client::new_from_env();
client
.hidden()
.get_auth_saml(
Some("https://example.com/foo/bar".to_string()),
uuid::Uuid::from_str("d9797f8d-9ad6-4e08-90d7-2ec17e13471c")?,
)
.await?;
Ok(())
}Sourcepub async fn post_auth_saml<'a>(
&'a self,
provider_id: Uuid,
body: &Bytes,
) -> Result<(), Error>
pub async fn post_auth_saml<'a>( &'a self, provider_id: Uuid, body: &Bytes, ) -> Result<(), Error>
Authenticate a user via SAML
Parameters:
provider_id: uuid::Uuid: The ID of the identity provider. (required)
use std::str::FromStr;
async fn example_hidden_post_auth_saml() -> anyhow::Result<()> {
let client = kittycad::Client::new_from_env();
client
.hidden()
.post_auth_saml(
uuid::Uuid::from_str("d9797f8d-9ad6-4e08-90d7-2ec17e13471c")?,
&bytes::Bytes::from("some-string"),
)
.await?;
Ok(())
}Sourcepub async fn logout<'a>(&'a self) -> Result<(), Error>
pub async fn logout<'a>(&'a self) -> Result<(), Error>
This endpoint removes the session cookie for a user.
This is used in logout scenarios.
async fn example_hidden_logout() -> anyhow::Result<()> {
let client = kittycad::Client::new_from_env();
client.hidden().logout().await?;
Ok(())
}Download a project using a share link.
Parameters:
format: Option<crate::types::ProjectArchiveFormat>: Archive format to return. Defaults totar.key: &'astr: Share-link key. (required)
async fn example_hidden_download_shared_project() -> anyhow::Result<()> {
let client = kittycad::Client::new_from_env();
client
.hidden()
.download_shared_project(Some(kittycad::types::ProjectArchiveFormat::Zip), "some-string")
.await?;
Ok(())
}Sourcepub async fn redirect_user_shortlink<'a>(
&'a self,
key: &'a str,
) -> Result<(), Error>
pub async fn redirect_user_shortlink<'a>( &'a self, key: &'a str, ) -> Result<(), Error>
Redirect the user to the URL for the shortlink.
This endpoint might require authentication by a Zoo user. It gets the shortlink for the user and redirects them to the URL. If the shortlink is owned by an org, the user must be a member of the org.
Parameters:
key: &'astr: The key of the shortlink. (required)
async fn example_hidden_redirect_user_shortlink() -> anyhow::Result<()> {
let client = kittycad::Client::new_from_env();
client
.hidden()
.redirect_user_shortlink("some-string")
.await?;
Ok(())
}Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Hidden
impl !UnwindSafe for Hidden
impl Freeze for Hidden
impl Send for Hidden
impl Sync for Hidden
impl Unpin for Hidden
impl UnsafeUnpin for Hidden
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more