pub struct Client {
    pub(crate) inner: Client,
    pub(crate) url: Url,
    pub(crate) session_id: Option<String>,
}
Expand description

A Metabase API client.

Fields

inner: Clienturl: Urlsession_id: Option<String>

Implementations

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.

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

Fetches public, global properties.

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

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.

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 Client::session_properties is None, the cluster is already set up, and this request will fail.

The underlying API call is POST /api/setup.

Fetches the list of databases known to Metabase.

The underlying API call is GET /database.

Fetches metadata about a particular database.

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

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

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

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

Calls U::from(self).

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

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

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