Struct Builder (0.23.0)
Stay organized with collections
Save and categorize content based on your preferences.
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.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-11-04 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-11-04 UTC."],[],[]]