public interface HasApiKey<O extends Api.ApiOptions>
Anything that has an ApiKey
.
This is used to allow GoogleApi
-based clients to be exposed via interface instead of subclass. Those interfaces can be declared as extending this, and GoogleApi
's will automatically fulfill the interface.
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 2024-10-31 UTC.
[null,null,["Last updated 2024-10-31 UTC."],[[["`HasApiKey` is an interface used for objects possessing an API key."],["It allows GoogleApi-based clients to be exposed as interfaces instead of subclasses, promoting flexibility in implementation."],["Interfaces extending `HasApiKey` can be automatically fulfilled by `GoogleApi` instances."],["The key purpose is to manage API keys within Google API interactions."]]],["`HasApiKey` is an interface in both Kotlin and Java. It serves as a marker for objects possessing an `ApiKey`. `GoogleApi`, the base class for Google API entry points, and `ModuleInstallClient`, an interface for module installation APIs, are direct subclasses. This interface enables `GoogleApi`-based clients to be exposed via interfaces instead of subclasses, allowing these interfaces to extend `HasApiKey`, which `GoogleApi` automatically fulfills.\n"]]