Struct metabase::Client[][src]

pub struct Client { /* fields omitted */ }

A Metabase API client.

Implementations

impl Client[src]

pub fn new<U>(url: U) -> Result<Self, Error> where
    U: IntoUrl
[src]

Constructs a new Client that will target a Metabase instance at url.

url must not contain a path nor be a cannot-be-a-base URL.

pub fn set_session_id(&mut self, session_id: String)[src]

Sets the session ID to include in future requests made by this client.

pub async fn session_properties(
    &self
) -> Result<SessionPropertiesResponse, Error>
[src]

Fetches public, global properties.

The underlying API call is GET /api/session/properties.

pub async fn login(
    &self,
    request: &LoginRequest
) -> Result<LoginResponse, Error>
[src]

Requests a session ID for the username and password named in request.

Note that usernames are typically email addresses. To authenticate future requests with the returned session ID, call set_session_id.

The underlying API call is POST /api/session.

pub async fn setup(
    &self,
    request: &SetupRequest
) -> Result<LoginResponse, Error>
[src]

Creates a user and database connection if the Metabase instance has not yet been set up.

The request must include the setup_token from a SessionPropertiesResponse. If the setup token returned by [session_properties] is None, the cluster is already set up, and this request will fail.

The underlying API call is POST /api/setup.

pub async fn databases(&self) -> Result<Vec<Database>, Error>[src]

Fetches the list of databases known to Metabase.

The underlying API call is GET /database.

pub async fn database_metadata(
    &self,
    id: usize
) -> Result<DatabaseMetadata, Error>
[src]

Fetches metadata about a particular database.

The underlying API call is GET /database/:id/metadata.

Trait Implementations

impl Debug for Client[src]

Auto Trait Implementations

impl !RefUnwindSafe for Client[src]

impl Send for Client[src]

impl Sync for Client[src]

impl Unpin for Client[src]

impl !UnwindSafe for Client[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.