pub struct MessagingClientBuilder { /* private fields */ }Expand description
Builds a MessagingClient.
Implementations§
Source§impl MessagingClientBuilder
impl MessagingClientBuilder
Sourcepub fn new(project_id: impl Into<String>) -> Self
pub fn new(project_id: impl Into<String>) -> Self
Starts building a client for the given Firebase project id.
Sourcepub fn service_account_key(self, key: ServiceAccountKey) -> Self
pub fn service_account_key(self, key: ServiceAccountKey) -> Self
Authenticates using an explicit service account key.
Sourcepub fn application_default_credentials(self) -> Self
pub fn application_default_credentials(self) -> Self
Authenticates using Application Default Credentials, resolved on
first use: the GOOGLE_APPLICATION_CREDENTIALS environment
variable, gcloud user credentials, or the GCE/Cloud Run metadata
server, in that order (see gcp_auth::provider).
Sourcepub fn enable_legacy_http_transport(self) -> Self
pub fn enable_legacy_http_transport(self) -> Self
Opts MessagingClient::send_each/MessagingClient::send_each_for_multicast
into HTTP/1.1 transport instead of multiplexing over HTTP/2 — mirrors
Messaging.enableLegacyHttpTransport() in the official Admin SDKs.
See MessagingClient::legacy_http_transport_enabled for why this is
a no-op on this crate’s transport.
Sourcepub fn http_client(self, client: Client) -> Self
pub fn http_client(self, client: Client) -> Self
Supplies a custom reqwest::Client, e.g. for testing.
Sourcepub fn build(self) -> Result<MessagingClient, MessagingError>
pub fn build(self) -> Result<MessagingClient, MessagingError>
Builds the MessagingClient.