Struct mz_cloud_api::client::Client
source · pub struct Client {
pub(crate) inner: Client,
pub(crate) auth_client: Arc<Client>,
pub(crate) endpoint: Url,
}
Expand description
Represents the structure for the client.
Fields§
§inner: Client
§auth_client: Arc<Client>
§endpoint: Url
Implementations§
source§impl Client
impl Client
sourcepub async fn list_cloud_regions(&self) -> Result<Vec<CloudProvider>, Error>
pub async fn list_cloud_regions(&self) -> Result<Vec<CloudProvider>, Error>
List all the available cloud regions.
E.g.: [us-east-1, eu-west-1]
source§impl Client
impl Client
sourcepub async fn get_region(&self, provider: CloudProvider) -> Result<Region, Error>
pub async fn get_region(&self, provider: CloudProvider) -> Result<Region, Error>
Get a customer region in a partciular cloud region for the current user.
sourcepub async fn get_all_regions(&self) -> Result<Vec<Region>, Error>
pub async fn get_all_regions(&self) -> Result<Vec<Region>, Error>
Get all the available customer regions for the current user.
sourcepub async fn create_region(
&self,
version: Option<String>,
environmentd_extra_args: Vec<String>,
cloud_provider: CloudProvider,
) -> Result<Region, Error>
pub async fn create_region( &self, version: Option<String>, environmentd_extra_args: Vec<String>, cloud_provider: CloudProvider, ) -> Result<Region, Error>
Creates a customer region in a particular cloud region for the current user
sourcepub async fn delete_region(
&self,
cloud_provider: CloudProvider,
hard: bool,
) -> Result<(), Error>
pub async fn delete_region( &self, cloud_provider: CloudProvider, hard: bool, ) -> Result<(), Error>
Deletes a customer region in a particular cloud region for the current user.
Soft deletes by default.
NOTE that this operation is only available to Materialize employees This operation has a long duration, it can take several minutes to complete.
source§impl Client
impl Client
Cloud endpoints architecture:
(CloudProvider) (Region)
| | | Region API | | Cloud | url | ––––– ———–– | | Sync | —————> | | Provider | –– | Region | | | | | | (aws..) | | (east-1..) | | | | | ––––– ———–– |
sourceasync fn build_global_request<P>(
&self,
method: Method,
path: P,
query: Option<&[(&str, &str)]>,
) -> Result<RequestBuilder, Error>
async fn build_global_request<P>( &self, method: Method, path: P, query: Option<&[(&str, &str)]>, ) -> Result<RequestBuilder, Error>
Builds a request towards the Client
’s endpoint
sourceasync fn build_region_request<P>(
&self,
method: Method,
path: P,
query: Option<&[(&str, &str)]>,
cloud_provider: &CloudProvider,
api_version: Option<u16>,
) -> Result<RequestBuilder, Error>
async fn build_region_request<P>( &self, method: Method, path: P, query: Option<&[(&str, &str)]>, cloud_provider: &CloudProvider, api_version: Option<u16>, ) -> Result<RequestBuilder, Error>
Builds a request towards the Client
’s endpoint
The function requires a CloudProvider as parameter
since it contains the api url (Region API url)
to interact with the region.
Specify an api_version corresponding to the request/response
schema your code will handle. Refer to the Region API docs
for schema information.
sourceasync fn build_request<P>(
&self,
method: Method,
path: P,
query: Option<&[(&str, &str)]>,
domain: Url,
headers: Option<HeaderMap>,
) -> Result<RequestBuilder, Error>
async fn build_request<P>( &self, method: Method, path: P, query: Option<&[(&str, &str)]>, domain: Url, headers: Option<HeaderMap>, ) -> Result<RequestBuilder, Error>
Builds a request towards the Client
’s endpoint
async fn send_request<T>(&self, req: RequestBuilder) -> Result<T, Error>where
T: DeserializeOwned,
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> 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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request
source§impl<T, U> OverrideFrom<Option<&T>> for Uwhere
U: OverrideFrom<T>,
impl<T, U> OverrideFrom<Option<&T>> for Uwhere
U: OverrideFrom<T>,
source§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<P, R> ProtoType<R> for Pwhere
R: RustType<P>,
impl<P, R> ProtoType<R> for Pwhere
R: RustType<P>,
source§fn into_rust(self) -> Result<R, TryFromProtoError>
fn into_rust(self) -> Result<R, TryFromProtoError>
RustType::from_proto
.source§fn from_rust(rust: &R) -> P
fn from_rust(rust: &R) -> P
RustType::into_proto
.source§impl<'a, S, T> Semigroup<&'a S> for Twhere
T: Semigroup<S>,
impl<'a, S, T> Semigroup<&'a S> for Twhere
T: Semigroup<S>,
source§fn plus_equals(&mut self, rhs: &&'a S)
fn plus_equals(&mut self, rhs: &&'a S)
std::ops::AddAssign
, for types that do not implement AddAssign
.