pub struct Client { /* private fields */ }Expand description
Entrypoint for interacting with the API client.
Implementations§
Source§impl Client
impl Client
Sourcepub fn new_from_reqwest<T>(
token: T,
builder_http: ClientBuilder,
builder_websocket: ClientBuilder,
) -> Self
pub fn new_from_reqwest<T>( token: T, builder_http: ClientBuilder, builder_websocket: ClientBuilder, ) -> Self
Create a new Client struct. It takes a type that can convert into
an &str (String or Vec<u8> for example). As long as the function is
given a valid API key your requests will work.
Also takes reqwest client builders, for customizing the client’s behaviour.
Sourcepub fn new<T>(token: T) -> Self
pub fn new<T>(token: T) -> Self
Create a new Client struct. It takes a type that can convert into
an &str (String or Vec<u8> for example). As long as the function is
given a valid API key your requests will work.
Sourcepub fn set_base_url<H>(&mut self, base_url: H)
pub fn set_base_url<H>(&mut self, base_url: H)
Set the base URL for the client to something other than the default: https://api.zoo.dev.
Sourcepub fn new_from_env() -> Self
pub fn new_from_env() -> Self
Create a new Client struct from the environment variable: ENV_VARIABLE_PREFIX_API_TOKEN.
Sourcepub async fn request_raw(
&self,
method: Method,
uri: &str,
body: Option<Body>,
) -> Result<RequestBuilder>
pub async fn request_raw( &self, method: Method, uri: &str, body: Option<Body>, ) -> Result<RequestBuilder>
Create a raw request to our API.
Sourcepub fn api_calls(&self) -> ApiCalls
pub fn api_calls(&self) -> ApiCalls
API calls that have been performed by users can be queried by the API. This is helpful for debugging as well as billing.
Sourcepub fn api_tokens(&self) -> ApiTokens
pub fn api_tokens(&self) -> ApiTokens
API tokens allow users to call the API outside of their session token that is used as a cookie in the user interface. Users can create, delete, and list their API tokens. But, of course, you need an API token to do this, so first be sure to generate one in the account UI.
Sourcepub fn executor(&self) -> Executor
pub fn executor(&self) -> Executor
Endpoints that allow for code execution or creation of code execution environments.
Sourcepub fn file(&self) -> File
pub fn file(&self) -> File
CAD file operations. Create, get, and list CAD file conversions. More endpoints will be added here in the future as we build out transforms, etc on CAD models.
Hidden API endpoints that should not show up in the docs.
Sourcepub fn modeling(&self) -> Modeling
pub fn modeling(&self) -> Modeling
Modeling API for updating your 3D files using the Zoo engine.
Sourcepub fn orgs(&self) -> Orgs
pub fn orgs(&self) -> Orgs
An organization is a group of users of the Zoo API. Here, we can add users to an org and perform operations on orgs.
Sourcepub fn service_accounts(&self) -> ServiceAccounts
pub fn service_accounts(&self) -> ServiceAccounts
Service accounts allow organizations to call the API. Organization admins can create, delete, and list the service accounts for their org. Service accounts are scoped to an organization not individual users, these are better to use for automations than individual API tokens, since they won’t stop working when an individual leaves the company.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
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> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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