Struct Builder (0.23.0)

A builder for creating credentials that authenticate using an API key.

API keys are convenient because no principal is needed. The API key associates the request with a Google Cloud project for billing and quota purposes.

Note that only some Cloud APIs support API keys. The rest require full credentials.

Implementations

new

 fn new<T: Into<String>>(api_key: T) -> Self

Creates a new builder with given API key.

Example

# use google_cloud_auth::credentials::api_key_credentials::Builder;
# tokio_test::block_on(async {
let credentials = Builder::new("my-api-key")
    .build();
# });

build

 fn build(self) -> Credentials

Returns a [Credentials] instance with the configured settings.