Struct Client

Source
pub struct Client { /* private fields */ }
Expand description

Entrypoint for interacting with the API client.

Implementations§

Source§

impl Client

Source

pub fn new_from_reqwest<T>( token: T, builder_http: ClientBuilder, builder_websocket: ClientBuilder, ) -> Self
where T: ToString + Debug,

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.

Source

pub fn new<T>(token: T) -> Self
where T: ToString + Debug,

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.

Source

pub fn set_base_url<H>(&mut self, base_url: H)
where H: Into<String> + Display + Debug,

Set the base URL for the client to something other than the default: https://api.zoo.dev.

Source

pub fn new_from_env() -> Self

Create a new Client struct from the environment variable: ENV_VARIABLE_PREFIX_API_TOKEN.

Source

pub async fn request_raw( &self, method: Method, uri: &str, body: Option<Body>, ) -> Result<RequestBuilder>

Create a raw request to our API.

Source

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.

FROM: https://zoo.dev/docs/api/api-calls

Source

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.

FROM: https://zoo.dev/docs/api/api-tokens

Source

pub fn apps(&self) -> Apps

Endpoints for third party app grant flows.

FROM: https://zoo.dev/docs/api/apps

Source

pub fn executor(&self) -> Executor

Endpoints that allow for code execution or creation of code execution environments.

FROM: https://zoo.dev/docs/api/executor

Source

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.

FROM: https://zoo.dev/docs/api/file

Source

pub fn hidden(&self) -> Hidden

Hidden API endpoints that should not show up in the docs.

FROM: https://zoo.dev/docs/api/hidden

Source

pub fn meta(&self) -> Meta

Meta information about the API.

FROM: https://zoo.dev/docs/api/meta

Source

pub fn ml(&self) -> Ml

Machine learning to generate CAD models and other things.

FROM: https://zoo.dev/docs/api/ml

Source

pub fn modeling(&self) -> Modeling

Modeling API for updating your 3D files using the Zoo engine.

FROM: https://zoo.dev/docs/api/modeling

Source

pub fn oauth2(&self) -> Oauth2

Endpoints that implement OAuth 2.0 grant flows.

FROM: https://zoo.dev/docs/api/oauth2

Source

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.

FROM: https://zoo.dev/docs/api/orgs

Source

pub fn payments(&self) -> Payments

Operations around payments and billing.

FROM: https://zoo.dev/docs/api/payments

Source

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.

FROM: https://zoo.dev/docs/api/service-accounts

Source

pub fn store(&self) -> Store

Operations involving our swag store.

FROM: https://zoo.dev/docs/api/store

Source

pub fn unit(&self) -> Unit

Unit conversion operations.

FROM: https://zoo.dev/docs/api/file

Source

pub fn users(&self) -> Users

A user is someone who uses the Zoo API. Here, we can create, delete, and list users. We can also get information about a user. Operations will only be authorized if the user is requesting information about themselves.

FROM: https://zoo.dev/docs/api/users

Trait Implementations§

Source§

impl Clone for Client

Source§

fn clone(&self) -> Client

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Client

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FutureExt for T

Source§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
Source§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> IntoResult<T> for T

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T